[][src]Trait prisma::channel::traits::ColorChannel

pub trait ColorChannel {
    type Format: Clone + PartialEq + PartialOrd + Default + Add<Self::Format, Output = Self::Format> + Sub<Self::Format, Output = Self::Format>;
    type Scalar;
    type Tag;
    fn min_bound() -> Self::Format;
fn max_bound() -> Self::Format;
fn clamp(&self, min: Self::Format, max: Self::Format) -> Self;
fn value(&self) -> Self::Format;
fn scalar(&self) -> Self::Scalar;
fn from_scalar(value: Self::Scalar) -> Self;
fn new(value: Self::Format) -> Self; }

The base trait for all channels

Associated Types

type Format: Clone + PartialEq + PartialOrd + Default + Add<Self::Format, Output = Self::Format> + Sub<Self::Format, Output = Self::Format>

The contained type representing the channel. Format can be a wrapper around a scalar, such as an Angle<f32>, or a scalar itself.

type Scalar

The scalar type used by the channel. This will be the scalar inside of a wrapper type.

type Tag

A unique identifying tag type used in generic contexts

Loading content...

Required methods

fn min_bound() -> Self::Format

The minimum valid value

fn max_bound() -> Self::Format

The maximum valid value

fn clamp(&self, min: Self::Format, max: Self::Format) -> Self

Return a new channel clamped between min and max

fn value(&self) -> Self::Format

Return the inner value of the channel

fn scalar(&self) -> Self::Scalar

Return the scalar value of the channel

fn from_scalar(value: Self::Scalar) -> Self

Construct the channel from a scalar value

fn new(value: Self::Format) -> Self

Construct the channel from the inner value

Loading content...

Implementors

impl<T> ColorChannel for AngularChannel<T> where
    T: Angle + Default + Add<T, Output = T> + Sub<T, Output = T>, 
[src]

type Format = T

type Scalar = T::Scalar

type Tag = AngularChannelTag

impl<T> ColorChannel for NormalBoundedChannel<T> where
    T: NormalChannelScalar
[src]

type Format = T

type Scalar = T

type Tag = NormalChannelTag

impl<T> ColorChannel for PosNormalBoundedChannel<T> where
    T: PosNormalChannelScalar
[src]

type Format = T

type Scalar = T

type Tag = PosNormalChannelTag

impl<T> ColorChannel for FreeChannel<T> where
    T: FreeChannelScalar
[src]

type Format = T

type Scalar = T

type Tag = FreeChannelTag

impl<T> ColorChannel for PosFreeChannel<T> where
    T: FreeChannelScalar
[src]

type Format = T

type Scalar = T

type Tag = PosFreeChannelTag

Loading content...