![]() |
NDEVR
API Documentation
|
A pointer to an Image and functions relating to that image within the Vulkan logic space. More...
Public Member Functions | |
| VulkanImageData (const ConstPointer< VulkanDevice > &instance) | |
| Constructs an empty Vulkan image on the given device. | |
| VulkanImageData (const ConstPointer< VulkanDevice > &instance, Buffer< String > &image_ids, uint04 mip_map_depth) | |
| Constructs a Vulkan image array from multiple image files. | |
| VulkanImageData (const ConstPointer< VulkanDevice > &instance, const StringView &image_id, uint04 mip_map_depth) | |
| Constructs a Vulkan image from a single image file. | |
| VulkanImageData (const ConstPointer< VulkanDevice > &instance, Vector< 2, uint04 > size, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties) | |
| Constructs a new Vulkan image with the given properties. | |
| VulkanImageData (const ConstPointer< VulkanDevice > &instance, VkImage image, Vector< 2, uint04 > size, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, bool image_owner) | |
| Constructs a Vulkan image wrapping an existing VkImage handle. | |
| VulkanImageData (VulkanImageData &&instance) noexcept | |
| Move constructor. | |
| ~VulkanImageData () | |
| Destructor. | |
| uint04 | arrayLayers () const |
| Returns the number of array layers. | |
| void | checkAndUpdateMemory (VkMemoryPropertyFlags properties, bool bind_image) |
| Checks and updates the memory allocation to match the required properties. | |
| void | cleanup (bool destroy_memory=true) |
| Releases Vulkan resources. | |
| void | clear (const RGBColor &color=RGBColor(0, 0, 0, 0), VkCommandBuffer_T *command=nullptr) |
| Clears the image to the given color. | |
| void | createImage (VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties) |
| Creates the Vulkan image object with the specified properties. | |
| ConstPointer< VulkanDevice > | device () const |
| Returns the Vulkan device. | |
| VkFormat | getFormat () const |
| Returns the Vulkan format of this image. | |
| Vector< 2, uint04 > | getMipSize (uint04 level) const |
| Calculates the dimensions of a specific mip level. | |
| const Time & | getModifiedTime () const |
| Returns the last modification time of the image data. | |
| bool | hasAlpha () const |
| Returns whether the image has an alpha channel. | |
| VkImageLayout | layout (uint04 mip_level=0) const |
| Returns the current layout of the specified mip level. | |
| uint04 | mipMapDepth () const |
| Returns the mip map depth. | |
| void | rawSetLayout (VkImageLayout layout) |
| Directly sets the tracked layout without issuing a transition command. | |
| void | setArrayLayers (uint04 array_layers) |
| Sets the number of array layers. | |
| void | setData (const StringView &image_id, uint04 layer) |
| Loads image data from a file into a specific array layer. | |
| void | setData (VkImage image, bool image_owner) |
| Assigns an existing VkImage to this object. | |
| void | setDevice (const ConstPointer< VulkanDevice > &instance) |
| Sets the Vulkan device for this image. | |
| void | setFormat (VkFormat format) |
| Sets the Vulkan format for this image. | |
| void | setImageProperties (Vector< 2, uint04 > size, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties) |
| Configures the image properties and allocates resources. | |
| void | setMipMapDepth (uint04 depth) |
| Sets the mip map depth. | |
| void | setMultiSampleCount (uint04 count) |
| Sets the multi-sample count. | |
| Vector< 2, uint04 > | size () const final override |
| Returns the image dimensions. | |
| void | transitionImageLayout (VkImageLayout newLayout, uint04 miplevel, uint04 level, VkCommandBuffer_T *command=nullptr) |
| Transitions a specific mip level range to a new layout. | |
| void | transitionImageLayout (VkImageLayout newLayout, VkCommandBuffer_T *command=nullptr) |
| Transitions the entire image to a new layout. | |
| VkDeviceMemory | vkMemory () const |
| Returns the device memory backing this image. | |
| VkImage | vulkanImage () const |
| Returns the underlying VkImage handle. | |
| Public Member Functions inherited from Image | |
| virtual | ~Image () |
| Virtual destructor for proper cleanup of derived Image classes. | |
| virtual uint04 | pixelSize () const |
| Returns the number of bytes per pixel in this image. | |
| virtual uint01 * | scanLine (uint04 row) |
| Returns a pointer to the raw pixel data for a given scanline (row). | |
Static Public Member Functions | |
| static VkSampleCountFlagBits | getSampleBitflags (uint04 multi_sample_count) |
| Converts a multi-sample count to Vulkan sample count flags. | |
A pointer to an Image and functions relating to that image within the Vulkan logic space.
Definition at line 53 of file VulkanImage.h.
| VulkanImageData::VulkanImageData | ( | const ConstPointer< VulkanDevice > & | instance | ) |
Constructs an empty Vulkan image on the given device.
| [in] | instance | The Vulkan device. |
Referenced by VulkanImageData().
|
noexcept |
| VulkanImageData::VulkanImageData | ( | const ConstPointer< VulkanDevice > & | instance, |
| const StringView & | image_id, | ||
| uint04 | mip_map_depth ) |
Constructs a Vulkan image from a single image file.
| [in] | instance | The Vulkan device. |
| [in] | image_id | The image file identifier. |
| [in] | mip_map_depth | The number of mip map levels. |
| VulkanImageData::VulkanImageData | ( | const ConstPointer< VulkanDevice > & | instance, |
| Buffer< String > & | image_ids, | ||
| uint04 | mip_map_depth ) |
Constructs a Vulkan image array from multiple image files.
| [in] | instance | The Vulkan device. |
| [in] | image_ids | The image file identifiers. |
| [in] | mip_map_depth | The number of mip map levels. |
| VulkanImageData::VulkanImageData | ( | const ConstPointer< VulkanDevice > & | instance, |
| VkImage | image, | ||
| Vector< 2, uint04 > | size, | ||
| VkFormat | format, | ||
| VkImageTiling | tiling, | ||
| VkImageUsageFlags | usage, | ||
| VkMemoryPropertyFlags | properties, | ||
| bool | image_owner ) |
Constructs a Vulkan image wrapping an existing VkImage handle.
| [in] | instance | The Vulkan device. |
| [in] | image | The existing VkImage handle. |
| [in] | size | The image dimensions. |
| [in] | format | The Vulkan image format. |
| [in] | tiling | The image tiling mode. |
| [in] | usage | The image usage flags. |
| [in] | properties | The memory property flags. |
| [in] | image_owner | Whether this object owns the VkImage. |
References size().
| VulkanImageData::VulkanImageData | ( | const ConstPointer< VulkanDevice > & | instance, |
| Vector< 2, uint04 > | size, | ||
| VkFormat | format, | ||
| VkImageTiling | tiling, | ||
| VkImageUsageFlags | usage, | ||
| VkMemoryPropertyFlags | properties ) |
| VulkanImageData::~VulkanImageData | ( | ) |
Destructor.
Frees GPU resources.
|
inline |
Returns the number of array layers.
Definition at line 102 of file VulkanImage.h.
| void VulkanImageData::checkAndUpdateMemory | ( | VkMemoryPropertyFlags | properties, |
| bool | bind_image ) |
Checks and updates the memory allocation to match the required properties.
| [in] | properties | The required memory property flags. |
| [in] | bind_image | Whether to bind the image to the new memory. |
| void VulkanImageData::cleanup | ( | bool | destroy_memory = true | ) |
Releases Vulkan resources.
| [in] | destroy_memory | Whether to also free the device memory. |
| void VulkanImageData::clear | ( | const RGBColor & | color = RGBColor(0, 0, 0, 0), |
| VkCommandBuffer_T * | command = nullptr ) |
Clears the image to the given color.
| [in] | color | The clear color. |
| [in] | command | Optional command buffer to record the clear into. |
| void VulkanImageData::createImage | ( | VkImageTiling | tiling, |
| VkImageUsageFlags | usage, | ||
| VkMemoryPropertyFlags | properties ) |
Creates the Vulkan image object with the specified properties.
| [in] | tiling | The image tiling mode. |
| [in] | usage | The image usage flags. |
| [in] | properties | The memory property flags. |
|
inline |
Returns the Vulkan device.
Definition at line 127 of file VulkanImage.h.
References device().
Referenced by device().
| VkFormat VulkanImageData::getFormat | ( | ) | const |
Returns the Vulkan format of this image.
Calculates the dimensions of a specific mip level.
| [in] | level | The mip level index. |
|
inline |
Returns the last modification time of the image data.
Definition at line 108 of file VulkanImage.h.
|
static |
Converts a multi-sample count to Vulkan sample count flags.
| [in] | multi_sample_count | The desired sample count. |
|
inline |
Returns whether the image has an alpha channel.
Definition at line 166 of file VulkanImage.h.
| VkImageLayout VulkanImageData::layout | ( | uint04 | mip_level = 0 | ) | const |
Returns the current layout of the specified mip level.
| [in] | mip_level | The mip level to query. |
Referenced by rawSetLayout().
|
inline |
Returns the mip map depth.
Definition at line 97 of file VulkanImage.h.
| void VulkanImageData::rawSetLayout | ( | VkImageLayout | layout | ) |
|
inline |
Sets the number of array layers.
| [in] | array_layers | The array layer count. |
Definition at line 104 of file VulkanImage.h.
| void VulkanImageData::setData | ( | const StringView & | image_id, |
| uint04 | layer ) |
Loads image data from a file into a specific array layer.
| [in] | image_id | The image file identifier. |
| [in] | layer | The array layer index. |
| void VulkanImageData::setData | ( | VkImage | image, |
| bool | image_owner ) |
Assigns an existing VkImage to this object.
| [in] | image | The VkImage handle. |
| [in] | image_owner | Whether this object owns the image. |
| void VulkanImageData::setDevice | ( | const ConstPointer< VulkanDevice > & | instance | ) |
Sets the Vulkan device for this image.
| [in] | instance | The Vulkan device. |
| void VulkanImageData::setFormat | ( | VkFormat | format | ) |
Sets the Vulkan format for this image.
| [in] | format | The VkFormat. |
|
inline |
Sets the mip map depth.
| [in] | depth | The mip map level count. |
Definition at line 99 of file VulkanImage.h.
|
inline |
Sets the multi-sample count.
| [in] | count | The sample count. |
Definition at line 156 of file VulkanImage.h.
Returns the image dimensions.
Reimplemented from Image.
Referenced by VulkanImageData(), VulkanImageData(), and setImageProperties().
| void VulkanImageData::transitionImageLayout | ( | VkImageLayout | newLayout, |
| uint04 | miplevel, | ||
| uint04 | level, | ||
| VkCommandBuffer_T * | command = nullptr ) |
Transitions a specific mip level range to a new layout.
| [in] | newLayout | The target image layout. |
| [in] | miplevel | The starting mip level. |
| [in] | level | The number of mip levels to transition. |
| [in] | command | Optional command buffer to record the transition into. |
| void VulkanImageData::transitionImageLayout | ( | VkImageLayout | newLayout, |
| VkCommandBuffer_T * | command = nullptr ) |
Transitions the entire image to a new layout.
| [in] | newLayout | The target image layout. |
| [in] | command | Optional command buffer to record the transition into. |
|
inline |
Returns the device memory backing this image.
Definition at line 132 of file VulkanImage.h.
|
inline |
Returns the underlying VkImage handle.
Definition at line 130 of file VulkanImage.h.