summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/lux.h
blob: 93ca64795803cb4f53e147691da273f6323ecf6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright (C) 2019, Raspberry Pi Ltd
 * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>
 *
 * Helper class that implements lux estimation
 */

#pragma once

#include <libcamera/base/utils.h>

namespace libcamera {

class YamlObject;

namespace ipa {

class Histogram;

class Lux
{
public:
	Lux(unsigned int binSize);

	int parseTuningData(const YamlObject &tuningData);
	double estimateLux(utils::Duration exposureTime,
			   double aGain, double dGain,
			   const Histogram &yHist) const;

private:
	unsigned int binSize_;
	utils::Duration referenceExposureTime_;
	double referenceAnalogueGain_;
	double referenceDigitalGain_;
	double referenceY_;
	double referenceLux_;
};

} /* namespace ipa */

} /* namespace libcamera */