use of com.android.gallery3d.filtershow.filters.FilterCropRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class EditorCrop method reflectCurrentFilter.
@Override
public void reflectCurrentFilter() {
MasterImage master = MasterImage.getImage();
master.setCurrentFilterRepresentation(master.getPreset().getFilterWithSerializationName(FilterCropRepresentation.SERIALIZATION_NAME));
super.reflectCurrentFilter();
FilterRepresentation rep = getLocalRepresentation();
if (rep == null || rep instanceof FilterCropRepresentation) {
mImageCrop.setFilterCropRepresentation((FilterCropRepresentation) rep);
} else {
Log.w(TAG, "Could not reflect current filter, not of type: " + FilterCropRepresentation.class.getSimpleName());
}
mImageCrop.invalidate();
}
use of com.android.gallery3d.filtershow.filters.FilterCropRepresentation 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;
}
use of com.android.gallery3d.filtershow.filters.FilterCropRepresentation in project android_packages_apps_Gallery2 by LineageOS.
the class ImageStraighten method getFinalRepresentation.
public Collection<FilterRepresentation> getFinalRepresentation() {
ArrayList<FilterRepresentation> reps = new ArrayList<FilterRepresentation>(2);
reps.add(mLocalRep);
if (mInitialAngle != mLocalRep.getStraighten()) {
reps.add(new FilterCropRepresentation(mCrop));
}
return reps;
}
Aggregations