Skip to main content

block_count

Function block_count 

Source
pub fn block_count(jpeg: &[u8]) -> Result<Vec<usize>, DctError>
Expand description

Return the number of 8×8 DCT blocks per component in a JPEG.

The returned Vec has one entry per component (in SOF order). Useful for determining how many blocks are available before calling read_coefficients.

§Errors

Returns DctError if the input is not a supported baseline JPEG.