The ImageProcessor translates an RGB-image to RGB-values for the leds.
More...
#include <ImageProcessor.h>
|
| ImageProcessor (const LedString &ledString, Hyperion *hyperion) |
| Constructs an image-processor for translating an image to led-color values based on the given led-string specification. More...
|
|
void | setSize (const unsigned width, const unsigned height) |
| Specifies the width and height of 'incomming' images. More...
|
|
void | setLedString (const LedString &ledString) |
| Update the led string (eg on settings change)
|
|
bool | blackBorderDetectorEnabled () |
| Returns starte of black border detector.
|
|
const int & | getUserLedMappingType () |
| Returns the current _userMappingType, this may not be the current applied type!
|
|
const int & | ledMappingType () |
| Returns the current _mappingType.
|
|
void | setHardLedMappingType (int mapType) |
| Set the Hyperion::update() requestes led mapping type. More...
|
|
template<typename Pixel_T > |
void | setSize (const Image< Pixel_T > &image) |
| Specifies the width and height of 'incomming' images. More...
|
|
template<typename Pixel_T > |
std::vector< ColorRgb > | process (const Image< Pixel_T > &image) |
| Processes the image to a list of led colors. More...
|
|
template<typename Pixel_T > |
void | process (const Image< Pixel_T > &image, std::vector< ColorRgb > &ledColors) |
| Determines the led colors of the image in the buffer. More...
|
|
bool | getScanParameters (size_t led, double &hscanBegin, double &hscanEnd, double &vscanBegin, double &vscanEnd) const |
| Get the hscan and vscan parameters for a single led. More...
|
|
|
static int | mappingTypeToInt (QString mappingType) |
|
static QString | mappingTypeToStr (int mappingType) |
|
The ImageProcessor translates an RGB-image to RGB-values for the leds.
The processing is performed in two steps. First the average color per led-region is computed. Second a color-tranform is applied based on a gamma-correction.
§ ImageProcessor()
Constructs an image-processor for translating an image to led-color values based on the given led-string specification.
- Parameters
-
§ getScanParameters()
bool ImageProcessor::getScanParameters |
( |
size_t |
led, |
|
|
double & |
hscanBegin, |
|
|
double & |
hscanEnd, |
|
|
double & |
vscanBegin, |
|
|
double & |
vscanEnd |
|
) |
| const |
Get the hscan and vscan parameters for a single led.
- Parameters
-
[in] | led | Index of the led |
[out] | hscanBegin | begin of the hscan |
[out] | hscanEnd | end of the hscan |
[out] | vscanBegin | begin of the hscan |
[out] | vscanEnd | end of the hscan |
- Returns
- true if the parameters could be retrieved
§ process() [1/2]
template<typename Pixel_T >
std::vector<ColorRgb> ImageProcessor::process |
( |
const Image< Pixel_T > & |
image | ) |
|
|
inline |
Processes the image to a list of led colors.
This will update the size of the buffer-image if required and call the image-to-leds mapping to determine the mean color per led.
- Parameters
-
[in] | image | The image to translate to led values |
- Returns
- The color value per led
§ process() [2/2]
template<typename Pixel_T >
void ImageProcessor::process |
( |
const Image< Pixel_T > & |
image, |
|
|
std::vector< ColorRgb > & |
ledColors |
|
) |
| |
|
inline |
Determines the led colors of the image in the buffer.
- Parameters
-
[in] | image | The image to translate to led values |
[out] | ledColors | The color value per led |
§ setHardLedMappingType()
void ImageProcessor::setHardLedMappingType |
( |
int |
mapType | ) |
|
Set the Hyperion::update() requestes led mapping type.
This type is used in favour of type set with setLedMappingType. If you don't want to force a mapType set this to -1 (user choice will be set)
- Parameters
-
mapType | The new mapping type |
§ setLedMappingType
void ImageProcessor::setLedMappingType |
( |
int |
mapType | ) |
|
|
slot |
Set the user requested led mapping.
The type set with setHardLedMappingType() will be used in favour to respect comp specific settings
- Parameters
-
mapType | The new mapping type |
§ setSize() [1/2]
void ImageProcessor::setSize |
( |
const unsigned |
width, |
|
|
const unsigned |
height |
|
) |
| |
Specifies the width and height of 'incomming' images.
This will resize the buffer-image to match the given size. NB All earlier obtained references will be invalid.
- Parameters
-
[in] | width | The new width of the buffer-image |
[in] | height | The new height of the buffer-image |
§ setSize() [2/2]
template<typename Pixel_T >
void ImageProcessor::setSize |
( |
const Image< Pixel_T > & |
image | ) |
|
|
inline |
Specifies the width and height of 'incomming' images.
This will resize the buffer-image to match the given size. NB All earlier obtained references will be invalid.
- Parameters
-
[in] | image | The dimensions taken from image |
The documentation for this class was generated from the following files: