libcamera: ipa: simple: Introduce a general correction matrix
Let's introduce IPAActiveState::combinedMatrix that is separate from IPAActiveState::ccm and represents the overall correction matrix, not only the sensor colour correction matrix. IPAActiveState::ccm still includes everything; this is changed in the followup patch. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.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
a7a0852662
commit
5f3cdafe0f
@@ -104,6 +104,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,
|
||||
if (saturation)
|
||||
applySaturation(ccm, saturation.value());
|
||||
|
||||
context.activeState.combinedMatrix = ccm;
|
||||
context.activeState.ccm = ccm;
|
||||
frameContext.saturation = saturation;
|
||||
context.activeState.matrixChanged = true;
|
||||
|
||||
@@ -131,7 +131,7 @@ void Lut::prepare(IPAContext &context,
|
||||
Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,
|
||||
0, gains.g(), 0,
|
||||
0, 0, gains.b() } };
|
||||
auto matrix = context.activeState.ccm * gainMatrix;
|
||||
auto matrix = context.activeState.combinedMatrix * gainMatrix;
|
||||
auto &red = params->redCcm;
|
||||
auto &green = params->greenCcm;
|
||||
auto &blue = params->blueCcm;
|
||||
|
||||
@@ -63,6 +63,7 @@ struct IPAActiveState {
|
||||
} gamma;
|
||||
|
||||
Matrix<float, 3, 3> ccm;
|
||||
Matrix<float, 3, 3> combinedMatrix;
|
||||
bool matrixChanged = false;
|
||||
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user