FilterFunctionEnvironment.javaAPI DocAndroid 5.1 API4026Thu Mar 12 22:22:30 GMT 2015android.filterfw


public class FilterFunctionEnvironment extends MffEnvironment
A FilterFunctionEnvironment provides a simple functional front-end to manually executing filters. Use this environment if a graph-based approach is not convenient for your case. Typically, a FilterFunctionEnvironment is used as follows: 1. Instantiate a new FilterFunctionEnvironment instance. 2. Perform any configuration, such as setting a GL environment. 3. Wrap Filters into FilterFunctions by calling createFunction(). 4. Execute FilterFunctions individually and use the results for further processing. Additionally, there is a convenience method to execute a number of filters in sequence.

Fields Summary
Constructors Summary
public FilterFunctionEnvironment()
Create a new FilterFunctionEnvironment with the default components.

public FilterFunctionEnvironment(android.filterfw.core.FrameManager frameManager)
Create a new FilterFunctionEnvironment with a custom FrameManager. Pass null to auto-create a FrameManager.

frameManager The FrameManager to use, or null to auto-create one.

Methods Summary
public android.filterfw.core.FilterFunctioncreateFunction(java.lang.Class filterClass, java.lang.Object parameters)
Create a new FilterFunction from a specific filter class. The function is initialized with the given key-value list of parameters. Note, that this function uses the default shared FilterFactory to create the filter instance.

filterClass The class of the filter to wrap. This must be a Filter subclass.
parameters An argument list of alternating key-value filter parameters.
A new FilterFunction instance.

        String filterName = "FilterFunction(" + filterClass.getSimpleName() + ")";
        Filter filter = FilterFactory.sharedFactory().createFilterByClass(filterClass, filterName);
        return new FilterFunction(getContext(), filter);