mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
color filter config additions (#142)
* add ability to disably specific color corrections update protobuf external move smoothing out of color section * update config * update schema * update schema
This commit is contained in:
parent
f1a4672a93
commit
04ab2f05f7
@ -28,18 +28,21 @@
|
||||
/// Color manipulation configuration used to tune the output colors to specific surroundings.
|
||||
/// The configuration contains a list of color-transforms. Each transform contains the
|
||||
/// following fields:
|
||||
/// * 'channelAdjustment_enable' : true/false enables/disables this channelAdjustment section
|
||||
/// * 'channelAdjustment'
|
||||
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
|
||||
/// * 'leds' : The indices (or index ranges) of the leds to which this channel adjustment applies
|
||||
/// (eg '0-5, 9, 11, 12-17'). The indices are zero based.
|
||||
/// * 'pureRed'/'pureGreen'/'pureBlue' : The manipulation in the Red-Green-Blue color domain with the
|
||||
/// following tuning parameters for each channel:
|
||||
/// * 'temperature_enable' : true/false enables/disables this temperature section
|
||||
/// * 'temperature'
|
||||
/// * 'id' : The unique identifier of the temperature (eg 'device_1')
|
||||
/// * 'leds' : The indices (or index ranges) of the leds to which this temperature applies
|
||||
/// (eg '0-5, 9, 11, 12-17'). The indices are zero based.
|
||||
/// * 'red'/'green'/'blue' : The temperature manipulation in the Red-Green-Blue color domain with the
|
||||
/// following tuning parameters for each channel:
|
||||
/// * 'transform_enable' : true/false enables/disables this transform section
|
||||
/// * 'transform'
|
||||
/// * 'id' : The unique identifier of the color transformation (eg 'device_1')
|
||||
/// * 'leds' : The indices (or index ranges) of the leds to which this color transform applies
|
||||
@ -54,18 +57,9 @@
|
||||
/// - 'threshold' The minimum required input value for the channel to be on
|
||||
/// (else zero)
|
||||
/// - 'gamma' The gamma-curve correction factor
|
||||
///
|
||||
/// Next to the list with color transforms there is also a smoothing option.
|
||||
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning
|
||||
/// parameters:
|
||||
/// - 'enable' Enable or disable the smoothing (true/false)
|
||||
/// - 'type' The type of smoothing algorithm ('linear' or 'none')
|
||||
/// - 'time_ms' The time constant for smoothing algorithm in milliseconds
|
||||
/// - 'updateFrequency' The update frequency of the leds in Hz
|
||||
/// - 'updateDelay' The delay of the output to leds (in periods of smoothing)
|
||||
/// - 'continuousOutput' Flag for enabling continuous output to Leds regardless of new input or not
|
||||
"color" :
|
||||
{
|
||||
"channelAdjustment_enable" : true,
|
||||
"channelAdjustment" :
|
||||
[
|
||||
{
|
||||
@ -91,6 +85,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature_enable" : true,
|
||||
"temperature" :
|
||||
[
|
||||
{
|
||||
@ -104,6 +99,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"transform_enable" : true,
|
||||
"transform" :
|
||||
[
|
||||
{
|
||||
@ -131,8 +127,18 @@
|
||||
"gamma" : 2.5000
|
||||
}
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
|
||||
/// smoothing
|
||||
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning
|
||||
/// parameters:
|
||||
/// - 'enable' Enable or disable the smoothing (true/false)
|
||||
/// - 'type' The type of smoothing algorithm ('linear' or 'none')
|
||||
/// - 'time_ms' The time constant for smoothing algorithm in milliseconds
|
||||
/// - 'updateFrequency' The update frequency of the leds in Hz
|
||||
/// - 'updateDelay' The delay of the output to leds (in periods of smoothing)
|
||||
/// - 'continuousOutput' Flag for enabling continuous output to Leds regardless of new input or not
|
||||
"smoothing" :
|
||||
{
|
||||
"enable" : true,
|
||||
@ -141,7 +147,6 @@
|
||||
"updateFrequency" : 25.0000,
|
||||
"updateDelay" : 0,
|
||||
"continuousOutput" : true
|
||||
}
|
||||
},
|
||||
|
||||
/// Configuration for the embedded V4L2 grabber
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
"color" :
|
||||
{
|
||||
"channelAdjustment_enable" : true,
|
||||
"channelAdjustment" :
|
||||
[
|
||||
{
|
||||
@ -40,6 +41,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"temperature_enable" : true,
|
||||
"temperature" :
|
||||
[
|
||||
{
|
||||
@ -53,6 +55,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"transform_enable" : true,
|
||||
"transform" :
|
||||
[
|
||||
{
|
||||
@ -80,7 +83,9 @@
|
||||
"gamma" : 2.5000
|
||||
}
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
|
||||
"smoothing" :
|
||||
{
|
||||
"enable" : true,
|
||||
@ -88,8 +93,7 @@
|
||||
"time_ms" : 200,
|
||||
"updateFrequency" : 25.0000,
|
||||
"updateDelay" : 0,
|
||||
"continuousOutput" : false
|
||||
}
|
||||
"continuousOutput" : true
|
||||
},
|
||||
|
||||
"grabber-v4l2" :
|
||||
|
2
dependencies/external/protobuf
vendored
2
dependencies/external/protobuf
vendored
@ -1 +1 @@
|
||||
Subproject commit ec0114231786a7e4ab819e66c826425b0bd2f8d0
|
||||
Subproject commit efb59b79e5a8f26eae4d15f38bbfb5667e23df60
|
@ -325,4 +325,8 @@ private:
|
||||
|
||||
/// register of input sources and it's prio channel
|
||||
PriorityRegister _priorityRegister;
|
||||
|
||||
bool _transformEnabled;
|
||||
bool _adjustmentEnabled;
|
||||
bool _temperatureEnabled;
|
||||
};
|
||||
|
@ -501,7 +501,7 @@ LedDevice * Hyperion::createColorSmoothing(const Json::Value & smoothingConfig,
|
||||
smoothingConfig.get("updateFrequency", 25.0).asDouble(),
|
||||
smoothingConfig.get("time_ms", 200).asInt(),
|
||||
smoothingConfig.get("updateDelay", 0).asUInt(),
|
||||
smoothingConfig.get("continuousOutput", false).asBool()
|
||||
smoothingConfig.get("continuousOutput", true).asBool()
|
||||
);
|
||||
}
|
||||
|
||||
@ -568,6 +568,15 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const std::string configFile)
|
||||
{
|
||||
throw std::runtime_error("Color transformation incorrectly set");
|
||||
}
|
||||
// set color correction activity state
|
||||
_transformEnabled = jsonConfig["color"].get("transform_enable",true).asBool();
|
||||
_adjustmentEnabled = jsonConfig["color"].get("channelAdjustment_enable",true).asBool();
|
||||
_temperatureEnabled = jsonConfig["color"].get("temperature_enable",true).asBool();
|
||||
|
||||
InfoIf(!_transformEnabled , _log, "Color transformation disabled" );
|
||||
InfoIf(!_adjustmentEnabled , _log, "Color adjustment disabled" );
|
||||
InfoIf(!_temperatureEnabled, _log, "Color temperature disabled" );
|
||||
|
||||
// initialize the image processor factory
|
||||
ImageProcessorFactory::getInstance().init(
|
||||
_ledString,
|
||||
@ -575,7 +584,8 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const std::string configFile)
|
||||
);
|
||||
|
||||
// initialize the color smoothing filter
|
||||
_device = createColorSmoothing(jsonConfig["color"]["smoothing"], _device);
|
||||
_device = createColorSmoothing(jsonConfig["smoothing"], _device);
|
||||
|
||||
|
||||
// setup the timer
|
||||
_timer.setSingleShot(true);
|
||||
@ -796,9 +806,9 @@ void Hyperion::update()
|
||||
|
||||
// Apply the correction and the transform to each led and color-channel
|
||||
// Avoid applying correction, the same task is performed by adjustment
|
||||
_raw2ledTransform->applyTransform(_ledBuffer);
|
||||
_raw2ledAdjustment->applyAdjustment(_ledBuffer);
|
||||
_raw2ledTemperature->applyCorrection(_ledBuffer);
|
||||
if (_transformEnabled) _raw2ledTransform->applyTransform(_ledBuffer);
|
||||
if (_adjustmentEnabled) _raw2ledAdjustment->applyAdjustment(_ledBuffer);
|
||||
if (_temperatureEnabled) _raw2ledTemperature->applyCorrection(_ledBuffer);
|
||||
|
||||
const std::vector<Led>& leds = _ledString.leds();
|
||||
|
||||
|
@ -58,6 +58,7 @@
|
||||
"required" : true,
|
||||
"properties":
|
||||
{
|
||||
"channelAdjustment_enable" : "boolean",
|
||||
"channelAdjustment" :
|
||||
{
|
||||
"type" : "array",
|
||||
@ -172,6 +173,7 @@
|
||||
"additionalProperties" : false
|
||||
}
|
||||
},
|
||||
"temperature_enable" : "boolean",
|
||||
"temperature" :
|
||||
{
|
||||
"type" : "array",
|
||||
@ -226,6 +228,7 @@
|
||||
"additionalProperties" : false
|
||||
}
|
||||
},
|
||||
"transform_enable" : "boolean",
|
||||
"transform" :
|
||||
{
|
||||
"type" : "array",
|
||||
@ -345,6 +348,9 @@
|
||||
},
|
||||
"additionalProperties" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
},
|
||||
"smoothing":
|
||||
{
|
||||
@ -390,9 +396,6 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
},
|
||||
"grabber-v4l2" :
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user