Utility class used to safely access channels of a buffer. More...
#include <ImageViz/SbImageDataVoxel.h>
Public Member Functions | |
SbImageDataVoxel (const SbImageDataType &channelType, SoBufferObject *buffer, size_t offset) | |
~SbImageDataVoxel () | |
SbImageDataVoxel (const SbImageDataVoxel &) | |
const SbImageDataVoxel & | operator= (const SbImageDataVoxel &right) |
const SbImageDataType & | getImageDataType () const |
template<typename TypeOut > | |
TypeOut | castValue (size_t channelIndex) const |
template<typename TypeOut > | |
TypeOut & | getValue (size_t channelIndex) |
template<typename TypeOut > | |
const TypeOut & | getValue (size_t channelIndex) const |
Utility class used to safely access channels of a buffer. The bufferObject is mapped in the constructor and unmapped in the destructor.
SoImageDataAdapter, SbImageDataAccessor
SbImageDataVoxel::SbImageDataVoxel | ( | const SbImageDataType & | channelType, | |
SoBufferObject * | buffer, | |||
size_t | offset | |||
) |
channelType | Type of channel (number of channel + data type) | |
buffer | main buffer containing data. Use to keep data alive and ensure they wont be deleted elsewhere. | |
offset | offset in byte to beginning of channel inside buffer. |
SbImageDataVoxel::~SbImageDataVoxel | ( | ) |
Unmap buffer.
SbImageDataVoxel::SbImageDataVoxel | ( | const SbImageDataVoxel & | ) |
Copy constructor.
TypeOut SbImageDataVoxel::castValue | ( | size_t | channelIndex | ) | const [inline] |
Return value casted to the proper type.
Return a copy and not a reference because data may be int and you may want to cast to float. Throw exception if channelIndex >= getImageDataType().getNumChannel().
const SbImageDataType& SbImageDataVoxel::getImageDataType | ( | ) | const [inline] |
Return channel type.
const TypeOut & SbImageDataVoxel::getValue | ( | size_t | channelIndex | ) | const [inline] |
TypeOut & SbImageDataVoxel::getValue | ( | size_t | channelIndex | ) | [inline] |
Return reference to values.
Throw exception if wrong type is specified. Throw exception if channelIndex >= getImageDataType().getNumChannel().
const SbImageDataVoxel& SbImageDataVoxel::operator= | ( | const SbImageDataVoxel & | right | ) |
Copy operator.