From feec39575617f101ba2df0d085979405e6a6222a Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sun, 16 May 2021 18:33:24 +0200 Subject: [PATCH] Minor Updates (#1241) --- include/hyperion/ImageToLedsMap.h | 4 ++-- libsrc/hyperion/Hyperion.cpp | 2 +- libsrc/hyperion/ImageProcessor.cpp | 2 +- libsrc/hyperion/ImageToLedsMap.cpp | 2 +- libsrc/leddevice/dev_other/LedDeviceFile.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hyperion/ImageToLedsMap.h b/include/hyperion/ImageToLedsMap.h index 71cfc9de..779082ab 100644 --- a/include/hyperion/ImageToLedsMap.h +++ b/include/hyperion/ImageToLedsMap.h @@ -154,7 +154,7 @@ namespace hyperion const unsigned _verticalBorder; /// The absolute indices into the image for each led - std::vector> _colorsMap; + std::vector> _colorsMap; /// /// Calculates the 'mean color' of the given list. This is the mean over each color-channel @@ -166,7 +166,7 @@ namespace hyperion /// @return The mean of the given list of colors (or black when empty) /// template - ColorRgb calcMeanColor(const Image & image, const std::vector & colors) const + ColorRgb calcMeanColor(const Image & image, const std::vector & colors) const { const auto colorVecSize = colors.size(); diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 149a4458..aee85769 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -580,7 +580,7 @@ void Hyperion::update() // copy image & process OR copy ledColors from muxer Image image = priorityInfo.image; - if(image.size() > 3) + if (image.width() > 1 || image.height() > 1) { emit currentImage(image); _ledBuffer = _imageProcessor->process(image); diff --git a/libsrc/hyperion/ImageProcessor.cpp b/libsrc/hyperion/ImageProcessor.cpp index cf47425c..e442f086 100644 --- a/libsrc/hyperion/ImageProcessor.cpp +++ b/libsrc/hyperion/ImageProcessor.cpp @@ -28,7 +28,7 @@ QString ImageProcessor::mappingTypeToStr(int mappingType) ImageProcessor::ImageProcessor(const LedString& ledString, Hyperion* hyperion) : QObject(hyperion) - , _log(Logger::getInstance("BLACKBORDER")) + , _log(Logger::getInstance("IMAGETOLED")) , _ledString(ledString) , _borderProcessor(new BlackBorderProcessor(hyperion, this)) , _imageToLeds(nullptr) diff --git a/libsrc/hyperion/ImageToLedsMap.cpp b/libsrc/hyperion/ImageToLedsMap.cpp index caebe20b..783fdedd 100644 --- a/libsrc/hyperion/ImageToLedsMap.cpp +++ b/libsrc/hyperion/ImageToLedsMap.cpp @@ -59,7 +59,7 @@ ImageToLedsMap::ImageToLedsMap( const auto maxYLedCount = qMin(maxY_idx, yOffset+actualHeight); const auto maxXLedCount = qMin(maxX_idx, xOffset+actualWidth); - std::vector ledColors; + std::vector ledColors; ledColors.reserve((size_t) maxXLedCount*maxYLedCount); for (unsigned y = minY_idx; y < maxYLedCount; ++y) diff --git a/libsrc/leddevice/dev_other/LedDeviceFile.cpp b/libsrc/leddevice/dev_other/LedDeviceFile.cpp index bb26a371..0dba14d8 100644 --- a/libsrc/leddevice/dev_other/LedDeviceFile.cpp +++ b/libsrc/leddevice/dev_other/LedDeviceFile.cpp @@ -114,7 +114,7 @@ int LedDeviceFile::write(const std::vector & ledValues) } #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - out << "]" << Qt::endl; + out << QString("]") << Qt::endl; #else out << "]" << endl; #endif