Skip to main content

level_count

Function level_count 

Source
pub fn level_count(width: f64, height: f64, size: usize) -> u32
Expand description

Levels above level 0: how many times size doubles before it reaches the larger bound dimension, i.e. ceil(log2(max(width, height) / size)) clamped to 0, counted by doubling so it never depends on a floating-point logarithm.