Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
Texture2dProgram

Class Texture2dProgram

Hierarchy

java.lang.Object

Package
com.android.grafika.gles

Overview

GL program and supporting functions for textured 2D shapes.

Fields

KERNEL_SIZE

public static final int KERNEL_SIZE
Constant Value
9

Constructors

Texture2dProgram( Texture2dProgram.ProgramType programType )

Prepares the program in the current EGL context.

public Texture2dProgram(Texture2dProgram.ProgramType programType)

Constructor Parameters

programType

Methods

release()

Releases the program.

The appropriate EGL context must be current (i.e. the one that was used to create the program).

public void release()

getProgramType()

Returns the program type.

public com.android.grafika.gles.Texture2dProgram.ProgramType getProgramType()

createTextureObject()

Creates a texture object suitable for use with this program.

On exit, the texture will be bound.

public int createTextureObject()

setKernel( float[] values, float colorAdj )

Configures the convolution filter values.

public void setKernel(float[] values,float colorAdj)

Method Parameters

values
Normalized filter values; must be KERNEL_SIZE elements.
colorAdj

setTexSize( int width, int height )

Sets the size of the texture. This is used to find adjacent texels when filtering.

public void setTexSize(int width,int height)

Method Parameters

width
height

draw( float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex, int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix, FloatBuffer texBuffer, int textureId, int texStride )

Issues the draw call. Does the full setup on every call.

public void draw(float[] mvpMatrix,FloatBuffer vertexBuffer,int firstVertex,int vertexCount,int coordsPerVertex,int vertexStride,float[] texMatrix,FloatBuffer texBuffer,int textureId,int texStride)

Method Parameters

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.
textureId
texStride
Width, in bytes, of the texture data for each vertex.

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section