summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/contrast.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-18 09:15:58 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-28 13:47:50 +0300
commitc1597f989654618f782012104f547b367082fa3e (patch)
tree7cbf0a2ff11609d0dbe60d145711f67a0f606ff6 /src/ipa/raspberrypi/controller/rpi/contrast.cpp
parent735f0ffeaac736f91c35774e575b1280ba868d69 (diff)
ipa: raspberrypi: Use YamlParser to replace dependency on boost
The Raspberry Pi IPA module depends on boost only to parse the JSON tuning data files. As libcamera depends on libyaml, use the YamlParser class to parse those files and drop the dependency on boost. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/contrast.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/contrast.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp
index d76dc43b..5b37edcb 100644
--- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp
@@ -38,21 +38,21 @@ char const *Contrast::name() const
return NAME;
}
-int Contrast::read(boost::property_tree::ptree const &params)
+int Contrast::read(const libcamera::YamlObject &params)
{
- /* enable adaptive enhancement by default */
- config_.ceEnable = params.get<int>("ce_enable", 1);
- /* the point near the bottom of the histogram to move */
- config_.loHistogram = params.get<double>("lo_histogram", 0.01);
- /* where in the range to try and move it to */
- config_.loLevel = params.get<double>("lo_level", 0.015);
- /* but don't move by more than this */
- config_.loMax = params.get<double>("lo_max", 500);
- /* equivalent values for the top of the histogram... */
- config_.hiHistogram = params.get<double>("hi_histogram", 0.95);
- config_.hiLevel = params.get<double>("hi_level", 0.95);
- config_.hiMax = params.get<double>("hi_max", 2000);
- return config_.gammaCurve.read(params.get_child("gamma_curve"));
+ // enable adaptive enhancement by default
+ config_.ceEnable = params["ce_enable"].get<int>(1);
+ // the point near the bottom of the histogram to move
+ config_.loHistogram = params["lo_histogram"].get<double>(0.01);
+ // where in the range to try and move it to
+ config_.loLevel = params["lo_level"].get<double>(0.015);
+ // but don't move by more than this
+ config_.loMax = params["lo_max"].get<double>(500);
+ // equivalent values for the top of the histogram...
+ config_.hiHistogram = params["hi_histogram"].get<double>(0.95);
+ config_.hiLevel = params["hi_level"].get<double>(0.95);
+ config_.hiMax = params["hi_max"].get<double>(2000);
+ return config_.gammaCurve.read(params["gamma_curve"]);
}
void Contrast::setBrightness(double brightness)