libcamera v0.7.2+1-aebe4861-nvm
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
exposure_mode_helper.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>
4 *
5 * Helper class that performs computations relating to exposure
6 */
7
8#pragma once
9
10#include <span>
11#include <utility>
12#include <vector>
13
15
17
18namespace libcamera {
19
20namespace ipa {
21
23{
24public:
25 ExposureModeHelper(std::span<std::pair<utils::Duration, double>> stages);
26 ~ExposureModeHelper() = default;
27
28 void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper);
30 double minGain, double maxGain);
31
38
39 [[nodiscard]] Result splitExposure(utils::Duration exposure) const;
40
41 utils::Duration minExposureTime() const { return minExposureTime_; }
42 utils::Duration maxExposureTime() const { return maxExposureTime_; }
43 double minGain() const { return minGain_; }
44 double maxGain() const { return maxGain_; }
45
46private:
47 utils::Duration clampExposureTime(utils::Duration exposureTime,
48 double *quantizationGain = nullptr) const;
49 double clampGain(double gain, double *quantizationGain = nullptr) const;
50
51 std::vector<utils::Duration> exposureTimes_;
52 std::vector<double> gains_;
53
54 utils::Duration lineDuration_;
55 utils::Duration minExposureTime_;
56 utils::Duration maxExposureTime_;
57 double minGain_;
58 double maxGain_;
59 const CameraSensorHelper *sensorHelper_;
60};
61
62} /* namespace ipa */
63
64} /* namespace libcamera */
Helper class that performs sensor-specific parameter computations.
Base class for computing sensor tuning parameters using sensor-specific constants.
Definition camera_sensor_helper.h:24
Class for splitting exposure into exposure time and total gain.
Definition exposure_mode_helper.h:23
utils::Duration minExposureTime() const
Retrieve the configured minimum exposure time limit set through setLimits()
Definition exposure_mode_helper.h:41
void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper)
Configure sensor details.
Definition exposure_mode_helper.cpp:97
utils::Duration maxExposureTime() const
Retrieve the configured maximum exposure time set through setLimits()
Definition exposure_mode_helper.h:42
Result splitExposure(utils::Duration exposure) const
Split exposure into exposure time and gain.
Definition exposure_mode_helper.cpp:211
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
double maxGain() const
Retrieve the configured maximum gain set through setLimits()
Definition exposure_mode_helper.h:44
double minGain() const
Retrieve the configured minimum gain set through setLimits()
Definition exposure_mode_helper.h:43
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition utils.h:331
Top-level libcamera namespace.
Definition backtrace.h:17
Result of splitExposure()
Definition exposure_mode_helper.h:32
utils::Duration exposureTime
The applicable exposure time.
Definition exposure_mode_helper.h:33
double analogueGain
The applicable analogue gain.
Definition exposure_mode_helper.h:34
double digitalGain
The applicable digital gain.
Definition exposure_mode_helper.h:36
double quantizationGain
The applicable quantization gain.
Definition exposure_mode_helper.h:35
Miscellaneous utility functions.