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. | |
Integer 2D-Kernel for morphological operations.
Define an n x m integer 2D-kernel.
SoSFKernel2i32, SoMFKernel2i32, SoMorphoLut2D
Definition at line 45 of file SbKernel2i32.h.
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.
int32_t & SbKernel2i32::operator() | ( | int | indexRow, |
int | indexCol | ||
) |
L-value accessor operator as an usual matrix.
So you can do:
Note:
const int32_t & SbKernel2i32::operator() | ( | int | indexRow, |
int | indexCol | ||
) | const |
Accessor operator as an usual matrix.
So you can do:
Note:
void SbKernel2i32::setSize | ( | const SbVec2i32 & | dimension | ) |
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.
|
friend |
Inequality comparison operator.
Definition at line 142 of file SbKernel2i32.h.
|
friend |
Equality comparison operator.