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>
This commit is contained in:
parent
f95bae418c
commit
8757cc7c42
6 changed files with 34 additions and 48 deletions
|
@ -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 ¶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<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 ¶ms)
|
|||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue