pub enum BitDepth {
IntegerSample {
bits_per_sample: u32,
},
FloatSample {
bits_per_sample: u32,
exp_bits: u32,
},
}
Expand description
Bit depth information.
Variants§
IntegerSample
Modular image samples represent integer values, where the range
0..=(1 << bits_per_sample) - 1
corresponds to [0.0, 1.0], scaled linearly.
The value outside of the [0.0, 1.0] range is not clamped.
FloatSample
Modular image samples represent bitcast of floating point values with a sign bit,
exp_bits
exponential bits, and the remaining mantissa bits.
Implementations§
Source§impl BitDepth
impl BitDepth
pub fn bits_per_sample(self) -> u32
Sourcepub fn parse_integer_sample(self, sample: i32) -> f32
pub fn parse_integer_sample(self, sample: i32) -> f32
Parses the given Modular image sample to an f32
.
Trait Implementations§
impl Copy for BitDepth
Auto Trait Implementations§
impl Freeze for BitDepth
impl RefUnwindSafe for BitDepth
impl Send for BitDepth
impl Sync for BitDepth
impl Unpin for BitDepth
impl UnwindSafe for BitDepth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Creates a default value with the given context.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)