From 5bfb96661f5ed5775e7976622624364565236d94 Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Thu, 11 Dec 2025 23:22:44 +0000 Subject: [PATCH] libcamera: software_isp: lut: Make gamma from lut.cpp available in debayer params 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 Reviewed-by: Kieran Bingham Signed-off-by: Bryan O'Donoghue Signed-off-by: Kieran Bingham --- 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(+) diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h index 5a0d9438..d5dad1a9 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 ccm; RGB blackLevel; + float gamma; }; } /* namespace libcamera */ diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp index 49482d71..ea5a86b2 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 11142f92..e171964b 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