Changed RgbImage to template based Image (with template for pixel type)

Former-commit-id: ef02f164eaf3c2f9dd552c1c17b525cf6eed499c
This commit is contained in:
T. van der Zwan
2013-11-11 09:00:37 +00:00
parent 90f1f282e2
commit dd16af0df5
58 changed files with 593 additions and 464 deletions

View File

@@ -15,7 +15,7 @@
// hyperion util includes
#include "hyperion/ImageProcessorFactory.h"
#include "hyperion/ImageProcessor.h"
#include "utils/RgbColor.h"
#include "utils/ColorRgb.h"
// project includes
#include "ProtoClientConnection.h"
@@ -120,7 +120,7 @@ void ProtoClientConnection::handleColorCommand(const proto::ColorRequest &messag
// extract parameters
int priority = message.priority();
int duration = message.has_duration() ? message.duration() : -1;
RgbColor color;
ColorRgb color;
color.red = qRed(message.rgbcolor());
color.green = qGreen(message.rgbcolor());
color.blue = qBlue(message.rgbcolor());
@@ -151,12 +151,12 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag
// set width and height of the image processor
_imageProcessor->setSize(width, height);
// create RgbImage
RgbImage image(width, height);
// create ImageRgb
Image<ColorRgb> image(width, height);
memcpy(image.memptr(), imageData.c_str(), imageData.size());
// process the image
std::vector<RgbColor> ledColors = _imageProcessor->process(image);
std::vector<ColorRgb> ledColors = _imageProcessor->process(image);
_hyperion->setColors(priority, ledColors, duration);
// send reply

View File

@@ -24,7 +24,7 @@ message ColorRequest {
required int32 priority = 1;
// integer value containing the rgb color (0x00RRGGBB)
required int32 rgbColor = 2;
required int32 RgbColor = 2;
// duration of the request (negative results in infinite)
optional int32 duration = 3;