| Message ID | 20251127022256.178929-22-bryan.odonoghue@linaro.org |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Bryan O'Donoghue (2025-11-27 02:22:53) > 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(+) > > 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 1034912e7..8bcbd5dde 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 > -- > 2.51.2 >
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 1034912e7..8bcbd5dde 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