@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
- * Copyright (C) 2024, Red Hat Inc.
+ * Copyright (C) 2024-2025 Red Hat Inc.
*
* Color lookup tables construction
*/
@@ -82,9 +82,11 @@ void Lut::updateGammaTable(IPAContext &context)
void Lut::prepare(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
- [[maybe_unused]] IPAFrameContext &frameContext,
+ IPAFrameContext &frameContext,
[[maybe_unused]] DebayerParams *params)
{
+ frameContext.contrast = context.activeState.knobs.contrast;
+
/*
* Update the gamma table if needed. This means if black level changes
* and since the black level gets updated only if a lower value is
@@ -116,6 +118,17 @@ void Lut::prepare(IPAContext &context,
}
}
+void Lut::process([[maybe_unused]] IPAContext &context,
+ [[maybe_unused]] const uint32_t frame,
+ [[maybe_unused]] IPAFrameContext &frameContext,
+ [[maybe_unused]] const SwIspStats *stats,
+ ControlList &metadata)
+{
+ const auto &contrast = frameContext.contrast;
+ if (contrast)
+ metadata.set(controls::Contrast, contrast.value());
+}
+
REGISTER_IPA_ALGORITHM(Lut, "Lut")
} /* namespace ipa::soft::algorithms */
@@ -30,6 +30,11 @@ public:
const uint32_t frame,
IPAFrameContext &frameContext,
DebayerParams *params) override;
+ void process(IPAContext &context,
+ const uint32_t frame,
+ IPAFrameContext &frameContext,
+ const SwIspStats *stats,
+ ControlList &metadata) override;
private:
void updateGammaTable(IPAContext &context);
@@ -62,6 +62,7 @@ struct IPAFrameContext : public FrameContext {
double red;
double blue;
} gains;
+ std::optional<double> contrast;
};
struct IPAContext {
Provide the requested contrast value, if any, in the metadata to add to the completed requests. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/ipa/simple/algorithms/lut.cpp | 17 +++++++++++++++-- src/ipa/simple/algorithms/lut.h | 5 +++++ src/ipa/simple/ipa_context.h | 1 + 3 files changed, 21 insertions(+), 2 deletions(-)