mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Adjustment merge + new brightness settings (#359)
* add new rgbtransform * activate rgbtransform * integrate new transform and gamma in adjustment, disable transform * fix brighness limit * advance upper and lower thresholds * start removing color transform * adjust configs/schema * implement json for new color adjustment * finish hyperion-remote extension for new adjustment settings * fix typos * rename luminance to brightness fix jsonapi for new adjustment * fix some bugs in adjustments * fix i18n * fix gamma via json * now brighness values goes from 0-1 with 0.5 is the default for all brighness is equal between the channels. less 0.5 all channels scaled down to new brighness, above 0.5 if possible channel gets brighter - but brighness is not equal between the channels anymore brighness value curve is now exponential instead of linear - this feels more natural * hslv cleanup
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
// Utils includes
|
||||
#include <utils/RgbChannelAdjustment.h>
|
||||
#include <utils/RgbTransform.h>
|
||||
|
||||
class ColorAdjustment
|
||||
{
|
||||
@@ -29,4 +30,6 @@ public:
|
||||
RgbChannelAdjustment _rgbMagentaAdjustment;
|
||||
/// The YELLOW (RGB-Channel) adjustment
|
||||
RgbChannelAdjustment _rgbYellowAdjustment;
|
||||
|
||||
RgbTransform _rgbTransform;
|
||||
};
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// STL includes
|
||||
#include <string>
|
||||
|
||||
// Utils includes
|
||||
#include <utils/RgbChannelTransform.h>
|
||||
#include <utils/HsvTransform.h>
|
||||
#include <utils/HslTransform.h>
|
||||
|
||||
class ColorTransform
|
||||
{
|
||||
public:
|
||||
|
||||
/// Unique identifier for this color transform
|
||||
std::string _id;
|
||||
|
||||
/// The RED-Channel (RGB) transform
|
||||
RgbChannelTransform _rgbRedTransform;
|
||||
/// The GREEN-Channel (RGB) transform
|
||||
RgbChannelTransform _rgbGreenTransform;
|
||||
/// The BLUE-Channel (RGB) transform
|
||||
RgbChannelTransform _rgbBlueTransform;
|
||||
|
||||
/// The HSV Transform for applying Saturation and Value transforms
|
||||
HsvTransform _hsvTransform;
|
||||
|
||||
/// The HSL Transform for applying Saturation and Value transforms
|
||||
HslTransform _hslTransform;
|
||||
};
|
@@ -22,7 +22,6 @@
|
||||
// Hyperion includes
|
||||
#include <hyperion/LedString.h>
|
||||
#include <hyperion/PriorityMuxer.h>
|
||||
#include <hyperion/ColorTransform.h>
|
||||
#include <hyperion/ColorAdjustment.h>
|
||||
#include <hyperion/MessageForwarder.h>
|
||||
#include <hyperion/ComponentRegister.h>
|
||||
@@ -38,13 +37,9 @@
|
||||
// Forward class declaration
|
||||
class LedDevice;
|
||||
class LinearColorSmoothing;
|
||||
class ColorTransform;
|
||||
class RgbTransform;
|
||||
class EffectEngine;
|
||||
class HsvTransform;
|
||||
class HslTransform;
|
||||
class RgbChannelTransform;
|
||||
class RgbChannelAdjustment;
|
||||
class MultiColorTransform;
|
||||
class MultiColorAdjustment;
|
||||
class KODIVideoChecker;
|
||||
///
|
||||
@@ -67,14 +62,6 @@ public:
|
||||
BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, INVALID
|
||||
};
|
||||
|
||||
///
|
||||
/// Enumeration of the possible color (color-channel) transforms
|
||||
///
|
||||
enum Transform
|
||||
{
|
||||
SATURATION_GAIN, VALUE_GAIN, THRESHOLD, GAMMA, BLACKLEVEL, WHITELEVEL
|
||||
};
|
||||
|
||||
///
|
||||
/// Destructor; cleans up resources
|
||||
///
|
||||
@@ -216,23 +203,11 @@ public slots:
|
||||
///
|
||||
void setImage(int priority, const Image<ColorRgb> & image, int duration_ms);
|
||||
|
||||
///
|
||||
/// Returns the list with unique transform identifiers
|
||||
/// @return The list with transform identifiers
|
||||
///
|
||||
const std::vector<std::string> & getTransformIds() const;
|
||||
|
||||
///
|
||||
/// Returns the list with unique adjustment identifiers
|
||||
/// @return The list with adjustment identifiers
|
||||
///
|
||||
const std::vector<std::string> & getAdjustmentIds() const;
|
||||
|
||||
///
|
||||
/// Returns the ColorTransform with the given identifier
|
||||
/// @return The transform with the given identifier (or nullptr if the identifier does not exist)
|
||||
///
|
||||
ColorTransform * getTransform(const std::string& id);
|
||||
|
||||
///
|
||||
/// Returns the ColorAdjustment with the given identifier
|
||||
@@ -246,9 +221,6 @@ public slots:
|
||||
///
|
||||
MessageForwarder * getForwarder();
|
||||
|
||||
/// Tell Hyperion that the transforms have changed and the leds need to be updated
|
||||
void transformsUpdated();
|
||||
|
||||
/// Tell Hyperion that the corrections have changed and the leds need to be updated
|
||||
void adjustmentsUpdated();
|
||||
|
||||
@@ -295,14 +267,9 @@ public:
|
||||
static LedString createLedString(const QJsonValue & ledsConfig, const ColorOrder deviceOrder);
|
||||
static LedString createLedStringClone(const QJsonValue & ledsConfig, const ColorOrder deviceOrder);
|
||||
|
||||
static MultiColorTransform * createLedColorsTransform(const unsigned ledCnt, const QJsonObject & colorTransformConfig);
|
||||
static MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const QJsonObject & colorAdjustmentConfig);
|
||||
static ColorTransform * createColorTransform(const QJsonObject & transformConfig);
|
||||
static ColorAdjustment * createColorAdjustment(const QJsonObject & adjustmentConfig);
|
||||
static HsvTransform * createHsvTransform(const QJsonObject & hsvConfig);
|
||||
static HslTransform * createHslTransform(const QJsonObject & hslConfig);
|
||||
static RgbChannelTransform * createRgbChannelTransform(const QJsonObject& colorConfig);
|
||||
static RgbChannelAdjustment * createRgbChannelCorrection(const QJsonObject& colorConfig);
|
||||
static RgbTransform * createRgbTransform(const QJsonObject& colorConfig);
|
||||
static RgbChannelAdjustment * createRgbChannelAdjustment(const QJsonArray& colorConfig, const RgbChannel color);
|
||||
|
||||
static LinearColorSmoothing * createColorSmoothing(const QJsonObject & smoothingConfig, LedDevice* leddevice);
|
||||
@@ -349,9 +316,6 @@ private:
|
||||
/// The priority muxer
|
||||
PriorityMuxer _muxer;
|
||||
|
||||
/// The transformation from raw colors to led colors
|
||||
MultiColorTransform * _raw2ledTransform;
|
||||
|
||||
/// The adjustment from raw colors to led colors
|
||||
MultiColorAdjustment * _raw2ledAdjustment;
|
||||
|
||||
@@ -393,12 +357,6 @@ private:
|
||||
/// flag for v4l color correction
|
||||
bool _colorAdjustmentV4Lonly;
|
||||
|
||||
/// flag for v4l color correction
|
||||
bool _colorTransformV4Lonly;
|
||||
|
||||
/// flag for color transform enable
|
||||
bool _transformEnabled;
|
||||
|
||||
/// flag for color adjustment enable
|
||||
bool _adjustmentEnabled;
|
||||
|
||||
|
Reference in New Issue
Block a user