diff options
author | Jamie Gennis <jgennis@google.com> | 2011-01-09 18:22:05 -0800 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-01-12 11:28:38 -0800 |
commit | b0ba48c95ea8768a051100c5adb4c906caa1e080 (patch) | |
tree | ce086804fb00584d57ccbc6932355889df25ab17 /graphics | |
parent | b598fb90727be45e926a11abefc319819a733540 (diff) | |
download | frameworks_base-b0ba48c95ea8768a051100c5adb4c906caa1e080.zip frameworks_base-b0ba48c95ea8768a051100c5adb4c906caa1e080.tar.gz frameworks_base-b0ba48c95ea8768a051100c5adb4c906caa1e080.tar.bz2 |
Add getTransformMatrix to the SurfaceTexture API.
Change-Id: Icd11ed4982220be9d08b00498aef02531610ce1f
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/SurfaceTexture.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 883c4eb..3eb0b03 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -79,6 +79,31 @@ public class SurfaceTexture { */ public native void updateTexImage(); + + /** + * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by + * the most recent call to updateTexImage. + * + * This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s + * and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample + * that location from the texture. Sampling the texture outside of the range of this transform + * is undefined. + * + * The matrix is stored in column-major order so that it may be passed directly to OpenGL ES via + * the glLoadMatrixf or glUniformMatrix4fv functions. + * + * @param mtx the array into which the 4x4 matrix will be stored. The array must have exactly + * 16 elements. + */ + public void getTransformMatrix(float[] mtx) { + if (mtx.length != 16) { + throw new IllegalArgumentException(); + } + getTransformMatrixImpl(mtx); + } + + private native void getTransformMatrixImpl(float[] mtx); + private native void init(int texName); /* |