SbKernel2i32 Class Reference

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

#include <ImageViz/SbKernel2i32.h>

List of all members.

Public Member Functions

 SbKernel2i32 ()
 SbKernel2i32 (int numRows, int numCols)
 SbKernel2i32 (const SbVec2i32 &size)
 ~SbKernel2i32 ()
SbVec2i32 getSize () const
size_t getNumRows () const
size_t getNumCols () const
int32_t getValue (int indexRow, int indexCol) const
void setValue (int indexRow, int indexCol, int32_t value)
int32_t & operator() (int indexRow, int indexCol)
const int32_t & operator() (int indexRow, int indexCol) const

Friends

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



void setSize (size_t numRows, size_t numCols)
void setSize (const SbVec2i32 &dimension)

Detailed Description

ImageViz Integer 2D-Kernel for morphological operations.

Define an n x m integer 2D-kernel.

SEE ALSO

SoSFKernel2i32, SoMFKernel2i32, SoMorphoLut2D


Constructor & Destructor Documentation

SbKernel2i32::SbKernel2i32 (  ) 

Default constructor.

The kernel is not initialized.

SbKernel2i32::SbKernel2i32 ( int  numRows,
int  numCols 
)

Constructor defining the size of the kernel.

Kernel is initialized to zero values.

SbKernel2i32::SbKernel2i32 ( const SbVec2i32 size  ) 

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

Kernel is initialized to zero values.

SbKernel2i32::~SbKernel2i32 (  ) 

Destructor.


Member Function Documentation

size_t SbKernel2i32::getNumCols (  )  const

Returns the number of columns.

size_t SbKernel2i32::getNumRows (  )  const

Returns the number of rows.

SbVec2i32 SbKernel2i32::getSize (  )  const

Returns the size of the kernel.

Size is the number of rows and number of columns.

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.

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).
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).
void SbKernel2i32::setSize ( const SbVec2i32 dimension  ) 

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.

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.

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 Function Documentation

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

Inequality comparison operator.

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

Equality comparison operator.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/