summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-01-31 12:31:53 -0800
committerJamie Gennis <jgennis@google.com>2011-01-31 12:31:53 -0800
commit5f8b6653e0b5b99097db7d8f41d5251f7b398704 (patch)
treef6519559a1eae23e444bbcc5c02edf6bfc1c7e45 /graphics/java
parent0982dc6488a921d9d54d23b9180a9acf33c61526 (diff)
downloadframeworks_base-5f8b6653e0b5b99097db7d8f41d5251f7b398704.zip
frameworks_base-5f8b6653e0b5b99097db7d8f41d5251f7b398704.tar.gz
frameworks_base-5f8b6653e0b5b99097db7d8f41d5251f7b398704.tar.bz2
Add SurfaceTexture docs for getTransformMatrix.
Change-Id: Ib08d00525c7932b23ba5066c07c7470f813b74f8
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/SurfaceTexture.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 4c659d4..1fc2722 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -32,6 +32,17 @@ import android.os.Message;
* updated to contain the most recent image from the image stream. This may cause some frames of
* the stream to be skipped.
*
+ * <p>When sampling from the texture one should first transform the texture coordinates using the
+ * matrix queried via {@link #getTransformMatrix}. The transform matrix may change each time {@link
+ * #updateTexImage} is called, so it should be re-queried each time the texture image is updated.
+ * This matrix transforms traditional 2D OpenGL ES texture coordinate column vectors of the form (s,
+ * t, 0, 1) where s and t are on the inclusive interval [0, 1] to the proper sampling location in
+ * the streamed texture. This transform compensates for any properties of the image stream source
+ * that cause it to appear different from a traditional OpenGL ES texture. For example, sampling
+ * from the bottom left corner of the image can be accomplished by transforming the column vector
+ * (0, 0, 0, 1) using the queried matrix, while sampling from the top right corner of the image can
+ * be done by transforming (1, 1, 0, 1).
+ *
* <p>The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the
* OES_EGL_image_external OpenGL ES extension. This limits how the texture may be used.
*