libcamera: software_isp: blacklevel: Make black level available in debayer params

Populate black level gain in blacklevel::prepare(). A copy is made of the gain
value in the DebayerParams structure.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Bryan O'Donoghue
2025-12-11 23:22:43 +00:00
committed by Kieran Bingham
parent 3d7ef342b7
commit 724a29e3cd
4 changed files with 20 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#include <stdint.h>
#include "libcamera/internal/matrix.h"
#include "libcamera/internal/vector.h"
namespace libcamera {
@@ -56,6 +57,7 @@ struct DebayerParams {
* Per frame corrections as calculated by the IPA
*/
Matrix<float, 3, 3> ccm;
RGB<float> blackLevel;
};
} /* namespace libcamera */

View File

@@ -47,6 +47,15 @@ int BlackLevel::configure(IPAContext &context,
return 0;
}
void BlackLevel::prepare(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
DebayerParams *params)
{
/* Latch the blacklevel gain so GPUISP can apply. */
params->blackLevel = RGB<float>(context.activeState.blc.level / 255.0f);
}
void BlackLevel::process(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
IPAFrameContext &frameContext,

View File

@@ -24,6 +24,10 @@ public:
int init(IPAContext &context, const YamlObject &tuningData) override;
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void prepare(IPAContext &context,
const uint32_t frame,
IPAFrameContext &frameContext,
DebayerParams *params) override;
void process(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
const SwIspStats *stats,

View File

@@ -105,6 +105,11 @@ namespace libcamera {
* \brief Per frame colour correction matrix for GPUISP
*/
/**
* \var DebayerParams::blackLevel
* \brief Blacklevel gains for the GPUISP
*/
/**
* \class Debayer
* \brief Base debayering class