imcodec_native library

Optional bundled native and WebAssembly codecs for Imcodec.

Classes

AvifCodec
Encodes and decodes AVIF with the bundled AV1 engine.
AvifDecodeOptions
Options for AVIF decoding.
AvifDecoder
Decodes the primary AVIF image, including alpha and container orientation.
AvifEncodeOptions
Options for AVIF encoding.
AvifEncoder
Encodes straight RGBA8 as lossy or mathematically lossless AVIF.
BmpCodec
Encodes and decodes Bitmap images.
BmpDecodeOptions
Allows to pass options to a BmpDecoder.
BmpDecoder
Decodes uncompressed, bitfield, and run-length encoded BMP images.
BmpEncodeOptions
Allows to pass options to a BmpEncoder.
BmpEncoder
Encodes RGBA pixels as a 32-bit BMP with explicit color masks.
DecodedImage
Stores straight-alpha process samples without reducing their precision.
DecodedImageMetadata
Describes metadata that affects faithful raster decoding.
GifCodec
Encodes and decodes the first image in Graphics Interchange Format data.
GifDecodeOptions
Options for GIF decoding.
GifDecoder
Decodes the first visible GIF frame to straight RGBA pixels.
GifEncodeOptions
Options for GIF encoding.
GifEncoder
Encodes a single image as GIF89a data.
HeifCodec
Encodes HEIC and decodes primary images from HEIF/HEIC containers.
HeifDecodeOptions
Options for HEIF/HEIC decoding.
HeifDecoder
Decodes primary HEIF/HEIC images, including grids, alpha and orientation.
HeifEncodeOptions
Options for HEIF/HEIC encoding.
HeifEncoder
Encodes straight RGBA8 as HEIC with HEVC 4:2:0 colour and lossless alpha.
Image
Stores an 8-bit image in straight-alpha RGBA order.
ImageCodecExtension<EncodeOptions extends RasterEncodeOptions, DecodeOptions extends RasterDecodeOptions>
Supplies an optional codec implementation without adding a package dependency.
ImageCodecRegistry
Isolate-local registry of explicitly installed optional codecs.
ImageFormat
A named image format with its own file-signature matcher.
ImageFormatRegistry
Isolate-local ordered collection of formats recognized by Imcodec.
ImcodecNative
Installs optional codecs into Imcodec after preparing the platform backend.
JpegCodec
Encodes and decodes Joint Photographic Experts Group images.
JpegDecodeOptions
Options for JPEG decoding.
JpegDecoder
Decodes baseline, extended sequential, and progressive Huffman JPEG data.
JpegEncodeOptions
Options for JPEG encoding.
JpegEncoder
Encodes images as baseline JPEG data.
JpegXlCodec
Encodes and decodes JPEG XL images.
JpegXlDecodeOptions
The JPEG XL decode options.
JpegXlDecoder
Decodes JPEG XL images to straight-alpha RGBA pixels.
JpegXlEncodeOptions
Lossy JPEG XL encoder options.
JpegXlEncoder
Encodes straight-alpha RGBA images as lossless JPEG XL Modular data.
NativeImageFormat
Additional formats supplied by ImcodecNative's bundled engines.
NativeJpegCodec
Encodes and decodes JPEG through libjpeg-turbo.
NativeJpegDecoder
Decodes JPEG through libjpeg-turbo.
NativeJpegEncoder
Encodes JPEG through libjpeg-turbo using Imcodec's options.
NativeJpegXlCodec
Encodes and decodes JPEG XL through libjxl.
NativeJpegXlDecoder
Decodes JPEG XL through libjxl to straight-alpha RGBA samples.
NativeJpegXlEncoder
Encodes lossless JPEG XL using libjxl, including RGB hidden by zero alpha.
NativeOpenExrCodec
Encodes and decodes OpenEXR through OpenEXR.
NativeOpenExrDecoder
Decodes OpenEXR through OpenEXR.
NativeOpenExrEncoder
Encodes OpenEXR through OpenEXR using Imcodec's options.
NativePngCodec
Encodes and decodes PNG through libpng.
NativePngDecoder
Decodes PNG through libpng.
NativePngEncoder
Encodes PNG through libpng using Imcodec's options.
NativeQoiCodec
Encodes and decodes QOI through the reference QOI library.
NativeQoiDecoder
Decodes QOI through the reference QOI library.
NativeQoiEncoder
Encodes QOI through the reference QOI library using Imcodec's options.
NativeTiffCodec
Encodes and decodes TIFF through libtiff.
NativeTiffDecoder
Decodes TIFF through libtiff.
NativeTiffEncoder
Encodes TIFF through libtiff using Imcodec's options.
NativeWebPCodec
Encodes and decodes WebP through libwebp.
NativeWebPDecoder
Decodes still or first-frame WebP through libwebp.
NativeWebPEncoder
Encodes WebP using libwebp while retaining Imcodec's straight-alpha contract.
OpenExrCodec
Encodes and decodes ordinary single-part OpenEXR scan-line images.
OpenExrDecodeOptions
The OpenEXT decoder options.
OpenExrDecoder
Decodes RGB, RGBA, or luminance OpenEXR scan-line parts.
OpenExrEncodeOptions
The OpenEXR encode options.
OpenExrEncoder
Encodes straight RGBA samples as scene-linear half-float OpenEXR.
ParallelRasterCodecExtension<EncodeOptions extends RasterEncodeOptions, Encoder extends ParallelRasterEncoder<EncodeOptions>, DecodeOptions extends RasterDecodeOptions, Decoder extends RasterDecoder<DecodeOptions>, Codec extends ParallelRasterCodec<EncodeOptions, Encoder, DecodeOptions, Decoder>>
A codec extension for a ParallelRasterCodec.
PngCodec
Encodes and decodes Portable Network Graphics images.
PngDecodeOptions
Options for the PNG decoder.
PngDecoder
Decodes standard and Adam7-interlaced PNG pixels synchronously.
PngEncodeOptions
Options for the PNG encoder.
PngEncoder
Encodes images as Portable Network Graphics data.
QoiCodec
Encodes and decodes Quite OK Image data.
QoiDecodeOptions
Options for the QOI decoder.
QoiDecoder
Decodes Quite OK Image data to RGBA pixels.
QoiEncodeOptions
Options for the QOI encoder.
QoiEncoder
Encodes RGBA pixels using the Quite OK Image specification.
RasterCodec<EncodeOptions extends RasterEncodeOptions, Encoder extends RasterEncoder<EncodeOptions>, DecodeOptions extends RasterDecodeOptions, Decoder extends RasterDecoder<DecodeOptions>>
Provides shared validation and error handling for synchronous image codecs.
RasterCodecExtension<EncodeOptions extends RasterEncodeOptions, Encoder extends RasterEncoder<EncodeOptions>, DecodeOptions extends RasterDecodeOptions, Decoder extends RasterDecoder<DecodeOptions>, Codec extends RasterCodec<EncodeOptions, Encoder, DecodeOptions, Decoder>>
A codec extension for a RasterCodec.
RasterDecodeOptions
Allows to pass options to a RasterDecoder.
RasterDecoder<Options extends RasterDecodeOptions>
Converts encoded raster bytes to an Image.
RasterEncodeOptions
Allows to pass options to a RasterEncoder.
RasterEncoder<Options extends RasterEncodeOptions>
Converts an Image to encoded raster bytes.
TgaCodec
Encodes and decodes Truevision TGA images.
TgaDecodeOptions
Options for the TGA decoder.
TgaDecoder
Decodes color-mapped, true-color, and grayscale TGA images.
TgaEncodeOptions
Options for the TGA encoder.
TgaEncoder
Encodes RGBA pixels as 32-bit true-color TGA data.
TiffCodec
Encodes and decodes Tagged Image File Format images.
TiffDecodeOptions
Options for the TIFF decoder.
TiffDecoder
Decodes baseline TIFF images to straight RGBA pixels.
TiffEncodeOptions
Options for the TIFF encoder.
TiffEncoder
Encodes straight RGBA pixels as baseline TIFF data.
WebPCodec
Encodes and decodes WebP images. Encoding produces lossless VP8L or lossy VP8 data. Decoding accepts lossless VP8L, lossy VP8, alpha data, and the first frame of animated WebP files.
WebPDecodeOptions
The WebP decode options.
WebPDecoder
Decodes static and first-frame WebP images synchronously.
WebPEncodeOptions
The options for encoding a WebP image.
WebPEncoder
Encodes images as lossless VP8L or lossy VP8 WebP data.

