|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcodeanticode.glgraphics.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 GLTextureFilterParameters |
defFilterParams
|
protected java.lang.String |
description
|
protected int[] |
destFBO
|
protected int |
destTexSizeUniform
|
protected int |
fadeConstUniform
|
protected GL |
gl
|
protected GLState |
glstate
|
protected GLTextureGrid |
grid
|
protected int |
numInputTex
|
protected processing.core.PApplet |
parent
|
protected PGraphicsOpenGL |
pgl
|
protected GLSLShader |
shader
|
protected int[] |
srcTexOffsetUniform
|
protected int[] |
srcTexUnitUniform
|
protected int |
timingDataUniform
|
protected XMLElement |
xmlFilterCfg
|
| Constructor Summary | |
|---|---|
GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename)
Creates an instance of GLTextureFilter, loading the filter from filename. |
|
GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
GLTextureFilterParameters params)
Creates an instance of GLTextureFilter, loading the filter from filename and using the parameter params. |
|
GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
int nInTex)
Creates an instance of GLTextureFilter, loading the filter from filename. |
|
GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
int nInTex,
GLTextureFilterParameters params)
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,
float fadeConst)
Applies the shader program on textures srcTex, writing the output to the textures destTex. |
void |
apply(GLTexture[] srcTex,
GLTexture[] destTex,
float fade,
GLTextureFilterParameters params)
Applies the shader program on textures srcTex, writing the output to the textures destTex. |
void |
apply(GLTexture[] srcTex,
GLTexture[] destTex,
GLTextureFilterParameters params)
Applies the shader program on textures srcTex, writing the output to the textures destTex. |
void |
apply(GLTexture srcTex,
GLTexture destTex)
Applies the shader program on texture srcTex, writing the output to the texture destTex. |
void |
apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture destTex)
Applies the shader program on textures srcTex0 and srcTex1, writing the output to the texture destTex. |
void |
apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture srcTex2,
GLTexture destTex)
Applies the shader program on textures srcTex0, srcTex1 and srcTex2, writing the output to the texture destTex. |
void |
apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture srcTex2,
GLTexture srcTex3,
GLTexture destTex)
Applies the shader program on textures srcTex0, srcTex1, srcTex2 and srcTex3, writing the output to the texture 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()
|
GLTextureFilterParameters |
getDefParams()
Returns default parameters of the filter. |
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,
GLTextureFilterParameters params)
|
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 processing.core.PApplet parent
protected GL gl
protected PGraphicsOpenGL pgl
protected GLState glstate
protected int[] destFBO
protected GLTextureGrid grid
protected GLTextureFilterParameters 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 fadeConstUniform
protected int destTexSizeUniform
| Constructor Detail |
|---|
public GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename)
parent - PAppletfilename - String
public GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
GLTextureFilterParameters params)
parent - PAppletfilename - Stringparams - GLTextureFilterParameters
public GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
int nInTex)
parent - PAppletfilename - StringnInTex - int
public GLTextureFilter(processing.core.PApplet parent,
java.lang.String filename,
int nInTex,
GLTextureFilterParameters params)
parent - PAppletfilename - StringnInTex - intparams - GLTextureFilterParameters| Method Detail |
|---|
public java.lang.String getDescription()
public int getNumInputTextures()
public GLTextureFilterParameters getDefParams()
public void apply(GLTexture srcTex,
GLTexture destTex)
srcTex - GLTexturedestTex - GLTexture
public void apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture destTex)
srcTex0 - GLTexturesrcTex1 - GLTexturedestTex - GLTexture
public void apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture srcTex2,
GLTexture destTex)
srcTex0 - GLTexturesrcTex1 - GLTexturesrcTex2 - GLTexturedestTex - GLTexture
public void apply(GLTexture srcTex0,
GLTexture srcTex1,
GLTexture srcTex2,
GLTexture srcTex3,
GLTexture destTex)
srcTex0 - GLTexturesrcTex1 - GLTexturesrcTex2 - GLTexturesrcTex3 - GLTexturedestTex - GLTexture
public void apply(GLTexture[] srcTex,
GLTexture[] destTex)
srcTex - GLTexture[]destTex - GLTexture[]
public void apply(GLTexture[] srcTex,
GLTexture[] destTex,
float fadeConst)
srcTex - GLTexture[]destTex - GLTexture[]fadeConst - float
public void apply(GLTexture[] srcTex,
GLTexture[] destTex,
GLTextureFilterParameters params)
srcTex - GLTexture[]destTex - GLTexture[]params - GLTextureFilterParameters
public void apply(GLTexture[] srcTex,
GLTexture[] destTex,
float fade,
GLTextureFilterParameters params)
srcTex - GLTexture[]destTex - GLTexture[]fade - floatparams - GLTextureFilterParameters
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,
GLTextureFilterParameters params)
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 | |||||||