summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/awb.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-07-27 09:55:22 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-27 18:12:18 +0300
commit8757cc7c4291420e94047ea54a735cbaa1eb6adb (patch)
tree56da27fd7f8d537a7cf8c6f26564654ce32e85a7 /src/ipa/raspberrypi/controller/rpi/awb.cpp
parentf95bae418c0c606903027322e37ece22b52d3c36 (diff)
ipa: raspberryip: Remove all exception throw statements
Replace all exception throw statements with LOG(RPi*, Fatal) error messages. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/awb.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/awb.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp
index c59a71f6..c1bef96c 100644
--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp
@@ -46,18 +46,15 @@ static void readCtCurve(Pwl &ctR, Pwl &ctB,
double ct = it->second.get_value<double>();
assert(it == params.begin() || ct != ctR.domain().end);
if (++it == params.end())
- throw std::runtime_error(
- "AwbConfig: incomplete CT curve entry");
+ LOG(RPiAwb, Fatal) << "AwbConfig: incomplete CT curve entry";
ctR.append(ct, it->second.get_value<double>());
if (++it == params.end())
- throw std::runtime_error(
- "AwbConfig: incomplete CT curve entry");
+ LOG(RPiAwb, Fatal) << "AwbConfig: incomplete CT curve entry";
ctB.append(ct, it->second.get_value<double>());
num++;
}
if (num < 2)
- throw std::runtime_error(
- "AwbConfig: insufficient points in CT curve");
+ LOG(RPiAwb, Fatal) << "AwbConfig: insufficient points in CT curve";
}
void AwbConfig::read(boost::property_tree::ptree const &params)
@@ -74,12 +71,11 @@ void AwbConfig::read(boost::property_tree::ptree const &params)
AwbPrior prior;
prior.read(p.second);
if (!priors.empty() && prior.lux <= priors.back().lux)
- throw std::runtime_error("AwbConfig: Prior must be ordered in increasing lux value");
+ LOG(RPiAwb, Fatal) << "AwbConfig: Prior must be ordered in increasing lux value";
priors.push_back(prior);
}
if (priors.empty())
- throw std::runtime_error(
- "AwbConfig: no AWB priors configured");
+ LOG(RPiAwb, Fatal) << "AwbConfig: no AWB priors configured";
}
if (params.get_child_optional("modes")) {
for (auto &p : params.get_child("modes")) {
@@ -88,7 +84,7 @@ void AwbConfig::read(boost::property_tree::ptree const &params)
defaultMode = &modes[p.first];
}
if (defaultMode == nullptr)
- throw std::runtime_error("AwbConfig: no AWB modes configured");
+ LOG(RPiAwb, Fatal) << "AwbConfig: no AWB modes configured";
}
minPixels = params.get<double>("min_pixels", 16.0);
minG = params.get<uint16_t>("min_G", 32);
@@ -98,7 +94,7 @@ void AwbConfig::read(boost::property_tree::ptree const &params)
transversePos = params.get<double>("transverse_pos", 0.01);
transverseNeg = params.get<double>("transverse_neg", 0.01);
if (transversePos <= 0 || transverseNeg <= 0)
- throw std::runtime_error("AwbConfig: transverse_pos/neg must be > 0");
+ LOG(RPiAwb, Fatal) << "AwbConfig: transverse_pos/neg must be > 0";
sensitivityR = params.get<double>("sensitivity_r", 1.0);
sensitivityB = params.get<double>("sensitivity_b", 1.0);
if (bayes) {