Enums

ChannelOrder
Describes the channel layout of source pixel bytes.
DecodedColorModel
Identifies the process channels retained by a decoded raster.
DecodedSampleFormat
Identifies the scalar representation of decoded channel samples.
JpegChroma
Selects the chroma sampling used by the JPEG encoder.
JpegXlEffort
Trade-off between JPEG XL encoding speed and output size.
OpenExrCompression
Compression methods emitted by OpenExrEncoder.
TiffCompression
Compression methods available when encoding TIFF images.
WebPEffort
Trade-off between lossy WebP encoding speed and output quality.

Mixins

InspectableFormat
An inspectable ImageFormat.
ParallelImageCodecExtension<EncodeOptions extends RasterEncodeOptions, DecodeOptions extends RasterDecodeOptions>
A codec extension that offers independent encoding work.
ParallelRasterCodec<EncodeOptions extends RasterEncodeOptions, Encoder extends ParallelRasterEncoder<EncodeOptions>, DecodeOptions extends RasterDecodeOptions, Decoder extends RasterDecoder<DecodeOptions>>
A codec that can spread work across isolates.
ParallelRasterEncoder<Options extends RasterEncodeOptions>
An encoder that can spread work across isolates.

Constants

defaultMaxDecodedBytes → const int
Default maximum number of sample bytes one decoded raster may hold.
defaultMaxDescriptiveMetadataBytes → const int
Default maximum size of each retained EXIF, IPTC, or XMP packet.
defaultMaxEncodedBytes → const int
Maximum size of one encoded output allocation.
defaultMaxIccProfileBytes → const int
Default maximum number of decompressed ICC bytes retained from a container.

