CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::GPUImage Class Referenceabstract

#include <CeresEngine/RenderAPI/GPUImage.hpp>

Inheritance diagram for CeresEngine::GPUImage:
CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource > CeresEngine::GPUResource CeresEngine::GPUDeviceObject CeresEngine::GPUObject CeresEngine::GLImage CeresEngine::MKImage CeresEngine::MTImage CeresEngine::NLImage CeresEngine::VKImage CeresEngine::WGImage

Public Member Functions

 GPUImage (const GPUImage &)=delete
 Deleted copy constructor.
 
GPUImageoperator= (const GPUImage &)=delete
 
 GPUImage (GPUImage &&)=delete
 Deleted move constructor.
 
GPUImageoperator= (GPUImage &&)=delete
 
virtual GPUImageViewPtr createView (const GPUImageViewDescriptor &descriptor)=0
 Creates a new Image that is a view of a given region of the parent image.
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUResource
 GPUDeviceObject (GPUDevice &device)
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 

Static Public Member Functions

static UInt32 numMipLevels (UInt32 width, UInt32 height=1, UInt32 depth=1) noexcept
 Returns the number of MIP-map levels for a image with the specified size.
 
static UInt32 numMipLevels (const GPUImageDescriptor &imageDesc) noexcept
 Returns the number of MIP-map levels for the specified image descriptor.
 
static UInt32 bufferSize (Format format, UInt32 numTexels) noexcept
 Returns the required buffer size (in bytes) of a image with the specified hardware format and number of texels.
 
static UInt32 size (const GPUImageDescriptor &imageDesc) noexcept
 
static bool isMipMapped (const GPUImageDescriptor &imageDesc) noexcept
 Returns true if the specified image descriptor describes a image with MIP-mapping enabled.
 
static bool isArray (GPUImageType type) noexcept
 Returns true if the specified image type is an array image.
 
static bool isMultiSample (GPUImageType type) noexcept
 Returns true if the specified image type is a multi-sample image.
 
static bool isCube (GPUImageType type) noexcept
 Returns true if the specified image type is a cube image.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
using Descriptor = GPUImageDescriptor
 An type-alias to the descriptor struct type.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 

Constructor & Destructor Documentation

◆ GPUImage() [1/2]

CeresEngine::GPUImage::GPUImage ( const GPUImage )
delete

Deleted copy constructor.

◆ GPUImage() [2/2]

CeresEngine::GPUImage::GPUImage ( GPUImage &&  )
delete

Deleted move constructor.

Member Function Documentation

◆ bufferSize()

static UInt32 CeresEngine::GPUImage::bufferSize ( Format  format,
UInt32  numTexels 
)
staticnoexcept

Returns the required buffer size (in bytes) of a image with the specified hardware format and number of texels.

Parameters
formatSpecifies the image format.
numTexelsSpecifies the number of image elements (texels). For the DXT compressed image formats, this must be a multiple of 16, since these formats compress the image in 4x4 texel blocks.
Returns
The required buffer size (in bytes), or zero if the input is invalid.
Remarks
The counterpart for image data is the function ImageDataSize.

◆ createView()

virtual GPUImageViewPtr CeresEngine::GPUImage::createView ( const GPUImageViewDescriptor descriptor)
pure virtual

Creates a new Image that is a view of a given region of the parent image.

The created view will hold a reference to the parent image.

Parameters
descriptorThe image view descriptor
Returns
The created image view

Implemented in CeresEngine::MTImage, CeresEngine::MKImage, CeresEngine::NLImage, CeresEngine::GLImage, CeresEngine::VKImage, and CeresEngine::WGImage.

◆ isArray()

static bool CeresEngine::GPUImage::isArray ( GPUImageType  type)
staticnoexcept

Returns true if the specified image type is an array image.

Returns
True if 'type' is . either ImageType::Image1DArray, ImageType::Image2DArray, ImageType::ImageCubeArray, or ImageType::Image2DMSArray.

◆ isCube()

static bool CeresEngine::GPUImage::isCube ( GPUImageType  type)
staticnoexcept

Returns true if the specified image type is a cube image.

Returns
True if 'type' is either ImageType::ImageCube or ImageType::ImageCubeArray.

◆ isMipMapped()

static bool CeresEngine::GPUImage::isMipMapped ( const GPUImageDescriptor imageDesc)
staticnoexcept

Returns true if the specified image descriptor describes a image with MIP-mapping enabled.

Returns
True if the image type is not a multi-sampled image and the number of MIP-map levels in the descriptor is either zero or greater than one.

◆ isMultiSample()

static bool CeresEngine::GPUImage::isMultiSample ( GPUImageType  type)
staticnoexcept

Returns true if the specified image type is a multi-sample image.

Returns
True if 'type' is either ImageType::Image2DMS, or ImageType::Image2DMSArray.

◆ numMipLevels() [1/2]

static UInt32 CeresEngine::GPUImage::numMipLevels ( const GPUImageDescriptor imageDesc)
staticnoexcept

Returns the number of MIP-map levels for the specified image descriptor.

Parameters
imageDescSpecifies the descriptor whose parameters are used to determine the number of MIP-map levels.
Remarks
This function will deduce the number MIP-map levels automatically only if the member "mipLevels" is zero. Otherwise, the value of this member is returned.

◆ numMipLevels() [2/2]

static UInt32 CeresEngine::GPUImage::numMipLevels ( UInt32  width,
UInt32  height = 1,
UInt32  depth = 1 
)
staticnoexcept

Returns the number of MIP-map levels for a image with the specified size.

Parameters
widthSpecifies the image width.
heightspecifies the image height or number of layers for 1D array images. By default 1 (if 1D images are used).
depthSpecifies the image depth or number of layers for 2D array images. By default 1 (if 1D or 2D images are used).
Remarks
The height and depth are optional parameters, so this function can be easily used for 1D, 2D, and 3D images.
Returns
1 + floor(log2(max{ width, height, depth })).

◆ operator=() [1/2]

GPUImage & CeresEngine::GPUImage::operator= ( const GPUImage )
delete

◆ operator=() [2/2]

GPUImage & CeresEngine::GPUImage::operator= ( GPUImage &&  )
delete

◆ size()

static UInt32 CeresEngine::GPUImage::size ( const GPUImageDescriptor imageDesc)
staticnoexcept
Returns
The image size (in texels) of the specified image descriptor, or zero if the image type is invalid.

◆ TDeviceObject() [1/3]

Inherited constructors.

◆ TDeviceObject() [2/3]

CeresEngine::TDeviceObject< TDescriptor, TParent >::TDeviceObject ( GPUDevice device,
const Descriptor descriptor 
)
inlineexplicit

Inherited constructors.

◆ TDeviceObject() [3/3]

CeresEngine::TDeviceObject< TDescriptor, TParent >::TDeviceObject ( TDeviceObject &&  )
delete

Inherited constructors.


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