Kanzi 4.0.0-beta2
kanzi::Framebuffer::AttachmentPoint Class Reference

Attachment point. More...

#include <kanzi/core.ui/graphics2d/framebuffer.hpp>

Classes

class  RenderbufferContainer
 Container for renderbuffer information. More...
 
class  TextureContainer
 Container for weak texture reference. More...
 

Public Types

using storage_type
 Internal storage type.
 

Public Member Functions

 AttachmentPoint ()=default
 Default constructor.
 
 AttachmentPoint (AttachmentPoint &&other) noexcept
 Move constructor.
 
 AttachmentPoint (const AttachmentPoint &)=delete
 
 AttachmentPoint (const Renderbuffer::CreateInfo &createInfo, string_view name)
 Constructor creating a renderbuffer.
 
 AttachmentPoint (const RenderbufferSharedPtr &renderbuffer)
 Constructor for an existing renderbuffer.
 
 AttachmentPoint (const TextureSharedPtr &texture, size_t faceIndex, size_t mipmapLevel)
 Constructor for referencing a texture.
 
bool empty () const
 Indicates whether the attachment point is empty.
 
RenderbufferSharedPtr getAnyRenderbuffer () const
 Gets a strong reference to any renderbuffer in this container.
 
GraphicsFormat getFormat () const
 Gets the format of the attachment.
 
size_t getGPUMemoryUsage () const
 Gets the GPU memory usage for this renderbuffer.
 
size_t getHeight () const
 Gets the height of the attachment.
 
RenderbufferContainergetRenderbufferContainer ()
 Gets the referenced renderbuffer container.
 
const RenderbufferContainergetRenderbufferContainer () const
 Gets the referenced renderbuffer container (const version).
 
size_t getSampleCount () const
 Gets the sample count of the attachment.
 
TextureSharedPtr getSharedTexture () const
 Gets a strong reference to any texture in this container.
 
TextureContainergetTextureContainer ()
 Gets the texture container.
 
const TextureContainergetTextureContainer () const
 Gets the texture container (const version).
 
RenderbufferWeakPtr getWeakRenderbuffer () const
 Gets the renderbuffer at the attachment point.
 
size_t getWidth () const
 Gets the width of the attachment.
 
bool hasRenderbufferContainer () const
 Indicates whether this attachment point holds a renderbuffer container.
 
bool hasTextureContainer () const
 Indicates whether this attachment point holds a texture container.
 
bool hasWeakRenderbuffer () const
 Indicates whether this attachment point holds a weak renderbuffer.
 
bool isTransient () const
 Indicates whether or not the attachment point is transient.
 
 operator bool () const
 Bool operator.
 
AttachmentPointoperator= (AttachmentPoint &&other) noexcept
 Move operator.
 
AttachmentPointoperator= (const AttachmentPoint &)=delete
 
bool setRenderbuffer (const RenderbufferSharedPtr &renderbuffer)
 Sets attached renderbuffer.
 
bool setRenderbufferCreateInfo (const Renderbuffer::CreateInfo &createInfo, string_view name)
 Sets the renderbuffer create information.
 
bool setTexture (const TextureSharedPtr &texture, size_t faceIndex, size_t mipmapLevel)
 Sets attached texture.
 
bool update (Renderer &renderer)
 Update the attachment point contents.
 

Protected Attributes

storage_type m_storage
 Internal storage for the attachment.
 

Detailed Description

Attachment point.

Contains data about the attachment which may be owned by the attachment point construct, or be a weak reference to an external object.

Since
Kanzi 3.9.0
Kanzi 4.0.0
  • Removed clear, getRenderbuffer and getTexture functions.
  • Removed m_renderbuffer and m_texture fields.

Member Typedef Documentation

◆ storage_type

Constructor & Destructor Documentation

