Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoConversion Class Reference

VSG extension Type conversion functions for buffers More...

#include <Inventor/algorithms/SoConversion.h>

Public Member Functions

 SoConversion ()
 SoConversion constructor.
 
virtual int convert (SoBufferObject *sourceBufferObject, const SbDataType src_type, SoBufferObject *targetBufferObject, const SbDataType dst_type, const size_t size)
 Convert the data in a buffer object from one data type to another one.
 
int convert (SoCpuBufferObject *sourceBufferObject, const SbDataType src_type, SoCpuBufferObject *targetBufferObject, const SbDataType dst_type, const size_t size)
 Convert the data in a buffer object from one data type to another one.
 
virtual int convertFloatToRGBA (SoBufferObject *sourceBufferObject, SoBufferObject *targetBufferObject, const size_t size, const float dataMin, const float dataMax)
 Convert FLOAT data stored in a buffer to (grayscale) RGBA data.
 
int convertFloatToRGBA (SoCpuBufferObject *sourceBufferObject, SoCpuBufferObject *targetBufferObject, const size_t size, const float dataMin, const float dataMax)
 Convert FLOAT data stored in a buffer to RGBA data.
 

Detailed Description

VSG extension Type conversion functions for buffers

This module provides data type conversions, like bytes to floats...

Examples:

SEE ALSO

SoAlgorithms, SoArithmetic, SoConvolution, SoDataExtract, SoSeismic

Definition at line 65 of file SoConversion.h.

Constructor & Destructor Documentation

◆ SoConversion()

SoConversion::SoConversion ( )

SoConversion constructor.

Member Function Documentation

◆ convert() [1/2]

virtual int SoConversion::convert ( SoBufferObject sourceBufferObject,
const SbDataType  src_type,
SoBufferObject targetBufferObject,
const SbDataType  dst_type,
const size_t  size 
)
virtual

Convert the data in a buffer object from one data type to another one.


Notes: The destination buffer and the source buffers can be same.

Limitations: This function only supports FLOAT and UNSIGNED_BYTE for dst_type.

Parameters
sourceBufferObjectThe source buffer object.
src_typeThe type of the data in the source buffer object.
targetBufferObjectThe destination buffer object.
dst_typeThe destination type.
sizeThe number of elements in the source buffer object to convert.
Returns
Returns 0 if there were no errors during the process. Returns 1 if one or more buffers don't have the correct size.

◆ convert() [2/2]

int SoConversion::convert ( SoCpuBufferObject sourceBufferObject,
const SbDataType  src_type,
SoCpuBufferObject targetBufferObject,
const SbDataType  dst_type,
const size_t  size 
)

Convert the data in a buffer object from one data type to another one.


Fast implementation for CPU buffers.

◆ convertFloatToRGBA() [1/2]

virtual int SoConversion::convertFloatToRGBA ( SoBufferObject sourceBufferObject,
SoBufferObject targetBufferObject,
const size_t  size,
const float  dataMin,
const float  dataMax 
)
virtual

Convert FLOAT data stored in a buffer to (grayscale) RGBA data.

  • The source and the target buffers can be the same.
  • The algorithm maps float values between dataMin and dataMax to the range 0..255.
  • The resulting values are clamped to 0..255.
Parameters
sourceBufferObjectThe source buffer object containing the FLOAT data.
targetBufferObjectThe target buffer object.
sizeThe number of FLOAT values to convert.
dataMinThe minimum value for the greyscale conversion.
dataMaxThe maximum value for the greyscale conversion.
Returns
Returns 0 if there were no errors during the process. Returns 1 if one or more buffers don't have the correct size.

◆ convertFloatToRGBA() [2/2]

int SoConversion::convertFloatToRGBA ( SoCpuBufferObject sourceBufferObject,
SoCpuBufferObject targetBufferObject,
const size_t  size,
const float  dataMin,
const float  dataMax 
)

Convert FLOAT data stored in a buffer to RGBA data.

Fast implementation for CPU buffers.


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