Struct exr::block::lines::LineSlice

source ·
pub struct LineSlice<T> {
    pub location: LineIndex,
    pub value: T,
}
Expand description

A single line of pixels. Use LineRef or LineRefMut for easier type names.

Fields§

§location: LineIndex

Where this line is located inside the image.

§value: T

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> LineSlice<&'s mut [u8]>

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.

source§

impl LineSlice<&[u8]>

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<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>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for LineSlice<T>where T: RefUnwindSafe,

§

impl<T> Send for LineSlice<T>where T: Send,

§

impl<T> Sync for LineSlice<T>where T: Sync,

§

impl<T> Unpin for LineSlice<T>where T: Unpin,

§

impl<T> UnwindSafe for LineSlice<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.