| Message ID | 20261019184526.252977-19-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
Hi Barnabás On Mon, Oct 19, 2026 at 08:45:25PM +0200, Barnabás Pőcze wrote: > 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(+) > > diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp > index 13dce50c48..6345a47c54 100644 > --- a/src/ipa/libipa/exposure_mode_helper.cpp > +++ b/src/ipa/libipa/exposure_mode_helper.cpp > @@ -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 I don't think our comments are styled this way > + */ > +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_); I'll post-pone comments on this part to the discussion about the Minimize/Maximize modes. > +} > + > } /* namespace ipa */ > > } /* namespace libcamera */ > diff --git a/src/ipa/libipa/exposure_mode_helper.h b/src/ipa/libipa/exposure_mode_helper.h > index a6cfb83880..ce140192b5 100644 > --- a/src/ipa/libipa/exposure_mode_helper.h > +++ b/src/ipa/libipa/exposure_mode_helper.h > @@ -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; > -- > 2.56.0 >
diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp index 13dce50c48..6345a47c54 100644 --- a/src/ipa/libipa/exposure_mode_helper.cpp +++ b/src/ipa/libipa/exposure_mode_helper.cpp @@ -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 */ diff --git a/src/ipa/libipa/exposure_mode_helper.h b/src/ipa/libipa/exposure_mode_helper.h index a6cfb83880..ce140192b5 100644 --- a/src/ipa/libipa/exposure_mode_helper.h +++ b/src/ipa/libipa/exposure_mode_helper.h @@ -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(+)