pub struct Ch32(_);
Expand description
32-bit color Channel.
The Channel
is represented by an f32
, but values are guaranteed to be
between 0 and 1, inclusive.
use pix::chan::{Ch16, Ch32, Ch8, Channel};
let c: Ch32 = 0.0.into();
assert_eq!(c, Ch32::MIN);
let c: Ch8 = c.into();
assert_eq!(c, Ch8::MIN);
let c: Ch32 = 1.0.into();
assert_eq!(c, Ch32::MAX);
let c: Ch16 = c.into();
assert_eq!(c, Ch16::MAX);
Implementations§
Trait Implementations§
source§impl Channel for Ch32
impl Channel for Ch32
source§fn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
Wrapping addition
source§fn wrapping_sub(self, rhs: Self) -> Self
fn wrapping_sub(self, rhs: Self) -> Self
Wrapping subtraction
source§fn encode_srgb(self) -> Self
fn encode_srgb(self) -> Self
Encode an sRGB gamma value from linear intensity
source§fn decode_srgb(self) -> Self
fn decode_srgb(self) -> Self
Decode an sRGB gamma value into linear intensity
source§impl Ord for Ch32
impl Ord for Ch32
source§impl PartialEq<Ch32> for Ch32
impl PartialEq<Ch32> for Ch32
source§impl PartialOrd<Ch32> for Ch32
impl PartialOrd<Ch32> for Ch32
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Ch32
impl Eq for Ch32
impl StructuralPartialEq for Ch32
Auto Trait Implementations§
impl RefUnwindSafe for Ch32
impl Send for Ch32
impl Sync for Ch32
impl Unpin for Ch32
impl UnwindSafe for Ch32
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