vOOlkan
An object oriented approach to Vulkan
|
An Image is an object representing what can be passed to the swapchain: the content of the image is what will be drawn. More...
#include <Image.h>
Public Member Functions | |
Image (const VkImage &image, const LogicalDevice &virtualGpu, VkFormat format, std::pair< unsigned int, unsigned int > resolution) | |
Image (const Image &)=delete | |
Image & | operator= (const Image &)=delete |
Image (Image &&) noexcept | |
Image & | operator= (Image &&) noexcept |
~Image () | |
const VkImage & | operator+ () const |
VkFormat | getFormat () const |
Returns the format of the image, which is the same format of all the images in the swapchain of this image. More... | |
const ImageView & | generateImageView (std::string tag, const LogicalDevice &virtualGpu, VkImageAspectFlags type=VK_IMAGE_ASPECT_COLOR_BIT) |
Creates a new image view for this image, and adds it to the array of image views of this image, on last position. More... | |
void | eliminateImageView (std::string tag) |
Eliminates the specified image view. More... | |
const ImageView & | operator[] (std::string tag) const |
Returns the image view associated with the tag. More... | |
const std::map< std::string, ImageView > & | getImageViews () const |
Returns all the image views of this image. More... | |
Protected Member Functions | |
Image () | |
template<std::same_as< VkMemoryPropertyFlagBits >... P> | |
Image (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, VkFormat format, std::pair< unsigned int, unsigned int > resolution, VkImageTiling tiling, VkImageUsageFlags usage, P... memoryProperties) | |
Protected Attributes | |
VkImage | image |
VkFormat | format |
VkImageLayout | layout |
std::pair< unsigned int, unsigned int > | resolution |
std::map< std::string, ImageView > | views |
VkDeviceMemory | allocatedMemory |
LogicalDevice const * | virtualGpu |
bool | isSwapchainImage |
Friends | |
void | swap (Image &lhs, Image &rhs) |
An Image is an object representing what can be passed to the swapchain: the content of the image is what will be drawn.
An Image contains a list of ImageViews where we can actually draw. When an image is created it contains no ImageViews, but you can add those by using the generateImageView function.
Vulkan::Image::Image | ( | const VkImage & | image, |
const LogicalDevice & | virtualGpu, | ||
VkFormat | format, | ||
std::pair< unsigned int, unsigned int > | resolution | ||
) |
|
delete |
|
noexcept |
Vulkan::Image::~Image | ( | ) |
|
protected |
|
inlineprotected |
void Vulkan::Image::eliminateImageView | ( | std::string | tag | ) |
Eliminates the specified image view.
tag | The image view to eliminate. |
const Vulkan::ImageView & Vulkan::Image::generateImageView | ( | std::string | tag, |
const LogicalDevice & | virtualGpu, | ||
VkImageAspectFlags | type = VK_IMAGE_ASPECT_COLOR_BIT |
||
) |
Creates a new image view for this image, and adds it to the array of image views of this image, on last position.
tag | A tag to retrieve this image view. |
virtualGpu | The LogicalGpu of the Vulkan application. |
VkFormat Vulkan::Image::getFormat | ( | ) | const |
Returns the format of the image, which is the same format of all the images in the swapchain of this image.
const std::map< std::string, Vulkan::ImageView > & Vulkan::Image::getImageViews | ( | ) | const |
Returns all the image views of this image.
const VkImage & Vulkan::Image::operator+ | ( | ) | const |
|
noexcept |
const Vulkan::ImageView & Vulkan::Image::operator[] | ( | std::string | tag | ) | const |
Returns the image view associated with the tag.
Throws a VulkanException if the tag is not existent.
tag | The tag of the image view to retrieve. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |