emptyBuffer method Null safety
Implementation
static RawImageF emptyBuffer(int width, int height, {Format format = Format.FORMAT_RGB}) {
if (!_formatMap.containsKey(format)) throw Exception("Unsuport image format");
int size = width * height * (format == Format.FORMAT_GRAY ? 1 : 3);
Pointer<Uint8> dataPtr = malloc.allocate(size);
if (dataPtr.address == nullptr.address) throw Exception("RawImageF.emptyBuffer: Failed to allocate a $size bytes");
return RawImageF(width, height, format, dataPtr.cast());
}