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.util.List<Texture2dProgram.ProgramType> |
EFFECTS |
static int |
KERNEL_SIZE |
Constructor and Description |
---|
Texture2dProgram(Texture2dProgram.ProgramType programType)
Prepares the program in the current EGL activity.
|
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)
Issues the draw call.
|
Texture2dProgram.ProgramType |
getProgramType()
Returns the program type.
|
void |
release()
Releases the program.
|
void |
setKernel(float[] values,
float colorAdj)
Configures the convolution filter values.
|
void |
setTexSize(int width,
int height)
Sets the size of the texture.
|
public static final java.util.List<Texture2dProgram.ProgramType> EFFECTS
public static final int KERNEL_SIZE
public Texture2dProgram(Texture2dProgram.ProgramType programType)
public void release()
The appropriate EGL activity 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 setKernel(float[] values, float colorAdj)
values
- Normalized filter values; must be KERNEL_SIZE elements.public void setTexSize(int width, int height)
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)
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.