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:
AEtHeLsYn
2016-03-09 19:25:04 +01:00
127 changed files with 3084 additions and 443 deletions

View File

@@ -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:
///