Search in sources :

Example 1 with CropObject

use of com.android.gallery3d.filtershow.crop.CropObject in project android_packages_apps_Gallery2 by LineageOS.

the class ImageCrop method forceStateConsistency.

private void forceStateConsistency() {
    MasterImage master = MasterImage.getImage();
    Bitmap image = master.getFiltersOnlyImage();
    FilterShowActivity filterShowActivity = (FilterShowActivity) getContext();
    boolean isReload = filterShowActivity.isReloadByConfigurationChanged();
    int width = image.getWidth();
    int height = image.getHeight();
    if (mCropObj == null || (!mUpdateHolder.equals(mGeometry) && !isReload) || mImageBounds.width() != width || mImageBounds.height() != height || !mLocalRep.getCrop().equals(mUpdateHolder.crop)) {
        mImageBounds.set(0, 0, width, height);
        mGeometry.set(mUpdateHolder);
        mLocalRep.setCrop(mUpdateHolder.crop);
        RectF scaledCrop = new RectF(mUpdateHolder.crop);
        FilterCropRepresentation.findScaledCrop(scaledCrop, width, height);
        mCropObj = new CropObject(mImageBounds, scaledCrop, (int) mUpdateHolder.straighten);
        mState = Mode.NONE;
        clearDisplay();
    }
}
Also used : RectF(android.graphics.RectF) Bitmap(android.graphics.Bitmap) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity) CropObject(com.android.gallery3d.filtershow.crop.CropObject) Paint(android.graphics.Paint)

Aggregations

Bitmap (android.graphics.Bitmap)1 Paint (android.graphics.Paint)1 RectF (android.graphics.RectF)1 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)1 CropObject (com.android.gallery3d.filtershow.crop.CropObject)1