6 #include <utils/Image.h> 9 #include <hyperion/LedString.h> 10 #include <hyperion/ImageToLedsMap.h> 11 #include <utils/Logger.h> 14 #include <utils/settings.h> 17 #include <blackborder/BlackBorderProcessor.h> 49 void setSize(
const unsigned width,
const unsigned height);
65 static int mappingTypeToInt(QString mappingType);
66 static QString mappingTypeToStr(
int mappingType);
94 template <
typename Pixel_T>
108 template <
typename Pixel_T>
111 std::vector<ColorRgb> colors;
121 switch (_mappingType)
129 Warning(_log,
"ImageProcessor::process called with image size 0");
142 template <
typename Pixel_T>
154 switch (_mappingType)
162 Warning(_log,
"Called with image size 0");
175 bool getScanParameters(
size_t led,
double & hscanBegin,
double & hscanEnd,
double & vscanBegin,
double & vscanEnd)
const;
183 template <
typename Pixel_T>
186 if (!_borderProcessor->
enabled() && ( _imageToLeds->horizontalBorder()!=0 || _imageToLeds->verticalBorder()!=0 ))
188 Debug(_log,
"Reset border");
189 _borderProcessor->
process(image);
194 if(_borderProcessor->
enabled() && _borderProcessor->
process(image))
218 void handleSettingsUpdate(
const settings::type& type,
const QJsonDocument& config);
234 int _userMappingType;
236 int _hardMappingType;
void setBlackbarDetectDisable(bool enable)
Enable or disable the black border detector based on component.
Definition: ImageProcessor.cpp:94
BlackBorder getCurrentBorder() const
Return the current (detected) border.
Definition: BlackBorderProcessor.cpp:107
bool getScanParameters(size_t led, double &hscanBegin, double &hscanEnd, double &vscanBegin, double &vscanEnd) const
Get the hscan and vscan parameters for a single led.
Definition: ImageProcessor.cpp:125
The main class of Hyperion.
Definition: Hyperion.h:57
Provide utility methods for Hyperion class.
Definition: BlackBorderDetector.h:7
The BlackBorder processor is a wrapper around the black-border detector for keeping track of detected...
Definition: BlackBorderProcessor.h:23
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.
Definition: ImageToLedsMap.h:72
int verticalSize
The size of the detected vertical border.
Definition: BlackBorderDetector.h:21
unsigned height() const
Returns the height of the image.
Definition: Image.h:129
bool blackBorderDetectorEnabled()
Returns starte of black border detector.
Definition: ImageProcessor.cpp:99
Result structure of the detected blackborder.
Definition: BlackBorderDetector.h:12
std::vector< Led > & leds()
Returns the led specifications.
Definition: LedString.cpp:20
void setLedString(const LedString &ledString)
Update the led string (eg on settings change)
Definition: ImageProcessor.cpp:79
void process(const Image< Pixel_T > &image, std::vector< ColorRgb > &ledColors)
Determines the led colors of the image in the buffer.
Definition: ImageProcessor.h:143
bool enabled() const
Return activation state of black border detector.
Definition: BlackBorderProcessor.cpp:112
void setHardLedMappingType(int mapType)
Set the Hyperion::update() requestes led mapping type.
Definition: ImageProcessor.cpp:115
std::vector< ColorRgb > process(const Image< Pixel_T > &image)
Processes the image to a list of led colors.
Definition: ImageProcessor.h:109
unsigned width() const
Returns the width of the image.
Definition: Image.h:119
const int & ledMappingType()
Returns the current _mappingType.
Definition: ImageProcessor.h:63
bool process(const Image< Pixel_T > &image)
Processes the image.
Definition: BlackBorderProcessor.h:64
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.
Definition: ImageToLedsMap.h:115
bool unknown
Falg indicating if the border is unknown.
Definition: BlackBorderDetector.h:15
The ImageProcessor translates an RGB-image to RGB-values for the leds.
Definition: ImageProcessor.h:26
ImageProcessor(const LedString &ledString, Hyperion *hyperion)
Constructs an image-processor for translating an image to led-color values based on the given led-str...
Definition: ImageProcessor.cpp:29
const int & getUserLedMappingType()
Returns the current _userMappingType, this may not be the current applied type!
Definition: ImageProcessor.h:60
void setSize(const unsigned width, const unsigned height)
Specifies the width and height of 'incomming' images.
Definition: ImageProcessor.cpp:64
void setLedMappingType(int mapType)
Set the user requested led mapping.
Definition: ImageProcessor.cpp:104
The ImageToLedsMap holds a mapping of indices into an image to leds.
Definition: ImageToLedsMap.h:22
int horizontalSize
The size of the detected horizontal border.
Definition: BlackBorderDetector.h:18
The LedString contains the image integration information of the leds.
Definition: LedString.h:111
void setSize(const Image< Pixel_T > &image)
Specifies the width and height of 'incomming' images.
Definition: ImageProcessor.h:95