From c1597f989654618f782012104f547b367082fa3e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 18 Jul 2022 09:15:58 +0100 Subject: 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 Tested-by: Naushir Patuck Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/rpi/contrast.cpp | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/ipa/raspberrypi/controller/rpi/contrast.cpp') 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 ¶ms) +int Contrast::read(const libcamera::YamlObject ¶ms) { - /* enable adaptive enhancement by default */ - config_.ceEnable = params.get("ce_enable", 1); - /* the point near the bottom of the histogram to move */ - config_.loHistogram = params.get("lo_histogram", 0.01); - /* where in the range to try and move it to */ - config_.loLevel = params.get("lo_level", 0.015); - /* but don't move by more than this */ - config_.loMax = params.get("lo_max", 500); - /* equivalent values for the top of the histogram... */ - config_.hiHistogram = params.get("hi_histogram", 0.95); - config_.hiLevel = params.get("hi_level", 0.95); - config_.hiMax = params.get("hi_max", 2000); - return config_.gammaCurve.read(params.get_child("gamma_curve")); + // enable adaptive enhancement by default + config_.ceEnable = params["ce_enable"].get(1); + // the point near the bottom of the histogram to move + config_.loHistogram = params["lo_histogram"].get(0.01); + // where in the range to try and move it to + config_.loLevel = params["lo_level"].get(0.015); + // but don't move by more than this + config_.loMax = params["lo_max"].get(500); + // equivalent values for the top of the histogram... + config_.hiHistogram = params["hi_histogram"].get(0.95); + config_.hiLevel = params["hi_level"].get(0.95); + config_.hiMax = params["hi_max"].get(2000); + return config_.gammaCurve.read(params["gamma_curve"]); } void Contrast::setBrightness(double brightness) -- cgit v1.2.1