pub struct ImageViewCreateInfo {
pub view_type: ImageViewType,
pub format: Option<Format>,
pub component_mapping: ComponentMapping,
pub aspects: ImageAspects,
pub array_layers: Range<u32>,
pub mip_levels: Range<u32>,
pub sampler_ycbcr_conversion: Option<Arc<SamplerYcbcrConversion>>,
pub _ne: NonExhaustive,
}
Expand description
Parameters to create a new ImageView
.
Fields
view_type: ImageViewType
The image view type.
The view type must be compatible with the dimensions of the image and the selected array layers.
The default value is ImageViewType::Dim2d
.
format: Option<Format>
The format of the image view.
If this is set to a format that is different from the image, the image must be created with
the mutable_format
flag.
The default value is None
, which must be overridden.
component_mapping: ComponentMapping
How to map components of each pixel.
The default value is ComponentMapping::identity()
.
aspects: ImageAspects
The aspects of the image that the view should cover.
The default value is ImageAspects::none()
, which must be overridden.
array_layers: Range<u32>
The range of array layers of the image that the view should cover.
The default value is 0..1
.
mip_levels: Range<u32>
The range of mipmap levels of the image that the view should cover.
The default value is 0..1
.
sampler_ycbcr_conversion: Option<Arc<SamplerYcbcrConversion>>
The sampler YCbCr conversion to be used with the image view.
If set to Some
, several restrictions apply:
- The
component_mapping
must be the identity swizzle for all components. - If the image view is to be used in a shader, it must be in a combined image sampler descriptor, a separate sampled image descriptor is not allowed.
- The corresponding sampler must have the same sampler YCbCr object or an identically created one, and must be used as an immutable sampler within a descriptor set layout.
The default value is None
.
_ne: NonExhaustive
Implementations
sourceimpl ImageViewCreateInfo
impl ImageViewCreateInfo
sourcepub fn from_image<I>(image: &I) -> Self where
I: ImageAccess + ?Sized,
pub fn from_image<I>(image: &I) -> Self where
I: ImageAccess + ?Sized,
Returns an ImageViewCreateInfo
with the view_type
determined from the image type and
array layers, aspects
determined from the image format, and array_layers
and
mip_levels
covering the whole image.
Trait Implementations
sourceimpl Debug for ImageViewCreateInfo
impl Debug for ImageViewCreateInfo
Auto Trait Implementations
impl RefUnwindSafe for ImageViewCreateInfo
impl Send for ImageViewCreateInfo
impl Sync for ImageViewCreateInfo
impl Unpin for ImageViewCreateInfo
impl UnwindSafe for ImageViewCreateInfo
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