Enum exr::image::FlatSamples
source · 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§
source§impl FlatSamples
impl FlatSamples
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of samples in the image. Should be the width times the height. Might vary when subsampling is used.
sourcepub fn values_as_f32<'s>(&'s self) -> impl 's + Iterator<Item = f32>
pub fn values_as_f32<'s>(&'s self) -> impl 's + Iterator<Item = f32>
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.
sourcepub fn values<'s>(&'s self) -> impl 's + Iterator<Item = Sample>
pub fn values<'s>(&'s self) -> impl 's + Iterator<Item = Sample>
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.
sourcepub fn value_by_flat_index(&self, index: usize) -> Sample
pub fn value_by_flat_index(&self, index: usize) -> Sample
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§
source§impl Clone for FlatSamples
impl Clone for FlatSamples
source§fn clone(&self) -> FlatSamples
fn clone(&self) -> FlatSamples
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FlatSamples
impl Debug for FlatSamples
source§impl PartialEq for FlatSamples
impl PartialEq for FlatSamples
source§impl ValidateResult for FlatSamples
impl ValidateResult for FlatSamples
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> WritableLevel<'samples> for FlatSamples
impl<'samples> WritableLevel<'samples> for FlatSamples
source§fn sample_type(&self) -> SampleType
fn sample_type(&self) -> SampleType
source§type Writer = FlatSamplesWriter<'samples>
type Writer = FlatSamplesWriter<'samples>
source§impl<'samples> WritableSamples<'samples> for FlatSamples
impl<'samples> WritableSamples<'samples> for FlatSamples
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 = FlatSamplesWriter<'samples>
type Writer = FlatSamplesWriter<'samples>
source§fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer
fn create_samples_writer(&'samples self, header: &Header) -> Self::Writer
impl StructuralPartialEq for FlatSamples
Auto Trait Implementations§
impl Freeze for FlatSamples
impl RefUnwindSafe for FlatSamples
impl Send for FlatSamples
impl Sync for FlatSamples
impl Unpin for FlatSamples
impl UnwindSafe for FlatSamples
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
)