@@ -53,7 +53,7 @@ int Awb::init(IPAContext &context, const YamlObject &tuningData)
kMaxColourTemperature,
kDefaultColourTemperature);
- MatrixInterpolator<double, 2, 1> gains;
+ Interpolator<Matrix<double, 2, 1>> gains;
int ret = gains.readYaml(tuningData["gains"], "ct", "gains");
if (ret < 0)
LOG(RkISP1Awb, Warning)
@@ -124,7 +124,7 @@ void Awb::queueRequest(IPAContext &context,
const auto &colourTemperature = controls.get(controls::ColourTemperature);
if (colourTemperature && !awb.autoEnabled && gains_ && !colourGains) {
- Matrix<double, 2, 1> gains = gains_->get(*colourTemperature);
+ Matrix<double, 2, 1> gains = gains_->getInterpolated(*colourTemperature);
awb.gains.manual.red = gains[0][0];
awb.gains.manual.blue = gains[1][0];
@@ -9,7 +9,8 @@
#include <optional>
-#include "libipa/matrix_interpolator.h"
+#include "libipa/interpolator.h"
+#include "libipa/matrix.h"
#include "algorithm.h"
@@ -39,7 +40,7 @@ public:
private:
uint32_t estimateCCT(double red, double green, double blue);
- std::optional<MatrixInterpolator<double, 2, 1>> gains_;
+ std::optional<Interpolator<Matrix<double, 2, 1>>> gains_;
bool rgbMode_;
};
@@ -23,7 +23,7 @@
#include "libcamera/internal/yaml_parser.h"
#include "../utils.h"
-#include "libipa/matrix_interpolator.h"
+#include "libipa/interpolator.h"
/**
* \file ccm.h
@@ -50,7 +50,7 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData
LOG(RkISP1Ccm, Warning)
<< "Failed to parse 'ccm' "
<< "parameter from tuning file; falling back to unit matrix";
- ccm_.reset();
+ ccm_.setData({ { 0, Matrix<float, 3, 3>::identity() } });
}
ret = offsets_.readYaml(tuningData["ccms"], "ct", "offsets");
@@ -58,14 +58,8 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData
LOG(RkISP1Ccm, Warning)
<< "Failed to parse 'offsets' "
<< "parameter from tuning file; falling back to zero offsets";
- /*
- * MatrixInterpolator::reset() resets to identity matrices
- * while here we need zero matrices so we need to construct it
- * ourselves.
- */
- Matrix<int16_t, 3, 1> m({ 0, 0, 0 });
- std::map<unsigned int, Matrix<int16_t, 3, 1>> matrices = { { 0, m } };
- offsets_ = MatrixInterpolator<int16_t, 3, 1>(matrices);
+
+ offsets_.setData({ { 0, Matrix<int16_t, 3, 1>({ 0, 0, 0 }) } });
}
return 0;
@@ -117,8 +111,8 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,
}
ct_ = ct;
- Matrix<float, 3, 3> ccm = ccm_.get(ct);
- Matrix<int16_t, 3, 1> offsets = offsets_.get(ct);
+ Matrix<float, 3, 3> ccm = ccm_.getInterpolated(ct);
+ Matrix<int16_t, 3, 1> offsets = offsets_.getInterpolated(ct);
context.activeState.ccm.ccm = ccm;
frameContext.ccm.ccm = ccm;
@@ -9,8 +9,8 @@
#include <linux/rkisp1-config.h>
+#include "libipa/interpolator.h"
#include "libipa/matrix.h"
-#include "libipa/matrix_interpolator.h"
#include "algorithm.h"
@@ -40,8 +40,8 @@ private:
const Matrix<int16_t, 3, 1> &offsets);
unsigned int ct_;
- MatrixInterpolator<float, 3, 3> ccm_;
- MatrixInterpolator<int16_t, 3, 1> offsets_;
+ Interpolator<Matrix<float, 3, 3>> ccm_;
+ Interpolator<Matrix<int16_t, 3, 1>> offsets_;
};
} /* namespace ipa::rkisp1::algorithms */
Replace all occurrences of the MatrixInterpolator with the generic one. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/awb.cpp | 4 ++-- src/ipa/rkisp1/algorithms/awb.h | 5 +++-- src/ipa/rkisp1/algorithms/ccm.cpp | 18 ++++++------------ src/ipa/rkisp1/algorithms/ccm.h | 6 +++--- 4 files changed, 14 insertions(+), 19 deletions(-)