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

Commit ec837187 authored by Yang Li's avatar Yang Li
Browse files

Added a method for spatial sampling.

parent e99f41f1
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