libcamera v0.8.0+1-3c8337a0-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 <vector>
11
13
15
16namespace libcamera {
17
18namespace ipa {
19
21{
22public:
27
28 ExposureModeHelper(std::vector<Stage> &&stages);
29
30 void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper);
31 void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime,
32 double minGain, double maxGain);
33
40
41 [[nodiscard]] Result splitExposure(utils::Duration exposure) const;
42
43private:
44 utils::Duration clampExposureTime(utils::Duration exposureTime,
45 double *quantizationGain = nullptr) const;
46 double clampGain(double gain, double *quantizationGain = nullptr) const;
47
48 std::vector<Stage> stages_;
49
50 utils::Duration lineDuration_;
51 utils::Duration minExposureTime_;
52 utils::Duration maxExposureTime_;
53 double minGain_;
54 double maxGain_;
55 const CameraSensorHelper *sensorHelper_;
56};
57
58} /* namespace ipa */
59
60} /* 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:21
void configure(utils::Duration lineLength, const CameraSensorHelper *sensorHelper)
Configure sensor details.
Definition exposure_mode_helper.cpp:105
Result splitExposure(utils::Duration exposure) const
Split exposure into exposure time and gain.
Definition exposure_mode_helper.cpp:219
void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, double minGain, double maxGain)
Set the exposure time and gain limits.
Definition exposure_mode_helper.cpp:128
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:34
utils::Duration exposureTime
The applicable exposure time.
Definition exposure_mode_helper.h:35
double analogueGain
The applicable analogue gain.
Definition exposure_mode_helper.h:36
double digitalGain
The applicable digital gain.
Definition exposure_mode_helper.h:38
double quantizationGain
The applicable quantization gain.
Definition exposure_mode_helper.h:37
Details of an exposure stage.
Definition exposure_mode_helper.h:23
double gain
The maximum analogue gain of the stage.
Definition exposure_mode_helper.h:25
utils::Duration exposureTime
The maximum exposure time of the stage.
Definition exposure_mode_helper.h:24
Miscellaneous utility functions.