Search in sources :

Example 6 with FilterDualCamFusionRepresentation

use of com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class ImagePreset method removeFilter.

public void removeFilter(FilterRepresentation filterRepresentation) {
    if (filterRepresentation.getFilterType() == FilterRepresentation.TYPE_BORDER || filterRepresentation.getFilterType() == FilterRepresentation.TYPE_DUALCAM || filterRepresentation.getFilterType() == FilterRepresentation.TYPE_TRUEPORTRAIT) {
        for (int i = 0; i < mFilters.size(); i++) {
            FilterRepresentation filter = mFilters.elementAt(i);
            if (filter.getFilterType() == filterRepresentation.getFilterType()) {
                mFilters.remove(i);
                // reset fusion underlay image.
                if (filter instanceof FilterDualCamFusionRepresentation || filter instanceof FilterTruePortraitFusionRepresentation) {
                    MasterImage.getImage().setFusionUnderlay(null);
                    MasterImage.getImage().setScaleFactor(1);
                    MasterImage.getImage().resetTranslation();
                }
                break;
            }
        }
    } else {
        for (int i = 0; i < mFilters.size(); i++) {
            if (sameSerializationName(mFilters.elementAt(i), filterRepresentation)) {
                mFilters.remove(i);
                break;
            }
        }
    }
}
Also used : FilterDualCamFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation) FilterTruePortraitFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Aggregations

FilterDualCamFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation)6 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)5 FilterTruePortraitFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation)3 Bitmap (android.graphics.Bitmap)1 Matrix (android.graphics.Matrix)1 Point (android.graphics.Point)1 DialogFragment (android.support.v4.app.DialogFragment)1 Fragment (android.support.v4.app.Fragment)1 DisplayMetrics (android.util.DisplayMetrics)1 MainPanel (com.android.gallery3d.filtershow.category.MainPanel)1 FilterDualCamBasicRepresentation (com.android.gallery3d.filtershow.filters.FilterDualCamBasicRepresentation)1 FilterFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterFusionRepresentation)1 FilterMirrorRepresentation (com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation)1 FilterRotateRepresentation (com.android.gallery3d.filtershow.filters.FilterRotateRepresentation)1 MediaPickerFragment (com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment)1 ImagePreset (com.android.gallery3d.filtershow.pipeline.ImagePreset)1