Mandrill 2025.6.0
Loading...
Searching...
No Matches
Mandrill::Image Class Reference

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>

Public Member Functions

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.
 

Detailed Description

Image class for managing Vulkan images. This class handles the creation and destruction of images, as well as basic memory management.

Constructor & Destructor Documentation

◆ 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
pDeviceDevice pointer
widthWidth of image
heightHeight of image
depthDepth of image
mipLevelsNumber of mipmapping levels
samplesNumber of samples
formatImage format
tilingTiling mode to use
usageHow the image will be used
propertiesWhich 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
pDeviceDevice pointer
widthWidth of image
heightHeight of image
depthDepth of image
mipLevelsNumber of mipmapping levels
samplesNumber of samples
formatImage format
tilingTiling mode to use
usageHow the image will be used
memoryAllocated memory to use for image
offsetWhere in the allocated memory the image should be stored

Member Function Documentation

◆ createImageView()

void Image::createImageView ( VkImageAspectFlags  aspectFlags)

Create a default image view for Image object.

Parameters
aspectFlagsAspect 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
imageViewImage view to use

The documentation for this class was generated from the following files: