summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/noise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/noise.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/noise.cpp14
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 &params)
+int Noise::read(const libcamera::YamlObject &params)
{
- 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;
}