Skip to main content

quantize_colors

Function quantize_colors 

Source
pub fn quantize_colors(
    colors: &[[f32; 4]],
) -> impl Iterator<Item = CompressedColor> + '_
Expand description

Quantize [f32; 4] colors to Unorm8x4, clamping out-of-range components.

Colors are normally already [u8; 4] and need no conversion; this is for callers whose colors come from a float source such as a [glam::Vec4]. Computed on demand, so nothing is allocated.