Utility functions for basic image conversion and manipulation.
More...
#include <Image.hpp>
|
| static PixelId | to1D (int row, int column, int numColumns) noexcept |
| | Converts (row, column) to a row-major linear index.
|
| static std::pair< int, int > | to2D (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.
|
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 277 of file Image.hpp.
◆ createRandomColor()
| ImageUInt8Ptr mmcfilters::ImageUtils::createRandomColor |
( |
int * | img, |
|
|
int | numRowsOfImage, |
|
|
int | numColumnsOfImage ) |
|
inlinestaticnodiscard |
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
-
| img | Pointer to numRowsOfImage * numColumnsOfImage integer labels. |
| numRowsOfImage | Number of input rows. |
| numColumnsOfImage | Number of input columns. |
- Returns
- RGB visualisation encoded as an image with numColumnsOfImage * 3 columns.
Definition at line 315 of file Image.hpp.
◆ to1D()
| PixelId mmcfilters::ImageUtils::to1D |
( |
int | row, |
|
|
int | column, |
|
|
int | numColumns ) |
|
inlinestaticnoexcept |
Converts (row, column) to a row-major linear index.
- Parameters
-
| row | Zero-based row coordinate. |
| column | Zero-based column coordinate. |
| numColumns | Number of columns in the image domain. |
- Returns
- Linear index row * numColumns + column.
Definition at line 287 of file Image.hpp.
◆ to2D()
| std::pair< int, int > mmcfilters::ImageUtils::to2D |
( |
PixelId | index, |
|
|
int | numColumns ) |
|
inlinestaticnoexcept |
Converts a row-major linear index to (row, column).
- Parameters
-
| index | Row-major linear index. |
| numColumns | Number of columns in the image domain. |
- Returns
- Pair (row, column).
Definition at line 296 of file Image.hpp.
The documentation for this class was generated from the following file: