[−][src]Trait prisma::channel::traits::ColorChannel
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
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
Implementors
impl<T> ColorChannel for AngularChannel<T> where
T: Angle + Default + Add<T, Output = T> + Sub<T, Output = T>,
[src]
T: Angle + Default + Add<T, Output = T> + Sub<T, Output = T>,
type Format = T
type Scalar = T::Scalar
type Tag = AngularChannelTag
fn min_bound() -> T
[src]
fn max_bound() -> T
[src]
fn clamp(&self, min: Self::Format, max: Self::Format) -> Self
[src]
fn value(&self) -> T
[src]
fn scalar(&self) -> T::Scalar
[src]
fn from_scalar(value: T::Scalar) -> Self
[src]
fn new(value: T) -> Self
[src]
impl<T> ColorChannel for NormalBoundedChannel<T> where
T: NormalChannelScalar,
[src]
T: NormalChannelScalar,
type Format = T
type Scalar = T
type Tag = NormalChannelTag
fn min_bound() -> T
[src]
fn max_bound() -> T
[src]
fn value(&self) -> T
[src]
fn clamp(&self, min: T, max: T) -> Self
[src]
fn scalar(&self) -> T
[src]
fn from_scalar(value: T) -> Self
[src]
fn new(value: T) -> Self
[src]
impl<T> ColorChannel for PosNormalBoundedChannel<T> where
T: PosNormalChannelScalar,
[src]
T: PosNormalChannelScalar,
type Format = T
type Scalar = T
type Tag = PosNormalChannelTag
fn min_bound() -> T
[src]
fn max_bound() -> T
[src]
fn value(&self) -> T
[src]
fn clamp(&self, min: T, max: T) -> Self
[src]
fn scalar(&self) -> T
[src]
fn from_scalar(value: T) -> Self
[src]
fn new(value: T) -> Self
[src]
impl<T> ColorChannel for FreeChannel<T> where
T: FreeChannelScalar,
[src]
T: FreeChannelScalar,
type Format = T
type Scalar = T
type Tag = FreeChannelTag
fn min_bound() -> T
[src]
fn max_bound() -> T
[src]
fn value(&self) -> T
[src]
fn clamp(&self, min: T, max: T) -> Self
[src]
fn scalar(&self) -> T
[src]
fn from_scalar(value: T) -> Self
[src]
fn new(value: T) -> Self
[src]
impl<T> ColorChannel for PosFreeChannel<T> where
T: FreeChannelScalar,
[src]
T: FreeChannelScalar,