mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Dominant Color support (#1569)
* Dominant Color and Mean Color Squared * Workaround - Suppress empty LED updates * Add missing text * Dominant Colors advanced * Test with fixed initial colors * Test with fixed initial colors * Support new processing values via API * ImageToLED - Add reduced pixel processing, make dominant color advanced configurable * Updates on Grabber fps setting * ImageToLedMap - Remove maptype and update test * Update dynamic cluster array allocation
This commit is contained in:
@@ -105,6 +105,19 @@ public:
|
||||
/// @note See https://bottosson.github.io/posts/colorpicker/#okhsv
|
||||
///
|
||||
static void okhsv2rgb(double hue, double saturation, double value, uint8_t & red, uint8_t & green, uint8_t & blue);
|
||||
|
||||
template <typename Pixel_T>
|
||||
static double rgb_euclidean(Pixel_T p1, Pixel_T p2)
|
||||
{
|
||||
double val = sqrt(
|
||||
(p1.red - p2.red) * (p1.red - p2.red) +
|
||||
(p1.green - p2.green) * (p1.green - p2.green) +
|
||||
(p1.blue - p2.blue) * (p1.blue - p2.blue)
|
||||
);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // COLORSYS_H
|
||||
|
Reference in New Issue
Block a user