summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/camera_sensor_helper.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-02-24 21:55:44 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-04-01 14:29:05 +0300
commita9d43c4710ba0db092c2abbf7d3423f4ac58352a (patch)
tree74292a9b73918b6c7e19da9f1dfe5ed09f0016ac /src/ipa/libipa/camera_sensor_helper.h
parentf9e2df951969f10f1ee1e46fb806942a27db8aca (diff)
libipa: camera_sensor_helper: Reorganize gain constants
To prepare for other gain models than the linear model, store the gain constants in a union with per-model members. Due to the lack of designated initializer support in gcc with C++17, initializing a single complex structure that includes a union will be difficult. Split the gain model type to a separate variable to work around this issue. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/ipa/libipa/camera_sensor_helper.h')
-rw-r--r--src/ipa/libipa/camera_sensor_helper.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
index 26adfcb5..6b96520b 100644
--- a/src/ipa/libipa/camera_sensor_helper.h
+++ b/src/ipa/libipa/camera_sensor_helper.h
@@ -34,15 +34,19 @@ protected:
AnalogueGainExponential,
};
- struct AnalogueGainConstants {
- AnalogueGainType type;
+ struct AnalogueGainLinearConstants {
int16_t m0;
int16_t c0;
int16_t m1;
int16_t c1;
};
- AnalogueGainConstants analogueGainConstants_;
+ union AnalogueGainConstants {
+ AnalogueGainLinearConstants linear;
+ };
+
+ AnalogueGainType gainType_;
+ AnalogueGainConstants gainConstants_;
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelper)