LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::IImage Class Referenceabstract

Describes a generic image. More...

#include <rendering_api.hpp>

Inherits LiteFX::Rendering::IDeviceMemory, and LiteFX::Rendering::IStateResource.

Inherited by LiteFX::Rendering::Backends::IDirectX12Image [virtual], and LiteFX::Rendering::Backends::IVulkanImage [virtual].

Public Member Functions

virtual ~IImage () noexcept=default
 
virtual size_t size (const UInt32 &level) const noexcept=0
 Returns the size (in bytes) of an image at a specified mip map level. If the image does not contain the provided mip map level, the method returns 0. More...
 
virtual Size3d extent (const UInt32 &level=0) const noexcept=0
 Gets the extent of the image at a certain mip-map level. More...
 
virtual const Format & format () const noexcept=0
 Gets the internal format of the image. More...
 
virtual const ImageDimensions & dimensions () const noexcept=0
 Gets the images dimensionality. More...
 
virtual const UInt32levels () const noexcept=0
 Gets the number of mip-map levels of the image. More...
 
virtual const UInt32layers () const noexcept=0
 Gets the number of layers (slices) of the image. More...
 
virtual const UInt32planes () const noexcept=0
 Returns the number of planes of the image resource. More...
 
virtual const MultiSamplingLevel & samples () const noexcept=0
 Gets the number of samples of the texture. More...
 
virtual UInt32 subresourceId (const UInt32 &level, const UInt32 &layer, const UInt32 &plane) const noexcept
 
- Public Member Functions inherited from LiteFX::Rendering::IDeviceMemory
virtual ~IDeviceMemory () noexcept=default
 
virtual const UInt32elements () const noexcept=0
 Gets the number of sub-resources inside the memory chunk. More...
 
virtual size_t size () const noexcept=0
 Gets the size (in bytes) of the aligned memory chunk. More...
 
virtual size_t elementSize () const noexcept=0
 Returns the size of a single element within the buffer. If there is only one element, this is equal to size. More...
 
virtual size_t elementAlignment () const noexcept=0
 Returns the alignment of a single element. More...
 
virtual size_t alignedElementSize () const noexcept=0
 Returns the actual size of the element in device memory. More...
 
virtual const bool & writable () const noexcept=0
 Returns true, if the resource can be bound to a read/write descriptor. More...
 
virtual const ResourceState & state (const UInt32 &subresource=0) const =0
 Returns the current state of the resource. More...
 
virtual ResourceState & state (const UInt32 &subresource=0)=0
 Returns a reference of the current state of the resource. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IStateResource
virtual ~IStateResource () noexcept=default
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource. More...
 

Detailed Description

Describes a generic image.

Constructor & Destructor Documentation

◆ ~IImage()

virtual LiteFX::Rendering::IImage::~IImage ( )
virtualdefaultnoexcept

Member Function Documentation

◆ dimensions()

virtual const ImageDimensions & LiteFX::Rendering::IImage::dimensions ( ) const
pure virtualnoexcept

Gets the images dimensionality.

The dimensions imply various things, most importantly, which components of the extent are used. Note that cube maps behave like 2D images when the extent is used.

Returns
The images dimensionality.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ extent()

virtual Size3d LiteFX::Rendering::IImage::extent ( const UInt32 level = 0) const
pure virtualnoexcept

Gets the extent of the image at a certain mip-map level.

Not all components of the extent are actually used. Check the dimensions to see, which components are required. The extent will be 0 for invalid mip-map levels and 1 or more for valid mip map levels.

Returns
The extent of the image at a certain mip-map level.
See also
dimensions

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ format()

virtual const Format & LiteFX::Rendering::IImage::format ( ) const
pure virtualnoexcept

Gets the internal format of the image.

Returns
The internal format of the image.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ layers()

virtual const UInt32 & LiteFX::Rendering::IImage::layers ( ) const
pure virtualnoexcept

Gets the number of layers (slices) of the image.

Returns
The number of layers (slices) of the image.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ levels()

virtual const UInt32 & LiteFX::Rendering::IImage::levels ( ) const
pure virtualnoexcept

Gets the number of mip-map levels of the image.

Returns
The number of mip-map levels of the image.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ planes()

virtual const UInt32 & LiteFX::Rendering::IImage::planes ( ) const
pure virtualnoexcept

Returns the number of planes of the image resource.

The number of planes is dictated by the image format.

Returns
The number of planes of the image resource.
See also
format

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ samples()

virtual const MultiSamplingLevel & LiteFX::Rendering::IImage::samples ( ) const
pure virtualnoexcept

Gets the number of samples of the texture.

Returns
The number of samples of the texture.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ size()

virtual size_t LiteFX::Rendering::IImage::size ( const UInt32 level) const
pure virtualnoexcept

Returns the size (in bytes) of an image at a specified mip map level. If the image does not contain the provided mip map level, the method returns 0.

Note that the size will only be returned for one layer. You have to multiply this value by the number of layers, if you want to receive the size of all layers of a certain mip-map level. This is especially important, if you use cube mapping, because this method will only return the size of one face.

Parameters
levelThe mip map level to return the size for.
Returns
The size (in bytes) of an image at a specified mip map level.

Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.

◆ subresourceId()

virtual UInt32 LiteFX::Rendering::IImage::subresourceId ( const UInt32 level,
const UInt32 layer,
const UInt32 plane 
) const
inlinevirtualnoexcept