hyperion.ng
Public Slots | Public Member Functions | Static Public Member Functions | List of all members
ImageProcessor Class Reference

The ImageProcessor translates an RGB-image to RGB-values for the leds. More...

#include <ImageProcessor.h>

Inheritance diagram for ImageProcessor:

Public Slots

void setBlackbarDetectDisable (bool enable)
 Enable or disable the black border detector based on component.
 
void setLedMappingType (int mapType)
 Set the user requested led mapping. More...
 

Public Member Functions

 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< ColorRgbprocess (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 Public Member Functions

static int mappingTypeToInt (QString mappingType)
 
static QString mappingTypeToStr (int mappingType)
 

Detailed Description

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.

Constructor & Destructor Documentation

§ ImageProcessor()

ImageProcessor::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.

Parameters
[in]ledStringLedString data
[in]hyperionHyperion instance pointer

Member Function Documentation

§ 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]ledIndex of the led
[out]hscanBeginbegin of the hscan
[out]hscanEndend of the hscan
[out]vscanBeginbegin of the hscan
[out]vscanEndend 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]imageThe 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]imageThe image to translate to led values
[out]ledColorsThe 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
mapTypeThe 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
mapTypeThe 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]widthThe new width of the buffer-image
[in]heightThe 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]imageThe dimensions taken from image

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