codeanticode.glgraphics
Class GLTextureFilterParameters

java.lang.Object
  extended by codeanticode.glgraphics.GLTextureFilterParameters

public class GLTextureFilterParameters
extends java.lang.Object

This class stores the parameters for a filter. There are 6 predefined parameters: three float numbers and three matrices (2x2, 3x3 and 4x4). This parameters should correspond to uniform parameters defined in the shader code.


Field Summary
protected  GL gl
           
 float parFlt1
          Float parameter 1.
protected  int parFlt1Uniform
           
 float parFlt2
          Float parameter 2.
protected  int parFlt2Uniform
           
 float parFlt3
          Float parameter 3.
protected  int parFlt3Uniform
           
 float[] parMat2
          2x2 matrix parameter.
protected  int parMat2Uniform
           
 float[] parMat3
          3x3 matrix parameter.
protected  int parMat3Uniform
           
 float[] parMat4
          4x matrix parameter.
protected  int parMat4Uniform
           
 
Constructor Summary
GLTextureFilterParameters(processing.core.PApplet parent)
          Creates an instance of GLTextureFilterParameters, setting all the parameters to zero.
 
Method Summary
 void copyDefParamIDs(GLTextureFilterParameters params)
          Copies the uniform IDs to params.
 float getMat2(int i, int j)
          Returns the (i, j) element of the 2x2 matrix parameter.
 float getMat3(int i, int j)
          Returns the (i, j) element of the 3x3 matrix parameter.
 float getMat4(int i, int j)
          Returns the (i, j) element of the 4x4 matrix parameter.
 void getParamIDs(GLSLShader shader)
          Get the OpenGL IDs of the uniform parameters in the shaders that correspond to the parameters stored in this class.
 void setMat2(int i, int j, float v)
          Sets the (i, j) element of the 2x2 matrix parameter to v.
 void setMat3(int i, int j, float v)
          Sets the (i, j) element of the 3x3 matrix parameter to v.
 void setMat4(int i, int j, float v)
          Sets the (i, j) element of the 4x4 matrix parameter to v.
 void setParamValues()
          Sets the values of the uniform parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parFlt1

public float parFlt1
Float parameter 1.


parFlt2

public float parFlt2
Float parameter 2.


parFlt3

public float parFlt3
Float parameter 3.


parMat2

public float[] parMat2
2x2 matrix parameter.


parMat3

public float[] parMat3
3x3 matrix parameter.


parMat4

public float[] parMat4
4x matrix parameter.


parFlt1Uniform

protected int parFlt1Uniform

parFlt2Uniform

protected int parFlt2Uniform

parFlt3Uniform

protected int parFlt3Uniform

parMat2Uniform

protected int parMat2Uniform

parMat3Uniform

protected int parMat3Uniform

parMat4Uniform

protected int parMat4Uniform

gl

protected GL gl
Constructor Detail

GLTextureFilterParameters

public GLTextureFilterParameters(processing.core.PApplet parent)
Creates an instance of GLTextureFilterParameters, setting all the parameters to zero.

Method Detail

getParamIDs

public void getParamIDs(GLSLShader shader)
Get the OpenGL IDs of the uniform parameters in the shaders that correspond to the parameters stored in this class.

Parameters:
shader - GLSLShader

setParamValues

public void setParamValues()
Sets the values of the uniform parameters.


copyDefParamIDs

public void copyDefParamIDs(GLTextureFilterParameters params)
Copies the uniform IDs to params.

Parameters:
params - GLTextureFilterParameters

setMat2

public void setMat2(int i,
                    int j,
                    float v)
Sets the (i, j) element of the 2x2 matrix parameter to v.

Parameters:
i - int
j - int
v - float

getMat2

public float getMat2(int i,
                     int j)
Returns the (i, j) element of the 2x2 matrix parameter.

Parameters:
i - int
j - int

setMat3

public void setMat3(int i,
                    int j,
                    float v)
Sets the (i, j) element of the 3x3 matrix parameter to v.

Parameters:
i - int
j - int
v - float

getMat3

public float getMat3(int i,
                     int j)
Returns the (i, j) element of the 3x3 matrix parameter.

Parameters:
i - int
j - int

setMat4

public void setMat4(int i,
                    int j,
                    float v)
Sets the (i, j) element of the 4x4 matrix parameter to v.

Parameters:
i - int
j - int
v - float

getMat4

public float getMat4(int i,
                     int j)
Returns the (i, j) element of the 4x4 matrix parameter.

Parameters:
i - int
j - int