FileDocCategorySizeDatePackage
FilterEffect.javaAPI DocAndroid 5.1 API3096Thu Mar 12 22:22:30 GMT 2015android.media.effect

FilterEffect

public abstract class FilterEffect extends Effect
The FilterEffect class is the base class for all Effects based on Filters from the Mobile Filter Framework (MFF).
hide

Fields Summary
protected EffectContext
mEffectContext
private String
mName
Constructors Summary
protected FilterEffect(EffectContext context, String name)
Protected constructor as FilterEffects should be created by Factory.

        mEffectContext = context;
        mName = name;
    
Methods Summary
protected voidbeginGLEffect()
Call this before manipulating the GL context. Will assert that the GL environment is in a valid state, and save it.

        mEffectContext.assertValidGLState();
        mEffectContext.saveGLState();
    
protected voidendGLEffect()
Call this after manipulating the GL context. Restores the previous GL state.

        mEffectContext.restoreGLState();
    
protected android.filterfw.core.FrameframeFromTexture(int texId, int width, int height)
Converts a texture into a Frame.

        FrameManager manager = getFilterContext().getFrameManager();
        FrameFormat format = ImageFormat.create(width, height,
                                                ImageFormat.COLORSPACE_RGBA,
                                                FrameFormat.TARGET_GPU);
        Frame frame = manager.newBoundFrame(format,
                                            GLFrame.EXISTING_TEXTURE_BINDING,
                                            texId);
        frame.setTimestamp(Frame.TIMESTAMP_UNKNOWN);
        return frame;
    
protected android.filterfw.core.FilterContextgetFilterContext()
Returns the active filter context for this effect.

        return mEffectContext.mFilterContext;
    
public java.lang.StringgetName()
Get the effect name. Returns the unique name of the effect, which matches the name used for instantiating this effect by the EffectFactory.

return
The name of the effect.

        return mName;