blob: 908904393fbf250fb913c18c6fa28688e5f2408b (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2019, Raspberry Pi Ltd
*
* agc.h - AGC/AEC control algorithm
*/
#pragma once
#include <optional>
#include <string>
#include <vector>
#include "../agc_algorithm.h"
#include "agc_channel.h"
namespace RPiController {
struct AgcChannelData {
AgcChannel channel;
std::optional<DeviceStatus> deviceStatus;
StatisticsPtr statistics;
};
class Agc : public AgcAlgorithm
{
public:
Agc(Controller *controller);
char const *name() const override;
int read(const libcamera::YamlObject ¶ms) override;
unsigned int getConvergenceFrames() const override;
std::vector<double> const &getWeights() const override;
void setEv(unsigned int channel, double ev) override;
void setFlickerPeriod(unsigned int channelIndex,
libcamera::utils::Duration flickerPeriod) override;
void setMaxShutter(libcamera::utils::Duration maxShutter) override;
void setFixedShutter(unsigned int channelIndex,
libcamera::utils::Duration fixedShutter) override;
void setFixedAnalogueGain(unsigned int channelIndex,
double fixedAnalogueGain) override;
void setMeteringMode(std::string const &meteringModeName) override;
void setExposureMode(unsigned int channelIndex,
std::string const &exposureModeName) override;
void setConstraintMode(unsigned int channelIndex,
std::string const &contraintModeName) override;
void enableAuto(unsigned int channelIndex) override;
void disableAuto(unsigned int channelIndex) override;
void switchMode(CameraMode const &cameraMode, Metadata *metadata) override;
void prepare(Metadata *imageMetadata) override;
void process(StatisticsPtr &stats, Metadata *imageMetadata) override;
void setActiveChannels(const std::vector<unsigned int> &activeChannels) override;
private:
int checkChannel(unsigned int channel) const;
std::vector<AgcChannelData> channelData_;
std::vector<unsigned int> activeChannels_;
unsigned int index_; /* index into the activeChannels_ */
AgcChannelTotalExposures channelTotalExposures_;
};
} /* namespace RPiController */
|