[v3,21/22] libcamera: software_isp: lut: Make gamma from lut.cpp available in debayer params
diff mbox series

Message ID 20251202133157.661407-22-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • GPUISP precursor series
Related show

Commit Message

Bryan O'Donoghue Dec. 2, 2025, 1:31 p.m. UTC
Provide the gamma used in IPA to Bayer parameters. We will pass Gamma into
the shader via a uniform and can then tweak that value from outside at
will.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 include/libcamera/internal/software_isp/debayer_params.h | 1 +
 src/ipa/simple/algorithms/lut.cpp                        | 2 ++
 src/libcamera/software_isp/debayer.cpp                   | 5 +++++
 3 files changed, 8 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h
index 5a0d9438f..d5dad1a98 100644
--- a/include/libcamera/internal/software_isp/debayer_params.h
+++ b/include/libcamera/internal/software_isp/debayer_params.h
@@ -58,6 +58,7 @@  struct DebayerParams {
 	 */
 	Matrix<float, 3, 3> ccm;
 	RGB<float> blackLevel;
+	float gamma;
 };
 
 } /* namespace libcamera */
diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp
index 49482d711..ea5a86b20 100644
--- a/src/ipa/simple/algorithms/lut.cpp
+++ b/src/ipa/simple/algorithms/lut.cpp
@@ -147,6 +147,8 @@  void Lut::prepare(IPAContext &context,
 			params->gammaLut[i] = gammaTable[i / div];
 		}
 	}
+
+	params->gamma = context.configuration.gamma;
 }
 
 void Lut::process([[maybe_unused]] IPAContext &context,
diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp
index 16bf7a218..7e8d81c09 100644
--- a/src/libcamera/software_isp/debayer.cpp
+++ b/src/libcamera/software_isp/debayer.cpp
@@ -110,6 +110,11 @@  namespace libcamera {
  * \brief Blacklevel gains for the GPUISP
  */
 
+/**
+ * \var DebayerParams::gamma
+ * \brief Gamma value for the GPUISP
+ */
+
 /**
  * \class Debayer
  * \brief Base debayering class