LiteFX 0.4.1.2025
Computer Graphics Engine
|
Describes a generic image. More...
#include <rendering_api.hpp>
Inherits LiteFX::Rendering::IDeviceMemory, LiteFX::Rendering::IStateResource, and LiteFX::SharedObject.
Inherited by LiteFX::Rendering::Backends::IDirectX12Image [virtual]
, and LiteFX::Rendering::Backends::IVulkanImage [virtual]
.
Public Member Functions | |
~IImage () noexcept override=default | |
virtual size_t | size (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 . | |
virtual Size3d | extent (UInt32 level=0) const noexcept=0 |
Gets the extent of the image at a certain mip-map level. | |
virtual Format | format () const noexcept=0 |
Gets the internal format of the image. | |
virtual ImageDimensions | dimensions () const noexcept=0 |
Gets the images dimensionality. | |
virtual UInt32 | levels () const noexcept=0 |
Gets the number of mip-map levels of the image. | |
virtual UInt32 | layers () const noexcept=0 |
Gets the number of layers (slices) of the image. | |
virtual UInt32 | planes () const noexcept=0 |
Returns the number of planes of the image resource. | |
virtual MultiSamplingLevel | samples () const noexcept=0 |
Gets the number of samples of the texture. | |
virtual UInt32 | subresourceId (UInt32 level, UInt32 layer, UInt32 plane) const noexcept |
Returns the sub-resource ID for a combination of mip-map level , array layer and plane . | |
virtual void | resolveSubresource (UInt32 subresource, UInt32 &plane, UInt32 &layer, UInt32 &level) const noexcept |
Returns the plane , layer and level for the provided subresource . | |
virtual size_t | size () const noexcept=0 |
Gets the size (in bytes) of the aligned memory chunk. | |
![]() | |
virtual | ~IDeviceMemory () noexcept=default |
virtual UInt32 | elements () const noexcept=0 |
Gets the number of sub-resources inside the memory chunk. | |
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. | |
virtual size_t | elementAlignment () const noexcept=0 |
Returns the alignment of a single element. | |
virtual size_t | alignedElementSize () const noexcept=0 |
Returns the actual size of the element in device memory. | |
virtual ResourceUsage | usage () const noexcept=0 |
Returns the usage flags for the resource. | |
bool | writable () const noexcept |
Returns true , if the resource can be bound to a read/write descriptor. | |
virtual UInt64 | virtualAddress () const noexcept=0 |
Gets the address of the resource in GPU memory. | |
![]() | |
virtual | ~IStateResource () noexcept=default |
Releases the state resource instance. | |
virtual const String & | name () const noexcept=0 |
Returns the name of the resource. | |
![]() | |
virtual | ~SharedObject () noexcept=default |
Destroys the shared object. | |
template<typename TSelf > | |
auto | shared_from_this (this TSelf &&self) noexcept |
Returns a shared pointer to the current object instance. | |
template<typename TSelf > | |
auto | weak_from_this (this TSelf &&self) noexcept -> WeakPtr< std::remove_reference_t< TSelf > > |
Returns a weak pointer to the current object instance. | |
Protected Member Functions | |
IImage () noexcept=default | |
IImage (IImage &&) noexcept=default | |
IImage (const IImage &)=delete | |
IImage & | operator= (IImage &&) noexcept=default |
IImage & | operator= (const IImage &)=delete |
![]() | |
IDeviceMemory () noexcept=default | |
IDeviceMemory (IDeviceMemory &&) noexcept=default | |
IDeviceMemory (const IDeviceMemory &)=default | |
IDeviceMemory & | operator= (IDeviceMemory &&) noexcept=default |
IDeviceMemory & | operator= (const IDeviceMemory &)=default |
![]() | |
IStateResource () noexcept=default | |
IStateResource (const IStateResource &)=delete | |
IStateResource (IStateResource &&) noexcept=default | |
IStateResource & | operator= (const IStateResource &)=delete |
IStateResource & | operator= (IStateResource &&) noexcept=default |
![]() | |
SharedObject () noexcept=default | |
Initializes a new shared object. | |
SharedObject (SharedObject &&) noexcept=default | |
SharedObject (const SharedObject &)=default | |
SharedObject & | operator= (SharedObject &&) noexcept=default |
SharedObject & | operator= (const SharedObject &)=default |
Additional Inherited Members | |
![]() | |
template<typename T , typename... TArgs> | |
static auto | create (TArgs &&... args) -> SharedPtr< T > |
Generic factory method used to create instances of the shared object. | |
Describes a generic image.
|
protecteddefaultnoexcept |
|
protecteddefaultnoexcept |
|
protecteddelete |
|
overridedefaultnoexcept |
|
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.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
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.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Gets the internal format of the image.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Gets the number of layers (slices) of the image.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Gets the number of mip-map levels of the image.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Returns the number of planes of the image resource.
The number of planes is dictated by the image format.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
inlinevirtualnoexcept |
Returns the plane , layer and level for the provided subresource .
subresource | The sub-resource ID. |
plane | The plane index of the sub-resource. |
layer | The array layer of the sub-resource. |
level | The mip-map level of the sub-resource. |
|
pure virtualnoexcept |
Gets the number of samples of the texture.
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
virtualnoexcept |
Gets the size (in bytes) of the aligned memory chunk.
The size of the device memory block depends on different factors. The actual used memory of one element can be obtained by calling by the elementSize. For different reasons, though, elements may be required to be aligned to a certain size. The size of one aligned element is returned by alignedElementSize. The size of the memory block, the elements get aligned to is returned by elementAlignment.
Implements LiteFX::Rendering::IDeviceMemory.
Reimplemented in LiteFX::Rendering::Backends::VulkanImage.
|
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.
level | The mip map level to return the size for. |
Implemented in LiteFX::Rendering::Backends::DirectX12Image, and LiteFX::Rendering::Backends::VulkanImage.
|
inlinevirtualnoexcept |
Returns the sub-resource ID for a combination of mip-map level , array layer and plane .
level | The mip map level of the sub-resource. |
layer | The array layer of the sub-resource. |
plane | The plane of the sub-resource. |