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. | |
Arithmetic functions for buffers
The Arithmetic module provides basic Add, Multiply, etc functions that operate on buffers.
Examples:
SoAlgorithms, SoConversion, SoConvolution, SoDataExtract, SoSeismic
Definition at line 48 of file SoArithmetic.h.
SoArithmetic::SoArithmetic | ( | ) |
Constructor.
|
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.
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 |
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:
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 |
Compute min max of all values contained in a buffer.
inputBuffer | The source buffer object. |
dataType | The type of the data in the source buffer object. |
min,max | Result values |
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 |
Compute min max of all values contained in a buffer that are not equal to the specified undefined value.
inputBuffer | The source buffer object. |
dataType | The type of the data in the source buffer object. |
undefinedValue | ignored value |
min,max | Result values |
|
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:
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 |
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 |
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 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 |
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
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 |
B = A * scaleFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.
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 |
B = A + shiftFactor
Note: B can be a reference to A
Limitation: typeA must be the same as typeC.
int SoArithmetic::shift | ( | SoCpuBufferObject * | inputBufferA, |
const SbDataType | typeA, | ||
SoCpuBufferObject * | outputBufferB, | ||
const SbDataType | typeB, | ||
const float | shiftFactor | ||
) |
B = A + shiftFactor
Fast version for Cpu buffers.