fromBytes static method
Implementation
static PixImage fromBytes(Uint8List imageBytes) {
ffi.Pointer<ffi.Uint8> imageBytesPtr =
calloc.allocate<ffi.Uint8>(imageBytes.length);
try {
imageBytesPtr.asTypedList(imageBytes.length).setAll(0, imageBytes);
return PixImage._(
imageBytes: imageBytesPtr,
length: imageBytes.length,
);
} finally {
calloc.free(imageBytesPtr);
}
}