mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
add ability to convert an image to RGB color order
forwarder: add flag to detect if forwarding is enabled Former-commit-id: c814651ec4973fe3b2bfca7c0370a0bac752f025
This commit is contained in:
@@ -27,7 +27,8 @@ public:
|
||||
|
||||
void addJsonSlave(std::string slave);
|
||||
void addProtoSlave(std::string slave);
|
||||
|
||||
|
||||
bool protoForwardingEnabled();
|
||||
QStringList getProtoSlaves();
|
||||
QList<MessageForwarder::JsonSlaveAddress> getJsonSlaves();
|
||||
|
||||
|
@@ -5,6 +5,8 @@
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <utils/ColorRgb.h>
|
||||
|
||||
|
||||
template <typename Pixel_T>
|
||||
class Image
|
||||
@@ -183,6 +185,25 @@ public:
|
||||
{
|
||||
return _pixels;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Convert image of any color order to a RGB image.
|
||||
///
|
||||
/// @param[out] image The image that buffers the output
|
||||
///
|
||||
void toRgb(Image<ColorRgb>& image)
|
||||
{
|
||||
image.resize(_width, _height);
|
||||
const unsigned imageSize = _width * _height;
|
||||
|
||||
for (unsigned idx=0; idx<imageSize; idx++)
|
||||
{
|
||||
const Pixel_T color = memptr()[idx];
|
||||
image.memptr()[idx] = ColorRgb{color.red, color.green, color.blue};
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
///
|
||||
|
Reference in New Issue
Block a user