Skip to main content

build_icc_cache_for_list

Function build_icc_cache_for_list 

Source
pub fn build_icc_cache_for_list(
    list: &DisplayList,
    system_cmyk_bytes: Option<&Arc<Vec<u8>>>,
) -> IccCache
Expand description

Pre-downsample an image when the transform indicates significant downscaling.

tiny-skia’s bilinear filter only samples a 2×2 neighborhood — it has no mipmap support, so large downscale ratios cause severe aliasing (e.g., 300 DPI bitmap fonts rendered at screen resolution).

For axis-aligned transforms: box-filter resample to the exact target dimensions.

Build an IccCache from ICC profiles found in a display list.

Registers all unique ICCBased profiles and optionally the system CMYK profile.