Functions

decodeAvif(Uint8List bytes, {AvifDecodeOptions? options}) → Image
Decodes the primary AVIF image to straight RGBA8.
decodeAvifAsync(Uint8List bytes, {AvifDecodeOptions? options}) → Future<Image>
Decodes AVIF on a native isolate or browser Worker.
decodeAvifData(Uint8List bytes, {AvifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes AVIF samples while preserving high-bit-depth input and ICC profiles.
decodeAvifDataAsync(Uint8List bytes, {AvifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves high-precision AVIF samples on a native isolate or browser Worker.
decodeBmp(Uint8List bytes, {BmpDecodeOptions? options}) → Image
Decodes an uncompressed or bitfield BMP image to straight RGBA.
decodeGif(Uint8List bytes, {GifDecodeOptions? options}) → Image
Decodes the first visible GIF frame to straight RGBA.
decodeHeic(Uint8List bytes, {HeifDecodeOptions? options}) → Image
Decodes the primary HEIC image to straight RGBA8.
decodeHeicAsync(Uint8List bytes, {HeifDecodeOptions? options}) → Future<Image>
Decodes HEIC on a native isolate or browser Worker.
decodeHeicData(Uint8List bytes, {HeifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes HEIC samples while preserving high-bit-depth input and ICC profiles.
decodeHeicDataAsync(Uint8List bytes, {HeifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves high-precision HEIC samples on a native isolate or browser Worker.
decodeHeif(Uint8List bytes, {HeifDecodeOptions? options}) → Image
Decodes the primary HEIF/HEIC image to straight RGBA8.
decodeHeifAsync(Uint8List bytes, {HeifDecodeOptions? options}) → Future<Image>
Decodes HEIF/HEIC on a native isolate or browser Worker.
decodeHeifData(Uint8List bytes, {HeifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes HEIF/HEIC samples while preserving high-bit-depth input and ICC profiles.
decodeHeifDataAsync(Uint8List bytes, {HeifDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves high-precision HEIF/HEIC samples on a native isolate or browser Worker.
decodeImage<Options extends RasterDecodeOptions>(Uint8List bytes, {Options? options}) → Image
Decodes a supported image synchronously to straight RGBA.
decodeImageData<Options extends RasterDecodeOptions>(Uint8List bytes, {Options? options, int? maxPixels, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes native process samples and attaches supported container metadata.
decodeJpegAsync(Uint8List bytes, {JpegDecodeOptions? options}) → Future<Image>
Decodes the primary JPEG image on an isolate or browser Worker.
decodeJpegDataAsync(Uint8List bytes, {JpegDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native JPEG samples on an isolate or browser Worker.
decodeJpegXl(Uint8List bytes, {JpegXlDecodeOptions? options}) → Image
Decodes the first visible frame of a JPEG XL image to straight RGBA.
decodeJpegXlAsync(Uint8List bytes, {JpegXlDecodeOptions? options}) → Future<Image>
Decodes the first visible JPEG XL frame on an isolate or browser Worker.
decodeJpegXlDataAsync(Uint8List bytes, {JpegXlDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native JPEG XL samples on an isolate or browser Worker.
decodeJpg(Uint8List bytes, {JpegDecodeOptions? options}) → Image
Decodes a JPEG image to opaque RGBA.
decodeJpgData(Uint8List bytes, {JpegDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes JPEG data while preserving native CMYK components when present.
decodeJxl(Uint8List bytes, {JpegXlDecodeOptions? options}) → Image
Decodes the first visible frame of a JPEG XL image to straight RGBA.
decodeJxlAsync(Uint8List bytes, {JpegXlDecodeOptions? options}) → Future<Image>
Decodes the first visible JPEG XL frame on an isolate or browser Worker.
decodeOpenExr(Uint8List bytes, {OpenExrDecodeOptions? options}) → Image
Decodes one single-part OpenEXR scan-line image to straight RGBA8.
decodeOpenExrAsync(Uint8List bytes, {OpenExrDecodeOptions? options}) → Future<Image>
Decodes the primary OpenEXR image on an isolate or browser Worker.
decodeOpenExrData(Uint8List bytes, {OpenExrDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes}) → DecodedImage
Decodes OpenEXR data while preserving floating-point HDR samples.
decodeOpenExrDataAsync(Uint8List bytes, {OpenExrDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native OpenEXR samples on an isolate or browser Worker.
decodePng(Uint8List bytes, {PngDecodeOptions? options}) → Image
Decodes the first frame of a PNG image to straight RGBA.
decodePngAsync(Uint8List bytes, {PngDecodeOptions? options}) → Future<Image>
Decodes the primary PNG image on an isolate or browser Worker.
decodePngData(Uint8List bytes, {PngDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes PNG data while preserving unsigned sixteen-bit samples.
decodePngDataAsync(Uint8List bytes, {PngDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native PNG samples on an isolate or browser Worker.
decodeQoi(Uint8List bytes, {QoiDecodeOptions? options}) → Image
Decodes a Quite OK Image to straight RGBA.
decodeQoiAsync(Uint8List bytes, {QoiDecodeOptions? options}) → Future<Image>
Decodes the primary QOI image on an isolate or browser Worker.
decodeQoiDataAsync(Uint8List bytes, {QoiDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native QOI samples on an isolate or browser Worker.
decodeTga(Uint8List bytes, {TgaDecodeOptions? options}) → Image
Decodes an uncompressed or run-length encoded TGA image to straight RGBA.
decodeTiff(Uint8List bytes, {TiffDecodeOptions? options}) → Image
Decodes the first image-file directory of a baseline TIFF image.
decodeTiffAsync(Uint8List bytes, {TiffDecodeOptions? options}) → Future<Image>
Decodes the primary TIFF image on an isolate or browser Worker.
decodeTiffData(Uint8List bytes, {TiffDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → DecodedImage
Decodes TIFF data while preserving integer or floating-point samples.
decodeTiffDataAsync(Uint8List bytes, {TiffDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native TIFF samples on an isolate or browser Worker.
decodeWebP(Uint8List bytes, {WebPDecodeOptions? options}) → Image
Decodes the first frame of a WebP image to straight RGBA.
decodeWebPAsync(Uint8List bytes, {WebPDecodeOptions? options}) → Future<Image>
Decodes the first composited WebP frame on an isolate or browser Worker.
decodeWebPDataAsync(Uint8List bytes, {WebPDecodeOptions? options, int maxDecodedBytes = defaultMaxDecodedBytes, int maxIccProfileBytes = defaultMaxIccProfileBytes}) → Future<DecodedImage>
Preserves native WebP samples on an isolate or browser Worker.
encodeAvif(Image image, {AvifEncodeOptions? options}) → Uint8List
Encodes straight RGBA8 as AVIF with lossless alpha.
encodeAvifWith(ParallelRunner runner, Image image, {AvifEncodeOptions? options}) → Future<Uint8List>
Encodes AVIF through runner.
encodeBmp(Image image, {BmpEncodeOptions? options}) → Uint8List
Encodes image as a 32-bit BMP with alpha bitfields.
encodeGif(Image image, {GifEncodeOptions? options}) → Uint8List
Encodes image as one static palette-indexed GIF frame.
encodeHeic(Image image, {HeifEncodeOptions? options}) → Uint8List
Encodes straight RGBA8 as HEIC with lossless alpha.
encodeHeicWith(ParallelRunner runner, Image image, {HeifEncodeOptions? options}) → Future<Uint8List>
Encodes HEIC through runner.
encodeHeif(Image image, {HeifEncodeOptions? options}) → Uint8List
Encodes straight RGBA8 as HEIC with lossless alpha.
encodeHeifWith(ParallelRunner runner, Image image, {HeifEncodeOptions? options}) → Future<Uint8List>
Encodes HEIF/HEIC through runner.
encodeImage<Options extends RasterEncodeOptions>(Image image, {required ImageFormat format, Options? options}) → Uint8List
Encodes image to format with format-specific options.
encodeImageWith<Options extends RasterEncodeOptions>(ParallelRunner runner, Image image, {required ImageFormat format, Options? options}) → Future<Uint8List>
Encodes image to format, offering runner independent work.
encodeJpeg(Image image, {JpegEncodeOptions? options}) → Uint8List
Encodes image as a baseline JPEG.
encodeJpegWith(ParallelRunner runner, Image image, {JpegEncodeOptions? options}) → Future<Uint8List>
Encodes image as a baseline JPEG through runner.
encodeJpegXl(Image image, {JpegXlEncodeOptions? options}) → Uint8List
Encodes image as lossless JPEG XL Modular data.
encodeJpegXlWith(ParallelRunner runner, Image image, {JpegXlEncodeOptions? options}) → Future<Uint8List>
Encodes image as lossless JPEG XL Modular data through runner.
encodeJpg(Image image, {JpegEncodeOptions? options}) → Uint8List
Encodes image as a baseline JPEG.
encodeJpgWith(ParallelRunner runner, Image image, {JpegEncodeOptions? options}) → Future<Uint8List>
Encodes image as a baseline JPEG through runner.
encodeJxl(Image image, {JpegXlEncodeOptions? options}) → Uint8List
Encodes image as lossless JPEG XL Modular data.
encodeOpenExr(Image image, {OpenExrEncodeOptions? options}) → Uint8List
Encodes image as a scene-linear half-float OpenEXR image.
encodeOpenExrFloat32Rgba({required int width, required int height, required Float32List pixels, OpenExrEncodeOptions? options}) → Uint8List
Encodes straight extended-sRGB float samples as half-float OpenEXR.
encodePng(Image image, {PngEncodeOptions? options}) → Uint8List
Encodes image as an 8-bit RGBA PNG.
encodePngWith(ParallelRunner runner, Image image, {PngEncodeOptions? options}) → Future<Uint8List>
Encodes image as an 8-bit RGBA PNG through runner.
encodeQoi(Image image, {QoiEncodeOptions? options}) → Uint8List
Encodes image as a lossless Quite OK Image.
encodeTga(Image image, {TgaEncodeOptions? options}) → Uint8List
Encodes image as a 32-bit TGA image.
encodeTiff(Image image, {TiffEncodeOptions? options}) → Uint8List
Encodes image as an eight-bit RGBA TIFF image.
encodeWebP(Image image, {WebPEncodeOptions? options}) → Uint8List
Encodes image as lossless VP8L or lossy VP8 WebP data.
encodeWebPWith(ParallelRunner runner, Image image, {WebPEncodeOptions? options}) → Future<Uint8List>
Encodes image as WebP through runner.
inspectImage(Uint8List bytes, {int maxIccProfileBytes = defaultMaxIccProfileBytes, int maxDescriptiveMetadataBytes = defaultMaxDescriptiveMetadataBytes}) → DecodedImageMetadata?
Reads metadata needed to preserve authored samples and colour meaning.
onBoundedIsolates<T, R>(List<T> inputs, R task(T input), {int limit = 2}) → Future<List<R>>
Runs jobs on isolates, never more than limit at a time.
onIsolates<T, R>(List<T> inputs, R task(T input)) → Future<List<R>>
Runs one isolate per job, the shortest runner a caller can write.
runSequentially<T, R>(List<T> inputs, R task(T input)) → Future<List<R>>
Runs every task on the current isolate, in order.

Typedefs

HeicCodec = HeifCodec
Conventional HEIC spelling of HeifCodec.
HeicDecodeOptions = HeifDecodeOptions
Conventional HEIC spelling of HeifDecodeOptions.
HeicDecoder = HeifDecoder
Conventional HEIC spelling of HeifDecoder.
HeicEncodeOptions = HeifEncodeOptions
Conventional HEIC spelling of HeifEncodeOptions.
HeicEncoder = HeifEncoder
Conventional HEIC spelling of HeifEncoder.
ParallelRunner = Future<List<R>> Function<T, R>(List<T> inputs, R task(T input))
Runs independent pieces of work, optionally on other isolates.

Exceptions / Errors

ImageCodecException
Reports invalid input or an unsupported codec operation.