logo
pub struct SamplerYcbcrConversionBuilder { /* private fields */ }
Expand description

Used to construct a new SamplerYcbcrConversion.

Implementations

Builds the SamplerYcbcrConversion.

The sampler_ycbcr_conversion feature must be enabled on the device.

The image view format that this conversion will read data from. The conversion cannot be used with image views of any other format.

The format must support YCbCr conversions, meaning that its FormatFeatures must support at least one of cosited_chroma_samples or midpoint_chroma_samples.

If this is set to a format that has chroma subsampling (contains 422 or 420 in the name) then component_mapping is restricted as follows:

  • g must be identity swizzled.
  • a must be identity swizzled or Zero or One.
  • r and b must be identity swizzled or mapped to each other.

Compatibility notice: currently, this value must be Some, but future additions may allow None as a valid value as well.

The default value is None.

The conversion between the input color model and the output RGB color model.

If this is not set to RgbIdentity, then the r, g and b components of component_mapping must not be Zero or One, and the component being read must exist in format (must be represented as a nonzero number of bits).

The default value is RgbIdentity.

If ycbcr_model is not RgbIdentity, specifies the range expansion of the input values that should be used.

If this is set to ItuNarrow, then the r, g and b components of component_mapping must each map to a component of format that is represented with at least 8 bits.

The default value is ItuFull.

The mapping to apply to the components of the input format, before color model conversion and range expansion.

The default value is ComponentMapping::identity().

For formats with chroma subsampling and a Linear filter, specifies the sampled location for the subsampled components, in the x and y direction.

The value is ignored if the filter is Nearest or the corresponding axis is not chroma subsampled. If the value is not ignored, the format must support the chosen mode.

The default value is CositedEven for both axes.

For formats with chroma subsampling, specifies the filter used for reconstructing the chroma components to full resolution.

The Cubic filter is not supported. If Linear is used, the format must support it.

The default value is Nearest.

Forces explicit reconstruction if the implementation does not use it by default. The format must support it. See the spec for more information.

The default value is false.

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

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

Returns the size of an individual element.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.