mmcfilters
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 PixelId to1D (int row, int column, int numColumns) noexcept
 Converts (row, column) to a row-major linear index.
 
static std::pair< int, intto2D (PixelId index, int numColumns) noexcept
 Converts a row-major linear index to (row, column).
 
static ImageUInt8Ptr createRandomColor (int *img, int numRowsOfImage, int numColumnsOfImage)
 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 293 of file Image.hpp.

Member Function Documentation

◆ createRandomColor()

static ImageUInt8Ptr mmcfilters::ImageUtils::createRandomColor ( int img,
int  numRowsOfImage,
int  numColumnsOfImage 
)
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 * numColumnsOfImage integer labels.
numRowsOfImageNumber of input rows.
numColumnsOfImageNumber of input columns.
Returns
RGB visualisation encoded as an image with numColumnsOfImage * 3 columns.

Definition at line 331 of file Image.hpp.

◆ to1D()

static PixelId mmcfilters::ImageUtils::to1D ( int  row,
int  column,
int  numColumns 
)
inlinestaticnoexcept

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

Parameters
rowZero-based row coordinate.
columnZero-based column coordinate.
numColumnsNumber of columns in the image domain.
Returns
Linear index row * numColumns + column.

Definition at line 303 of file Image.hpp.

◆ to2D()

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

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

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

Definition at line 312 of file Image.hpp.


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