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
impl<Samples: PartialEq> StructuralPartialEq for Levels<Samples>
Auto Trait Implementations
impl<Samples> Freeze for Levels<Samples>
where
Samples: Freeze,
Vec<Samples>: Freeze,
RipMaps<Samples>: Freeze,
impl<Samples> RefUnwindSafe for Levels<Samples>
where
Samples: RefUnwindSafe,
Vec<Samples>: RefUnwindSafe,
RipMaps<Samples>: RefUnwindSafe,
impl<Samples> Send for Levels<Samples>
where
Samples: Send,
Vec<Samples>: Send,
RipMaps<Samples>: Send,
impl<Samples> Sync for Levels<Samples>
where
Samples: Sync,
Vec<Samples>: Sync,
RipMaps<Samples>: Sync,
impl<Samples> Unpin for Levels<Samples>
where
Samples: Unpin,
Vec<Samples>: Unpin,
RipMaps<Samples>: Unpin,
impl<Samples> UnsafeUnpin for Levels<Samples>
where
Samples: UnsafeUnpin,
Vec<Samples>: UnsafeUnpin,
RipMaps<Samples>: UnsafeUnpin,
impl<Samples> UnwindSafe for Levels<Samples>
where
Samples: UnwindSafe,
Vec<Samples>: UnwindSafe,
RipMaps<Samples>: UnwindSafe,
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Levels<Samples>
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Levels<Samples>
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for Levels<Samples>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Levels<Samples>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Levels<Samples>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Levels<Samples>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Levels<Samples>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for Levels<Samples>
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> Read<Exclusive, BecauseExclusive> for Levels<Samples>
where
T: ?Sized,
impl<T> ToOwned for Levels<Samples>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Levels<Samples>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Levels<Samples>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Levels<Samples>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>