opengl: fix transform order
The TransformMatrix is provided by Android to apply its internal coordinates transformations to sample the texture at the correct location, so it must be applied last, after the orientation/crop from the picture_t. The fact that their internal transform is exposed as an explicit matrix is an arbitrary design choice from Android. Instead they could have exposed a GLSL function "android_texture2D(vec2 coords)": vec2 tex_coords = TexCoordsMap * OrientationMatrix * pic_coords; vec4 texel = android_texture2D(tex_coords); In that case, it is obvious that their transform would be applied last. Refs <https://developer.android.com/reference/android/graphics/SurfaceTexture#getTransformMatrix(float%5B%5D)>
parent
9d00bf29
No related branches found
No related tags found
Loading
Please register or sign in to comment