FlutterMozjpeg class abstract

A Flutter wrapper of Mozilla JPEG Encoder (mozjpeg).

Constructors

FlutterMozjpeg()

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

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

getter/setter pair
messageCallback MessageCallback?
Callback that receives log messages from mozjpeg library.
getter/setter pair
mozJpegLib DynamicLibrary
final

Static Methods

jpegCompress(Pointer<Uint8> src, int width, int height, int stride, MozJpegColorSpace colorSpace, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<MozJpegEncodedResult?>
Compress the raw image data on memory. stride, a.k.a. bytes-per-line, is depending on the pixel layout. If the data is RGBA, stride is typically width * 4 unless there are any trailing padding bytes. quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressFile(File file, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<MozJpegEncodedResult?>
quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressFileBytes(Uint8List fileBytes, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<MozJpegEncodedResult?>
quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressFileBytesToFile(Uint8List fileBytes, File output, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<bool>
quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressFileToFile(File input, File output, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<bool>
quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressImage(Image image, {int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<MozJpegEncodedResult?>
quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.
jpegCompressRgbaBytes(Uint8List rgba, int width, int height, {int? stride, int quality = 75, int dpi = 96, ProgressCallback? progressCallback}) Future<MozJpegEncodedResult?>
Compress the raw RGBA image data on memory. stride, a.k.a. bytes-per-line, is depending on the pixel layout. If the data is RGBA, stride is typically width * 4 unless there are any trailing padding bytes. quality is JPEG compression quality in 0 - 100; the default is 75. dpi is just an additional metadata, dot-per-inch; the default is 96. progressCallback receives progress percentage during the conversion.