Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbImageDataVoxel Class Reference

ImageViz 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 SbImageDataVoxeloperator= (const SbImageDataVoxel &right)
 Copy operator.
 
const SbImageDataTypegetImageDataType () 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
 

Detailed Description

ImageViz 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.

SEE ALSO

SoImageDataAdapter, SbImageDataAccessor

Definition at line 46 of file SbImageDataVoxel.h.

Constructor & Destructor Documentation

◆ SbImageDataVoxel() [1/2]

SbImageDataVoxel::SbImageDataVoxel ( const SbImageDataType channelType,
SoBufferObject buffer,
size_t  offset 
)
Parameters
channelTypeType of channel (number of channel + data type)
buffermain buffer containing data. Use to keep data alive and ensure they wont be deleted elsewhere.
offsetoffset in byte to beginning of channel inside buffer.

◆ ~SbImageDataVoxel()

SbImageDataVoxel::~SbImageDataVoxel ( )

Unmap buffer.

◆ SbImageDataVoxel() [2/2]

SbImageDataVoxel::SbImageDataVoxel ( const SbImageDataVoxel )

Copy constructor.

Member Function Documentation

◆ castValue()

template<typename TypeOut >
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.

◆ getImageDataType()

const SbImageDataType & SbImageDataVoxel::getImageDataType ( ) const
inline

Return channel type.

Definition at line 65 of file SbImageDataVoxel.h.

◆ getValue() [1/2]

template<typename TypeOut >
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.

◆ getValue() [2/2]

template<typename TypeOut >
const TypeOut & SbImageDataVoxel::getValue ( size_t  channelIndex) const

Definition at line 132 of file SbImageDataVoxel.h.

◆ operator=()

const SbImageDataVoxel & SbImageDataVoxel::operator= ( const SbImageDataVoxel right)

Copy operator.


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