Package net.paulhertz.pixelaudio.curves
Class GestureMapping.DefaultMapping
java.lang.Object
net.paulhertz.pixelaudio.curves.GestureMapping.DefaultMapping
- All Implemented Interfaces:
GestureMapping
- Enclosing interface:
- GestureMapping
Default: interpret p as pixel coordinates and mappingSnapshot as width*height raster.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.paulhertz.pixelaudio.curves.GestureMapping
GestureMapping.DefaultMapping -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intclamp(int v, int lo, int hi) intpointToSnapshotIndex(processing.core.PVector p, int[] mappingSnapshot)
-
Field Details
-
width
private final int width -
height
private final int height
-
-
Constructor Details
-
DefaultMapping
public DefaultMapping(int width, int height)
-
-
Method Details
-
pointToSnapshotIndex
public int pointToSnapshotIndex(processing.core.PVector p, int[] mappingSnapshot) - Specified by:
pointToSnapshotIndexin interfaceGestureMapping- Parameters:
p- gesture point (typically in pixel coordinates)mappingSnapshot- array of mapped buffer indices (immutable snapshot)- Returns:
- an index into mappingSnapshot (NOT the sample value), or -1 if invalid
-
clamp
private static int clamp(int v, int lo, int hi)
-