@@ -539,7 +539,7 @@ double AgcMeanLuminance::estimateInitialGain(const Traits &traits) const
*/
double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
const Histogram &hist,
- double gain)
+ double gain) const
{
auto applyConstraint = [this, &gain, &hist](const AgcConstraint &constraint) {
double lux = lux_;
@@ -569,7 +569,7 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
}
};
- std::vector<AgcConstraint> &constraints = constraintModes_[constraintModeIndex];
+ const std::vector<AgcConstraint> &constraints = constraintModes_.at(constraintModeIndex);
std::for_each(constraints.begin(), constraints.end(), applyConstraint);
std::for_each(additionalConstraints_.begin(), additionalConstraints_.end(), applyConstraint);
@@ -105,7 +105,7 @@ private:
double estimateInitialGain(const Traits &traits) const;
double constraintClampGain(uint32_t constraintModeIndex,
const Histogram &hist,
- double gain);
+ double gain) const;
utils::Duration filterExposure(utils::Duration exposureValue);
utils::Duration filteredExposure_;
There is no reason not to have this member function as `const`. Change the map lookup to use `at()` just like it is done for `calculateNewEv()`, with the same requirement that validation is the job of the caller. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/agc_mean_luminance.cpp | 4 ++-- src/ipa/libipa/agc_mean_luminance.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)