Skip to main content

pack_image_params

Function pack_image_params 

Source
pub fn pack_image_params(
    quality: u32,
    extend_x: u32,
    extend_y: u32,
    atlas_index: u32,
    is_external: bool,
) -> u32
Expand description

Packs sampling quality (bits 0-1), the two extend modes (bits 2-3 and 4-5), the atlas layer (bits 6-13) and the source kind (bit 14) into one word.

Each field is masked to its width rather than reported: every input is produced by this crate’s own encoding, and the preconditions are checked in debug builds.