Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoArithmetic Class Reference

VSG extension Arithmetic functions for buffers More...

#include <Inventor/algorithms/SoArithmetic.h>

Public Member Functions

 SoArithmetic ()
 Constructor.
 
virtual int add (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
 Add two buffers into a third one.
 
int add (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
 Add two buffers into a third one.
 
virtual int mult (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
 Multiply two buffers into a third one.
 
int mult (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
 Multiply two buffers into a third one.
 
virtual int scale (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
 B = A * scaleFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.
 
int scale (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
 B = A * scaleFactor
Fast version for Cpu buffers.
 
virtual int shift (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
 B = A + shiftFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.
 
int shift (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
 B = A + shiftFactor
Fast version for Cpu buffers.
 
virtual int madd (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
 C = A * scale + B
Note: C can be a reference to A or B
Limitation: typeA and typeB must be the same as typeC.
 
int madd (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
 C = A * scale + B
Fast version for Cpu buffers.
 
virtual void computeMinMax (SoBufferObject *inputBuffer, const SbDataType dataType, double &min, double &max)
 Compute min max of all values contained in a buffer.
 
virtual void computeMinMax (SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
 Compute min max of values contained in the specified range of the buffer.
 
void computeMinMax (SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
 Compute min max of values contained in the specified range of the buffer.
 
virtual void computeMinMaxWithUndefinedValue (SoBufferObject *inputBuffer, const SbDataType dataType, const double undefinedValue, double &min, double &max)
 Compute min max of all values contained in a buffer that are not equal to the specified undefined value.
 
virtual void computeMinMaxWithUndefinedValue (SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)
 Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.
 
void computeMinMaxWithUndefinedValue (SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)
 Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.
 

Detailed Description

VSG extension Arithmetic functions for buffers

The Arithmetic module provides basic Add, Multiply, etc functions that operate on buffers.

Examples:

SEE ALSO

SoAlgorithms, SoConversion, SoConvolution, SoDataExtract, SoSeismic

Definition at line 48 of file SoArithmetic.h.

Constructor & Destructor Documentation

◆ SoArithmetic()

SoArithmetic::SoArithmetic ( )

Constructor.

Member Function Documentation

◆ add() [1/2]

virtual int SoArithmetic::add ( SoBufferObject inputBufferA,
const SbDataType  typeA,
SoBufferObject inputBufferB,
const SbDataType  typeB,
SoBufferObject outputBufferC,
const SbDataType  typeC 
)
virtual

Add two buffers into a third one.


C = A + B
Note: C can be a reference to A or B.
Limitation: typeA and typeB must be the same as typeC.

◆ add() [2/2]

int SoArithmetic::add ( SoCpuBufferObject inputBufferA,
const SbDataType  typeA,
SoCpuBufferObject inputBufferB,
const SbDataType  typeB,
SoCpuBufferObject outputBufferC,
const SbDataType  typeC 
)

Add two buffers into a third one.


Fast version for Cpu buffers.

◆ computeMinMax() [1/3]

virtual void SoArithmetic::computeMinMax ( SoBufferObject inputBuffer,
const SbDataType  dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
double &  min,
double &  max 
)
virtual

Compute min max of values contained in the specified range of the buffer.



Assumes the buffer contains a 3D array of values. However 1D and 2D arrays can be handled as degenerate cases. For example, to use a 1D array of length N and compute over the range I to J:

  • Set arrayDim = N,1,1 (do not use 0 for any dimension)
  • Set range = I,0,0,J,1,1 (be sure min and max for each axis are not the same)
Parameters
inputBufferThe source buffer object.
dataTypeThe type of the data in the source buffer object.
arrayDimDimensions of the array (can be degenerate, e.g. N,1,1)
rangeSubset of the array to consider
min,maxResult values

◆ computeMinMax() [2/3]

virtual void SoArithmetic::computeMinMax ( SoBufferObject inputBuffer,
const SbDataType  dataType,
double &  min,
double &  max 
)
virtual

Compute min max of all values contained in a buffer.


Parameters
inputBufferThe source buffer object.
dataTypeThe type of the data in the source buffer object.
min,maxResult values

◆ computeMinMax() [3/3]

void SoArithmetic::computeMinMax ( SoCpuBufferObject inputBuffer,
const SbDataType  dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
double &  min,
double &  max 
)

Compute min max of values contained in the specified range of the buffer.


Fast version for Cpu buffers.

◆ computeMinMaxWithUndefinedValue() [1/3]

virtual void SoArithmetic::computeMinMaxWithUndefinedValue ( SoBufferObject inputBuffer,
const SbDataType  dataType,
const double  undefinedValue,
double &  min,
double &  max 
)
virtual

Compute min max of all values contained in a buffer that are not equal to the specified undefined value.


Parameters
inputBufferThe source buffer object.
dataTypeThe type of the data in the source buffer object.
undefinedValueignored value
min,maxResult values

◆ computeMinMaxWithUndefinedValue() [2/3]

virtual void SoArithmetic::computeMinMaxWithUndefinedValue ( SoBufferObject inputBuffer,
const SbDataType  dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
const double  undefinedValue,
double &  min,
double &  max 
)
virtual

Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.



Assumes the buffer contains a 3D array of values. However 1D and 2D arrays can be handled as degenerate cases. For example, to use a 1D array of length N and compute over the range I to J:

  • Set arrayDim = N,1,1 (do not use 0 for any dimension)
  • Set range = I,0,0,J,1,1 (be sure min and max for each axis are not the same)
Parameters
inputBufferThe source buffer object.
dataTypeThe type of the data in the source buffer object.
arrayDimDimensions of the array (can be degenerate, e.g. N,1,1)
rangeSubset of the array to consider
undefinedValueignored value
min,maxResult values

◆ computeMinMaxWithUndefinedValue() [3/3]

void SoArithmetic::computeMinMaxWithUndefinedValue ( SoCpuBufferObject inputBuffer,
const SbDataType  dataType,
const SbVec3i32 arrayDim,
const SbBox3i32 range,
const double  undefinedValue,
double &  min,
double &  max 
)

Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.


Fast version for Cpu buffers.

◆ madd() [1/2]

virtual int SoArithmetic::madd ( SoBufferObject inputBufferA,
const SbDataType  typeA,
SoBufferObject inputBufferB,
const SbDataType  typeB,
SoBufferObject outputBufferC,
const SbDataType  typeC,
const float  scaleValue 
)
virtual

C = A * scale + B
Note: C can be a reference to A or B
Limitation: typeA and typeB must be the same as typeC.

◆ madd() [2/2]

int SoArithmetic::madd ( SoCpuBufferObject inputBufferA,
const SbDataType  typeA,
SoCpuBufferObject inputBufferB,
const SbDataType  typeB,
SoCpuBufferObject outputBufferC,
const SbDataType  typeC,
const float  scaleValue 
)

C = A * scale + B
Fast version for Cpu buffers.

◆ mult() [1/2]

virtual int SoArithmetic::mult ( SoBufferObject inputBufferA,
const SbDataType  typeA,
SoBufferObject inputBufferB,
const SbDataType  typeB,
SoBufferObject outputBufferC,
const SbDataType  typeC 
)
virtual

Multiply two buffers into a third one.


C = A * B Note: C can be a reference to A or B
Limitation: typeA and typeB must be the same as typeC

◆ mult() [2/2]

int SoArithmetic::mult ( SoCpuBufferObject inputBufferA,
const SbDataType  typeA,
SoCpuBufferObject inputBufferB,
const SbDataType  typeB,
SoCpuBufferObject outputBufferC,
const SbDataType  typeC 
)

Multiply two buffers into a third one.


Fast version for Cpu buffers.

◆ scale() [1/2]

virtual int SoArithmetic::scale ( SoBufferObject inputBufferA,
const SbDataType  typeA,
SoBufferObject outputBufferB,
const SbDataType  typeB,
const float  scaleValue 
)
virtual

B = A * scaleFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.

◆ scale() [2/2]

int SoArithmetic::scale ( SoCpuBufferObject inputBufferA,
const SbDataType  typeA,
SoCpuBufferObject outputBufferB,
const SbDataType  typeB,
const float  scaleValue 
)

B = A * scaleFactor
Fast version for Cpu buffers.

◆ shift() [1/2]

virtual int SoArithmetic::shift ( SoBufferObject inputBufferA,
const SbDataType  typeA,
SoBufferObject outputBufferB,
const SbDataType  typeB,
const float  shiftFactor 
)
virtual

B = A + shiftFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.

◆ shift() [2/2]

int SoArithmetic::shift ( SoCpuBufferObject inputBufferA,
const SbDataType  typeA,
SoCpuBufferObject outputBufferB,
const SbDataType  typeB,
const float  shiftFactor 
)

B = A + shiftFactor
Fast version for Cpu buffers.


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