ImageClipSession class

Stateful editing session built around an EditedImage.

A session is useful when a feature applies multiple edits to the same image. Each successful operation updates image, so callers can keep a single object as the current editing state instead of manually threading intermediate EditedImage values through every call.

Constructors

ImageClipSession({required EditedImage image, ImageProcessor processor = const ImageProcessor()})
Creates a session with an initial image.

Properties

hashCode int
The hash code for this object.
no setterinherited
image EditedImage
Current image state for the session.
no setter
isBusy bool
Whether the session currently has a running task.
no setter
operationCount int
Number of successful operations applied since the last replacement.
no setter
processor ImageProcessor
Processor used by this session.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

adjustColor(ColorAdjustment adjustment, {ImageClipTaskOptions? options}) Future<EditedImage>
Applies brightness, contrast, and saturation to the current image.
apply(List<ImageClipPipelineStep> steps, {ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), String? operationLabel, ImageClipTaskOptions? options}) Future<EditedImage>
Applies steps to the current image and updates image on success.
applyTask(List<ImageClipPipelineStep> steps, {ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), String? operationLabel, ImageClipTaskOptions? options}) ImageClipTask<EditedImage>
Starts applying steps to the current image.
cancelTask() bool
Cancels the active session task, if any.
cropRegion(CropRegion region, {ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) Future<EditedImage>
Crops the current image to region.
cropRegionTask(CropRegion region, {ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) ImageClipTask<EditedImage>
Starts cropping the current image to region.
exportImage({ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) Future<EditedImage>
Re-encodes the current image with outputSettings.
flipHorizontal({ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) Future<EditedImage>
Flips the current image around the vertical axis.
flipHorizontalTask({ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) ImageClipTask<EditedImage>
Starts flipping the current image around the vertical axis.
flipVertical({ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) Future<EditedImage>
Flips the current image around the horizontal axis.
flipVerticalTask({ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) ImageClipTask<EditedImage>
Starts flipping the current image around the horizontal axis.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceImage(EditedImage image) → void
Replaces the current session image and cancels any running task.
resizeLongSide(int maxSide, {ImageClipTaskOptions? options}) Future<EditedImage>
Resizes the current image so its longest side is maxSide.
rotate({int degrees = 90, ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) Future<EditedImage>
Rotates the current image clockwise by degrees.
rotateTask({int degrees = 90, ImageClipOutputSettings outputSettings = const ImageClipOutputSettings.png(), ImageClipTaskOptions? options}) ImageClipTask<EditedImage>
Starts rotating the current image clockwise by degrees.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited