MorphologicalAttributeFilters
Public API documentation
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
mmcfilters::ImageUtils Class Reference

Utility functions for basic image conversion and manipulation. More...

#include <Image.hpp>

Static Public Member Functions

static int to1D (int row, int col, int numCols) noexcept
 Converts (row, col) to a row-major linear index.
 
static std::pair< int, intto2D (int index, int numCols) noexcept
 Converts a row-major linear index to (row, col).
 
static ImageUInt8Ptr createRandomColor (int *img, int numRowsOfImage, int numColsOfImage)
 Creates a random-colour visualisation from an integer-labelled image.
 

Detailed Description

Utility functions for basic image conversion and manipulation.

Groups helpers for converting between 1D/2D coordinates and for generating colour visualisations from integer labels.

Definition at line 262 of file Image.hpp.

Member Function Documentation

◆ createRandomColor()

static ImageUInt8Ptr mmcfilters::ImageUtils::createRandomColor ( int img,
int  numRowsOfImage,
int  numColsOfImage 
)
inlinestatic

Creates a random-colour visualisation from an integer-labelled image.

The output is a row-major uint8_t image with three adjacent columns per input pixel, storing RGB triples as (R, G, B). Labels are used as array indices and therefore must be non-negative.

Parameters
imgPointer to numRowsOfImage * numColsOfImage integer labels.
numRowsOfImageNumber of input rows.
numColsOfImageNumber of input columns.
Returns
RGB visualisation encoded as an image with numColsOfImage * 3 columns.

Definition at line 302 of file Image.hpp.

◆ to1D()

static int mmcfilters::ImageUtils::to1D ( int  row,
int  col,
int  numCols 
)
inlinestaticnoexcept

Converts (row, col) to a row-major linear index.

Parameters
rowZero-based row coordinate.
colZero-based column coordinate.
numColsNumber of columns in the image domain.
Returns
Linear index row * numCols + col.

Definition at line 272 of file Image.hpp.

◆ to2D()

static std::pair< int, int > mmcfilters::ImageUtils::to2D ( int  index,
int  numCols 
)
inlinestaticnoexcept

Converts a row-major linear index to (row, col).

Parameters
indexRow-major linear index.
numColsNumber of columns in the image domain.
Returns
Pair (row, col).

Definition at line 283 of file Image.hpp.


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