Enum exr::image::FlatSamples[][src]

pub enum FlatSamples {
    F16(Vec<f16>),
    F32(Vec<f32>),
    U32(Vec<u32>),
}
Expand description

A vector of non-deep values (one value per pixel per channel). Stores row after row in a single vector. The precision of all values is either f16, f32 or u32.

Since this is close to the pixel layout in the byte file, this will most likely be the fastest storage. Using a different storage, for example SpecificChannels, will probably be slower.

Variants

F16(Vec<f16>)

A vector of non-deep f16 values.

F32(Vec<f32>)

A vector of non-deep f32 values.

U32(Vec<u32>)

A vector of non-deep u32 values.

Implementations

impl FlatSamples[src]

pub fn len(&self) -> usize[src]

The number of samples in the image. Should be the width times the height. Might vary when subsampling is used.

pub fn values_as_f32<'s>(&'s self) -> impl 's + Iterator<Item = f32>[src]

Views all samples in this storage as f32. Matches the underlying sample type again for every sample, match yourself if performance is critical! Does not allocate.

pub fn values<'s>(&'s self) -> impl 's + Iterator<Item = Sample>[src]

All samples in this storage as iterator. Matches the underlying sample type again for every sample, match yourself if performance is critical! Does not allocate.

pub fn value_by_flat_index(&self, index: usize) -> Sample[src]

Lookup a single value, by flat index. The flat index can be obtained using Vec2::flatten_for_width which computes the index in a flattened array of pixel rows.

Trait Implementations

impl Clone for FlatSamples[src]

fn clone(&self) -> FlatSamples[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 Debug for FlatSamples[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<FlatSamples> for FlatSamples[src]

fn eq(&self, other: &FlatSamples) -> bool[src]

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

fn ne(&self, other: &FlatSamples) -> bool[src]

This method tests for !=.

impl ValidateResult for FlatSamples[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> WritableLevel<'samples> for FlatSamples[src]

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

Generate the file meta data regarding the number type of these samples

type Writer = FlatSamplesWriter<'samples>

The type of the temporary writer for this single level of samples

fn create_level_writer(&'samples self, size: Vec2<usize>) -> Self::Writer[src]

Create a temporary writer for this single level of samples

impl<'samples> WritableSamples<'samples> for FlatSamples[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 = FlatSamplesWriter<'samples>

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 StructuralPartialEq for FlatSamples[src]

Auto Trait Implementations

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.