pub struct Plan {
pub mode: Mode,
pub width: u32,
pub height: u32,
pub input_bytes: u64,
pub output_bytes: u64,
pub scratch: u64,
}Expand description
What decoding a texture of a format and a size, from data of a given
length, will need and give, worked out before the data is read
(plan()).
Fields§
§mode: ModeThe image’s mode: the format’s, or RGBA for a side of 0.
width: u32The image’s width: the texture’s, or 0 for a side of 0.
height: u32The image’s height: the texture’s, or 0 for a side of 0.
input_bytes: u64The bytes of data mip 0 takes, at its padded size; 0 for a side of 0. For crunch, the minimum CRN header size (74), not its variable compressed length.
output_bytes: u64The image’s bytes: width x height x the mode’s bytes per pixel.
scratch: u64What the decode charges beside the output while it runs, and returns before it ends: an ASTC format’s tables, or a conservative bound for crunch blocks, palettes and Huffman tables; 0 for the rest.
Implementations§
Source§impl Plan
impl Plan
Sourcepub const fn charge(&self) -> u64
pub const fn charge(&self) -> u64
What decode() charges the meter for the output: heap_cost of
Self::output_bytes (0 for the empty image). The allocator may
round the allocation up past it, in which case MeteredVec
charges the difference too.
Sourcepub const fn peak_charge(&self) -> u64
pub const fn peak_charge(&self) -> u64
The most decode() has charged at once: Self::charge and
Self::scratch.