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;
}
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;
}
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;
}
}
}
}
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);
}
}
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);
}
}
Aggregations