47 std::variant<std::monostate, AnalogueGainLinear, AnalogueGainExp>
gain_;
59 static std::unique_ptr<CameraSensorHelper>
create(
const std::string &name);
61 static std::vector<CameraSensorHelperFactoryBase *> &
factories();
68 virtual std::unique_ptr<CameraSensorHelper> createInstance()
const = 0;
73template<
typename _Helper>
83 std::unique_ptr<CameraSensorHelper> createInstance()
const override
85 return std::make_unique<_Helper>();
89#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \
90static CameraSensorHelperFactory<helper> global_##helper##Factory(name);
Utilities to help constructing class interfaces.
#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass)
Disable copy and move construction and assignment of the klass.
Definition class.h:29
CameraSensorHelperFactoryBase(const std::string name)
Construct a camera sensor helper factory base.
Definition camera_sensor_helper.cpp:228
static std::vector< CameraSensorHelperFactoryBase * > & factories()
Retrieve the list of all camera sensor helper factories.
Definition camera_sensor_helper.cpp:277
static std::unique_ptr< CameraSensorHelper > create(const std::string &name)
Create an instance of the CameraSensorHelper corresponding to a named factory.
Definition camera_sensor_helper.cpp:243
CameraSensorHelperFactory(const char *name)
Construct a camera sensor helper factory.
Definition camera_sensor_helper.h:77
std::optional< int16_t > blackLevel() const
Fetch the black level of the sensor.
Definition camera_sensor_helper.h:29
virtual uint32_t gainCode(double gain) const
Compute gain code from the analogue gain absolute value.
Definition camera_sensor_helper.cpp:88
std::optional< int16_t > blackLevel_
The black level of the sensor.
Definition camera_sensor_helper.h:46
std::variant< std::monostate, AnalogueGainLinear, AnalogueGainExp > gain_
The analogue gain parameters used for calculation.
Definition camera_sensor_helper.h:47
virtual double gain(uint32_t gainCode) const
Compute the real gain from the V4L2 subdev control gain code.
Definition camera_sensor_helper.cpp:115
CameraSensorHelper()=default
Construct a CameraSensorHelper instance.
The IPA (Image Processing Algorithm) namespace.
Definition af.cpp:58
Top-level libcamera namespace.
Definition backtrace.h:17
Analogue gain constants for the exponential gain model.
Definition camera_sensor_helper.h:41
double m
Constant used in the exponential gain coding/decoding.
Definition camera_sensor_helper.h:43
double a
Constant used in the exponential gain coding/decoding.
Definition camera_sensor_helper.h:42
Analogue gain constants for the linear gain model.
Definition camera_sensor_helper.h:34
int16_t m1
Constant used in the linear gain coding/decoding.
Definition camera_sensor_helper.h:37
int16_t m0
Constant used in the linear gain coding/decoding.
Definition camera_sensor_helper.h:35
int16_t c0
Constant used in the linear gain coding/decoding.
Definition camera_sensor_helper.h:36
int16_t c1
Constant used in the linear gain coding/decoding.
Definition camera_sensor_helper.h:38