pub enum Levels<Samples> {
Singular(Samples),
Mip {
rounding_mode: RoundingMode,
level_data: LevelMaps<Samples>,
},
Rip {
rounding_mode: RoundingMode,
level_data: RipMaps<Samples>,
},
}
Expand description
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 Samples
directly, and not Levels<Samples>
.
Mip
Contains uniformly scaled smaller versions of the original.
Fields
rounding_mode: RoundingMode
Whether to round up or down when calculating Mip/Rip levels.
Rip
Contains any possible combination of smaller versions of the original.
Fields
rounding_mode: RoundingMode
Whether to round up or down when calculating Mip/Rip levels.
Implementations§
source§impl<LevelSamples> Levels<LevelSamples>
impl<LevelSamples> Levels<LevelSamples>
sourcepub fn get_level(&self, level: Vec2<usize>) -> Result<&LevelSamples>
pub fn get_level(&self, level: Vec2<usize>) -> Result<&LevelSamples>
Get a resolution level by index, sorted by size, decreasing.
sourcepub fn get_level_mut(&mut self, level: Vec2<usize>) -> Result<&mut LevelSamples>
pub fn get_level_mut(&mut self, level: Vec2<usize>) -> Result<&mut LevelSamples>
Get a resolution level by index, sorted by size, decreasing.
sourcepub fn levels_as_slice(&self) -> &[LevelSamples]
pub fn levels_as_slice(&self) -> &[LevelSamples]
Get a slice of all resolution levels, sorted by size, decreasing.
sourcepub fn levels_as_slice_mut(&mut self) -> &mut [LevelSamples]
pub fn levels_as_slice_mut(&mut self) -> &mut [LevelSamples]
Get a mutable slice of all resolution levels, sorted by size, decreasing.
sourcepub fn level_mode(&self) -> LevelMode
pub fn level_mode(&self) -> LevelMode
Whether this stores multiple resolution levels.