ImageMerger class
Pure-Dart image merging (vertical/horizontal stitching) — reachable as
PixelCompressor.merge. Unlike every other concern on the facade, this
does no native platform-channel work: it's dart:ui Canvas drawing
entirely on the Dart side, and only ever produces PNG bytes (dart:ui
has no built-in JPEG/WebP/HEIC encoder). To get another format or hit
a target file size, pipe the PNG through PixelCompressor.image.compress:
final merged = await PixelCompressor.merge.combine(sources);
final jpeg = await PixelCompressor.image.compress(
MediaSource.file(merged.outputFile),
options: const ImageCompressOptions(
format: ImageFormat.jpeg,
targetSizeBytes: 500 * 1024,
),
);
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
combine(
List< MediaSource> inputs, {MergeOptions options = const MergeOptions()}) → Future<MergeResult> -
Decodes every source in
inputs, stitches them peroptions, and writes the result tooptions.outputPath(or a temp file). Requires at least 2 sources. -
decode(
MediaSource source) → Future< Image> -
Decodes one source into a
dart:uiui.Image — the same decode path combine uses internally, exposed so a liveMergeViewpreview shares identical PixelCompressorException handling with the headless path. The caller owns the returned image and must call.dispose()on it when done. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited