ImageDescriptor.raw constructor
- ImmutableBuffer buffer, {
- required int width,
- required int height,
- int? rowBytes,
- required PixelFormat pixelFormat,
Creates an image descriptor from raw image pixels.
The pixels
parameter is the pixel data. They are packed in bytes in the
order described by pixelFormat
, then grouped in rows, from left to right,
then top to bottom.
The rowBytes
parameter is the number of bytes consumed by each row of
pixels in the data buffer. If unspecified, it defaults to width
multiplied
by the number of bytes per pixel in the provided format
.
Implementation
// Not async because there's no expensive work to do here.
factory ImageDescriptor.raw(
ImmutableBuffer buffer, {
required int width,
required int height,
int? rowBytes,
required PixelFormat pixelFormat,
}) = _NativeImageDescriptor.raw;