mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'refs/remotes/tvdzwan/master'
# Conflicts: # include/hyperion/Hyperion.h # libsrc/hyperion/CMakeLists.txt # libsrc/hyperion/Hyperion.cpp Former-commit-id: 1144520581d4531952038d2118cb11e01bebc10e
This commit is contained in:
@@ -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