mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactor: Address (Windows) compile warnings (#840)
* Windows compile errors and (Qt 5.15 deprecation) warnings * Usability - Enable/Disable Instance button Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
struct ColorRgb;
|
||||
|
||||
///
|
||||
@@ -49,6 +51,19 @@ inline std::ostream& operator<<(std::ostream& os, const ColorRgb& color)
|
||||
return os;
|
||||
}
|
||||
|
||||
///
|
||||
/// Stream operator to write ColorRgb to a QTextStream (format "'{'[red]','[green]','[blue]'}'")
|
||||
///
|
||||
/// @param os The output stream
|
||||
/// @param color The color to write
|
||||
/// @return The output stream (with the color written to it)
|
||||
///
|
||||
inline QTextStream& operator<<(QTextStream &os, const ColorRgb& color)
|
||||
{
|
||||
os << "{" << unsigned(color.red) << "," << unsigned(color.green) << "," << unsigned(color.blue) << "}";
|
||||
return os;
|
||||
}
|
||||
|
||||
/// Compare operator to check if a color is 'smaller' than another color
|
||||
inline bool operator<(const ColorRgb & lhs, const ColorRgb & rhs)
|
||||
{
|
||||
|
@@ -5,17 +5,17 @@
|
||||
/**
|
||||
* Enumeration of the possible pixel formats the grabber can be set to
|
||||
*/
|
||||
enum PixelFormat {
|
||||
PIXELFORMAT_YUYV,
|
||||
PIXELFORMAT_UYVY,
|
||||
PIXELFORMAT_BGR16,
|
||||
PIXELFORMAT_BGR24,
|
||||
PIXELFORMAT_RGB32,
|
||||
PIXELFORMAT_BGR32,
|
||||
enum class PixelFormat {
|
||||
YUYV,
|
||||
UYVY,
|
||||
BGR16,
|
||||
BGR24,
|
||||
RGB32,
|
||||
BGR32,
|
||||
#ifdef HAVE_JPEG_DECODER
|
||||
PIXELFORMAT_MJPEG,
|
||||
MJPEG,
|
||||
#endif
|
||||
PIXELFORMAT_NO_CHANGE
|
||||
NO_CHANGE
|
||||
};
|
||||
|
||||
inline PixelFormat parsePixelFormat(QString pixelFormat)
|
||||
@@ -23,37 +23,37 @@ inline PixelFormat parsePixelFormat(QString pixelFormat)
|
||||
// convert to lower case
|
||||
pixelFormat = pixelFormat.toLower();
|
||||
|
||||
if (pixelFormat == "yuyv")
|
||||
if (pixelFormat.compare("yuyv") )
|
||||
{
|
||||
return PIXELFORMAT_YUYV;
|
||||
return PixelFormat::YUYV;
|
||||
}
|
||||
else if (pixelFormat == "uyvy")
|
||||
else if (pixelFormat.compare("uyvy") )
|
||||
{
|
||||
return PIXELFORMAT_UYVY;
|
||||
return PixelFormat::UYVY;
|
||||
}
|
||||
else if (pixelFormat == "bgr16")
|
||||
else if (pixelFormat.compare("bgr16") )
|
||||
{
|
||||
return PIXELFORMAT_BGR16;
|
||||
return PixelFormat::BGR16;
|
||||
}
|
||||
else if (pixelFormat == "bgr24")
|
||||
else if (pixelFormat.compare("bgr24") )
|
||||
{
|
||||
return PIXELFORMAT_BGR24;
|
||||
return PixelFormat::BGR24;
|
||||
}
|
||||
else if (pixelFormat == "rgb32")
|
||||
else if (pixelFormat.compare("rgb32") )
|
||||
{
|
||||
return PIXELFORMAT_RGB32;
|
||||
return PixelFormat::RGB32;
|
||||
}
|
||||
else if (pixelFormat == "bgr32")
|
||||
else if (pixelFormat.compare("bgr32") )
|
||||
{
|
||||
return PIXELFORMAT_BGR32;
|
||||
return PixelFormat::BGR32;
|
||||
}
|
||||
#ifdef HAVE_JPEG_DECODER
|
||||
else if (pixelFormat == "mjpeg")
|
||||
else if (pixelFormat.compare("mjpeg") )
|
||||
{
|
||||
return PIXELFORMAT_MJPEG;
|
||||
return PixelFormat::MJPEG;
|
||||
}
|
||||
#endif
|
||||
|
||||
// return the default NO_CHANGE
|
||||
return PIXELFORMAT_NO_CHANGE;
|
||||
return PixelFormat::NO_CHANGE;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace RGBW {
|
||||
|
||||
enum WhiteAlgorithm {
|
||||
enum class WhiteAlgorithm {
|
||||
INVALID,
|
||||
SUBTRACT_MINIMUM,
|
||||
SUB_MIN_WARM_ADJUST,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
/**
|
||||
* Enumeration of the possible modes in which video can be playing (2D, 3D)
|
||||
*/
|
||||
enum VideoMode
|
||||
enum class VideoMode
|
||||
{
|
||||
VIDEO_2D,
|
||||
VIDEO_3DSBS,
|
||||
@@ -19,24 +19,24 @@ inline VideoMode parse3DMode(QString videoMode)
|
||||
|
||||
if (videoMode == "3DTAB")
|
||||
{
|
||||
return VIDEO_3DTAB;
|
||||
return VideoMode::VIDEO_3DTAB;
|
||||
}
|
||||
else if (videoMode == "3DSBS")
|
||||
{
|
||||
return VIDEO_3DSBS;
|
||||
return VideoMode::VIDEO_3DSBS;
|
||||
}
|
||||
|
||||
// return the default 2D
|
||||
return VIDEO_2D;
|
||||
return VideoMode::VIDEO_2D;
|
||||
}
|
||||
|
||||
inline QString videoMode2String(VideoMode mode)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case VIDEO_3DTAB: return "3DTAB";
|
||||
case VIDEO_3DSBS: return "3DSBS";
|
||||
case VIDEO_2D: return "2D";
|
||||
case VideoMode::VIDEO_3DTAB: return "3DTAB";
|
||||
case VideoMode::VIDEO_3DSBS: return "3DSBS";
|
||||
case VideoMode::VIDEO_2D: return "2D";
|
||||
default: return "INVALID";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user