Integer 2D-Kernel for morphological operations. More...
#include <ImageViz/SbKernel2i32.h>
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) |
Define an n x m integer 2D-kernel.
SoSFKernel2i32, SoMFKernel2i32, SoMorphoLut2D
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.
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:
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:
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.
int operator!= | ( | const SbKernel2i32 & | k1, | |
const SbKernel2i32 & | k2 | |||
) | [friend] |
Inequality comparison operator.
int operator== | ( | const SbKernel2i32 & | k1, | |
const SbKernel2i32 & | k2 | |||
) | [friend] |
Equality comparison operator.