public class Texture2dProgram
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Texture2dProgram.ProgramType |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FRAGMENT_SHADER_YUV |
protected int |
mSampleULoc |
protected int |
mSampleVLoc |
protected int |
mSampleYLoc |
| Constructor and Description |
|---|
Texture2dProgram(Texture2dProgram.ProgramType programType)
Prepares the program in the current EGL context.
|
| Modifier and Type | Method and Description |
|---|---|
int |
createTextureObject()
Creates a texture object suitable for use with this program.
|
void |
draw(float[] mvpMatrix,
java.nio.FloatBuffer vertexBuffer,
int firstVertex,
int vertexCount,
int coordsPerVertex,
int vertexStride,
float[] texMatrix,
java.nio.FloatBuffer texBuffer,
int textureId,
int texStride,
int waterMarkTextureId,
int ytextureId,
int utextureId,
int vtextureId)
Issues the draw call.
|
Texture2dProgram.ProgramType |
getProgramType()
Returns the program type.
|
void |
release()
Releases the program.
|
public static final java.lang.String FRAGMENT_SHADER_YUV
protected int mSampleYLoc
protected int mSampleULoc
protected int mSampleVLoc
public Texture2dProgram(Texture2dProgram.ProgramType programType)
public void release()
The appropriate EGL context must be current (i.e. the one that was used to create the program).
public Texture2dProgram.ProgramType getProgramType()
public int createTextureObject()
On exit, the texture will be bound.
public void draw(float[] mvpMatrix,
java.nio.FloatBuffer vertexBuffer,
int firstVertex,
int vertexCount,
int coordsPerVertex,
int vertexStride,
float[] texMatrix,
java.nio.FloatBuffer texBuffer,
int textureId,
int texStride,
int waterMarkTextureId,
int ytextureId,
int utextureId,
int vtextureId)
mvpMatrix - The 4x4 projection matrix.vertexBuffer - Buffer with vertex position data.firstVertex - Index of first vertex to use in vertexBuffer.vertexCount - Number of vertices in vertexBuffer.coordsPerVertex - The number of coordinates per vertex (e.g. x,y is 2).vertexStride - Width, in bytes, of the position data for each vertex (often
vertexCount * sizeof(float)).texMatrix - A 4x4 transformation matrix for texture coords. (Primarily intended
for use with SurfaceTexture.)texBuffer - Buffer with vertex texture data.texStride - Width, in bytes, of the texture data for each vertex.