|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproject.android.imageprocessing.GLRenderer
project.android.imageprocessing.input.GLTextureOutputRenderer
project.android.imageprocessing.filter.BasicFilter
project.android.imageprocessing.filter.MultiInputFilter
public abstract class MultiInputFilter
A multiple filter input extension of the BasicFilter.
This class allows for multiple textures as inputs to the filter.
This class can be used as the base for a filter which requires multiple filter inputs.
By itself, this class is not useful because it's fragment shader only uses one texture.
To take advantage of the multiple texture inputs, the getFragmentShader() method should be
override to return a more useful fragment shader. This class supports a maximum of 10
input textures. However, only one set of texture coordinates is used so any rotation done in
this filter will be applied to all input images.
The position of the input textures should be registered before the filter attempts to draw.
For example, if this class was extended with a fragment shader that required a grey scale filter as the first input
texture and a blur filter as the second input, it would be set up as follows:
GreyScaleFilter grey = new GreyScaleFilter();
FastBlurFilter blur = new FastBlurFilter();
SomeMultiInputFilter multiInput = new SomeMultiInputFilter();
grey.addTarget(multiInput);
blur.addTarget(multiInput);
multiInput.registerFilterLocation(grey, 0);
multiInput.registerFilterLocation(blur, 1);
Field Summary |
---|
Fields inherited from class project.android.imageprocessing.GLRenderer |
---|
ATTRIBUTE_POSITION, ATTRIBUTE_TEXCOORD, UNIFORM_TEXTURE0, VARYING_TEXCOORD |
Constructor Summary | |
---|---|
MultiInputFilter(int numOfInputs)
Creates a MultiInputFilter with any number of initial filters or filter graphs that produce a set number of textures which can be used by this filter. |
Method Summary | |
---|---|
void |
clearRegisteredFilterLocations()
Removes all currently registered filters from filter location list. |
void |
newTextureReady(int texture,
GLTextureOutputRenderer source)
Signals that a new texture is available and the image should be reprocessed. |
void |
registerFilterLocation(GLTextureOutputRenderer filter)
Registers the given filter in the next available texture location. |
void |
registerFilterLocation(GLTextureOutputRenderer filter,
int location)
Registers the given filter in the given texture location. |
Methods inherited from class project.android.imageprocessing.input.GLTextureOutputRenderer |
---|
addTarget, destroy, getLockObject, getTargets, removeTarget |
Methods inherited from class project.android.imageprocessing.GLRenderer |
---|
getBackgroundAlpha, getBackgroundBlue, getBackgroundGreen, getBackgroundRed, getHeight, getWidth, onDrawFrame, reInitialize, rotateClockwise90Degrees, rotateCounterClockwise90Degrees, setBackgroundAlpha, setBackgroundBlue, setBackgroundColour, setBackgroundGreen, setBackgroundRed, setRenderSize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiInputFilter(int numOfInputs)
numOfInputs
- The number of inputs of this filter. For example, if the fragment shader of this filter
requires three input textures, then this would be set to three.Method Detail |
---|
public void clearRegisteredFilterLocations()
public void newTextureReady(int texture, GLTextureOutputRenderer source)
GLTextureInputRenderer
newTextureReady
in interface GLTextureInputRenderer
newTextureReady
in class BasicFilter
texture
- The texture id to be used as input.source
- The GLTextureOutputRenderer which produced the texture.public void registerFilterLocation(GLTextureOutputRenderer filter)
filter
- An output filter which passes its output to this filter.public void registerFilterLocation(GLTextureOutputRenderer filter, int location)
filter
- An output filter which passes its output to this filter.location
- The texture location that this filter should pass its output to. This location must be in [0,numOfInputs).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |