pub struct ImageView { /* private fields */ }
Expand description
A wrapper around an image that makes it available to shaders or framebuffers.
See also the parent module-level documentation for more information about images.
Implementations§
source§impl ImageView
impl ImageView
sourcepub fn new(
image: Arc<Image>,
create_info: ImageViewCreateInfo
) -> Result<Arc<ImageView>, Validated<VulkanError>>
pub fn new( image: Arc<Image>, create_info: ImageViewCreateInfo ) -> Result<Arc<ImageView>, Validated<VulkanError>>
Creates a new ImageView
.
sourcepub fn new_default(
image: Arc<Image>
) -> Result<Arc<ImageView>, Validated<VulkanError>>
pub fn new_default( image: Arc<Image> ) -> Result<Arc<ImageView>, Validated<VulkanError>>
Creates a default ImageView
. Equivalent to
ImageView::new(image, ImageViewCreateInfo::from_image(image))
.
sourcepub unsafe fn from_handle(
image: Arc<Image>,
handle: ImageView,
create_info: ImageViewCreateInfo
) -> Result<Arc<Self>, VulkanError>
pub unsafe fn from_handle( image: Arc<Image>, handle: ImageView, create_info: ImageViewCreateInfo ) -> Result<Arc<Self>, VulkanError>
Creates a new ImageView
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromimage
.create_info
must match the info used to create the object.
sourcepub fn image(&self) -> &Arc<Image>
pub fn image(&self) -> &Arc<Image>
Returns the wrapped image that this image view was created from.
sourcepub fn view_type(&self) -> ImageViewType
pub fn view_type(&self) -> ImageViewType
Returns the ImageViewType
of this image view.
sourcepub fn format(&self) -> Format
pub fn format(&self) -> Format
Returns the format of this view. This can be different from the parent’s format.
sourcepub fn component_mapping(&self) -> ComponentMapping
pub fn component_mapping(&self) -> ComponentMapping
Returns the component mapping of this view.
sourcepub fn subresource_range(&self) -> &ImageSubresourceRange
pub fn subresource_range(&self) -> &ImageSubresourceRange
Returns the subresource range of the wrapped image that this view exposes.
sourcepub fn usage(&self) -> ImageUsage
pub fn usage(&self) -> ImageUsage
Returns the usage of the image view.
sourcepub fn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
pub fn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
Returns the sampler YCbCr conversion that this image view was created with, if any.
sourcepub fn format_features(&self) -> FormatFeatures
pub fn format_features(&self) -> FormatFeatures
Returns the features supported by the image view’s format.
sourcepub fn filter_cubic(&self) -> bool
pub fn filter_cubic(&self) -> bool
Returns whether the image view supports sampling with a
Cubic
mag_filter
or min_filter
.