pub struct SampleParts { /* private fields */ }
Expand description

Describes which values are present in a texel.

This is some set of channels that describe the color point precisely, given a color space. Depending on the chosen color there may be multiple ways in which case this names which of the canonical encodings to use. For example, CIELAB may be represented as Lab (Lightness, red/green, blue/yellow) or LCh (Lightness, Chroma, Hue; the polar cooordinate form of the previous).

FIXME(color): describe YUV, ASTC and BC block formats? Other? We surely can handle planar data properly?

Implementations

A pure alpha part.

A pure red part.

Create from up to four color channels.

This is suitable for describing the channels of a single pixel, and relating it to the bit parts in the corresponding texel.

The order of parts will be remembered. All color channels must belong to a common color representation.

Extract a single channel.

The channel is extract as if part of the ColorChannelModel used in the construction of these sample parts.

Test if these parts contain the provided channel.

Get an array of up to four color channel present.

Create parts that describe 4:2:2 subsampled color channels.

These parts represent a 1x2 block, with 4 channels total.

Create parts that describe 4:1:1 subsampled color channels.

These parts represent a 1x4 block, with 6 channels total.

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.