Commits from @MartB and more ...

- Commit: 1d9165f403
- New default QT capture implementation
- UploadHandler added to Effects Configurator to allow uploading GIF files
- Docker compile script and instruction
- Travis Fix
This commit is contained in:
Paulchen-Panther
2019-01-06 19:49:56 +01:00
parent 7352ff4d42
commit 2dca1c93e6
57 changed files with 1134 additions and 341 deletions

View File

@@ -39,7 +39,7 @@ public:
virtual bool setWidthHeight(int width, int height);
///
/// @brief Apply new pixelDecimation (used from x11)
/// @brief Apply new pixelDecimation (used from x11 and qt)
///
virtual void setPixelDecimation(int pixelDecimation) {};
@@ -71,7 +71,7 @@ public:
virtual void setDeviceVideoStandard(QString device, VideoStandard videoStandard) {};
///
/// @brief Apply display index (used from x11)
/// @brief Apply display index (used from qt)
///
virtual void setDisplayIndex(int index) {};

View File

@@ -360,8 +360,14 @@ public slots:
/// @param args arguments of the effect script
/// @param priority The priority channel of the effect
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
int setEffect(const QString & effectName, const QJsonObject & args, int priority,
int timeout = -1, const QString & pythonScript = "", const QString & origin="System");
int setEffect(const QString &effectName
, const QJsonObject &args
, int priority
, int timeout = -1
, const QString &pythonScript = ""
, const QString &origin="System"
, const QString &imageData = ""
);
/// sets the methode how image is maped to leds at ImageProcessor
void setLedMappingType(const int& mappingType);

View File

@@ -168,7 +168,9 @@ namespace hyperion
template <typename Pixel_T>
ColorRgb calcMeanColor(const Image<Pixel_T> & image, const std::vector<unsigned> & colors) const
{
if (colors.size() == 0)
const auto colorVecSize = colors.size();
if (colorVecSize == 0)
{
return ColorRgb::BLACK;
}
@@ -177,18 +179,20 @@ namespace hyperion
uint_fast16_t cummRed = 0;
uint_fast16_t cummGreen = 0;
uint_fast16_t cummBlue = 0;
const auto& imgData = image.memptr();
for (const unsigned colorOffset : colors)
{
const Pixel_T& pixel = image.memptr()[colorOffset];
const auto& pixel = imgData[colorOffset];
cummRed += pixel.red;
cummGreen += pixel.green;
cummBlue += pixel.blue;
}
// Compute the average of each color channel
const uint8_t avgRed = uint8_t(cummRed/colors.size());
const uint8_t avgGreen = uint8_t(cummGreen/colors.size());
const uint8_t avgBlue = uint8_t(cummBlue/colors.size());
const uint8_t avgRed = uint8_t(cummRed/colorVecSize);
const uint8_t avgGreen = uint8_t(cummGreen/colorVecSize);
const uint8_t avgBlue = uint8_t(cummBlue/colorVecSize);
// Return the computed color
return {avgRed, avgGreen, avgBlue};
@@ -211,9 +215,11 @@ namespace hyperion
uint_fast16_t cummBlue = 0;
const unsigned imageSize = image.width() * image.height();
const auto& imgData = image.memptr();
for (unsigned idx=0; idx<imageSize; idx++)
{
const Pixel_T& pixel = image.memptr()[idx];
const auto& pixel = imgData[idx];
cummRed += pixel.red;
cummGreen += pixel.green;
cummBlue += pixel.blue;