Skip to main content

image_size

Function image_size 

Source
pub fn image_size(pixel_format: u32, width: u32, height: u32) -> usize
Expand description

Bytes an image of this format occupies on the wire, by the fake’s own rule.

Bits 23–16 of a standard PFNC code are the pixel’s bit depth, so a packed format such as Mono12Packed (12 bits) sends ceil(w × h × 12 / 8) bytes — not w × h × bytes-per-pixel, which no whole number satisfies. Vendor codes (bit 31 set) keep the fake’s historical one byte per pixel; the EVS test streams were written around that.