Search in sources :

Example 1 with FilterTruePortraitFusionRepresentation

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

the class SaveImage method findFusionRepresentation.

private FilterFusionRepresentation findFusionRepresentation(ImagePreset preset) {
    FilterDualCamFusionRepresentation dcRepresentation = (FilterDualCamFusionRepresentation) preset.getFilterWithSerializationName(FilterDualCamFusionRepresentation.SERIALIZATION_NAME);
    FilterTruePortraitFusionRepresentation tpRepresentation = (FilterTruePortraitFusionRepresentation) preset.getFilterWithSerializationName(FilterTruePortraitFusionRepresentation.SERIALIZATION_NAME);
    FilterFusionRepresentation fusionRep = null;
    if (dcRepresentation != null)
        fusionRep = (FilterFusionRepresentation) dcRepresentation;
    else if (tpRepresentation != null)
        fusionRep = (FilterFusionRepresentation) tpRepresentation;
    return fusionRep;
}
Also used : FilterDualCamFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation) FilterTruePortraitFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation) FilterFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterFusionRepresentation)

Example 2 with FilterTruePortraitFusionRepresentation

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

the class MasterImage method hasFusionApplied.

public synchronized boolean hasFusionApplied() {
    FilterRepresentation dcRepresentation = mPreset.getFilterWithSerializationName(FilterDualCamFusionRepresentation.SERIALIZATION_NAME);
    FilterRepresentation tpRepresentation = mPreset.getFilterWithSerializationName(FilterTruePortraitFusionRepresentation.SERIALIZATION_NAME);
    if (dcRepresentation instanceof FilterDualCamFusionRepresentation || tpRepresentation instanceof FilterTruePortraitFusionRepresentation) {
        return true;
    }
    return false;
}
Also used : FilterDualCamFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation) FilterTruePortraitFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 3 with FilterTruePortraitFusionRepresentation

use of com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation 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)

Example 4 with FilterTruePortraitFusionRepresentation

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

the class EditorTruePortraitFusion method setUnderlayImageUri.

public void setUnderlayImageUri(Uri uri) {
    mUnderlayUri = uri;
    FilterRepresentation filter = getLocalRepresentation();
    if (filter instanceof FilterTruePortraitFusionRepresentation) {
        mImageFusion.setUnderlay(uri);
        commitLocalRepresentation();
        // save fusion underlay uri
        GalleryUtils.setStringPref(mContext, mContext.getString(R.string.pref_trueportrait_fusion_underlay_key), (uri != null) ? uri.toString() : null);
    }
}
Also used : FilterTruePortraitFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 5 with FilterTruePortraitFusionRepresentation

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

the class EditorTruePortraitFusion method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && rep instanceof FilterTruePortraitFusionRepresentation) {
        FilterTruePortraitFusionRepresentation fusionRep = (FilterTruePortraitFusionRepresentation) rep;
        mImageFusion.setRepresentation(fusionRep);
    }
}
Also used : FilterTruePortraitFusionRepresentation(com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Aggregations

FilterTruePortraitFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterTruePortraitFusionRepresentation)5 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)4 FilterDualCamFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation)3 FilterFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterFusionRepresentation)1