Direct Known Subclasses:
AccumulationBlurFilter, AnaglyphicFilter, Bias, CameraBlur, Combine, Convolve1D, Copy, CrtScreen, CubemapProjectionsFilter, DepthBufferFilter, FisheyeDistortion, Flare, FlareDirt, FxaaFilter, GeometryWarpFilter, Glow, GravitationalDistortionFilter, Lens, LevelsFilter, Luma, NfaaFilter, RadialBlur, RadialDistortion, Scattering, Threshold, UnsharpMaskFilter, Vignetting, Zoom

public abstract class Filter<T>
extends java.lang.Object
The base class for any single-pass filter.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  Filter.Parameter  
  • Field Summary

    Modifier and Type Field Description
    protected inputBuffer  
    protected inputTexture  
    protected outputBuffer  
    protected program  
    protected static FullscreenQuad quad  
    protected static int u_texture0  
    protected static int u_texture1  
    protected static int u_texture2  
    protected static int u_texture3  
  • Constructor Summary

    Constructor Description
    Filter​( program)  
  • Method Summary

    Modifier and Type Method Description
    void dispose()  
    protected void endParams()
    Should be called after any one or more setParams method calls.
    protected abstract void onBeforeRender()
    This method will get called just before a rendering operation occurs.
    protected void realRender()  
    abstract void rebind()
    FIXME add comment
    void render()  
    T setInput​( input)  
    T setInput​( input)  
    T setOutput​( output)  
    protected void setParam​(Filter.Parameter param, float value)  
    protected void setParam​(Filter.Parameter param, int value)  
    protected T setParam​(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value)  
    protected T setParam​(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value)  
    protected void setParam​(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value)  
    protected void setParam​(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value)  
    protected T setParams​(Filter.Parameter param, float value)
    Sets the parameter to the specified value for this filter.
    protected T setParams​(Filter.Parameter param, int value)  
    protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value)  
    protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value)  
    protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value)  
    protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value)  
    protected T setParamsv​(Filter.Parameter param, float[] values, int offset, int length)  
    protected T setParamv​(Filter.Parameter param, float[] values, int offset, int length)  
    void updateProgram​( program)
    Caution, disposes of the current program and updates it with the new one.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • quad

      protected static final FullscreenQuad quad
    • u_texture0

      protected static final int u_texture0
      See Also:
      Constant Field Values
    • u_texture1

      protected static final int u_texture1
      See Also:
      Constant Field Values
    • u_texture2

      protected static final int u_texture2
      See Also:
      Constant Field Values
    • u_texture3

      protected static final int u_texture3
      See Also:
      Constant Field Values
    • inputTexture

      protected inputTexture
    • inputBuffer

      protected inputBuffer
    • outputBuffer

      protected outputBuffer
    • program

      protected program
  • Constructor Details

    • Filter

      public Filter​( program)
  • Method Details

    • setInput

      public T setInput​( input)
    • setInput

      public T setInput​( input)
    • setOutput

      public T setOutput​( output)
    • updateProgram

      public void updateProgram​( program)
      Caution, disposes of the current program and updates it with the new one. Run synchronously after render().
      program - The new shader program.
    • dispose

      public void dispose()
    • rebind

      public abstract void rebind()
      FIXME add comment
    • setParam

      protected void setParam​(Filter.Parameter param, int value)
    • setParam

      protected void setParam​(Filter.Parameter param, float value)
    • setParam

      protected void setParam​(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value)
    • setParam

      protected void setParam​(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value)
    • setParam

      protected T setParam​(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value)
    • setParam

      protected T setParam​(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value)
    • setParamv

      protected T setParamv​(Filter.Parameter param, float[] values, int offset, int length)
    • setParams

      protected T setParams​(Filter.Parameter param, float value)
      Sets the parameter to the specified value for this filter. When you are finished building the batch you shall signal it by invoking endParams().
    • setParams

      protected T setParams​(Filter.Parameter param, int value)
    • setParams

      protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value)
    • setParams

      protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value)
    • setParams

      protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value)
    • setParams

      protected T setParams​(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value)
    • setParamsv

      protected T setParamsv​(Filter.Parameter param, float[] values, int offset, int length)
    • endParams

      protected void endParams()
      Should be called after any one or more setParams method calls.
    • onBeforeRender

      protected abstract void onBeforeRender()
      This method will get called just before a rendering operation occurs.
    • render

      public final void render()
    • realRender

      protected void realRender()