Enum exr::block::samples::Sample [−][src]
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]
fn contains_nan_pixels(&self) -> bool
[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]
T: Into<Sample> + Default,
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]
fn from_f16(value: f16) -> Self
[src]
fn from_f32(value: f32) -> Self
[src]
fn from_u32(value: u32) -> Self
[src]
impl IntoNativeSample for Sample
[src]
impl PartialEq<Sample> for Sample
[src]
Auto Trait Implementations
impl RefUnwindSafe for Sample
[src]
impl Send for Sample
[src]
impl Sync for Sample
[src]
impl Unpin for Sample
[src]
impl UnwindSafe for Sample
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<R, P> ReadPrimitive<R> for P where
R: ReadEndian<P> + Read,
P: Default,
[src]
R: ReadEndian<P> + Read,
P: Default,
pub fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
[src]
pub fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
[src]
pub fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,