◆ AttachmentPoint() [1/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( )
explicitdefault

Default constructor.

◆ AttachmentPoint() [2/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( const Renderbuffer::CreateInfo & createInfo,
string_view name )
inlineexplicit

Constructor creating a renderbuffer.

Parameters
createInfoRenderbuffer create information.
nameName of the renderbuffer.
Since
Kanzi 4.0.0

◆ AttachmentPoint() [3/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( const RenderbufferSharedPtr & renderbuffer)
inlineexplicit

Constructor for an existing renderbuffer.

Parameters
renderbufferAn existing Renderbuffer.
Since
Kanzi 4.0.0 changed the type of the renderbuffer parameter to const RenderbufferSharedPtr&.

◆ AttachmentPoint() [4/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( const TextureSharedPtr & texture,
size_t faceIndex,
size_t mipmapLevel )
inlineexplicit

Constructor for referencing a texture.

Parameters
textureReference to a Texture.
faceIndexAttachment face index.
mipmapLevelAttachment mipmap level.
Since
Kanzi 4.0.0
  • Changed the type of the texture parameter to const TextureSharedPtr&.
  • Added the faceIndex and mipmapLevel parameters.

◆ AttachmentPoint() [5/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( AttachmentPoint && other)
inlinenoexcept

Move constructor.

Parameters
otherSource attachment point.
Since
Kanzi 4.0.0

◆ AttachmentPoint() [6/6]

kanzi::Framebuffer::AttachmentPoint::AttachmentPoint ( const AttachmentPoint & )
delete

Member Function Documentation

◆ operator=() [1/2]

AttachmentPoint & kanzi::Framebuffer::AttachmentPoint::operator= ( AttachmentPoint && other)
inlinenoexcept

Move operator.

Parameters
otherSource attachment point.
Returns
This attachment point.
Since
Kanzi 4.0.0

◆ operator=() [2/2]

AttachmentPoint & kanzi::Framebuffer::AttachmentPoint::operator= ( const AttachmentPoint & )
delete

◆ getSampleCount()

size_t kanzi::Framebuffer::AttachmentPoint::getSampleCount ( ) const

Gets the sample count of the attachment.

Returns
Attachment sample count.
Since
Kanzi 4.0.0

◆ getFormat()

GraphicsFormat kanzi::Framebuffer::AttachmentPoint::getFormat ( ) const

Gets the format of the attachment.

Returns
Attachment format.
Since
Kanzi 4.0.0

◆ getWidth()

size_t kanzi::Framebuffer::AttachmentPoint::getWidth ( ) const

Gets the width of the attachment.

Returns
Attachment width.
Since
Kanzi 4.0.0

◆ getHeight()

size_t kanzi::Framebuffer::AttachmentPoint::getHeight ( ) const

Gets the height of the attachment.

Returns
Attachment height.
Since
Kanzi 4.0.0

◆ isTransient()

bool kanzi::Framebuffer::AttachmentPoint::isTransient ( ) const

Indicates whether or not the attachment point is transient.

Returns
If the attachment point data is transient true, false otherwise.
Since
Kanzi 4.0.0

◆ empty()

bool kanzi::Framebuffer::AttachmentPoint::empty ( ) const
inline

Indicates whether the attachment point is empty.

Returns
If the attachment point is empty true, false otherwise.
Since
Kanzi 4.0.0

◆ hasRenderbufferContainer()

bool kanzi::Framebuffer::AttachmentPoint::hasRenderbufferContainer ( ) const
inline

Indicates whether this attachment point holds a renderbuffer container.

Returns
If the storage contains a renderbuffer container true, false otherwise.
Since
Kanzi 4.0.0

◆ hasWeakRenderbuffer()

bool kanzi::Framebuffer::AttachmentPoint::hasWeakRenderbuffer ( ) const
inline

Indicates whether this attachment point holds a weak renderbuffer.

Returns
If the storage contains a weak renderbuffer true, false otherwise.
Since
Kanzi 4.0.0

◆ hasTextureContainer()

bool kanzi::Framebuffer::AttachmentPoint::hasTextureContainer ( ) const
inline

Indicates whether this attachment point holds a texture container.

Returns
If the storage contains a texture container true, false otherwise.
Since
Kanzi 4.0.0

◆ getRenderbufferContainer() [1/2]

RenderbufferContainer * kanzi::Framebuffer::AttachmentPoint::getRenderbufferContainer ( )
inline

Gets the referenced renderbuffer container.

Returns
Renderbuffer container. May be nullptr.
Since
Kanzi 4.0.0

◆ getRenderbufferContainer() [2/2]

const RenderbufferContainer * kanzi::Framebuffer::AttachmentPoint::getRenderbufferContainer ( ) const
inline

Gets the referenced renderbuffer container (const version).

Returns
Renderbuffer container. May be nullptr.
Since
Kanzi 4.0.0

◆ getWeakRenderbuffer()

RenderbufferWeakPtr kanzi::Framebuffer::AttachmentPoint::getWeakRenderbuffer ( ) const
inline

Gets the renderbuffer at the attachment point.

Returns
Renderbuffer owned by the attachment point or nullptr.
Since
Kanzi 4.0.0

◆ getTextureContainer() [1/2]

TextureContainer * kanzi::Framebuffer::AttachmentPoint::getTextureContainer ( )
inline

Gets the texture container.

Returns
Texture container. May be nullptr.
Since
Kanzi 4.0.0

◆ getTextureContainer() [2/2]

const TextureContainer * kanzi::Framebuffer::AttachmentPoint::getTextureContainer ( ) const
inline

Gets the texture container (const version).

Returns
Texture container. May be nullptr.
Since
Kanzi 4.0.0

◆ getAnyRenderbuffer()

RenderbufferSharedPtr kanzi::Framebuffer::AttachmentPoint::getAnyRenderbuffer ( ) const
inline

Gets a strong reference to any renderbuffer in this container.

Returns
Shared reference from a weak reference or the renderbuffer owned by the attachment point. nullptr otherwise.
Since
Kanzi 4.0.0

◆ getSharedTexture()

TextureSharedPtr kanzi::Framebuffer::AttachmentPoint::getSharedTexture ( ) const
inline

Gets a strong reference to any texture in this container.

Returns
Shared reference from a weak texture reference. nullptr otherwise.

◆ setRenderbufferCreateInfo()

bool kanzi::Framebuffer::AttachmentPoint::setRenderbufferCreateInfo ( const Renderbuffer::CreateInfo & createInfo,
string_view name )
inline

Sets the renderbuffer create information.

Parameters
createInfoCreate info structure to set.
nameName of the renderbuffer.
Returns
If the set operation had an effect and the attachment point is dirty true, false otherwise.
Since
Kanzi 4.0.0

◆ setRenderbuffer()

bool kanzi::Framebuffer::AttachmentPoint::setRenderbuffer ( const RenderbufferSharedPtr & renderbuffer)
inline

Sets attached renderbuffer.

Parameters
renderbufferRenderbuffer to set.
Returns
If the set operation had an effect and the attachment point is dirty true, false otherwise.
Since
Kanzi 4.0.0

◆ setTexture()

bool kanzi::Framebuffer::AttachmentPoint::setTexture ( const TextureSharedPtr & texture,
size_t faceIndex,
size_t mipmapLevel )
inline

Sets attached texture.

Parameters
textureTexture to set.
faceIndexAttachment face index.
mipmapLevelMipmap level
Returns
If the set operation had an effect and the attachment point is dirty true, false otherwise.
Since
Kanzi 4.0.0

◆ getGPUMemoryUsage()

size_t kanzi::Framebuffer::AttachmentPoint::getGPUMemoryUsage ( ) const
inline

Gets the GPU memory usage for this renderbuffer.

This function will not return the GPU memory usage of weakly referenced textures.

Returns
GPU memory usage in bytes.
Since
Kanzi 4.0.0

◆ update()

bool kanzi::Framebuffer::AttachmentPoint::update ( Renderer & renderer)
inline

Update the attachment point contents.

Only has effect on allocated renderbuffers. Owners of weak references handle updating themselves.

Returns
If the contained renderbuffer was updated in any way true, false otherwise.
Since
Kanzi 4.0.0 removed texture and renderbuffer parameters, added renderer parameter.

◆ operator bool()

kanzi::Framebuffer::AttachmentPoint::operator bool ( ) const
inline

Bool operator.

Wraps the validity check.

Since
Kanzi 4.0.0

Member Data Documentation

◆ m_storage

storage_type kanzi::Framebuffer::AttachmentPoint::m_storage
protected

Internal storage for the attachment.

Since
Kanzi 4.0.0

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