Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf4cd1a5 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Added a method for spatial sampling."

parents 3fe3ebfa ec837187
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import java.util.concurrent.atomic.AtomicInteger;
/**
 * A gesture is a hand-drawn shape on a touch screen. It can have one or multiple strokes.
 * Each stroke is a sequence of timed points. A user-defined gesture can be recognized by 
 * a GestureLibrary and a built-in alpabet gesture can be recognized by a LetterRecognizer. 
 * a GestureLibrary and a built-in alphabet gesture can be recognized by a LetterRecognizer. 
 */

public class Gesture implements Parcelable {
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ final class GestureUtilities {
        }
    }
    
    static float[] spatialSampling(Gesture gesture, int sampleMatrixDimension) {
        return spatialSampling(gesture, sampleMatrixDimension, false);
    }

    static float[] spatialSampling(Gesture gesture, int sampleMatrixDimension, 
            boolean uniformScaling) {
        final float targetPatchSize = sampleMatrixDimension - 1; // edge inclusive