libcamera v0.8.0+1-3c8337a0-nvm
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
lux.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (C) 2019, Raspberry Pi Ltd
4 * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>
5 *
6 * Helper class that implements lux estimation
7 */
8
9#pragma once
10
11#include <optional>
12
14
15namespace libcamera {
16
17class ControlList;
18class ValueNode;
19
20namespace ipa {
21
22class Histogram;
23
24namespace lux {
25
27 double lux;
28};
29
31 double lux;
32};
33
34} /* namespace lux */
35
37{
38public:
45
46 int init(const ValueNode &tuningData);
47 void prepare(const lux::ActiveState &state, lux::FrameContext &frameContext);
48 void process(lux::ActiveState &state, const lux::FrameContext &frameContext,
49 ControlList &metadata, std::optional<ProcessParams> &&params);
50
51private:
52 double estimateLux(const ProcessParams &params) const;
53
54 utils::Duration referenceExposureTime_;
55 double referenceAnalogueGain_;
56 double referenceDigitalGain_;
57 double referenceY_;
58 double referenceLux_;
59};
60
61} /* namespace ipa */
62
63} /* namespace libcamera */
Associate a list of ControlId with their values for an object.
Definition controls.h:453
A class representing a tree structure of values.
Definition value_node.h:27
The base class for creating histograms.
Definition histogram.h:23
Lux estimation algorithm.
Definition lux.h:37
int init(const ValueNode &tuningData)
Initialize algorithm and parse tuning data.
Definition lux.cpp:129
void process(lux::ActiveState &state, const lux::FrameContext &frameContext, ControlList &metadata, std::optional< ProcessParams > &&params)
Definition lux.cpp:196
void prepare(const lux::ActiveState &state, lux::FrameContext &frameContext)
Definition lux.cpp:181
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
Parameters for LuxAlgorithm::process()
Definition lux.h:39
double digitalGain
Effective digital gain of the frame.
Definition lux.h:42
double analogueGain
Effective analogue gain of the frame.
Definition lux.h:41
const Histogram & yHist
Luminance histogram of the frame.
Definition lux.h:43
utils::Duration exposureTime
Effective exposure time of the frame.
Definition lux.h:40
The active state for the algorithm.
Definition lux.h:26
double lux
The latest lux estimation.
Definition lux.h:27
The frame context for the algorithm.
Definition lux.h:30
double lux
The estimated lux value for the given frame.
Definition lux.h:31
Miscellaneous utility functions.