#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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

The color model of the channel.

Returns None if it does not belong to any singular color model.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.