Skip to main content

max_decomposition_levels

Function max_decomposition_levels 

Source
pub const fn max_decomposition_levels(width: u32, height: u32) -> u8
Expand description

Return the maximum number of DWT decomposition levels supported by an image geometry.

The shared encoder policy is floor(log2(min(width, height))); a zero or unit-length axis supports no decomposition levels. Keeping this conservative geometry rule here ensures CPU and GPU paths apply the same ceiling.