Enum exr::image::Levels[][src]

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.

Show fields

Fields of Mip

rounding_mode: RoundingMode

Whether to round up or down when calculating Mip/Rip levels.

level_data: LevelMaps<Samples>

The smaller versions of the original.

Rip

Contains any possible combination of smaller versions of the original.

Show fields

Fields of Rip

rounding_mode: RoundingMode

Whether to round up or down when calculating Mip/Rip levels.

level_data: RipMaps<Samples>

The smaller versions of the original.

Implementations

impl<LevelSamples> Levels<LevelSamples>[src]

pub fn get_level(&self, level: Vec2<usize>) -> Result<&LevelSamples>[src]

Get a resolution level by index, sorted by size, decreasing.

pub fn get_level_mut(&mut self, level: Vec2<usize>) -> Result<&mut LevelSamples>[src]

Get a resolution level by index, sorted by size, decreasing.

pub fn levels_as_slice(&self) -> &[LevelSamples]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Get a slice of all resolution levels, sorted by size, decreasing.

pub fn levels_as_slice_mut(&mut self) -> &mut [LevelSamples]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Get a mutable slice of all resolution levels, sorted by size, decreasing.

pub fn level_mode(&self) -> LevelMode[src]

Whether this stores multiple resolution levels.

Trait Implementations

impl<Samples: Clone> Clone for Levels<Samples>[src]

fn clone(&self) -> Levels<Samples>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<Samples: Debug> Debug for Levels<Samples>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<Samples: PartialEq> PartialEq<Levels<Samples>> for Levels<Samples>[src]

fn eq(&self, other: &Levels<Samples>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Levels<Samples>) -> bool[src]

This method tests for !=.

impl<S> ValidateResult for Levels<S> where
    S: ValidateResult
[src]

fn validate_result(
    &self,
    other: &Self,
    options: ValidationOptions,
    location: String
) -> ValidationResult
[src]

Compare self with the other. Exceptional behaviour: Read more

fn assert_equals_result(&self, result: &Self)[src]

Compare self with the other. Panics if not equal. Read more

impl<'samples, LevelSamples> WritableSamples<'samples> for Levels<LevelSamples> where
    LevelSamples: WritableLevel<'samples>, 
[src]

fn sample_type(&self) -> SampleType[src]

Generate the file meta data regarding the number type of this storage

fn infer_level_modes(&self) -> (LevelMode, RoundingMode)[src]

Generate the file meta data regarding resolution levels

type Writer = LevelsWriter<LevelSamples::Writer>

The type of the temporary writer for this sample storage

fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer[src]

Create a temporary writer for this sample storage

impl<Samples: Eq> Eq for Levels<Samples>[src]

impl<Samples> StructuralEq for Levels<Samples>[src]

impl<Samples> StructuralPartialEq for Levels<Samples>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.