The ImageToLedsMap holds a mapping of indices into an image to leds.
More...
#include <ImageToLedsMap.h>
|
| ImageToLedsMap (const unsigned width, const unsigned height, const unsigned horizontalBorder, const unsigned verticalBorder, const std::vector< Led > &leds) |
| Constructs an mapping from the absolute indices in an image to each led based on the border definition given in the list of leds. More...
|
|
unsigned | width () const |
| Returns the width of the indexed image. More...
|
|
unsigned | height () const |
| Returns the height of the indexed image. More...
|
|
unsigned | horizontalBorder () |
|
unsigned | verticalBorder () |
|
template<typename Pixel_T > |
std::vector< ColorRgb > | getMeanLedColor (const Image< Pixel_T > &image) const |
| Determines the mean color for each led using the mapping the image given at construction. More...
|
|
template<typename Pixel_T > |
void | getMeanLedColor (const Image< Pixel_T > &image, std::vector< ColorRgb > &ledColors) const |
| Determines the mean color for each led using the mapping the image given at construction. More...
|
|
template<typename Pixel_T > |
std::vector< ColorRgb > | getUniLedColor (const Image< Pixel_T > &image) const |
| Determines the uni color for each led using the mapping the image given at construction. More...
|
|
template<typename Pixel_T > |
void | getUniLedColor (const Image< Pixel_T > &image, std::vector< ColorRgb > &ledColors) const |
| Determines the uni color for each led using the mapping the image given at construction. More...
|
|
The ImageToLedsMap holds a mapping of indices into an image to leds.
It can be used to calculate the average (or mean) color per led for a specific region.
§ ImageToLedsMap()
ImageToLedsMap::ImageToLedsMap |
( |
const unsigned |
width, |
|
|
const unsigned |
height, |
|
|
const unsigned |
horizontalBorder, |
|
|
const unsigned |
verticalBorder, |
|
|
const std::vector< Led > & |
leds |
|
) |
| |
Constructs an mapping from the absolute indices in an image to each led based on the border definition given in the list of leds.
The map holds absolute indices to any given image, provided that it is row-oriented. The mapping is created purely on size (width and height). The given borders are excluded from indexing.
- Parameters
-
[in] | width | The width of the indexed image |
[in] | height | The width of the indexed image |
[in] | horizontalBorder | The size of the horizontal border (0=no border) |
[in] | verticalBorder | The size of the vertical border (0=no border) |
[in] | leds | The list with led specifications |
§ getMeanLedColor() [1/2]
template<typename Pixel_T >
std::vector<ColorRgb> hyperion::ImageToLedsMap::getMeanLedColor |
( |
const Image< Pixel_T > & |
image | ) |
const |
|
inline |
Determines the mean color for each led using the mapping the image given at construction.
- Parameters
-
[in] | image | The image from which to extract the led colors |
- Returns
- ledColors The vector containing the output
§ getMeanLedColor() [2/2]
template<typename Pixel_T >
void hyperion::ImageToLedsMap::getMeanLedColor |
( |
const Image< Pixel_T > & |
image, |
|
|
std::vector< ColorRgb > & |
ledColors |
|
) |
| const |
|
inline |
Determines the mean color for each led using the mapping the image given at construction.
- Parameters
-
[in] | image | The image from which to extract the led colors |
[out] | ledColors | The vector containing the output |
§ getUniLedColor() [1/2]
template<typename Pixel_T >
std::vector<ColorRgb> hyperion::ImageToLedsMap::getUniLedColor |
( |
const Image< Pixel_T > & |
image | ) |
const |
|
inline |
Determines the uni color for each led using the mapping the image given at construction.
- Parameters
-
[in] | image | The image from which to extract the led colors |
- Returns
- ledColors The vector containing the output
§ getUniLedColor() [2/2]
template<typename Pixel_T >
void hyperion::ImageToLedsMap::getUniLedColor |
( |
const Image< Pixel_T > & |
image, |
|
|
std::vector< ColorRgb > & |
ledColors |
|
) |
| const |
|
inline |
Determines the uni color for each led using the mapping the image given at construction.
- Parameters
-
[in] | image | The image from which to extract the led colors |
[out] | ledColors | The vector containing the output |
§ height()
unsigned ImageToLedsMap::height |
( |
| ) |
const |
Returns the height of the indexed image.
- Returns
- The height of the indexed image [pixels]
§ width()
unsigned ImageToLedsMap::width |
( |
| ) |
const |
Returns the width of the indexed image.
- Returns
- The width of the indexed image [pixels]
The documentation for this class was generated from the following files: