Loading...
Searching...
No Matches
exposure_mode_helper.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>
*
* Helper class that performs computations relating to exposure
*/
#pragma once
#include <tuple>
#include <utility>
#include <vector>
#include <libcamera/base/span.h>
#include <libcamera/base/utils.h>
#include "camera_sensor_helper.h"
namespace libcamera {
namespace ipa {
class ExposureModeHelper
{
public:
ExposureModeHelper(const Span<std::pair<utils::Duration, double>> stages);
~ExposureModeHelper() = default;
void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper);
void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime,
double minGain, double maxGain);
std::tuple<utils::Duration, double, double, double>
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,
double *quantizationGain = nullptr) const;
double clampGain(double gain, double *quantizationGain = nullptr) const;
std::vector<utils::Duration> exposureTimes_;
std::vector<double> gains_;
utils::Duration lineDuration_;
utils::Duration minExposureTime_;
utils::Duration maxExposureTime_;
double minGain_;
double maxGain_;
const CameraSensorHelper *sensorHelper_;
};
} /* namespace ipa */
} /* namespace libcamera */
camera_sensor_helper.h
Helper class that performs sensor-specific parameter computations.
libcamera::ipa::CameraSensorHelper
Base class for computing sensor tuning parameters using sensor-specific constants.
Definition camera_sensor_helper.h:24
libcamera::ipa::ExposureModeHelper::configure
void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper)
Configure sensor details.
Definition exposure_mode_helper.cpp:97
libcamera::ipa::ExposureModeHelper::minExposureTime
utils::Duration minExposureTime() const
Retrieve the configured minimum exposure time limit set through setLimits().
Definition exposure_mode_helper.h:36
libcamera::ipa::ExposureModeHelper::splitExposure
std::tuple< utils::Duration, double, double, double > splitExposure(utils::Duration exposure) const
Split exposure into exposure time and gain.
Definition exposure_mode_helper.cpp:194
libcamera::ipa::ExposureModeHelper::setLimits
void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, double minGain, double maxGain)
Set the exposure time and gain limits.
Definition exposure_mode_helper.cpp:120
libcamera::ipa::ExposureModeHelper::minGain
double minGain() const
Retrieve the configured minimum gain set through setLimits().
Definition exposure_mode_helper.h:38
libcamera::ipa::ExposureModeHelper::ExposureModeHelper
ExposureModeHelper(const Span< std::pair< utils::Duration, double > > stages)
Construct an ExposureModeHelper instance.
Definition exposure_mode_helper.cpp:72
libcamera::ipa::ExposureModeHelper::maxGain
double maxGain() const
Retrieve the configured maximum gain set through setLimits().
Definition exposure_mode_helper.h:39
libcamera::ipa::ExposureModeHelper::maxExposureTime
utils::Duration maxExposureTime() const
Retrieve the configured maximum exposure time set through setLimits().
Definition exposure_mode_helper.h:37
libcamera::utils::Duration
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition utils.h:322
libcamera::ipa
The IPA (Image Processing Algorithm) namespace.
Definition af.cpp:58
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
utils.h
Miscellaneous utility functions.