@@ -10,6 +10,7 @@
#include <variant>
#include <libcamera/base/log.h>
+#include <libcamera/base/utils.h>
/**
* \file exposure_mode_helper.h
@@ -382,6 +383,26 @@ ExposureModeHelper::splitExposure(utils::Duration exposure, std::span<const Stag
exposure / (exposureTime * gain * quantGain) };
}
+/**
+ * \brief Retrieve the maximum stage exposure time
+ *
+ * \return The largest configured stage exposure time,
+ * or a default constructed Duration object
+ * if not stages are configured
+ */
+utils::Duration
+ExposureModeHelper::maxStageExposureTime() const
+{
+ return std::visit(utils::overloaded {
+ [](const auto &) {
+ return utils::Duration{};
+ },
+ [](const std::vector<Stage> &stages) {
+ return stages.back().exposureTime;
+ },
+ }, mode_);
+}
+
} /* namespace ipa */
} /* namespace libcamera */
@@ -50,6 +50,8 @@ public:
[[nodiscard]] Result splitExposure(utils::Duration exposure) const;
+ [[nodiscard]] utils::Duration maxStageExposureTime() const;
+
private:
utils::Duration clampExposureTime(utils::Duration exposureTime,
double *quantizationGain = nullptr) const;
Add a getter that can be used to retrieve the maximum "static" exposure time (i.e. established by configuration, not by runtime `setLimits()` calls). Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/exposure_mode_helper.cpp | 21 +++++++++++++++++++++ src/ipa/libipa/exposure_mode_helper.h | 2 ++ 2 files changed, 23 insertions(+)