[v2,5/5] ipa: simple: Report contrast in metadata
diff mbox series

Message ID 20241219211010.103310-6-mzamazal@redhat.com
State New
Headers show
Series
  • ipa: simple: Introduce metadata reporting
Related show

Commit Message

Milan Zamazal Dec. 19, 2024, 9:10 p.m. UTC
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 | 11 +++++++++++
 src/ipa/simple/algorithms/lut.h   |  5 +++++
 2 files changed, 16 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp
index 0ba2391f..31208bfe 100644
--- a/src/ipa/simple/algorithms/lut.cpp
+++ b/src/ipa/simple/algorithms/lut.cpp
@@ -116,6 +116,17 @@  void Lut::prepare(IPAContext &context,
 	}
 }
 
+void Lut::process(IPAContext &context,
+		  [[maybe_unused]] const uint32_t frame,
+		  [[maybe_unused]] IPAFrameContext &frameContext,
+		  [[maybe_unused]] const SwIspStats *stats,
+		  ControlList &metadata)
+{
+	const auto contrast = context.activeState.knobs.contrast;
+	if (contrast)
+		metadata.set(controls::Contrast, contrast.value());
+}
+
 REGISTER_IPA_ALGORITHM(Lut, "Lut")
 
 } /* namespace ipa::soft::algorithms */
diff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h
index 889f864b..ab4e1094 100644
--- a/src/ipa/simple/algorithms/lut.h
+++ b/src/ipa/simple/algorithms/lut.h
@@ -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);