RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
ramses::Texture2DBuffer Class Reference

The Texture2DBuffer is a mutable texture buffer used to hold texture data with the possibility to perform partial updates. This object must be initialized with data, otherwise the contents of it are not specified (garbage data or black, depending on driver behavior). The number of mipmap levels is user given value and the size of the mipchain is computed according to OpenGL specification (each further mipMap level has half the size of the previous mipMap level). Refer to documentation of glTexStorage2D for more details. More...

#include <Texture2DBuffer.h>

Inheritance diagram for ramses::Texture2DBuffer:
[legend]
Collaboration diagram for ramses::Texture2DBuffer:
[legend]

Public Member Functions

status_t updateData (uint32_t mipLevel, uint32_t offsetX, uint32_t offsetY, uint32_t width, uint32_t height, const void *data)
 Update a subregion of the data of Texture2DBuffer. The caller is responsible to check that the data has the correct size, i.e. the size of a texel times the number of texels specified in the subregion of the texture face. Returns error if the specified subregion exceeds the size of the target mipmap level. More...
 
uint32_t getMipLevelCount () const
 Returns the number of mipmap levels created for the Texture2DBuffer (same as provided in ramses::Scene::createTexture2DBuffer() ) More...
 
status_t getMipLevelSize (uint32_t mipLevel, uint32_t &widthOut, uint32_t &heightOut) const
 Returns the size of a specific mipmap level in texels. More...
 
uint32_t getMipLevelDataSizeInBytes (uint32_t mipLevel) const
 Returns the size of a specific mipmap level in bytes. More...
 
ETextureFormat getTexelFormat () const
 Returns the texel format provided at creation. More...
 
status_t getMipLevelData (uint32_t mipLevel, void *buffer, uint32_t bufferSize) const
 Copies the data of a single mip-level into a user-provided buffer. The amount of data copied is bufferSize or getMipLevelDataSizeInBytes, whichever is smaller. More...
 
- Public Member Functions inherited from ramses::SceneObject
sceneObjectId_t getSceneObjectId () const
 Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene. More...
 
sceneId_t getSceneId () const
 Returns sceneid to which this object belongs to. More...
 
- Public Member Functions inherited from ramses::RamsesObject
const char * getName () const
 Returns the name of the object. More...
 
status_t setName (const char *name)
 Changes the name of the object. More...
 
ERamsesObjectType getType () const
 Gets type of the object. More...
 
bool isOfType (ERamsesObjectType type) const
 Checks if the object is of given type. More...
 
- Public Member Functions inherited from ramses::StatusObject
status_t validate () const
 Generates verbose validation of the object. More...
 
const char * getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const
 Provides verbose report in human readable form generated by validate. More...
 
const char * getStatusMessage (status_t status) const
 Get the string description for a status provided by a RAMSES API function. More...
 
 StatusObject (const StatusObject &other)=delete
 Deleted copy constructor. More...
 
StatusObjectoperator= (const StatusObject &other)=delete
 Deleted copy assignment. More...
 

Public Attributes

class Texture2DBufferImpl & impl
 
- Public Attributes inherited from ramses::SceneObject
class SceneObjectImpl & impl
 
- Public Attributes inherited from ramses::ClientObject
class ClientObjectImpl & impl
 
- Public Attributes inherited from ramses::RamsesObject
class RamsesObjectImpl & impl
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Protected Member Functions

 Texture2DBuffer (Texture2DBufferImpl &pimpl)
 Constructor for Texture2DBuffer. More...
 
virtual ~Texture2DBuffer ()
 Destructor of the Texture2DBuffer. More...
 
- Protected Member Functions inherited from ramses::SceneObject
 SceneObject (SceneObjectImpl &pimpl)
 Constructor for SceneObject. More...
 
virtual ~SceneObject ()
 Destructor of the SceneObject. More...
 
- Protected Member Functions inherited from ramses::ClientObject
 ClientObject (ClientObjectImpl &pimpl)
 Constructor for ClientObject. More...
 
virtual ~ClientObject ()
 Destructor of the ClientObject. More...
 
- Protected Member Functions inherited from ramses::RamsesObject
 RamsesObject (RamsesObjectImpl &pimpl)
 Constructor for RamsesObject. More...
 
virtual ~RamsesObject ()
 Destructor of the RamsesObject. More...
 
- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Friends

class SceneImpl
 Scene is the factory for creating Texture2DBuffer instances. More...
 

Detailed Description

The Texture2DBuffer is a mutable texture buffer used to hold texture data with the possibility to perform partial updates. This object must be initialized with data, otherwise the contents of it are not specified (garbage data or black, depending on driver behavior). The number of mipmap levels is user given value and the size of the mipchain is computed according to OpenGL specification (each further mipMap level has half the size of the previous mipMap level). Refer to documentation of glTexStorage2D for more details.

Examples
ramses-example-data-buffers-texture/src/main.cpp.

Constructor & Destructor Documentation

◆ Texture2DBuffer()

ramses::Texture2DBuffer::Texture2DBuffer ( Texture2DBufferImpl &  pimpl)
explicitprotected

Constructor for Texture2DBuffer.

Parameters
[in]pimplInternal data for implementation specifics of Texture2DBuffer (sink - instance becomes owner)

◆ ~Texture2DBuffer()

virtual ramses::Texture2DBuffer::~Texture2DBuffer ( )
protectedvirtual

Destructor of the Texture2DBuffer.

Member Function Documentation

◆ getMipLevelCount()

uint32_t ramses::Texture2DBuffer::getMipLevelCount ( ) const

Returns the number of mipmap levels created for the Texture2DBuffer (same as provided in ramses::Scene::createTexture2DBuffer() )

Returns
number of mipmap levels

◆ getMipLevelData()

status_t ramses::Texture2DBuffer::getMipLevelData ( uint32_t  mipLevel,
void *  buffer,
uint32_t  bufferSize 
) const

Copies the data of a single mip-level into a user-provided buffer. The amount of data copied is bufferSize or getMipLevelDataSizeInBytes, whichever is smaller.

Parameters
[in]mipLevelThe mipMap level of which the data will be returned
[out]bufferThe buffer where the mip data will be copied into
[in]bufferSizeThe size of given buffer in bytes
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getMipLevelDataSizeInBytes()

uint32_t ramses::Texture2DBuffer::getMipLevelDataSizeInBytes ( uint32_t  mipLevel) const

Returns the size of a specific mipmap level in bytes.

Parameters
[in]mipLevelThe mipMap level of which the size will be returned
Returns
Size of data in bytes for given mip level, 0 if mipLevel invalid

◆ getMipLevelSize()

status_t ramses::Texture2DBuffer::getMipLevelSize ( uint32_t  mipLevel,
uint32_t &  widthOut,
uint32_t &  heightOut 
) const

Returns the size of a specific mipmap level in texels.

Parameters
[in]mipLevelThe mipMap level of which the size will be returned
[out]widthOutthe width of the mipMap level which was specified
[out]heightOutthe height of the mipMap level which was specified
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ getTexelFormat()

ETextureFormat ramses::Texture2DBuffer::getTexelFormat ( ) const

Returns the texel format provided at creation.

Returns
The texel format provided at creation

◆ updateData()

status_t ramses::Texture2DBuffer::updateData ( uint32_t  mipLevel,
uint32_t  offsetX,
uint32_t  offsetY,
uint32_t  width,
uint32_t  height,
const void *  data 
)

Update a subregion of the data of Texture2DBuffer. The caller is responsible to check that the data has the correct size, i.e. the size of a texel times the number of texels specified in the subregion of the texture face. Returns error if the specified subregion exceeds the size of the target mipmap level.

Parameters
mipLevelThe level of the mipMap level which will receive the data. First mipMap is 0, second is 1 and so on
offsetXThe horizontal texel offset into the texture data
offsetYThe vertical texel offset into the texture data
widthThe horizontal subregion size in texels
heightThe vertical subregion size in texels
dataPointer in memory to the data provided for update. The function makes a copy of the data into Texture2DBuffer data structures. Texture2DBuffer object does not take ownership of the memory data passed to it.
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().
Examples
ramses-example-data-buffers-texture/src/main.cpp.

Friends And Related Function Documentation

◆ SceneImpl

friend class SceneImpl
friend

Scene is the factory for creating Texture2DBuffer instances.

Member Data Documentation

◆ impl

class Texture2DBufferImpl& ramses::Texture2DBuffer::impl

Stores internal data for implementation specifics of Texture2DBuffer.


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