logo
pub struct SamplerYcbcrConversionCreateInfo {
    pub format: Option<Format>,
    pub ycbcr_model: SamplerYcbcrModelConversion,
    pub ycbcr_range: SamplerYcbcrRange,
    pub component_mapping: ComponentMapping,
    pub chroma_offset: [ChromaLocation; 2],
    pub chroma_filter: Filter,
    pub force_explicit_reconstruction: bool,
    pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new SamplerYcbcrConversion.

Fields

format: Option<Format>

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.

ycbcr_model: SamplerYcbcrModelConversion

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.

ycbcr_range: SamplerYcbcrRange

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.

component_mapping: ComponentMapping

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

The default value is ComponentMapping::identity().

chroma_offset: [ChromaLocation; 2]

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.

chroma_filter: Filter

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.

force_explicit_reconstruction: bool

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.

_ne: NonExhaustive

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

Returns the “default value” for a type. Read more

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

🔬 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.