Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Private Member Functions | Private Attributes
Fling::Image Class Reference

An image represents a 2D file that has data about each pixel in the image. More...

#include <Image.h>

Inherits Fling::Resource.

Public Member Functions

 Image (Guid t_ID, void *t_Data=nullptr)
 
virtual ~Image ()
 
FORCEINLINE UINT32 GetWidth () const
 
FORCEINLINE UINT32 GetHeight () const
 
FORCEINLINE INT32 GetChannels () const
 
FORCEINLINE const VkImage & GetVkImage () const
 
FORCEINLINE const VkImageView & GetVkImageView () const
 
FORCEINLINE const VkSampler & GetSampler () const
 
UINT64 GetImageSize () const
 Get the Image Size object (width * height * 4) Multiply by 4 because the pixel is laid out row by row with 4 bytes per pixel. More...
 
void Release ()
 Release the Vulkan resources of this image. More...
 
- Public Member Functions inherited from Fling::Resource
 Resource (Fling::Guid t_ID)
 
virtual ~Resource ()=default
 
Fling::Guid_Handle GetGuidHandle () const
 Get GUID handle (just an int) for this resources guid. More...
 
std::string GetGuidString () const
 Get the human-readable string representation of this GUID. More...
 
std::string GetFilepathReleativeToAssets () const
 Returns the full file path that is relative to the assets path based on the GUID of this resource. More...
 

Private Member Functions

void LoadVulkanImage ()
 Loads the Vulkan resources needed for this image. More...
 
void CreateImageView ()
 Create a Image View object that is needed to sample this image from the swap chain. More...
 
void CreateTextureSampler ()
 
void CopyBufferToImage (VkBuffer t_Buffer)
 

Private Attributes

UINT32 m_Width = 0
 Width of this image. More...
 
UINT32 m_Height = 0
 Height of this image. More...
 
INT32 m_Channels = 0
 The color channels of this image. More...
 
VkImage m_vVkImage
 The Vulkan image data. More...
 
VkImageView m_ImageView
 The view of this image for the swap chain. More...
 
VkSampler m_TextureSampler
 
VkDeviceMemory m_VkMemory
 The Vulkan memory resource for this image. More...
 

Additional Inherited Members

- Protected Attributes inherited from Fling::Resource
Fling::Guid m_Guid
 

Detailed Description

An image represents a 2D file that has data about each pixel in the image.

Constructor & Destructor Documentation

◆ Image()

Fling::Image::Image ( Guid  t_ID,
void *  t_Data = nullptr 
)
explicit

◆ ~Image()

Fling::Image::~Image ( )
virtual

Member Function Documentation

◆ CopyBufferToImage()

void Fling::Image::CopyBufferToImage ( VkBuffer  t_Buffer)
private

◆ CreateImageView()

void Fling::Image::CreateImageView ( )
private

Create a Image View object that is needed to sample this image from the swap chain.

◆ CreateTextureSampler()

void Fling::Image::CreateTextureSampler ( )
private

◆ GetChannels()

FORCEINLINE INT32 Fling::Image::GetChannels ( ) const
inline

◆ GetHeight()

FORCEINLINE UINT32 Fling::Image::GetHeight ( ) const
inline

◆ GetImageSize()

UINT64 Fling::Image::GetImageSize ( ) const
inline

Get the Image Size object (width * height * 4) Multiply by 4 because the pixel is laid out row by row with 4 bytes per pixel.

Returns
INT32

◆ GetSampler()

FORCEINLINE const VkSampler& Fling::Image::GetSampler ( ) const
inline

◆ GetVkImage()

FORCEINLINE const VkImage& Fling::Image::GetVkImage ( ) const
inline

◆ GetVkImageView()

FORCEINLINE const VkImageView& Fling::Image::GetVkImageView ( ) const
inline

◆ GetWidth()

FORCEINLINE UINT32 Fling::Image::GetWidth ( ) const
inline

◆ LoadVulkanImage()

void Fling::Image::LoadVulkanImage ( )
private

Loads the Vulkan resources needed for this image.

◆ Release()

void Fling::Image::Release ( )

Release the Vulkan resources of this image.

Field Documentation

◆ m_Channels

INT32 Fling::Image::m_Channels = 0
private

The color channels of this image.

◆ m_Height

UINT32 Fling::Image::m_Height = 0
private

Height of this image.

◆ m_ImageView

VkImageView Fling::Image::m_ImageView
private

The view of this image for the swap chain.

◆ m_TextureSampler

VkSampler Fling::Image::m_TextureSampler
private

◆ m_VkMemory

VkDeviceMemory Fling::Image::m_VkMemory
private

The Vulkan memory resource for this image.

◆ m_vVkImage

VkImage Fling::Image::m_vVkImage
private

The Vulkan image data.

◆ m_Width

UINT32 Fling::Image::m_Width = 0
private

Width of this image.


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