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>
|
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...
|
|
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...
|
|
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...
|
|
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...
|
|
StatusObject & | operator= (const StatusObject &other)=delete |
| Deleted copy assignment. More...
|
|
|
class Texture2DBufferImpl & | impl |
|
class SceneObjectImpl & | impl |
|
class ClientObjectImpl & | impl |
|
class RamsesObjectImpl & | impl |
|
class StatusObjectImpl & | impl |
|
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.
◆ Texture2DBuffer()
ramses::Texture2DBuffer::Texture2DBuffer |
( |
Texture2DBufferImpl & |
pimpl | ) |
|
|
explicitprotected |
◆ ~Texture2DBuffer()
virtual ramses::Texture2DBuffer::~Texture2DBuffer |
( |
| ) |
|
|
protectedvirtual |
◆ getMipLevelCount()
uint32_t ramses::Texture2DBuffer::getMipLevelCount |
( |
| ) |
const |
◆ 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] | mipLevel | The mipMap level of which the data will be returned |
[out] | buffer | The buffer where the mip data will be copied into |
[in] | bufferSize | The 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] | mipLevel | The 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] | mipLevel | The mipMap level of which the size will be returned |
[out] | widthOut | the width of the mipMap level which was specified |
[out] | heightOut | the 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()
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
-
mipLevel | The level of the mipMap level which will receive the data. First mipMap is 0, second is 1 and so on |
offsetX | The horizontal texel offset into the texture data |
offsetY | The vertical texel offset into the texture data |
width | The horizontal subregion size in texels |
height | The vertical subregion size in texels |
data | Pointer 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.
◆ SceneImpl
◆ impl
class Texture2DBufferImpl& ramses::Texture2DBuffer::impl |
The documentation for this class was generated from the following file:
- /home/runner/work/ramses/ramses/client/ramses-client/ramses-client-api/include/ramses-client-api/Texture2DBuffer.h