package com.marshalchen.common.uimodule.imageprocessing.filter;
import com.marshalchen.common.uimodule.imageprocessing.input.GLTextureOutputRenderer;
import com.marshalchen.common.uimodule.imageprocessing.output.GLTextureInputRenderer;
/**
* A basic filter that takes a texture as input and produces a texture as output.
* This class is a base class that can be extended to use custom vertex or fragment shaders.
* This class by itself is relatively useless because it will simpily produce the input texture
* as the output texture.
* @author Chris Batt
*/
public abstract class BasicFilter extends GLTextureOutputRenderer implements GLTextureInputRenderer {
/* (non-Javadoc)
* @see com.marshalchen.common.uimodule.imageprocessing.output.GLTextureInputRenderer#newTextureReady(int, com.marshalchen.common.uimodule.imageprocessing.input.GLTextureOutputRenderer)
*/
@Override
public void newTextureReady(int texture, GLTextureOutputRenderer source, boolean newData) {
if(newData) {
markAsDirty();
}
texture_in = texture;
setWidth(source.getWidth());
setHeight(source.getHeight());
onDrawFrame();
}
}