/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2024, Paul Elder * * Helper class that performs computations relating to exposure */ #pragma once #include #include #include #include #include namespace libcamera { namespace ipa { class ExposureModeHelper { public: ExposureModeHelper(const Span> stages); ~ExposureModeHelper() = default; void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, double minGain, double maxGain); std::tuple splitExposure(utils::Duration exposure) const; utils::Duration minExposureTime() const { return minExposureTime_; } utils::Duration maxExposureTime() const { return maxExposureTime_; } double minGain() const { return minGain_; } double maxGain() const { return maxGain_; } private: utils::Duration clampExposureTime(utils::Duration exposureTime) const; double clampGain(double gain) const; std::vector exposureTimes_; std::vector gains_; utils::Duration minExposureTime_; utils::Duration maxExposureTime_; double minGain_; double maxGain_; }; } /* namespace ipa */ } /* namespace libcamera */