Search in sources :

Example 1 with IPlugin

use of com.aviary.android.feather.library.plugins.PluginManager.IPlugin in project mobile-android by photo.

the class BordersPanel method loadNativeFilter.

protected INativeFilter loadNativeFilter(final EffectPack pack, int position, final CharSequence label, boolean hires) {
    BorderFilter filter = (BorderFilter) FilterLoaderFactory.get(Filters.BORDERS);
    filter.setBorderName(label);
    filter.setHiRes(hires);
    IPlugin plugin = pack.mPluginRef;
    if (null != plugin) {
        if (plugin instanceof InternalPlugin) {
            filter.setSourceApp(((InternalPlugin) plugin).getSourceDir(mPluginType));
            // border size
            int[] sizes = ((InternalPlugin) plugin).listBordersWidths();
            position -= pack.getIndex();
            if (null != sizes && sizes.length > (position - 1) && position > 0) {
                int borderSize = sizes[position - 1];
                filter.setSize((double) borderSize / 100.0);
            }
        }
    }
    return filter;
}
Also used : InternalPlugin(com.aviary.android.feather.library.plugins.PluginManager.InternalPlugin) BorderFilter(com.aviary.android.feather.library.filters.BorderFilter) Point(android.graphics.Point) IPlugin(com.aviary.android.feather.library.plugins.PluginManager.IPlugin)

Aggregations

Point (android.graphics.Point)1 BorderFilter (com.aviary.android.feather.library.filters.BorderFilter)1 IPlugin (com.aviary.android.feather.library.plugins.PluginManager.IPlugin)1 InternalPlugin (com.aviary.android.feather.library.plugins.PluginManager.InternalPlugin)1