pub struct Image<A: Allocator = DefaultAllocator> { /* private fields */ }Expand description
Abstraction over a VkImage. Stores information about size, format, etc. Additionally couples the image data together
with a memory allocation.
Implementations§
Source§impl<A: Allocator> Image<A>
impl<A: Allocator> Image<A>
Sourcepub fn new(
device: Device,
alloc: &mut A,
width: u32,
height: u32,
usage: ImageUsageFlags,
format: Format,
samples: SampleCountFlags,
) -> Result<Self>
pub fn new( device: Device, alloc: &mut A, width: u32, height: u32, usage: ImageUsageFlags, format: Format, samples: SampleCountFlags, ) -> Result<Self>
Create a new simple [VkImage] and allocate some memory to it.
Sourcepub fn view(&self, aspect: ImageAspectFlags) -> Result<ImageView>
pub fn view(&self, aspect: ImageAspectFlags) -> Result<ImageView>
Sourcepub fn is_owned(&self) -> bool
pub fn is_owned(&self) -> bool
Whether this image resource is owned by the application or an external manager (such as the swapchain).
Sourcepub unsafe fn handle(&self) -> Image
pub unsafe fn handle(&self) -> Image
Get unsafe access to the underlying VkImage handle.
§Safety
Any vulkan calls that mutate this image’s state may put the system into an undefined state.
Sourcepub fn mip_levels(&self) -> u32
pub fn mip_levels(&self) -> u32
Get the number of mip levels in the image
Sourcepub fn samples(&self) -> SampleCountFlags
pub fn samples(&self) -> SampleCountFlags
Get the number of MSAA samples for this image.
Trait Implementations§
Source§impl Nameable for Image
impl Nameable for Image
Source§const OBJECT_TYPE: ObjectType = vk::ObjectType::IMAGE
const OBJECT_TYPE: ObjectType = vk::ObjectType::IMAGE
Change the name of the given object
impl<A: Allocator> Send for Image<A>
impl<A: Allocator> Sync for Image<A>
Auto Trait Implementations§
impl<A> Freeze for Image<A>
impl<A> RefUnwindSafe for Image<A>
impl<A> Unpin for Image<A>
impl<A> UnwindSafe for Image<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more