Search in sources :

Example 6 with FilterFunction

use of android.filterfw.core.FilterFunction in project android_frameworks_base by ResurrectionRemix.

the class FilterFunctionEnvironment method createFunction.

/**
     * 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.
     *
     * @param filterClass   The class of the filter to wrap. This must be a Filter subclass.
     * @param parameters    An argument list of alternating key-value filter parameters.
     * @return             A new FilterFunction instance.
     */
public FilterFunction createFunction(Class filterClass, Object... parameters) {
    String filterName = "FilterFunction(" + filterClass.getSimpleName() + ")";
    Filter filter = FilterFactory.sharedFactory().createFilterByClass(filterClass, filterName);
    filter.initWithAssignmentList(parameters);
    return new FilterFunction(getContext(), filter);
}
Also used : FilterFunction(android.filterfw.core.FilterFunction) Filter(android.filterfw.core.Filter)

Aggregations

Filter (android.filterfw.core.Filter)6 FilterFunction (android.filterfw.core.FilterFunction)6