Files
session-android/src/org/thoughtcrime/securesms/imageeditor/EditSession.java

32 lines
945 B
Java
Raw Normal View History

2019-05-09 14:11:11 -03:00
package org.thoughtcrime.securesms.imageeditor;
import android.graphics.Matrix;
import android.graphics.PointF;
import androidx.annotation.NonNull;
2019-05-09 14:11:11 -03:00
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);
2019-05-09 14:11:11 -03:00
EditorElement getSelected();
EditSession newPoint(@NonNull Matrix newInverse, @NonNull PointF point, int p);
2019-05-09 14:11:11 -03:00
EditSession removePoint(@NonNull Matrix newInverse, int p);
2019-05-09 14:11:11 -03:00
void commit();
}