Enum Levels
pub enum Levels<Samples>
One or multiple resolution levels of the same image.
Samples can be FlatSamples.
Variants
-
Singular(Samples) A single image without smaller versions of itself. If you only want to handle exclusively this case, use
Samplesdirectly, and notLevels<Samples>.-
Mip { rounding_mode: RoundingMode, level_data: LevelMaps<Samples> } Contains uniformly scaled smaller versions of the original.
-
Rip { rounding_mode: RoundingMode, level_data: RipMaps<Samples> } Contains any possible combination of smaller versions of the original.
Implementations
impl<LevelSamples> Levels<LevelSamples>
fn get_level(&self, level: Vec2<usize>) -> Result<&LevelSamples>Get a resolution level by index, sorted by size, decreasing.
fn get_level_mut(&mut self, level: Vec2<usize>) -> Result<&mut LevelSamples>Get a resolution level by index, sorted by size, decreasing.
fn levels_as_slice(&self) -> &[LevelSamples]Get a slice of all resolution levels, sorted by size, decreasing.
fn levels_as_slice_mut(&mut self) -> &mut [LevelSamples]Get a mutable slice of all resolution levels, sorted by size, decreasing.
const fn level_mode(&self) -> LevelModeWhether this stores multiple resolution levels.
Trait Implementations
impl<'samples, LevelSamples> WritableSamples<'samples> for Levels<LevelSamples>
where
LevelSamples: WritableLevel<'samples>,
type Writer = LevelsWriter<<LevelSamples as WritableLevel<'samples>>::Writer>;fn sample_type(&self) -> SampleTypefn infer_level_modes(&self) -> (LevelMode, RoundingMode)fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer
impl<S> ValidateResult for Levels<S>
where
S: ValidateResult,
fn validate_result(&self, other: &Self, options: ValidationOptions, location: impl Fn() -> String) -> ValidationResult
impl<Samples: Clone> Clone for Levels<Samples>
fn clone(&self) -> Self
impl<Samples: Debug> Debug for Levels<Samples>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<Samples: Eq> Eq for Levels<Samples>
impl<Samples: PartialEq> PartialEq for Levels<Samples>
fn eq(&self, other: &Self) -> bool