use of com.android.gallery3d.filtershow.filters.FilterStraightenRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorStraighten method reflectCurrentFilter.
@Override
public void reflectCurrentFilter() {
MasterImage master = MasterImage.getImage();
master.setCurrentFilterRepresentation(master.getPreset().getFilterWithSerializationName(FilterStraightenRepresentation.SERIALIZATION_NAME));
super.reflectCurrentFilter();
FilterRepresentation rep = getLocalRepresentation();
if (rep == null || rep instanceof FilterStraightenRepresentation) {
mImageStraighten.setFilterStraightenRepresentation((FilterStraightenRepresentation) rep);
} else {
Log.w(TAG, "Could not reflect current filter, not of type: " + FilterStraightenRepresentation.class.getSimpleName());
}
mImageStraighten.invalidate();
}
use of com.android.gallery3d.filtershow.filters.FilterStraightenRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class ImagePreset method equals.
public boolean equals(ImagePreset preset) {
if (preset == null) {
return false;
}
if (preset.mFilters.size() != mFilters.size()) {
return false;
}
if (mDoApplyGeometry != preset.mDoApplyGeometry) {
return false;
}
if (mDoApplyFilters != preset.mDoApplyFilters) {
if (mFilters.size() > 0 || preset.mFilters.size() > 0) {
return false;
}
}
for (int i = 0; i < preset.mFilters.size(); i++) {
FilterRepresentation a = preset.mFilters.elementAt(i);
FilterRepresentation b = mFilters.elementAt(i);
boolean isGeometry = false;
if (a instanceof FilterRotateRepresentation || a instanceof FilterMirrorRepresentation || a instanceof FilterCropRepresentation || a instanceof FilterStraightenRepresentation) {
isGeometry = true;
}
boolean evaluate = true;
if (!isGeometry && mDoApplyGeometry && !mDoApplyFilters) {
evaluate = false;
} else if (isGeometry && !mDoApplyGeometry && mDoApplyFilters) {
evaluate = false;
}
if (evaluate && !a.equals(b)) {
return false;
}
}
return true;
}
Aggregations