mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge branch 'master' into add_effect_engine
Conflicts: include/hyperion/Hyperion.h libsrc/hyperion/Hyperion.cpp libsrc/jsonserver/JsonClientConnection.cpp Former-commit-id: 1df163d1880691ded2fc8b5902c6ad3501912c48
This commit is contained in:
@@ -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
|
||||
|
@@ -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)
|
@@ -154,6 +154,8 @@ void JsonSchemaChecker::checkType(const Json::Value & value, const Json::Value &
|
||||
wrongType = !value.isNumeric();
|
||||
else if (type == "integer")
|
||||
wrongType = !value.isIntegral();
|
||||
else if (type == "double")
|
||||
wrongType = !value.isDouble();
|
||||
else if (type == "boolean")
|
||||
wrongType = !value.isBool();
|
||||
else if (type == "object")
|
||||
@@ -162,6 +164,8 @@ void JsonSchemaChecker::checkType(const Json::Value & value, const Json::Value &
|
||||
wrongType = !value.isArray();
|
||||
else if (type == "null")
|
||||
wrongType = !value.isNull();
|
||||
else if (type == "enum")
|
||||
wrongType = !value.isString();
|
||||
else if (type == "any")
|
||||
wrongType = false;
|
||||
// else
|
||||
|
Reference in New Issue
Block a user