pub struct ImageView<I>where
I: ImageAccess + ?Sized,{ /* private fields */ }
Expand description
A wrapper around an image that makes it available to shaders or framebuffers.
Implementations
sourceimpl<I> ImageView<I>where
I: ImageAccess + ?Sized,
impl<I> ImageView<I>where
I: ImageAccess + ?Sized,
sourcepub fn new(
image: Arc<I>,
create_info: ImageViewCreateInfo
) -> Result<Arc<ImageView<I>>, ImageViewCreationError>
pub fn new(
image: Arc<I>,
create_info: ImageViewCreateInfo
) -> Result<Arc<ImageView<I>>, ImageViewCreationError>
Creates a new ImageView
.
Panics
- Panics if
create_info.array_layers
is empty. - Panics if
create_info.mip_levels
is empty. - Panics if
create_info.aspects
contains any aspects other thancolor
,depth
,stencil
,plane0
,plane1
orplane2
. - Panics if
create_info.aspects
contains more more than one aspect, unlessdepth
andstencil
are the only aspects selected.
sourcepub fn new_default(
image: Arc<I>
) -> Result<Arc<ImageView<I>>, ImageViewCreationError>
pub fn new_default(
image: Arc<I>
) -> Result<Arc<ImageView<I>>, ImageViewCreationError>
Creates a default ImageView
. Equivalent to
ImageView::new(image, ImageViewCreateInfo::from_image(image))
.
sourcepub unsafe fn from_handle(
image: Arc<I>,
handle: ImageView,
create_info: ImageViewCreateInfo
) -> Result<Arc<Self>, VulkanError>
pub unsafe fn from_handle(
image: Arc<I>,
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.
Trait Implementations
sourceimpl<I> DeviceOwned for ImageView<I>where
I: ImageAccess + ?Sized,
impl<I> DeviceOwned for ImageView<I>where
I: ImageAccess + ?Sized,
sourceimpl<I> Drop for ImageView<I>where
I: ImageAccess + ?Sized,
impl<I> Drop for ImageView<I>where
I: ImageAccess + ?Sized,
sourceimpl<I: ImageAccess + ?Sized> Hash for ImageView<I>
impl<I: ImageAccess + ?Sized> Hash for ImageView<I>
sourceimpl<I> ImageViewAbstract for ImageView<I>where
I: ImageAccess + Debug + 'static,
impl<I> ImageViewAbstract for ImageView<I>where
I: ImageAccess + Debug + 'static,
sourcefn image(&self) -> Arc<dyn ImageAccess>
fn image(&self) -> Arc<dyn ImageAccess>
Returns the wrapped image that this image view was created from.
sourcefn component_mapping(&self) -> ComponentMapping
fn component_mapping(&self) -> ComponentMapping
Returns the component mapping of this view.
sourcefn filter_cubic(&self) -> bool
fn filter_cubic(&self) -> bool
sourcefn filter_cubic_minmax(&self) -> bool
fn filter_cubic_minmax(&self) -> bool
sourcefn format(&self) -> Option<Format>
fn format(&self) -> Option<Format>
Returns the format of this view. This can be different from the parent’s format.
sourcefn format_features(&self) -> &FormatFeatures
fn format_features(&self) -> &FormatFeatures
Returns the features supported by the image view’s format.
sourcefn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
fn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
Returns the sampler YCbCr conversion that this image view was created with, if any.
sourcefn subresource_range(&self) -> &ImageSubresourceRange
fn subresource_range(&self) -> &ImageSubresourceRange
Returns the subresource range of the wrapped image that this view exposes.
sourcefn usage(&self) -> &ImageUsage
fn usage(&self) -> &ImageUsage
Returns the usage of the image view.
sourcefn view_type(&self) -> ImageViewType
fn view_type(&self) -> ImageViewType
Returns the
ImageViewType
of this image view.sourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of this view.
sourceimpl ImageViewAbstract for ImageView<dyn ImageAccess>
impl ImageViewAbstract for ImageView<dyn ImageAccess>
sourcefn image(&self) -> Arc<dyn ImageAccess>
fn image(&self) -> Arc<dyn ImageAccess>
Returns the wrapped image that this image view was created from.
sourcefn component_mapping(&self) -> ComponentMapping
fn component_mapping(&self) -> ComponentMapping
Returns the component mapping of this view.
sourcefn filter_cubic(&self) -> bool
fn filter_cubic(&self) -> bool
sourcefn filter_cubic_minmax(&self) -> bool
fn filter_cubic_minmax(&self) -> bool
sourcefn format(&self) -> Option<Format>
fn format(&self) -> Option<Format>
Returns the format of this view. This can be different from the parent’s format.
sourcefn format_features(&self) -> &FormatFeatures
fn format_features(&self) -> &FormatFeatures
Returns the features supported by the image view’s format.
sourcefn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
fn sampler_ycbcr_conversion(&self) -> Option<&Arc<SamplerYcbcrConversion>>
Returns the sampler YCbCr conversion that this image view was created with, if any.
sourcefn subresource_range(&self) -> &ImageSubresourceRange
fn subresource_range(&self) -> &ImageSubresourceRange
Returns the subresource range of the wrapped image that this view exposes.
sourcefn usage(&self) -> &ImageUsage
fn usage(&self) -> &ImageUsage
Returns the usage of the image view.
sourcefn view_type(&self) -> ImageViewType
fn view_type(&self) -> ImageViewType
Returns the
ImageViewType
of this image view.sourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of this view.
sourceimpl<I: ImageAccess + ?Sized> PartialEq<ImageView<I>> for ImageView<I>
impl<I: ImageAccess + ?Sized> PartialEq<ImageView<I>> for ImageView<I>
sourceimpl<I> VulkanObject for ImageView<I>where
I: ImageAccess + ?Sized,
impl<I> VulkanObject for ImageView<I>where
I: ImageAccess + ?Sized,
impl<I: ImageAccess + ?Sized> Eq for ImageView<I>
Auto Trait Implementations
impl<I> !RefUnwindSafe for ImageView<I>
impl<I: ?Sized> Send for ImageView<I>
impl<I: ?Sized> Sync for ImageView<I>
impl<I: ?Sized> Unpin for ImageView<I>
impl<I> !UnwindSafe for ImageView<I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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