Renamed ColorTransform to RgbChannelTransform

Former-commit-id: 390b832ba2d463710d4a063692f00b83a8c6c8ad
This commit is contained in:
T. van der Zwan
2013-11-19 20:17:59 +00:00
parent f5f1019f72
commit c8ce23e652
7 changed files with 41 additions and 41 deletions

View File

@@ -24,7 +24,7 @@
#include "LinearColorSmoothing.h"
#include <utils/ColorTransform.h>
#include <utils/RgbChannelTransform.h>
#include <utils/HsvTransform.h>
LedDevice* Hyperion::createDevice(const Json::Value& deviceConfig)
@@ -163,14 +163,14 @@ HsvTransform * Hyperion::createHsvTransform(const Json::Value & hsvConfig)
return new HsvTransform(saturationGain, valueGain);
}
ColorTransform* Hyperion::createColorTransform(const Json::Value& colorConfig)
RgbChannelTransform* Hyperion::createColorTransform(const Json::Value& colorConfig)
{
const double threshold = colorConfig.get("threshold", 0.0).asDouble();
const double gamma = colorConfig.get("gamma", 1.0).asDouble();
const double blacklevel = colorConfig.get("blacklevel", 0.0).asDouble();
const double whitelevel = colorConfig.get("whitelevel", 1.0).asDouble();
ColorTransform* transform = new ColorTransform(threshold, gamma, blacklevel, whitelevel);
RgbChannelTransform* transform = new RgbChannelTransform(threshold, gamma, blacklevel, whitelevel);
return transform;
}
@@ -322,7 +322,7 @@ void Hyperion::setColors(int priority, const std::vector<ColorRgb>& ledColors, c
void Hyperion::setTransform(Hyperion::Transform transform, Hyperion::Color color, double value)
{
// select the transform of the requested color
ColorTransform * t = nullptr;
RgbChannelTransform * t = nullptr;
switch (color)
{
case RED:
@@ -396,7 +396,7 @@ void Hyperion::clearall()
double Hyperion::getTransform(Hyperion::Transform transform, Hyperion::Color color) const
{
// select the transform of the requested color
ColorTransform * t = nullptr;
RgbChannelTransform * t = nullptr;
switch (color)
{
case RED:

View File

@@ -4,8 +4,6 @@
#include <hyperion/ImageToLedsMap.h>
#include <hyperion/BlackBorderProcessor.h>
#include <utils/ColorTransform.h>
using namespace hyperion;
ImageProcessor::ImageProcessor(const LedString& ledString, bool enableBlackBorderDetector) :

View File

@@ -11,11 +11,11 @@ add_library(hyperion-utils
${CURRENT_HEADER_DIR}/ColorRgba.h
${CURRENT_SOURCE_DIR}/ColorRgba.cpp
${CURRENT_HEADER_DIR}/Image.h
${CURRENT_HEADER_DIR}/ColorTransform.h
${CURRENT_HEADER_DIR}/HsvTransform.h
${CURRENT_SOURCE_DIR}/ColorTransform.cpp
${CURRENT_HEADER_DIR}/HsvTransform.h
${CURRENT_SOURCE_DIR}/HsvTransform.cpp
${CURRENT_HEADER_DIR}/RgbChannelTransform.h
${CURRENT_SOURCE_DIR}/RgbChannelTransform.cpp
${CURRENT_HEADER_DIR}/jsonschema/JsonFactory.h
${CURRENT_HEADER_DIR}/jsonschema/JsonSchemaChecker.h

View File

@@ -1,9 +1,10 @@
// STL includes
#include <cmath>
#include <utils/ColorTransform.h>
// Utils includes
#include <utils/RgbChannelTransform.h>
ColorTransform::ColorTransform() :
RgbChannelTransform::RgbChannelTransform() :
_threshold(0),
_gamma(1.0),
_blacklevel(0.0),
@@ -12,7 +13,7 @@ ColorTransform::ColorTransform() :
initializeMapping();
}
ColorTransform::ColorTransform(double threshold, double gamma, double blacklevel, double whitelevel) :
RgbChannelTransform::RgbChannelTransform(double threshold, double gamma, double blacklevel, double whitelevel) :
_threshold(threshold),
_gamma(gamma),
_blacklevel(blacklevel),
@@ -21,55 +22,55 @@ ColorTransform::ColorTransform(double threshold, double gamma, double blacklevel
initializeMapping();
}
ColorTransform::~ColorTransform()
RgbChannelTransform::~RgbChannelTransform()
{
}
double ColorTransform::getThreshold() const
double RgbChannelTransform::getThreshold() const
{
return _threshold;
}
void ColorTransform::setThreshold(double threshold)
void RgbChannelTransform::setThreshold(double threshold)
{
_threshold = threshold;
initializeMapping();
}
double ColorTransform::getGamma() const
double RgbChannelTransform::getGamma() const
{
return _gamma;
}
void ColorTransform::setGamma(double gamma)
void RgbChannelTransform::setGamma(double gamma)
{
_gamma = gamma;
initializeMapping();
}
double ColorTransform::getBlacklevel() const
double RgbChannelTransform::getBlacklevel() const
{
return _blacklevel;
}
void ColorTransform::setBlacklevel(double blacklevel)
void RgbChannelTransform::setBlacklevel(double blacklevel)
{
_blacklevel = blacklevel;
initializeMapping();
}
double ColorTransform::getWhitelevel() const
double RgbChannelTransform::getWhitelevel() const
{
return _whitelevel;
}
void ColorTransform::setWhitelevel(double whitelevel)
void RgbChannelTransform::setWhitelevel(double whitelevel)
{
_whitelevel = whitelevel;
initializeMapping();
}
void ColorTransform::initializeMapping()
void RgbChannelTransform::initializeMapping()
{
// initialize the mapping as a linear array
for (int i = 0; i < 256; ++i)