Enum image_canvas::color::ColorChannel
source · [−]#[non_exhaustive]
pub enum ColorChannel {
Show 18 variants
R,
G,
B,
Luma,
Alpha,
Cb,
Cr,
L,
LABa,
LABb,
C,
LABh,
X,
Y,
Z,
Scalar0,
Scalar1,
Scalar2,
}
Expand description
Describes a single channel from an image.
This can be thought of as an index into a vector of channels relating to a color. Combine with
a concrete ColorChannelModel
for the canonical index in a 4-sample color representation.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
R
The weight of the red primary.
G
The weight of the green primary.
B
The weight of the blue primary.
Luma
A luminescence.
Note that YCbCr
will be composed of Luma and Cb, Cr. This avoids the gnarly overlap
between it and Y
as the standard observer (even though this Y is often used to define the
Luma relative to standard illuminant).
Alpha
An alpha/translucence component.
Cb
Blue-channel difference.
Cr
Red-channel difference.
L
Lightness. Not to be confused with luminescence as this is perceptual.
LABa
The component a (green/red) of a LAB color.
LABb
The component b (green/red) of a LAB color.
C
Chroma of a LAB color, polar distance, hypot(a, b)
.
LABh
Hue of a LAB based color, polar angle, `atan2(b, a).
X
The first CIE standard observer.
Y
The second CIE standard observer.
Z
The second CIE standard observer.
Scalar0
Scalar1
Scalar2
Implementations
sourceimpl ColorChannel
impl ColorChannel
sourcepub fn in_model(self, model: ColorChannelModel) -> bool
pub fn in_model(self, model: ColorChannelModel) -> bool
The color model of the channel.
Returns None
if it does not belong to any singular color model.
Trait Implementations
sourceimpl Clone for ColorChannel
impl Clone for ColorChannel
sourcefn clone(&self) -> ColorChannel
fn clone(&self) -> ColorChannel
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ColorChannel
impl Debug for ColorChannel
sourceimpl PartialEq<ColorChannel> for ColorChannel
impl PartialEq<ColorChannel> for ColorChannel
impl Copy for ColorChannel
impl Eq for ColorChannel
impl StructuralEq for ColorChannel
impl StructuralPartialEq for ColorChannel
Auto Trait Implementations
impl RefUnwindSafe for ColorChannel
impl Send for ColorChannel
impl Sync for ColorChannel
impl Unpin for ColorChannel
impl UnwindSafe for ColorChannel
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