decodeImageFromPixelsSync function
- Uint8List pixels,
- int width,
- int height,
- PixelFormat format,
Decodes the given pixels into an Image synchronously.
The pixels are expected to be in the format specified by format.
The width and height arguments specify the dimensions of the image.
This function returns an Image immediately. The image might not be fully decoded yet, but it can be drawn to a Canvas.
Implementation
Image decodeImageFromPixelsSync(Uint8List pixels, int width, int height, PixelFormat format) {
final image = Image._(_Image._(), width, height);
_decodeImageFromPixelsSync(pixels, width, height, format.index, image._image);
return image;
}