diff options
Diffstat (limited to 'src/ipa/simple/algorithms')
-rw-r--r-- | src/ipa/simple/algorithms/blc.cpp | 7 | ||||
-rw-r--r-- | src/ipa/simple/algorithms/blc.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp index b4e32fe1..1d7d370b 100644 --- a/src/ipa/simple/algorithms/blc.cpp +++ b/src/ipa/simple/algorithms/blc.cpp @@ -21,7 +21,8 @@ BlackLevel::BlackLevel() { } -int BlackLevel::init(IPAContext &context, const YamlObject &tuningData) +int BlackLevel::init([[maybe_unused]] IPAContext &context, + const YamlObject &tuningData) { auto blackLevel = tuningData["blackLevel"].get<int16_t>(); if (blackLevel.has_value()) { @@ -29,7 +30,7 @@ int BlackLevel::init(IPAContext &context, const YamlObject &tuningData) * Convert 16 bit values from the tuning file to 8 bit black * level for the SoftISP. */ - context.configuration.black.level = blackLevel.value() >> 8; + definedLevel_ = blackLevel.value() >> 8; } return 0; } @@ -37,6 +38,8 @@ int BlackLevel::init(IPAContext &context, const YamlObject &tuningData) int BlackLevel::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { + if (definedLevel_.has_value()) + context.configuration.black.level = definedLevel_; context.activeState.blc.level = context.configuration.black.level.value_or(255); return 0; diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h index 67c688ae..52d59cab 100644 --- a/src/ipa/simple/algorithms/blc.h +++ b/src/ipa/simple/algorithms/blc.h @@ -7,6 +7,9 @@ #pragma once +#include <optional> +#include <stdint.h> + #include "algorithm.h" namespace libcamera { @@ -29,6 +32,7 @@ public: private: int32_t exposure_; double gain_; + std::optional<uint8_t> definedLevel_; }; } /* namespace ipa::soft::algorithms */ |