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.
Trait Implementations§
source§impl<S> ValidateResult for Levels<S>where
S: ValidateResult,
impl<S> ValidateResult for Levels<S>where
S: ValidateResult,
source§fn validate_result(
&self,
other: &Self,
options: ValidationOptions,
location: impl Fn() -> String,
) -> ValidationResult
fn validate_result( &self, other: &Self, options: ValidationOptions, location: impl Fn() -> String, ) -> ValidationResult
source§fn assert_equals_result(&self, result: &Self)
fn assert_equals_result(&self, result: &Self)
source§impl<'samples, LevelSamples> WritableSamples<'samples> for Levels<LevelSamples>where
LevelSamples: WritableLevel<'samples>,
impl<'samples, LevelSamples> WritableSamples<'samples> for Levels<LevelSamples>where
LevelSamples: WritableLevel<'samples>,
source§fn sample_type(&self) -> SampleType
fn sample_type(&self) -> SampleType
source§fn infer_level_modes(&self) -> (LevelMode, RoundingMode)
fn infer_level_modes(&self) -> (LevelMode, RoundingMode)
source§type Writer = LevelsWriter<<LevelSamples as WritableLevel<'samples>>::Writer>
type Writer = LevelsWriter<<LevelSamples as WritableLevel<'samples>>::Writer>
source§fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer
fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer
impl<Samples: Eq> Eq for Levels<Samples>
impl<Samples> StructuralPartialEq for Levels<Samples>
Auto Trait Implementations§
impl<Samples> Freeze for Levels<Samples>where
Samples: Freeze,
impl<Samples> RefUnwindSafe for Levels<Samples>where
Samples: RefUnwindSafe,
impl<Samples> Send for Levels<Samples>where
Samples: Send,
impl<Samples> Sync for Levels<Samples>where
Samples: Sync,
impl<Samples> Unpin for Levels<Samples>where
Samples: Unpin,
impl<Samples> UnwindSafe for Levels<Samples>where
Samples: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)