BASE_frameSize static method
Returns the byte size of a single frame.
Returns 0 if either width or height is 0.
Throws a StateError if format is PixelFormat.PIXELFORMAT_NONE.
Implementation
static int BASE_frameSize(int width, int height, PixelFormat format) {
if (width == 0 || height == 0) return 0;
if (format == .PIXELFORMAT_NONE) throw StateError('Image format must be set before accessing data layout');
return width * height * BASE_bytesPerPixel(format);
}