diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-18 09:15:58 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-28 13:47:50 +0300 |
commit | c1597f989654618f782012104f547b367082fa3e (patch) | |
tree | 7cbf0a2ff11609d0dbe60d145711f67a0f606ff6 /src/ipa/raspberrypi/controller/rpi/noise.cpp | |
parent | 735f0ffeaac736f91c35774e575b1280ba868d69 (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/noise.cpp')
-rw-r--r-- | src/ipa/raspberrypi/controller/rpi/noise.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/noise.cpp b/src/ipa/raspberrypi/controller/rpi/noise.cpp index 74fa99ba..bcd8b9ed 100644 --- a/src/ipa/raspberrypi/controller/rpi/noise.cpp +++ b/src/ipa/raspberrypi/controller/rpi/noise.cpp @@ -41,10 +41,18 @@ void Noise::switchMode(CameraMode const &cameraMode, modeFactor_ = std::max(1.0, cameraMode.noiseFactor); } -int Noise::read(boost::property_tree::ptree const ¶ms) +int Noise::read(const libcamera::YamlObject ¶ms) { - referenceConstant_ = params.get<double>("reference_constant"); - referenceSlope_ = params.get<double>("reference_slope"); + auto value = params["reference_constant"].get<double>(); + if (!value) + return -EINVAL; + referenceConstant_ = *value; + + value = params["reference_slope"].get<double>(); + if (!value) + return -EINVAL; + referenceSlope_ = *value; + return 0; } |