mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
make blackboder component enable/disable at runtime (#228)
* make enable/disable of bborder work * fix typo * smoothing can be disabled via config again * fix smoothing
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
// Forward class declaration
|
||||
class LedDevice;
|
||||
class LinearColorSmoothing;
|
||||
class ColorTransform;
|
||||
class EffectEngine;
|
||||
class HsvTransform;
|
||||
@@ -287,7 +288,7 @@ public:
|
||||
static RgbChannelAdjustment * createRgbChannelCorrection(const Json::Value& colorConfig);
|
||||
static RgbChannelAdjustment * createRgbChannelAdjustment(const Json::Value& colorConfig, const RgbChannel color);
|
||||
|
||||
static LedDevice * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice * ledDevice);
|
||||
static LinearColorSmoothing * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice* leddevice);
|
||||
static MessageForwarder * createMessageForwarder(const Json::Value & forwarderConfig);
|
||||
|
||||
signals:
|
||||
@@ -339,6 +340,9 @@ private:
|
||||
/// The actual LedDevice
|
||||
LedDevice * _device;
|
||||
|
||||
/// The smoothing LedDevice
|
||||
LinearColorSmoothing * _deviceSmooth;
|
||||
|
||||
/// Effect engine
|
||||
EffectEngine * _effectEngine;
|
||||
|
||||
|
@@ -119,6 +119,14 @@ private:
|
||||
template <typename Pixel_T>
|
||||
void verifyBorder(const Image<Pixel_T> & image)
|
||||
{
|
||||
if (!_borderProcessor->enabled() && ( _imageToLeds->horizontalBorder()!=0 || _imageToLeds->verticalBorder()!=0 ))
|
||||
{
|
||||
Debug(Logger::getInstance("BLACKBORDER"), "disabled, reset border");
|
||||
_borderProcessor->process(image);
|
||||
delete _imageToLeds;
|
||||
_imageToLeds = new hyperion::ImageToLedsMap(image.width(), image.height(), 0, 0, _ledString.leds());
|
||||
}
|
||||
|
||||
if(_borderProcessor->enabled() && _borderProcessor->process(image))
|
||||
{
|
||||
Debug(Logger::getInstance("BLACKBORDER"), "BORDER SWITCH REQUIRED!!");
|
||||
|
@@ -56,6 +56,9 @@ namespace hyperion
|
||||
///
|
||||
unsigned height() const;
|
||||
|
||||
const unsigned horizontalBorder() const { return _horizontalBorder; };
|
||||
const unsigned verticalBorder() const { return _verticalBorder; };
|
||||
|
||||
///
|
||||
/// Determines the mean-color for each led using the mapping the image given
|
||||
/// at construction.
|
||||
@@ -99,6 +102,11 @@ namespace hyperion
|
||||
const unsigned _width;
|
||||
/// The height of the indexed image
|
||||
const unsigned _height;
|
||||
|
||||
const unsigned _horizontalBorder;
|
||||
|
||||
const unsigned _verticalBorder;
|
||||
|
||||
/// The absolute indices into the image for each led
|
||||
std::vector<std::vector<unsigned>> mColorsMap;
|
||||
|
||||
|
Reference in New Issue
Block a user