SoArithmetic Class Reference
[CPU algorithms]

VSG extension Arithmetic functions for buffers More...

#include <Inventor/algorithms/SoArithmetic.h>

Inheritance diagram for SoArithmetic:
SoCudaArithmetic SoOpenCLArithmetic

List of all members.

Public Member Functions

 SoArithmetic ()
virtual int add (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
int add (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
virtual int mult (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
int mult (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
virtual int scale (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
int scale (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
virtual int shift (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
int shift (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
virtual int madd (SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
int madd (SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
virtual void computeMinMax (SoBufferObject *inputBuffer, const SbDataType dataType, double &min, double &max)
virtual void computeMinMax (SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
void computeMinMax (SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
virtual void computeMinMaxWithUndefinedValue (SoBufferObject *inputBuffer, const SbDataType dataType, const double undefinedValue, double &min, double &max)
virtual void computeMinMaxWithUndefinedValue (SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)
void computeMinMaxWithUndefinedValue (SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)

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


Constructor & Destructor Documentation

SoArithmetic::SoArithmetic (  ) 

Constructor.


Member Function Documentation

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.

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.

Reimplemented in SoCudaArithmetic, and SoOpenCLArithmetic.

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.

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:
inputBuffer The source buffer object.
dataType The type of the data in the source buffer object.
arrayDim Dimensions of the array (can be degenerate, e.g. N,1,1)
range Subset of the array to consider
min,max Result values
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:
inputBuffer The source buffer object.
dataType The type of the data in the source buffer object.
min,max Result values
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.

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:
inputBuffer The source buffer object.
dataType The type of the data in the source buffer object.
arrayDim Dimensions of the array (can be degenerate, e.g. N,1,1)
range Subset of the array to consider
undefinedValue ignored value
min,max Result values
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:
inputBuffer The source buffer object.
dataType The type of the data in the source buffer object.
undefinedValue ignored value
min,max Result values
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.

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.

Reimplemented in SoCudaArithmetic, and SoOpenCLArithmetic.

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.

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

Reimplemented in SoCudaArithmetic, and SoOpenCLArithmetic.

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

B = A * scaleFactor
Fast version for Cpu buffers.

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.

Reimplemented in SoCudaArithmetic, and SoOpenCLArithmetic.

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

B = A + shiftFactor
Fast version for Cpu buffers.

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.

Reimplemented in SoCudaArithmetic, and SoOpenCLArithmetic.


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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/