LDM buffer object optimized for compressed tile data. More...
#include <LDM/tiles/SoCpuBufferCompressed.h>
Public Member Functions | |
SoCpuBufferCompressed () | |
SoCpuBufferCompressed (SoDataCompressor *compressor) | |
virtual void | map (SoBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void | map (SoCpuBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void | map (SoGLBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void * | map (AccessMode accessMode) |
virtual void | unmap (SoCpuBufferObject *bufferObject) |
virtual void | unmap (SoGLBufferObject *bufferObject) |
virtual void | unmap (SoBufferObject *bufferObject) |
virtual void | unmap () |
virtual bool | getMinMax (double &min, double &max) |
virtual void | setMinMax (const double &min, const double &max) |
size_t | getRealSize () const |
virtual void | setCompressor (SoDataCompressor *compressor) |
virtual bool | setSize (size_t size) |
This type of buffer efficiently represents a tile containing compressed data (usually read from a compressed LDM file). The buffer can be used like any other buffer, but uses much less memory when its contents are not actually being accessed.
SoBufferPropertiesInterface, SoCpuBufferObject
SoCpuBufferCompressed::SoCpuBufferCompressed | ( | ) |
Default constructor.
SoCpuBufferCompressed::SoCpuBufferCompressed | ( | SoDataCompressor * | compressor | ) |
Constructor with compressor given as parameter.
virtual bool SoCpuBufferCompressed::getMinMax | ( | double & | min, | |
double & | max | |||
) | [virtual] |
Get the min and max values in the buffer, if they are known.
Returns false if these values have not been set or computed. Returns true if values are available.
min | user variable to store min value | |
max | user variable to store max value |
Implements SoBufferPropertiesInterface.
size_t SoCpuBufferCompressed::getRealSize | ( | ) | const [virtual] |
Returns the size of the uncompressed data in bytes.
Implements SoBufferPropertiesInterface.
virtual void* SoCpuBufferCompressed::map | ( | AccessMode | accessMode | ) | [virtual] |
Returns a pointer to the memory array used for the storage of the buffer.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::map | ( | SoGLBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified GL buffer object.
See the general map method for more information.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::map | ( | SoCpuBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified CPU buffer object.
See the general map method for more information.
Implements SoBufferObject.
virtual void SoCpuBufferCompressed::map | ( | SoBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified buffer object.
It is useful in order to use a buffer in multiple contexts (e.g. OpenGL and CUDA).
targetBufferObject | The buffer object which will be the mapped version of this buffer. | |
accessMode | The access mode used for the mapping. | |
startPosition | offset in source buffer to map from (default is start of buffer). | |
mappingSize | size from the startPosition, if SO_BUFFER_SIZE_ALL then the whole buffer is mapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::setCompressor | ( | SoDataCompressor * | compressor | ) | [virtual] |
Set the compressor used to decompress buffer.
compressor | Pointer to the compressor to use |
virtual void SoCpuBufferCompressed::setMinMax | ( | const double & | min, | |
const double & | max | |||
) | [virtual] |
Set the min and max values for this buffer.
min | user variable containing min value | |
max | user variable containing max value |
virtual bool SoCpuBufferCompressed::setSize | ( | size_t | size | ) | [virtual] |
Sets the size in bytes of the buffer object.
Return FALSE if allocation failed. TRUE otherwise
size | The size in bytes of the raw buffer object. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::unmap | ( | ) | [virtual] |
Unmap a mapped buffer.
No error is reported if the buffer was not mapped.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::unmap | ( | SoBufferObject * | bufferObject | ) | [virtual] |
Remove the specified bufferObject from the list of buffers which map the current buffer.
If the access mode supports writing the specified buffer is sync'd with the buffer.
bufferObject | Buffer to be unmapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::unmap | ( | SoGLBufferObject * | bufferObject | ) | [virtual] |
Unmap the specified GL buffer object
It is defined just to speed up the call when the type of the object is known.
If the access mode supports writing the specified buffer is sync'd with the buffer.
See the general unmap function for more information.
bufferObject | Buffer to be unmapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferCompressed::unmap | ( | SoCpuBufferObject * | bufferObject | ) | [virtual] |
Unmap the specified CPU buffer object
It is defined just to speed up the call when the type of the object is known.
Remove the specified bufferObject from the list of buffers which map the current buffer.
See the general unmap function for more information.
Implements SoBufferObject.