|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcodeanticode.gltexture.GLTextureFilter
public class GLTextureFilter
This class defines a 2D filter to apply on GLTexture objects. A filter is basically a glsl shader program with a set of predefined uniform attributes and a 2D grid where the input textures are mapped on. The points of the 2D grid can be altered in the vertex stage of the filter, allowing for arbitrary distorsions in the shape of the mesh. The filter is specified in a xml file where the files names of the vertex and fragment shaders stored, as well as the definition of the grid (resolution and spacing).
| Field Summary | |
|---|---|
protected boolean |
blendOn
|
protected GLTextureFilterParams |
defFilterParams
|
protected java.lang.String |
description
|
protected int[] |
destFBO
|
protected int |
destTexSizeUniform
|
protected GL |
gl
|
protected GLState |
glstate
|
protected GLTextureGrid |
grid
|
protected int |
numInputTex
|
protected PApplet |
parent
|
protected int |
parFlt1Uniform
|
protected int |
parFlt2Uniform
|
protected int |
parFlt3Uniform
|
protected int |
parMat2Uniform
|
protected int |
parMat3Uniform
|
protected int |
parMat4Uniform
|
protected PGraphicsOpenGL |
pgl
|
protected GLSLShader |
shader
|
protected int[] |
srcTexOffsetUniform
|
protected int[] |
srcTexUnitUniform
|
protected int |
timingDataUniform
|
protected XMLElement |
xmlFilterCfg
|
| Constructor Summary | |
|---|---|
GLTextureFilter(PApplet parent,
java.lang.String filename)
Creates an instance of GLTextureFilter, loading the filter from filename. |
|
GLTextureFilter(PApplet parent,
java.lang.String filename,
int nInTex)
Creates an instance of GLTextureFilter, loading the filter from filename. |
|
| Method Summary | |
|---|---|
void |
apply(GLTexture[] srcTex,
GLTexture[] destTex)
Applies the shader program on textures srcTex, writing the output to the textures destTex. |
void |
apply(GLTexture[] srcTex,
GLTexture[] destTex,
GLTextureFilterParams params)
Applies the shader program on textures srcTex, writing the output to the textures destTex. |
protected void |
bindDestFBO()
|
protected void |
bindDestTexToFBO(GLTexture[] destTex)
|
protected void |
bindSrcTex(GLTexture[] srcTex)
|
protected void |
checkDestTex(GLTexture[] destTex,
int w,
int h)
|
protected void |
checkFBO()
|
java.lang.String |
getDescription()
Returns the description of the filter. |
int |
getNumInputTextures()
Returns the number of input or source textures supported by this filter. |
protected void |
initFBO()
|
protected void |
initFilter(int nInTex)
|
protected void |
restoreGLConf()
|
protected void |
setGLConf(int w,
int h)
|
protected void |
unbindDestFBO()
|
protected void |
unbindSrcTex(int ntex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PApplet parent
protected GL gl
protected PGraphicsOpenGL pgl
protected GLState glstate
protected int[] destFBO
protected GLTextureGrid grid
protected GLTextureFilterParams defFilterParams
protected XMLElement xmlFilterCfg
protected java.lang.String description
protected boolean blendOn
protected GLSLShader shader
protected int numInputTex
protected int[] srcTexUnitUniform
protected int[] srcTexOffsetUniform
protected int timingDataUniform
protected int destTexSizeUniform
protected int parFlt1Uniform
protected int parFlt2Uniform
protected int parFlt3Uniform
protected int parMat2Uniform
protected int parMat3Uniform
protected int parMat4Uniform
| Constructor Detail |
|---|
public GLTextureFilter(PApplet parent,
java.lang.String filename)
parent - PAppletfilename - String
public GLTextureFilter(PApplet parent,
java.lang.String filename,
int nInTex)
parent - PAppletfilename - StringnInTex - int| Method Detail |
|---|
public java.lang.String getDescription()
public int getNumInputTextures()
public void apply(GLTexture[] srcTex,
GLTexture[] destTex)
srcTex - GLTexture[]destTex - GLTexture[]
public void apply(GLTexture[] srcTex,
GLTexture[] destTex,
GLTextureFilterParams params)
srcTex - GLTexture[]destTex - GLTexture[]params - GLTextureFilterParams
protected void setGLConf(int w,
int h)
protected void restoreGLConf()
protected void bindSrcTex(GLTexture[] srcTex)
protected void unbindSrcTex(int ntex)
protected void bindDestFBO()
protected void unbindDestFBO()
protected void bindDestTexToFBO(GLTexture[] destTex)
protected void checkFBO()
protected void initFBO()
protected void initFilter(int nInTex)
protected void checkDestTex(GLTexture[] destTex,
int w,
int h)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||