public class Texture2dProgram
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Texture2dProgram.ProgramType |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mHasKernel2 |
| Modifier | Constructor and Description |
|---|---|
|
Texture2dProgram(int target,
java.lang.String fss) |
|
Texture2dProgram(int target,
java.lang.String vss,
java.lang.String fss) |
|
Texture2dProgram(Texture2dProgram.ProgramType programType) |
protected |
Texture2dProgram(Texture2dProgram.ProgramType programType,
int target,
java.lang.String vss,
java.lang.String fss)
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,
int mvpMatrixOffset,
java.nio.FloatBuffer vertexBuffer,
int firstVertex,
int vertexCount,
int coordsPerVertex,
int vertexStride,
float[] texMatrix,
int texMatrixOffset,
java.nio.FloatBuffer texBuffer,
int textureId,
int texStride)
Issues the draw call.
|
int |
getProgramHandle() |
Texture2dProgram.ProgramType |
getProgramType()
Returns the program type.
|
void |
handleTouchEvent(android.view.MotionEvent ev)
Configures the effect offset
This only has an effect for programs that
use positional effects like SQUEEZE and MIRROR
|
protected void |
initLocation(float[] kernel,
float[] kernel2) |
protected void |
internal_draw(int firstVertex,
int vertexCount) |
void |
release()
Releases the program.
|
void |
setColorAdjust(float adjust) |
void |
setFlag(int index,
int value) |
void |
setFlags(int[] flags) |
void |
setKernel(float[] values,
float colorAdj)
Configures the convolution filter values.
|
void |
setKernel2(float[] values) |
void |
setTexSize(int width,
int height)
Sets the size of the texture.
|
public Texture2dProgram(int target,
java.lang.String fss)
public Texture2dProgram(int target,
java.lang.String vss,
java.lang.String fss)
public Texture2dProgram(Texture2dProgram.ProgramType programType)
protected Texture2dProgram(Texture2dProgram.ProgramType programType, int target, java.lang.String vss, java.lang.String fss)
public void release()
public Texture2dProgram.ProgramType getProgramType()
public int getProgramHandle()
public int createTextureObject()
On exit, the texture will be bound.
public void handleTouchEvent(android.view.MotionEvent ev)
public void setKernel(float[] values,
float colorAdj)
values - Normalized filter values; must be KERNEL_SIZE3x3 elements.public void setKernel2(float[] values)
public void setColorAdjust(float adjust)
public void setTexSize(int width,
int height)
public void setFlags(int[] flags)
public void setFlag(int index,
int value)
public void draw(float[] mvpMatrix,
int mvpMatrixOffset,
java.nio.FloatBuffer vertexBuffer,
int firstVertex,
int vertexCount,
int coordsPerVertex,
int vertexStride,
float[] texMatrix,
int texMatrixOffset,
java.nio.FloatBuffer texBuffer,
int textureId,
int texStride)
mvpMatrix - The 4x4 projection matrix.mvpMatrixOffset - offset of mvpMatrixvertexBuffer - 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.texMatrixOffset - offset of texMatrixtexBuffer - Buffer with vertex texture data.texStride - Width, in bytes, of the texture data for each vertex.protected void initLocation(float[] kernel,
float[] kernel2)
protected void internal_draw(int firstVertex,
int vertexCount)