project.android.imageprocessing.input
Class GLTextureOutputRenderer

java.lang.Object
  extended by project.android.imageprocessing.GLRenderer
      extended by project.android.imageprocessing.input.GLTextureOutputRenderer
Direct Known Subclasses:
BasicFilter, CameraPreviewInput, ImageResourceInput, VideoResourceInput

public abstract class GLTextureOutputRenderer
extends GLRenderer

A output producing extension of GLRenderer. This class produces its output in the form of a texture and then sends that texture to all of the filters or endpoints that have been added as targets to this renderer.

Author:
Chris Batt

Field Summary
 
Fields inherited from class project.android.imageprocessing.GLRenderer
ATTRIBUTE_POSITION, ATTRIBUTE_TEXCOORD, UNIFORM_TEXTURE0, VARYING_TEXCOORD
 
Constructor Summary
GLTextureOutputRenderer()
          Creates a GLTextureOutputRenderer which initially has an empty list of targets.
 
Method Summary
 void addTarget(GLTextureInputRenderer target)
          Adds the given target to the list of targets that this renderer sends its output to.
 void destroy()
          Cleans up the opengl objects for this renderer.
 java.lang.Object getLockObject()
          Returns the object used to lock the target list.
 java.util.List<GLTextureInputRenderer> getTargets()
          Returns a list of all the targets that this renderer should send its output to.
 void removeTarget(GLTextureInputRenderer target)
          Removes the given target from the list of targets that this renderer sends its output to.
 
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

GLTextureOutputRenderer

public GLTextureOutputRenderer()
Creates a GLTextureOutputRenderer which initially has an empty list of targets.

Method Detail

addTarget

public void addTarget(GLTextureInputRenderer target)
Adds the given target to the list of targets that this renderer sends its output to.

Parameters:
target - The target which should be added to the list of targets that this renderer sends its output to.

destroy

public void destroy()
Description copied from class: GLRenderer
Cleans up the opengl objects for this renderer. Must be called with opengl context. Normally called by FastImageProcessingPipeline.

Overrides:
destroy in class GLRenderer

getLockObject

public java.lang.Object getLockObject()
Returns the object used to lock the target list. Iterating over or changing the target list should be done in a synchronized block that is locked using the object return.

Returns:
lock the object which is used to lock the target list

getTargets

public java.util.List<GLTextureInputRenderer> getTargets()
Returns a list of all the targets that this renderer should send its output to. Iterating over or changing this list should be done in a synchronized block, locked using the object returned from getLockObject().

Returns:
targets

removeTarget

public void removeTarget(GLTextureInputRenderer target)
Removes the given target from the list of targets that this renderer sends its output to.

Parameters:
target - The target which should be removed from the list of targets that this renderer sends its output to.