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 () | |
| Unmap buffer. | |
| SbImageDataVoxel (const SbImageDataVoxel &) | |
| Copy constructor. | |
| const SbImageDataVoxel & | operator= (const SbImageDataVoxel &right) |
| Copy operator. | |
| const SbImageDataType & | getImageDataType () const |
| Return channel type. | |
| template<typename TypeOut > | |
| TypeOut | castValue (size_t channelIndex) const |
| Return value casted to the proper type. | |
| template<typename TypeOut > | |
| TypeOut & | getValue (size_t channelIndex) |
| Return reference to values. | |
| template<typename TypeOut > | |
| const TypeOut & | getValue (size_t channelIndex) const |
Utility class used to safely access channels of a buffer.
Utility class used to safely access channels of a buffer. The bufferObject is mapped in the constructor and unmapped in the destructor.
SoImageDataAdapter, SbImageDataAccessor
Definition at line 46 of file SbImageDataVoxel.h.
| 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 |
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().
Definition at line 107 of file SbImageDataVoxel.h.
|
inline |
Return channel type.
Definition at line 65 of file SbImageDataVoxel.h.
| TypeOut & SbImageDataVoxel::getValue | ( | size_t | channelIndex | ) |
Return reference to values.
Throw exception if wrong type is specified. Throw exception if channelIndex >= getImageDataType().getNumChannel().
Definition at line 149 of file SbImageDataVoxel.h.
| const TypeOut & SbImageDataVoxel::getValue | ( | size_t | channelIndex | ) | const |
Definition at line 132 of file SbImageDataVoxel.h.
| const SbImageDataVoxel & SbImageDataVoxel::operator= | ( | const SbImageDataVoxel & | right | ) |
Copy operator.