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 Samples directly, and not Levels<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) -> LevelMode

Whether 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) -> SampleType
fn 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,

impl<T> Borrow<T> for Levels<Samples> where T: ?Sized,

impl<T> BorrowMut<T> for Levels<Samples> where T: ?Sized,

impl<T> CloneToUninit for Levels<Samples> where T: Clone,

impl<T> From<T> for Levels<Samples>

impl<T> Pointable for Levels<Samples>

impl<T> Read<Exclusive, BecauseExclusive> for Levels<Samples> where T: ?Sized,

impl<T> ToOwned for Levels<Samples> where T: Clone,

impl<T, U> Into<U> for Levels<Samples> where U: From<T>,

impl<T, U> TryFrom<U> for Levels<Samples> where U: Into<T>,

impl<T, U> TryInto<U> for Levels<Samples> where U: TryFrom<T>,