Type Alias exr::block::lines::LineRefMut

source ·
pub type LineRefMut<'s> = LineSlice<&'s mut [u8]>;
Expand description

A reference to a single mutable line of pixels. May go across the whole image or just a tile section of it.

This line contains a mutable slice that all samples will be written to.

Aliased Type§

struct LineRefMut<'s> {
    pub location: LineIndex,
    pub value: &'s mut [u8],
}

Fields§

§location: LineIndex

Where this line is located inside the image.

§value: &'s mut [u8]

The raw bytes of the pixel line, either &[u8] or &mut [u8]. Must be re-interpreted as slice of f16, f32, or u32, according to the channel data type.

Implementations§

source§

impl<'s> LineRefMut<'s>

source

pub fn write_samples_from_slice<T: Data>(self, slice: &[T]) -> UnitResult

Writes the samples (f16, f32, u32 values) into this line value reference. Use write_samples if there is not slice available.

source

pub fn write_samples<T: Data>( self, get_sample: impl FnMut(usize) -> T ) -> UnitResult

Iterate over all samples in this line, from left to right. The supplied get_line function returns the sample value for a given sample index within the line, which starts at zero for each individual line. Use write_samples_from_slice if you already have a slice of samples.

Trait Implementations§

source§

impl<T: Clone> Clone for LineSlice<T>

source§

fn clone(&self) -> LineSlice<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for LineSlice<T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<T: PartialEq> PartialEq<LineSlice<T>> for LineSlice<T>

source§

fn eq(&self, other: &LineSlice<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Copy> Copy for LineSlice<T>

source§

impl<T: Eq> Eq for LineSlice<T>

source§

impl<T> StructuralEq for LineSlice<T>

source§

impl<T> StructuralPartialEq for LineSlice<T>