[][src]Struct pix::Ch16

pub struct Ch16(_);

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.

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);

Methods

impl Ch16[src]

pub fn new(value: u16) -> Self[src]

Create a new 16-bit Channel value.

Trait Implementations

impl<R> Add<R> for Ch16 where
    Self: From<R>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl Channel for Ch16[src]

const MIN: Ch16[src]

Minimum intensity (zero)

const MAX: Ch16[src]

Maximum intensity (one)

fn powf(self, g: f32) -> Self[src]

Raise to given power

impl Clone for Ch16[src]

impl Copy for Ch16[src]

impl Debug for Ch16[src]

impl Default for Ch16[src]

impl<R> Div<R> for Ch16 where
    Self: From<R>, 
[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f32> for Ch16[src]

type Output = Self

The resulting type after applying the / operator.

impl Eq for Ch16[src]

impl From<Ch16> for u16[src]

impl From<Ch16> for Ch8[src]

impl From<Ch16> for Ch32[src]

impl From<Ch32> for Ch16[src]

impl From<Ch8> for Ch16[src]

impl<C: Channel> From<Opaque<C>> for Ch16[src]

impl From<u16> for Ch16[src]

impl<R> Mul<R> for Ch16 where
    Self: From<R>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f32> for Ch16[src]

type Output = Self

The resulting type after applying the * operator.

impl Ord for Ch16[src]

impl PartialEq<Ch16> for Ch16[src]

impl PartialOrd<Ch16> for Ch16[src]

impl StructuralEq for Ch16[src]

impl StructuralPartialEq for Ch16[src]

impl<R> Sub<R> for Ch16 where
    Self: From<R>, 
[src]

type Output = Self

The resulting type after applying the - operator.

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

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<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.