PackedBitmapEncoder class final

Encodes a bitmap to a compact (packed) binary format.

For a given buffer, PixelFormat.zero is encoded as 0, and any other value is encoded as 1. 32 values are packed into a single byte, with the least significant bit representing the first value. The first two 32-bit words of the output are the width and height of the bitmap, respectively.

For example, a 128x128 bitmap, which normally would require 2048 bytes, can be encoded into 256 bytes (128 * 128 / 32), or a 8x reduction in size, at the cost of some overhead to pack and unpack the data.

A singleton instance of this class is available as packedBitmapEncoder.

Inheritance

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

bind(Stream<Buffer<int>> stream) Stream<Uint32List>
Transforms the provided stream.
inherited
cast<RS, RT>() Converter<RS, RT>
Provides a Converter<RS, RT> view of this stream transformer.
inherited
convert(Buffer<int> input) Uint32List
Converts input and returns the result of the conversion.
override
fuse<TT>(Converter<Uint32List, TT> other) Converter<Buffer<int>, TT>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startChunkedConversion(Sink<Uint32List> sink) Sink<Buffer<int>>
Starts a chunked conversion.
inherited
toString() String
A string representation of this object.
inherited

Operators

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