From d5597d55a778d21e6d57f1193219dc4c3a99864c Mon Sep 17 00:00:00 2001 From: johan Date: Wed, 30 Apr 2014 22:53:05 +0200 Subject: [PATCH] Disable the blackborder detector for effects Former-commit-id: 2d4660f48c17977aabff52b7cbbc8d832b216f00 --- include/hyperion/ImageProcessor.h | 5 ++++- libsrc/effectengine/Effect.cpp | 3 +++ libsrc/hyperion/ImageProcessor.cpp | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hyperion/ImageProcessor.h b/include/hyperion/ImageProcessor.h index deb40df1..5049ac03 100644 --- a/include/hyperion/ImageProcessor.h +++ b/include/hyperion/ImageProcessor.h @@ -37,6 +37,9 @@ public: /// void setSize(const unsigned width, const unsigned height); + /// Enable or disable the black border detector + void enableBalckBorderDetector(bool enable); + /// /// 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. @@ -142,7 +145,7 @@ private: const LedString _ledString; /// Flag the enables(true)/disabled(false) blackborder detector - const bool _enableBlackBorderRemoval; + bool _enableBlackBorderRemoval; /// The processor for black border detection hyperion::BlackBorderProcessor * _borderProcessor; diff --git a/libsrc/effectengine/Effect.cpp b/libsrc/effectengine/Effect.cpp index 09411c87..72abbf3c 100644 --- a/libsrc/effectengine/Effect.cpp +++ b/libsrc/effectengine/Effect.cpp @@ -64,6 +64,9 @@ Effect::Effect(PyThreadState * mainThreadState, int priority, int timeout, const { _colors.resize(_imageProcessor->getLedCount(), ColorRgb::BLACK); + // disable the black border detector for effects + _imageProcessor->enableBalckBorderDetector(false); + // connect the finished signal connect(this, SIGNAL(finished()), this, SLOT(effectFinished())); } diff --git a/libsrc/hyperion/ImageProcessor.cpp b/libsrc/hyperion/ImageProcessor.cpp index 66b02e74..25784d0a 100644 --- a/libsrc/hyperion/ImageProcessor.cpp +++ b/libsrc/hyperion/ImageProcessor.cpp @@ -43,6 +43,11 @@ void ImageProcessor::setSize(const unsigned width, const unsigned height) _imageToLeds = new ImageToLedsMap(width, height, 0, 0, _ledString.leds()); } +void ImageProcessor::enableBalckBorderDetector(bool enable) +{ + _enableBlackBorderRemoval = enable; +} + bool ImageProcessor::getScanParameters(size_t led, double &hscanBegin, double &hscanEnd, double &vscanBegin, double &vscanEnd) const { if (led < _ledString.leds().size())