From 8757cc7c4291420e94047ea54a735cbaa1eb6adb Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 27 Jul 2022 09:55:22 +0100 Subject: ipa: raspberryip: Remove all exception throw statements Replace all exception throw statements with LOG(RPi*, Fatal) error messages. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/ipa/raspberrypi/controller/rpi/awb.cpp') 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(); 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()); 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()); 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 ¶ms) @@ -74,12 +71,11 @@ void AwbConfig::read(boost::property_tree::ptree const ¶ms) 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 ¶ms) 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("min_pixels", 16.0); minG = params.get("min_G", 32); @@ -98,7 +94,7 @@ void AwbConfig::read(boost::property_tree::ptree const ¶ms) transversePos = params.get("transverse_pos", 0.01); transverseNeg = params.get("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("sensitivity_r", 1.0); sensitivityB = params.get("sensitivity_b", 1.0); if (bayes) { -- cgit v1.2.1