@@ -27,13 +27,26 @@ namespace ipa::soft::algorithms {
LOG_DEFINE_CATEGORY(IPASoftCcm)
-int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)
+int Ccm::init([[maybe_unused]] IPAContext &context,[[maybe_unused]] const YamlObject &tuningData)
{
- int ret = ccm_.readYaml(tuningData["ccms"], "ct", "ccm");
- if (ret < 0) {
- LOG(IPASoftCcm, Error)
- << "Failed to parse 'ccm' parameter from tuning file.";
- return ret;
+ if (!context.selfInitialising) {
+ int ret = ccm_.readYaml(tuningData["ccms"], "ct", "ccm");
+ if (ret < 0) {
+ LOG(IPASoftCcm, Error)
+ << "Failed to parse 'ccm' parameter from tuning file.";
+ return ret;
+ }
+ } else {
+ /* Initialize with identity CCM at standard D65 color temperature */
+ float identity[] = { 1, 0, 0,
+ 0, 1, 0,
+ 0, 0, 1 };
+ Matrix<float, 3, 3> identityMatrix(identity);
+
+ std::map<unsigned int, Matrix<float, 3, 3>> ccmData;
+ ccmData[6500] = identityMatrix;
+
+ ccm_ = Interpolator<Matrix<float, 3, 3>>(std::move(ccmData));
}
context.ccmEnabled = true;
This is an overloaded init() routine that allows the CCM class to self enumerate a default identity CCM at colour temperature 6500k. This is required for the case where we are running GPUISP but don't have a CCM for the sensor. In this case we want to generate a default CCM and use it instead of using the CPUISP's lookup tables. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- src/ipa/simple/algorithms/ccm.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)