exr::block::lines

Type Alias LineRef

Source
pub type LineRef<'s> = LineSlice<&'s [u8]>;
Expand description

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

This line contains an immutable slice that all samples will be read from.

Aliased Type§

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

Fields§

§location: LineIndex

Where this line is located inside the image.

§value: &'s [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 LineRef<'_>

Source

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

Read the samples (f16, f32, u32 values) from this line value reference. Use read_samples if there is not slice available.

Source

pub fn read_samples<T: Data>(&self) -> impl Iterator<Item = Result<T>> + '_

Iterate over all samples in this line, from left to right. Use read_sample_into_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 for LineSlice<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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> StructuralPartialEq for LineSlice<T>