Image class for managing Vulkan images. This class handles the creation and destruction of images, as well as basic memory management.
More...
#include <Image.h>
|
MANDRILL_API | Image (ptr< Device > pDevice, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevels, VkSampleCountFlagBits samples, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties) |
| Create a new Image and allocate memory for it.
|
|
MANDRILL_API | Image (ptr< Device > pDevice, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevels, VkSampleCountFlagBits samples, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkDeviceMemory memory, VkDeviceSize offset) |
| Create a new Image using memory that has already been allocated.
|
|
MANDRILL_API | ~Image () |
| Destructor for image.
|
|
MANDRILL_API void | createImageView (VkImageAspectFlags aspectFlags) |
| Create a default image view for Image object.
|
|
MANDRILL_API VkImage | getImage () const |
| Get the VkImage handle.
|
|
MANDRILL_API void | setImageView (VkImageView imageView) |
| Use this function if image view is created externally.
|
|
MANDRILL_API VkImageView | getImageView () const |
| Get the VkImageView handle.
|
|
MANDRILL_API VkDeviceMemory | getMemory () const |
| Get the device memory.
|
|
MANDRILL_API VkImageUsageFlags | getUsage () const |
| Get the image usage flags.
|
|
MANDRILL_API VkMemoryPropertyFlags | getProperties () const |
| Get the memory property flags.
|
|
MANDRILL_API void * | getHostMap () const |
| If the buffer memory is host-coherent, this returns the pointor to the memory.
|
|
MANDRILL_API VkFormat | getFormat () const |
| Get the format of the image.
|
|
MANDRILL_API uint32_t | getWidth () const |
| Get the width of the image.
|
|
MANDRILL_API uint32_t | getHeight () const |
| Get the height of the image.
|
|
MANDRILL_API uint32_t | getDepth () const |
| Get the depth of the image.
|
|
MANDRILL_API uint32_t | getMipLevels () const |
| Get the mipmap levels of the image.
|
|
Image class for managing Vulkan images. This class handles the creation and destruction of images, as well as basic memory management.
◆ Image() [1/2]
Image::Image |
( |
ptr< Device > |
pDevice, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
depth, |
|
|
uint32_t |
mipLevels, |
|
|
VkSampleCountFlagBits |
samples, |
|
|
VkFormat |
format, |
|
|
VkImageTiling |
tiling, |
|
|
VkImageUsageFlags |
usage, |
|
|
VkMemoryPropertyFlags |
properties |
|
) |
| |
Create a new Image and allocate memory for it.
- Parameters
-
pDevice | Device pointer |
width | Width of image |
height | Height of image |
depth | Depth of image |
mipLevels | Number of mipmapping levels |
samples | Number of samples |
format | Image format |
tiling | Tiling mode to use |
usage | How the image will be used |
properties | Which memory properties to require |
◆ Image() [2/2]
Image::Image |
( |
ptr< Device > |
pDevice, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
depth, |
|
|
uint32_t |
mipLevels, |
|
|
VkSampleCountFlagBits |
samples, |
|
|
VkFormat |
format, |
|
|
VkImageTiling |
tiling, |
|
|
VkImageUsageFlags |
usage, |
|
|
VkDeviceMemory |
memory, |
|
|
VkDeviceSize |
offset |
|
) |
| |
Create a new Image using memory that has already been allocated.
- Parameters
-
pDevice | Device pointer |
width | Width of image |
height | Height of image |
depth | Depth of image |
mipLevels | Number of mipmapping levels |
samples | Number of samples |
format | Image format |
tiling | Tiling mode to use |
usage | How the image will be used |
memory | Allocated memory to use for image |
offset | Where in the allocated memory the image should be stored |
◆ createImageView()
void Image::createImageView |
( |
VkImageAspectFlags |
aspectFlags | ) |
|
Create a default image view for Image object.
- Parameters
-
aspectFlags | Aspect flags to use for image view |
◆ getDepth()
MANDRILL_API uint32_t Mandrill::Image::getDepth |
( |
| ) |
const |
|
inline |
Get the depth of the image.
- Returns
- Image height
◆ getFormat()
MANDRILL_API VkFormat Mandrill::Image::getFormat |
( |
| ) |
const |
|
inline |
Get the format of the image.
- Returns
- Image format
◆ getHeight()
MANDRILL_API uint32_t Mandrill::Image::getHeight |
( |
| ) |
const |
|
inline |
Get the height of the image.
- Returns
- Image height
◆ getHostMap()
MANDRILL_API void * Mandrill::Image::getHostMap |
( |
| ) |
const |
|
inline |
If the buffer memory is host-coherent, this returns the pointor to the memory.
- Returns
- Pointer to buffer memory, or nullptr
◆ getImage()
MANDRILL_API VkImage Mandrill::Image::getImage |
( |
| ) |
const |
|
inline |
Get the VkImage handle.
- Returns
- VkImage handle
◆ getImageView()
MANDRILL_API VkImageView Mandrill::Image::getImageView |
( |
| ) |
const |
|
inline |
Get the VkImageView handle.
- Returns
- VkImageView handle
◆ getMemory()
MANDRILL_API VkDeviceMemory Mandrill::Image::getMemory |
( |
| ) |
const |
|
inline |
Get the device memory.
- Returns
- VkDeviceMemory handle
◆ getMipLevels()
MANDRILL_API uint32_t Mandrill::Image::getMipLevels |
( |
| ) |
const |
|
inline |
Get the mipmap levels of the image.
- Returns
- Image mipmap levels
◆ getProperties()
MANDRILL_API VkMemoryPropertyFlags Mandrill::Image::getProperties |
( |
| ) |
const |
|
inline |
Get the memory property flags.
- Returns
- Memory property flags
◆ getUsage()
MANDRILL_API VkImageUsageFlags Mandrill::Image::getUsage |
( |
| ) |
const |
|
inline |
Get the image usage flags.
- Returns
- Usage flags
◆ getWidth()
MANDRILL_API uint32_t Mandrill::Image::getWidth |
( |
| ) |
const |
|
inline |
Get the width of the image.
- Returns
- Image width
◆ setImageView()
MANDRILL_API void Mandrill::Image::setImageView |
( |
VkImageView |
imageView | ) |
|
|
inline |
Use this function if image view is created externally.
- Parameters
-
imageView | Image view to use |
The documentation for this class was generated from the following files:
- /home/runner/work/Mandrill/Mandrill/src/Image.h
- /home/runner/work/Mandrill/Mandrill/src/Image.cpp