RawFrame constructor
RawFrame({})
Creates a frame at frameIndex with widthxheight pixels in rgba.
Throws an ArgumentError when rgba.length != width * height * 4.
Implementation
RawFrame({
required this.frameIndex,
required this.width,
required this.height,
required this.rgba,
}) {
final expected = width * height * 4;
if (rgba.length != expected) {
throw ArgumentError.value(
rgba.length,
'rgba',
'must hold exactly width*height*4 = $expected bytes for ${width}x$height',
);
}
}