![]() |
Raven Engine v0.1
|
Vulkan implementation of a 2D image resource. More...
#include <VulkanImage.h>
Public Member Functions | |
| VulkanImage2D (const ImageSpecification &spec) | |
| Construct a VulkanImage2D with the given specification. | |
| ~VulkanImage2D () | |
| Destructor handles Vulkan resource cleanup. | |
| ImageSpecification & | GetSpecification () override |
| Access the current image specification. | |
| const ImageSpecification & | GetSpecification () const override |
| Get immutable reference to the image specification. | |
| void | Resize (const u32 width, const u32 height) |
| Resize the image and recreate underlying Vulkan resources. | |
| u32 | GetWidth () const override |
| Get the width of the image in pixels. | |
| u32 | GetHeight () const override |
| Get the height of the image in pixels. | |
| Crux::uvec2 | GetSize () const override |
| Get image size as 2D vector. | |
| virtual float | GetAspectRatio () const override |
| Compute the aspect ratio (width / height) of the image. | |
| void | Invalidate () override |
| Recreate the Vulkan image and related resources (called on resize). | |
| void | Release () override |
| Release Vulkan resources associated with this image. | |
| VulkanImageInfo & | GetImageInfo () |
| Get Vulkan-specific image handles. | |
| const VulkanImageInfo & | GetImageInfo () const |
| VkImageView | GetLayerImageView (u32 layer) const |
| Get the image view corresponding to a specific layer. | |
| Buffer | GetBuffer () const override |
| Get or set the raw image data buffer. | |
| Buffer & | GetBuffer () override |
| Get a mutable reference to the internal buffer. | |
| void | CopyToHostBuffer (Buffer &buffer) |
| Copy image data to a host-visible buffer. | |
| void | CreatePerSpecificLayerImageViews (const std::vector< u32 > &layerIndices) |
| Create image views only for specified layers. | |
| void | CreatePerLayerImageViews () override |
| Create image views for all layers. | |
| void | GenerateMips () const |
| Generate mipmaps for the image (if supported). | |
| Public Member Functions inherited from Raven::Image2D | |
| virtual | ~Image2D ()=default |
Additional Inherited Members | |
| Static Public Member Functions inherited from Raven::Image2D | |
| static Ref< Image2D > | Create (const ImageSpecification &spec) |
| Factory method to create a concrete Image2D instance. | |
Vulkan implementation of a 2D image resource.
Manages Vulkan image creation, views per layer/mip, resizing, and memory. Inherits from the generic Image2D interface.
| Raven::VulkanImage2D::VulkanImage2D | ( | const ImageSpecification & | spec | ) |
Construct a VulkanImage2D with the given specification.
| spec | Specification describing image dimensions, format, etc. |
| Raven::VulkanImage2D::~VulkanImage2D | ( | ) |
Destructor handles Vulkan resource cleanup.
| void Raven::VulkanImage2D::CopyToHostBuffer | ( | Buffer & | buffer | ) |
Copy image data to a host-visible buffer.
| buffer | Target buffer on the host. |
|
overridevirtual |
Create image views for all layers.
Implements Raven::Image2D.
| void Raven::VulkanImage2D::CreatePerSpecificLayerImageViews | ( | const std::vector< u32 > & | layerIndices | ) |
Create image views only for specified layers.
| layerIndices | Vector of layer indices for which to create views. |
| void Raven::VulkanImage2D::GenerateMips | ( | ) | const |
Generate mipmaps for the image (if supported).
|
inlineoverridevirtual |
Compute the aspect ratio (width / height) of the image.
Implements Raven::Image2D.
|
inlineoverridevirtual |
Get or set the raw image data buffer.
Implements Raven::Image2D.
|
inlineoverridevirtual |
Get a mutable reference to the internal buffer.
Allows modification of the buffer, e.g., for updates or transfers.
Implements Raven::Image2D.
|
inlineoverridevirtual |
|
inline |
Get Vulkan-specific image handles.
|
inline |
|
inline |
Get the image view corresponding to a specific layer.
| layer | Index of the image layer. |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Get immutable reference to the image specification.
For read-only access to image parameters.
Implements Raven::Image2D.
|
inlineoverridevirtual |
Access the current image specification.
Implements Raven::Image2D.
|
inlineoverridevirtual |
|
overridevirtual |
Recreate the Vulkan image and related resources (called on resize).
Implements Raven::Image2D.
|
overridevirtual |
Release Vulkan resources associated with this image.
Implements Raven::Image2D.
Resize the image and recreate underlying Vulkan resources.
| width | New image width. |
| height | New image height. |
Implements Raven::Image2D.