summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/alsc.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/alsc.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/alsc.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/alsc.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp
index 35da336e..7df89445 100644
--- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp
@@ -54,10 +54,10 @@ static void generateLut(double *lut, boost::property_tree::ptree const &params)
{
double cstrength = params.get<double>("corner_strength", 2.0);
if (cstrength <= 1.0)
- throw std::runtime_error("Alsc: corner_strength must be > 1.0");
+ LOG(RPiAlsc, Fatal) << "Alsc: corner_strength must be > 1.0";
double asymmetry = params.get<double>("asymmetry", 1.0);
if (asymmetry < 0)
- throw std::runtime_error("Alsc: asymmetry must be >= 0");
+ LOG(RPiAlsc, Fatal) << "Alsc: asymmetry must be >= 0";
double f1 = cstrength - 1, f2 = 1 + sqrt(cstrength);
double R2 = X * Y / 4 * (1 + asymmetry * asymmetry);
int num = 0;
@@ -79,12 +79,11 @@ static void readLut(double *lut, boost::property_tree::ptree const &params)
const int maxNum = XY;
for (auto &p : params) {
if (num == maxNum)
- throw std::runtime_error(
- "Alsc: too many entries in LSC table");
+ LOG(RPiAlsc, Fatal) << "Alsc: too many entries in LSC table";
lut[num++] = p.second.get_value<double>();
}
if (num < maxNum)
- throw std::runtime_error("Alsc: too few entries in LSC table");
+ LOG(RPiAlsc, Fatal) << "Alsc: too few entries in LSC table";
}
static void readCalibrations(std::vector<AlscCalibration> &calibrations,
@@ -96,9 +95,8 @@ static void readCalibrations(std::vector<AlscCalibration> &calibrations,
for (auto &p : params.get_child(name)) {
double ct = p.second.get<double>("ct");
if (ct <= lastCt)
- throw std::runtime_error(
- "Alsc: entries in " + name +
- " must be in increasing ct order");
+ LOG(RPiAlsc, Fatal)
+ << "Alsc: entries in " << name << " must be in increasing ct order";
AlscCalibration calibration;
calibration.ct = lastCt = ct;
boost::property_tree::ptree const &table =
@@ -106,17 +104,14 @@ static void readCalibrations(std::vector<AlscCalibration> &calibrations,
int num = 0;
for (auto it = table.begin(); it != table.end(); it++) {
if (num == XY)
- throw std::runtime_error(
- "Alsc: too many values for ct " +
- std::to_string(ct) + " in " +
- name);
+ LOG(RPiAlsc, Fatal)
+ << "Alsc: too many values for ct " << ct << " in " << name;
calibration.table[num++] =
it->second.get_value<double>();
}
if (num != XY)
- throw std::runtime_error(
- "Alsc: too few values for ct " +
- std::to_string(ct) + " in " + name);
+ LOG(RPiAlsc, Fatal)
+ << "Alsc: too few values for ct " << ct << " in " << name;
calibrations.push_back(calibration);
LOG(RPiAlsc, Debug)
<< "Read " << name << " calibration for ct " << ct;