Enum exr::block::samples::Sample[][src]

pub enum Sample {
    F16(f16),
    F32(f32),
    U32(u32),
}

A single red, green, blue, or alpha value.

Variants

F16(f16)

A 16-bit float sample.

F32(f32)

A 32-bit float sample.

U32(u32)

An unsigned integer sample.

Implementations

impl Sample[src]

pub fn f32(f32: f32) -> Self[src]

Create a sample containing a 32-bit float.

pub fn f16(f16: f16) -> Self[src]

Create a sample containing a 16-bit float.

pub fn u32(u32: u32) -> Self[src]

Create a sample containing a 32-bit integer.

pub fn to_f16(self) -> f16[src]

Convert the sample to an f16 value. This has lower precision than f32. Note: An f32 can only represent integers up to 1024 as precise as a u32 could.

pub fn to_f32(self) -> f32[src]

Convert the sample to an f32 value. Note: An f32 can only represent integers up to 8388608 as precise as a u32 could.

pub fn to_u32(self) -> u32[src]

Convert the sample to a u32. Rounds floats to integers the same way that 3.1 as u32 does.

pub fn is_nan(self) -> bool[src]

Is this value not a number?

pub fn is_zero(&self) -> bool[src]

Is this value zero or negative zero?

Trait Implementations

impl Clone for Sample[src]

impl ContainsNaN for Sample[src]

impl Copy for Sample[src]

impl Debug for Sample[src]

impl Default for Sample[src]

impl<T> From<Option<T>> for Sample where
    T: Into<Sample> + Default
[src]

impl From<Sample> for f16[src]

impl From<f16> for Sample[src]

impl From<f32> for Sample[src]

impl From<u32> for Sample[src]

impl FromNativeSample for Sample[src]

impl IntoNativeSample for Sample[src]

impl PartialEq<Sample> for Sample[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R, P> ReadPrimitive<R> for P where
    R: ReadEndian<P> + Read,
    P: Default
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.