ImageCompressorPlatform class abstract

The contract every platform backend implements.

Two native operations: encodeOnce (fixed quality) and encodeToSize (decode once, binary-search quality to a byte ceiling). Source resolution and batching stay in the Dart facade; the compute-heavy work is native so a target-size search decodes the image only once.

Inheritance
  • Object
  • PlatformInterface
  • ImageCompressorPlatform
Implementers

Constructors

ImageCompressorPlatform()

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

encodeOnce(EncodeRequest request) Future<EncodeResult>
Encode request exactly once and return the resulting bytes plus decoded dimensions. Backends must decode at a reduced size when maxWidth/ maxHeight are set (downsample-on-decode) to avoid loading huge bitmaps into memory.
encodeToSize(EncodeSizeRequest request) Future<EncodeResult>
Decode request once, then binary-search quality down to minQuality until the output fits under maxBytes. Returns the best fitting result, or (if nothing fits) the smallest achievable with reachedTarget false.
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

Static Properties

instance ImageCompressorPlatform
getter/setter pair