VPP  0.8
A high-level modern C++ API for Vulkan
vpp::ImageInfo Struct Reference

A structure containing image parameters. More...

#include <vppImageInfo.hpp>

Public Member Functions

 ImageInfo (EImagePurpose _purpose, EImageType _type, VkFormat _format, const VkExtent3D &_extent, unsigned int _mipLevels, unsigned int _arrayLayers, VkSampleCountFlagBits _multisampling, VkImageTiling _tiling, unsigned int _usage, unsigned int _flags)
 Constructs an image info with all parameters. More...
 
 ImageInfo (unsigned int width, unsigned int height, EImagePurpose _purpose, unsigned int usage, VkFormat fmt)
 Constructs an image info with most important parameters. More...
 
std::uint32_t getAspect () const
 Retrieves default aspect mask guessed from format.
 
VkImageViewType getViewType () const
 Retrieves Vulkan view type from image type.
 
VkImageType getImageType () const
 Retrieves Vulkan image type.
 
std::uint32_t getDimensions () const
 Retrieves the number of image dimensions.
 
bool operator< (const ImageInfo &rhs) const
 Comparison operator for maps.
 
bool operator== (const ImageInfo &rhs) const
 Comparison operator for equality.
 
bool operator!= (const ImageInfo &rhs) const
 Comparison operator for inequality.
 

Public Attributes

EImagePurpose purpose
 Overall purpose of an image. Usually RENDER or SWAPCHAIN.
 
EImageType type
 Type of image. Determins the number of dimensions.
 
VkFormat format
 Image format. A value of Vulkan format enumeration.
 
VkExtent3D extent
 Image size.
 
unsigned int mipLevels
 Number of levels in a mip-mapped image.
 
unsigned int arrayLayers
 Number of layers in an arrayed image.
 
VkSampleCountFlagBits multisampling
 Number of samples in a multisampled image.
 
VkImageTiling tiling
 Image tiling - usually VK_IMAGE_TILING_OPTIMAL.
 
unsigned int usage
 Usage flags - bitwise or of EUsageFlags values.
 
unsigned int flags
 Additional flags - by default 0.
 

Detailed Description

A structure containing image parameters.

This is a run-time structure containing a complete set of image parameters.

It can be used both to define images (untyped) and obtain information about existing image.

Constructor & Destructor Documentation

◆ ImageInfo() [1/2]

vpp::ImageInfo::ImageInfo ( EImagePurpose  _purpose,
EImageType  _type,
VkFormat  _format,
const VkExtent3D &  _extent,
unsigned int  _mipLevels,
unsigned int  _arrayLayers,
VkSampleCountFlagBits  _multisampling,
VkImageTiling  _tiling,
unsigned int  _usage,
unsigned int  _flags 
)

Constructs an image info with all parameters.

Example:

vpp::ImageInfo myImgInfo (
vpp::IMG_TYPE_2D,
VK_FORMAT_R8G8B8A8_UINT,
{ 1024, 768, 1 },
1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_TILING_OPTIMAL,
);

◆ ImageInfo() [2/2]

vpp::ImageInfo::ImageInfo ( unsigned int  width,
unsigned int  height,
EImagePurpose  _purpose,
unsigned int  usage,
VkFormat  fmt 
)

Constructs an image info with most important parameters.

Example:

vpp::ImageInfo myImgInfo (
640, 480,
VK_FORMAT_R8G8B8A8_UINT
);

The documentation for this struct was generated from the following file: