public class FilterGraphEffect extends FilterEffect
Modifier and Type | Field and Description |
---|---|
protected FilterGraph |
mGraph |
protected String |
mInputName |
protected String |
mOutputName |
protected GraphRunner |
mRunner |
protected Class |
mSchedulerClass |
mEffectContext
Constructor and Description |
---|
FilterGraphEffect(EffectContext context,
String name,
String graphString,
String inputName,
String outputName,
Class scheduler)
Constructs a new FilterGraphEffect.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(int inputTexId,
int width,
int height,
int outputTexId)
Apply an effect to GL textures.
|
void |
release()
Release an effect.
|
void |
setParameter(String parameterKey,
Object value)
Set a filter parameter.
|
beginGLEffect, endGLEffect, frameFromTexture, getFilterContext, getName
setUpdateListener
protected String mInputName
protected String mOutputName
protected GraphRunner mRunner
protected FilterGraph mGraph
protected Class mSchedulerClass
public FilterGraphEffect(EffectContext context, String name, String graphString, String inputName, String outputName, Class scheduler)
name
- The name of this effect (used to create it in the EffectFactory).graphString
- The graph string to create the graph.inputName
- The name of the input GLTextureSource filter.outputName
- The name of the output GLTextureSource filter.public void apply(int inputTexId, int width, int height, int outputTexId)
Effect
Apply the Effect on the specified input GL texture, and write the result into the output GL texture. The texture names passed must be valid in the current GL context.
The input texture must be a valid texture name with the given width and height and must be bound to a GL_TEXTURE_2D texture image (usually done by calling the glTexImage2D() function). Multiple mipmap levels may be provided.
If the output texture has not been bound to a texture image, it will be automatically bound by the effect as a GL_TEXTURE_2D. It will contain one mipmap level (0), which will have the same size as the input. No other mipmap levels are defined. If the output texture was bound already, and its size does not match the input texture size, the result may be clipped or only partially fill the texture.
Note, that regardless of whether a texture image was originally provided or not, both the input and output textures are owned by the caller. That is, the caller is responsible for calling glDeleteTextures() to deallocate the input and output textures.
public void setParameter(String parameterKey, Object value)
Effect
setParameter
in class Effect
parameterKey
- The name of the parameter to adjust.value
- The new value to set the parameter to.public void release()
Effect
Releases the effect and any resources associated with it. You may call this if you need to make sure acquired resources are no longer held by the effect. Releasing an effect makes it invalid for reuse.
Note that this method must be called with the EffectContext and EGL context current, as the effect may release internal GL resources.