pub struct Ch16(_);
Expand description
16-bit color Channel.
The Channel
is represented by a u16
, but multiplication and division
treat values as though they range between 0 and 1.
use pix::chan::{Ch16, Ch32, Ch8, Channel};
let c: Ch16 = std::u16::MIN.into();
assert_eq!(c, Ch16::MIN);
let c: Ch8 = c.into();
assert_eq!(c, Ch8::MIN);
let c: Ch16 = std::u16::MAX.into();
assert_eq!(c, Ch16::MAX);
let c: Ch32 = c.into();
assert_eq!(c, Ch32::MAX);
Implementations
Trait Implementations
sourceimpl Channel for Ch16
impl Channel for Ch16
sourcefn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
Wrapping addition
sourcefn wrapping_sub(self, rhs: Self) -> Self
fn wrapping_sub(self, rhs: Self) -> Self
Wrapping subtraction
sourcefn encode_srgb(self) -> Self
fn encode_srgb(self) -> Self
Encode an sRGB gamma value from linear intensity
sourcefn decode_srgb(self) -> Self
fn decode_srgb(self) -> Self
Decode an sRGB gamma value into linear intensity
sourceimpl Ord for Ch16
impl Ord for Ch16
sourceimpl PartialOrd<Ch16> for Ch16
impl PartialOrd<Ch16> for Ch16
sourcefn partial_cmp(&self, other: &Ch16) -> Option<Ordering>
fn partial_cmp(&self, other: &Ch16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for Ch16
impl Eq for Ch16
impl StructuralEq for Ch16
impl StructuralPartialEq for Ch16
Auto Trait Implementations
impl RefUnwindSafe for Ch16
impl Send for Ch16
impl Sync for Ch16
impl Unpin for Ch16
impl UnwindSafe for Ch16
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more