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 orZero
orOne
.r
andb
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
sourceimpl Clone for SamplerYcbcrConversionCreateInfo
impl Clone for SamplerYcbcrConversionCreateInfo
sourcefn clone(&self) -> SamplerYcbcrConversionCreateInfo
fn clone(&self) -> SamplerYcbcrConversionCreateInfo
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
Auto Trait Implementations
impl RefUnwindSafe for SamplerYcbcrConversionCreateInfo
impl Send for SamplerYcbcrConversionCreateInfo
impl Sync for SamplerYcbcrConversionCreateInfo
impl Unpin for SamplerYcbcrConversionCreateInfo
impl UnwindSafe for SamplerYcbcrConversionCreateInfo
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more