mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-28 15:27:03 +00:00
* 4% of original pixels must be visible. * The entire crop must be within the image. * On release, try to scale crop area and image to fit if the crop is invalid. * Undo to last valid position if that didn't work. * Additionally, center thumbs now do not respect aspect ratio lock.
32 lines
952 B
Java
32 lines
952 B
Java
package org.thoughtcrime.securesms.imageeditor;
|
|
|
|
import android.graphics.Matrix;
|
|
import android.graphics.PointF;
|
|
import android.support.annotation.NonNull;
|
|
|
|
import org.thoughtcrime.securesms.imageeditor.model.EditorElement;
|
|
|
|
/**
|
|
* Represents an underway edit of the image.
|
|
* <p>
|
|
* Accepts new touch positions, new touch points, released touch points and when complete can commit the edit.
|
|
* <p>
|
|
* Examples of edit session implementations are, Drag, Draw, Resize:
|
|
* <p>
|
|
* {@link ElementDragEditSession} for dragging with a single finger.
|
|
* {@link ElementScaleEditSession} for resize/dragging with two fingers.
|
|
* {@link DrawingSession} for drawing with a single finger.
|
|
*/
|
|
interface EditSession {
|
|
|
|
void movePoint(int p, @NonNull PointF point);
|
|
|
|
EditorElement getSelected();
|
|
|
|
EditSession newPoint(@NonNull Matrix newInverse, @NonNull PointF point, int p);
|
|
|
|
EditSession removePoint(@NonNull Matrix newInverse, int p);
|
|
|
|
void commit();
|
|
}
|