per effect smoothing (#456)

* add dynamic smoothing first step
* extend prio muxer to hold smoothing preset id
* add icons for systray
* fix missing changes in prio muxer
*  implement specific smoothing params for effects
* refactoring: std::min/max to qMin/Max
* some code optimization
* fix schema and translation
* revoke change of python include order
* fix eol in effect shemas
* optimize random,candle and fadecandy json schemas
This commit is contained in:
redPanther
2017-08-04 12:01:45 +02:00
committed by GitHub
parent 6625a318ac
commit 6279dcb2a9
44 changed files with 824 additions and 568 deletions

View File

@@ -31,8 +31,8 @@
#endif
AmlogicGrabber::AmlogicGrabber(const unsigned width, const unsigned height)
: _width(std::max(160u, width)) // Minimum required width or height is 160
, _height(std::max(160u, height))
: _width(qMax(160u, width)) // Minimum required width or height is 160
, _height(qMax(160u, height))
, _amlogicCaptureDev(-1)
, _log(Logger::getInstance("AMLOGICGRABBER"))
{

View File

@@ -44,7 +44,7 @@ V4L2Grabber::V4L2Grabber(const QString & device
, _height(height)
, _lineLength(-1)
, _frameByteSize(-1)
, _frameDecimation(std::max(1, frameDecimation))
, _frameDecimation(qMax(1, frameDecimation))
, _noSignalCounterThreshold(50)
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _signalDetectionEnabled(true)
@@ -62,8 +62,8 @@ V4L2Grabber::V4L2Grabber(const QString & device
, _deviceAutoDiscoverEnabled(false)
{
_imageResampler.setHorizontalPixelDecimation(std::max(1, horizontalPixelDecimation));
_imageResampler.setVerticalPixelDecimation(std::max(1, verticalPixelDecimation));
_imageResampler.setHorizontalPixelDecimation(qMax(1, horizontalPixelDecimation));
_imageResampler.setVerticalPixelDecimation(qMax(1, verticalPixelDecimation));
getV4Ldevices();
}
@@ -198,7 +198,7 @@ void V4L2Grabber::setSignalThreshold(double redSignalThreshold, double greenSign
_noSignalThresholdColor.red = uint8_t(255*redSignalThreshold);
_noSignalThresholdColor.green = uint8_t(255*greenSignalThreshold);
_noSignalThresholdColor.blue = uint8_t(255*blueSignalThreshold);
_noSignalCounterThreshold = std::max(1, noSignalCounterThreshold);
_noSignalCounterThreshold = qMax(1, noSignalCounterThreshold);
Info(_log, "Signal threshold set to: {%d, %d, %d}", _noSignalThresholdColor.red, _noSignalThresholdColor.green, _noSignalThresholdColor.blue );
}

View File

@@ -1,9 +1,4 @@
// STL includes
#include <iostream>
#include <cstdint>
#include <utils/Logger.h>
// X11Grabber includes
#include <grabber/X11Grabber.h>
X11Grabber::X11Grabber(bool useXGetImage, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation)
@@ -137,7 +132,7 @@ Image<ColorRgb> & X11Grabber::grab()
{
double scale_x = static_cast<double>(_windowAttr.width / _horizontalDecimation) / static_cast<double>(_windowAttr.width);
double scale_y = static_cast<double>(_windowAttr.height / _verticalDecimation) / static_cast<double>(_windowAttr.height);
double scale = std::min(scale_y, scale_x);
double scale = qMin(scale_y, scale_x);
_transform =
{
@@ -215,7 +210,7 @@ int X11Grabber::grabFrame(Image<ColorRgb> & image)
{
double scale_x = static_cast<double>(_windowAttr.width / _horizontalDecimation) / static_cast<double>(_windowAttr.width);
double scale_y = static_cast<double>(_windowAttr.height / _verticalDecimation) / static_cast<double>(_windowAttr.height);
double scale = std::min(scale_y, scale_x);
double scale = qMin(scale_y, scale_x);
_transform =
{