diff options
author | Milan Zamazal <mzamazal@redhat.com> | 2024-11-28 13:52:25 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2024-12-06 12:34:48 +0000 |
commit | 3930b9402110472ef2e8d4a997f4ebc4925e864b (patch) | |
tree | 0831ba12b58680f33c986319c816a470b17955e2 /src/ipa/simple | |
parent | 9135aacff1fa8aa6af1a44493c6ec8abfbde31a3 (diff) |
libcamera: software_isp: Add contrast control
This patch introduces support for applying runtime controls to software
ISP. It enables the contrast control as the first control that can be
used.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/simple')
-rw-r--r-- | src/ipa/simple/algorithms/lut.cpp | 7 | ||||
-rw-r--r-- | src/ipa/simple/algorithms/lut.h | 1 | ||||
-rw-r--r-- | src/ipa/simple/ipa_context.h | 1 | ||||
-rw-r--r-- | src/ipa/simple/soft_simple.cpp | 9 |
4 files changed, 16 insertions, 2 deletions
diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp index dd76e117..0ba2391f 100644 --- a/src/ipa/simple/algorithms/lut.cpp +++ b/src/ipa/simple/algorithms/lut.cpp @@ -24,6 +24,13 @@ LOG_DEFINE_CATEGORY(IPASoftLut) namespace ipa::soft::algorithms { +int Lut::init(IPAContext &context, + [[maybe_unused]] const YamlObject &tuningData) +{ + context.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 2.0f, 1.0f); + return 0; +} + int Lut::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { diff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h index ef2df147..889f864b 100644 --- a/src/ipa/simple/algorithms/lut.h +++ b/src/ipa/simple/algorithms/lut.h @@ -19,6 +19,7 @@ public: Lut() = default; ~Lut() = default; + int init(IPAContext &context, const YamlObject &tuningData) override; int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void queueRequest(typename Module::Context &context, const uint32_t frame, diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h index 3771b9f5..4af51306 100644 --- a/src/ipa/simple/ipa_context.h +++ b/src/ipa/simple/ipa_context.h @@ -69,6 +69,7 @@ struct IPAContext { IPASessionConfiguration configuration; IPAActiveState activeState; FCQueue<IPAFrameContext> frameContexts; + ControlInfoMap::Map ctrlMap; }; } /* namespace ipa::soft */ diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp index 1e551e5b..b26e4e15 100644 --- a/src/ipa/simple/soft_simple.cpp +++ b/src/ipa/simple/soft_simple.cpp @@ -50,7 +50,8 @@ public: int init(const IPASettings &settings, const SharedFD &fdStats, const SharedFD &fdParams, - const ControlInfoMap &sensorInfoMap) override; + const ControlInfoMap &sensorInfoMap, + ControlInfoMap *ipaControls) override; int configure(const IPAConfigInfo &configInfo) override; int start() override; @@ -87,7 +88,8 @@ IPASoftSimple::~IPASoftSimple() int IPASoftSimple::init(const IPASettings &settings, const SharedFD &fdStats, const SharedFD &fdParams, - const ControlInfoMap &sensorInfoMap) + const ControlInfoMap &sensorInfoMap, + ControlInfoMap *ipaControls) { camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel); if (!camHelper_) { @@ -158,6 +160,9 @@ int IPASoftSimple::init(const IPASettings &settings, stats_ = static_cast<SwIspStats *>(mem); } + ControlInfoMap::Map ctrlMap = context_.ctrlMap; + *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls); + /* * Check if the sensor driver supports the controls required by the * Soft IPA. |