Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoConvolution Class Reference

VSG extension Convolution functions for buffers More...

#include <Inventor/algorithms/SoConvolution.h>

Public Member Functions

 SoConvolution ()
 SoConvolution constructor.
 
virtual int doSeparateConvolution1D (SoBufferObject *sourceBufferObject, SoBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 This function performs a 1D convolution on a two dimensional buffer using a 1D kernel.
 
virtual int doSeparateConvolution2D (SoBufferObject *sourceBufferObject, SoBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 This function performs a 2D convolution on a two dimensional buffer using a 1D kernel.
 
virtual int doSeparateConvolutionRow (SoBufferObject *sourceBufferObject, SoBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 This function performs a row convolution on a two dimensional buffer using a 1D kernel.
 
virtual int doSeparateConvolutionColumn (SoBufferObject *sourceBufferObject, SoBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 This function performs a column convolution on a two dimensional buffe using a 1D kernel.
 
int doSeparateConvolution1D (SoCpuBufferObject *sourceBufferObject, SoCpuBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 Fast version for CPU buffers.
 
int doSeparateConvolution2D (SoCpuBufferObject *sourceBufferObject, SoCpuBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 Fast version for CPU buffers.
 
int doSeparateConvolutionRow (SoCpuBufferObject *sourceBufferObject, SoCpuBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 Fast version for CPU buffers.
 
int doSeparateConvolutionColumn (SoCpuBufferObject *sourceBufferObject, SoCpuBufferObject *targetBufferObject, float *kernelData, int kernelSize, int width, int height)
 Fast version for CPU buffers.
 

Detailed Description

VSG extension Convolution functions for buffers

This module provides functions to perform convolution on 2D buffers.

Examples:

SEE ALSO

SoAlgorithms, SoArithmetic, SoConversion, SoDataExtract, SoSeismic

Definition at line 50 of file SoConvolution.h.

Constructor & Destructor Documentation

◆ SoConvolution()

SoConvolution::SoConvolution ( )

SoConvolution constructor.

Member Function Documentation

◆ doSeparateConvolution1D() [1/2]

virtual int SoConvolution::doSeparateConvolution1D ( SoBufferObject sourceBufferObject,
SoBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)
virtual

This function performs a 1D convolution on a two dimensional buffer using a 1D kernel.

  • The data in the input buffer must contain floats.
  • The function puts float values in the output buffer.

This convolution is equivalent to a row convolution.

Parameters
sourceBufferObjectThe input float buffer.
targetBufferObjectThe output float buffer.
kernelDataThe kernel values.
kernelSizeThe kernel size.
widthThe width of the two dimensional buffer.
heightThe height of the two dimensional buffer.
Returns
Returns 0 if there is no error, 1 if one of the buffers is too small.

◆ doSeparateConvolution1D() [2/2]

int SoConvolution::doSeparateConvolution1D ( SoCpuBufferObject sourceBufferObject,
SoCpuBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)

Fast version for CPU buffers.


The general version maps the user buffers to CPU buffers and calls this function

◆ doSeparateConvolution2D() [1/2]

virtual int SoConvolution::doSeparateConvolution2D ( SoBufferObject sourceBufferObject,
SoBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)
virtual

This function performs a 2D convolution on a two dimensional buffer using a 1D kernel.

  • The data in the input buffer must contain floats.
  • The function puts float values in the output buffer.

The 2D convolution performs a row convolution followed by a column convolution using the same kernel for the two passes.

To do a 2D convolution with two different 1D kernels use the row/column methods doSeparateConvolutionRow() and doSeparateConvolutionColumn().

Parameters
sourceBufferObjectThe input float buffer.
targetBufferObjectThe output float buffer.
kernelDataThe kernel values.
kernelSizeThe kernel size.
widthThe width of the two dimensional buffer.
heightThe height of the two dimensional buffer.
Returns
Returns 0 if there is no error, 1 if one of the buffers is two small.

◆ doSeparateConvolution2D() [2/2]

int SoConvolution::doSeparateConvolution2D ( SoCpuBufferObject sourceBufferObject,
SoCpuBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)

Fast version for CPU buffers.


The general version maps the user buffers to CPU buffers and calls this function

◆ doSeparateConvolutionColumn() [1/2]

virtual int SoConvolution::doSeparateConvolutionColumn ( SoBufferObject sourceBufferObject,
SoBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)
virtual

This function performs a column convolution on a two dimensional buffe using a 1D kernel.

  • The data in the input buffer must contain floats.
  • The function puts float values in the output buffer.
Parameters
sourceBufferObjectThe input float buffer.
targetBufferObjectThe output float buffer.
kernelDataThe kernel values.
kernelSizeThe kernel size.
widthThe width of the two dimensional buffer.
heightThe height of the two dimensional buffer.
Returns
Returns 0 if there is no error, 1 if one of the buffers is two small.

◆ doSeparateConvolutionColumn() [2/2]

int SoConvolution::doSeparateConvolutionColumn ( SoCpuBufferObject sourceBufferObject,
SoCpuBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)

Fast version for CPU buffers.


The general version maps the user buffers to CPU buffers and calls this function

◆ doSeparateConvolutionRow() [1/2]

virtual int SoConvolution::doSeparateConvolutionRow ( SoBufferObject sourceBufferObject,
SoBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)
virtual

This function performs a row convolution on a two dimensional buffer using a 1D kernel.

  • The data in the input buffer must contain floats.
  • The function puts float values in the output buffer.
Parameters
sourceBufferObjectThe input float buffer.
targetBufferObjectThe output float buffer.
kernelDataThe kernel values.
kernelSizeThe kernel size.
widthThe width of the two dimensional buffer.
heightThe height of the two dimensional buffer.
Returns
Returns 0 if there is no error, 1 if one of the buffers is two small.

◆ doSeparateConvolutionRow() [2/2]

int SoConvolution::doSeparateConvolutionRow ( SoCpuBufferObject sourceBufferObject,
SoCpuBufferObject targetBufferObject,
float *  kernelData,
int  kernelSize,
int  width,
int  height 
)

Fast version for CPU buffers.


The general version maps the user buffers to CPU buffers and calls this function


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