Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbKernel2i32 Class Reference

ImageViz Integer 2D-Kernel for morphological operations. More...

#include <ImageViz/SbKernel2i32.h>

Public Member Functions

 SbKernel2i32 ()
 Default constructor.
 
 SbKernel2i32 (int numRows, int numCols)
 Constructor defining the size of the kernel.
 
 SbKernel2i32 (const SbVec2i32 &size)
 Constructor defining the size of the kernel (numRows, numColumns).
 
 ~SbKernel2i32 ()
 Destructor.
 
SbVec2i32 getSize () const
 Returns the size of the kernel.
 
size_t getNumRows () const
 Returns the number of rows.
 
size_t getNumCols () const
 Returns the number of columns.
 
void setSize (size_t numRows, size_t numCols)
 Set the size of the kernel.
 
void setSize (const SbVec2i32 &dimension)
 
int32_t getValue (int indexRow, int indexCol) const
 Returns the value of the kernel at position (row, col).
 
void setValue (int indexRow, int indexCol, int32_t value)
 Sets the value of the kernel at position (row, col).
 
int32_t & operator() (int indexRow, int indexCol)
 L-value accessor operator as an usual matrix.
 
const int32_t & operator() (int indexRow, int indexCol) const
 Accessor operator as an usual matrix.
 

Friends

int operator== (const SbKernel2i32 &k1, const SbKernel2i32 &k2)
 Equality comparison operator.
 
int operator!= (const SbKernel2i32 &k1, const SbKernel2i32 &k2)
 Inequality comparison operator.
 

Detailed Description

ImageViz Integer 2D-Kernel for morphological operations.

Define an n x m integer 2D-kernel.

SEE ALSO

SoSFKernel2i32, SoMFKernel2i32, SoMorphoLut2D

Definition at line 45 of file SbKernel2i32.h.

Constructor & Destructor Documentation

◆ SbKernel2i32() [1/3]

SbKernel2i32::SbKernel2i32 ( )

Default constructor.

The kernel is not initialized.

◆ SbKernel2i32() [2/3]

SbKernel2i32::SbKernel2i32 ( int  numRows,
int  numCols 
)

Constructor defining the size of the kernel.

Kernel is initialized to zero values.

◆ SbKernel2i32() [3/3]

SbKernel2i32::SbKernel2i32 ( const SbVec2i32 size)

Constructor defining the size of the kernel (numRows, numColumns).

Kernel is initialized to zero values.

◆ ~SbKernel2i32()

SbKernel2i32::~SbKernel2i32 ( )

Destructor.

Member Function Documentation

◆ getNumCols()

size_t SbKernel2i32::getNumCols ( ) const

Returns the number of columns.

◆ getNumRows()

size_t SbKernel2i32::getNumRows ( ) const

Returns the number of rows.

◆ getSize()

SbVec2i32 SbKernel2i32::getSize ( ) const

Returns the size of the kernel.

Size is the number of rows and number of columns.

◆ getValue()

int32_t SbKernel2i32::getValue ( int  indexRow,
int  indexCol 
) const

Returns the value of the kernel at position (row, col).

Throws an SbException if indices are out of bounds.

◆ operator()() [1/2]

int32_t & SbKernel2i32::operator() ( int  indexRow,
int  indexCol 
)

L-value accessor operator as an usual matrix.

So you can do:

kernel(i, j) = val;

Note:

  • kernel(i, j) refers to the element at kernel(row, column).
  • For performance reasons this is an unsafe accessor (bounds are not tested).

◆ operator()() [2/2]

const int32_t & SbKernel2i32::operator() ( int  indexRow,
int  indexCol 
) const

Accessor operator as an usual matrix.

So you can do:

val = kernel(i, j);

Note:

  • kernel(i, j) refers to the element at kernel(row, column).
  • For performance reasons this is an unsafe accessor (bounds are not tested).

◆ setSize() [1/2]

void SbKernel2i32::setSize ( const SbVec2i32 dimension)

◆ setSize() [2/2]

void SbKernel2i32::setSize ( size_t  numRows,
size_t  numCols 
)

Set the size of the kernel.

Size is the number of rows and number of columns.

If numCols (or numRows) is smaller than the current number of columns (or rows), the kernel is reduced to the first numCols columns (or numRows rows).
If numCols (or numRows) is greater than the current number of columns (or rows), values inside the old bounds are preserved and values outside the old bounds are filled to 0.

◆ setValue()

void SbKernel2i32::setValue ( int  indexRow,
int  indexCol,
int32_t  value 
)

Sets the value of the kernel at position (row, col).

Throws an SbException if indices are out of bounds.

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const SbKernel2i32 k1,
const SbKernel2i32 k2 
)
friend

Inequality comparison operator.

Definition at line 142 of file SbKernel2i32.h.

◆ operator==

int operator== ( const SbKernel2i32 k1,
const SbKernel2i32 k2 
)
friend

Equality comparison operator.


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