libcamera: ipa: simple: Rename "ccm" identifiers not specific to CCM
Let's rename the identifiers that are related to general colour corrections applied by matrix operations, rather than directly to the sensor colour correction matrix. Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Robert Mader <robert.mader@collabora.com> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
77942a3bd0
commit
a7a0852662
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2024-2025, Red Hat Inc.
|
||||
* Copyright (C) 2024-2026, Red Hat Inc.
|
||||
*
|
||||
* Color lookup tables construction
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ void Lut::updateGammaTable(IPAContext &context)
|
||||
context.activeState.gamma.contrastExp = contrastExp;
|
||||
}
|
||||
|
||||
int16_t Lut::ccmValue(unsigned int i, float ccm) const
|
||||
int16_t Lut::matrixValue(unsigned int i, float ccm) const
|
||||
{
|
||||
return std::round(i * ccm);
|
||||
}
|
||||
@@ -128,25 +128,25 @@ void Lut::prepare(IPAContext &context,
|
||||
params->blue[i] = gammaTable[static_cast<unsigned int>(lutGains.b())];
|
||||
}
|
||||
} else if (context.activeState.matrixChanged || gammaUpdateNeeded) {
|
||||
Matrix<float, 3, 3> gainCcm = { { gains.r(), 0, 0,
|
||||
0, gains.g(), 0,
|
||||
0, 0, gains.b() } };
|
||||
auto ccm = context.activeState.ccm * gainCcm;
|
||||
Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,
|
||||
0, gains.g(), 0,
|
||||
0, 0, gains.b() } };
|
||||
auto matrix = context.activeState.ccm * gainMatrix;
|
||||
auto &red = params->redCcm;
|
||||
auto &green = params->greenCcm;
|
||||
auto &blue = params->blueCcm;
|
||||
params->ccm = ccm;
|
||||
params->ccm = matrix;
|
||||
if (!context.gpuIspEnabled) {
|
||||
for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {
|
||||
red[i].r = ccmValue(i, ccm[0][0]);
|
||||
red[i].g = ccmValue(i, ccm[1][0]);
|
||||
red[i].b = ccmValue(i, ccm[2][0]);
|
||||
green[i].r = ccmValue(i, ccm[0][1]);
|
||||
green[i].g = ccmValue(i, ccm[1][1]);
|
||||
green[i].b = ccmValue(i, ccm[2][1]);
|
||||
blue[i].r = ccmValue(i, ccm[0][2]);
|
||||
blue[i].g = ccmValue(i, ccm[1][2]);
|
||||
blue[i].b = ccmValue(i, ccm[2][2]);
|
||||
red[i].r = matrixValue(i, matrix[0][0]);
|
||||
red[i].g = matrixValue(i, matrix[1][0]);
|
||||
red[i].b = matrixValue(i, matrix[2][0]);
|
||||
green[i].r = matrixValue(i, matrix[0][1]);
|
||||
green[i].g = matrixValue(i, matrix[1][1]);
|
||||
green[i].b = matrixValue(i, matrix[2][1]);
|
||||
blue[i].r = matrixValue(i, matrix[0][2]);
|
||||
blue[i].g = matrixValue(i, matrix[1][2]);
|
||||
blue[i].b = matrixValue(i, matrix[2][2]);
|
||||
params->gammaLut[i] = gammaTable[i / div];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
private:
|
||||
void updateGammaTable(IPAContext &context);
|
||||
int16_t ccmValue(unsigned int i, float ccm) const;
|
||||
int16_t matrixValue(unsigned int i, float ccm) const;
|
||||
};
|
||||
|
||||
} /* namespace ipa::soft::algorithms */
|
||||
|
||||
Reference in New Issue
Block a user