summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi
diff options
context:
space:
mode:
authorChristian Rauch <Rauch.Christian@gmx.de>2022-08-02 23:03:24 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-09 13:53:29 +0300
commit09c1b081baa215874545eaa35b081be06fea25b6 (patch)
tree4a420d02ffba4c2c2cbadcd3618e4d00f8dd1c4b /src/ipa/raspberrypi
parent293e23e21cea5c1eb46df3938ac8b107e43b0c2b (diff)
libcamera: controls: Generate and use fixed-sized Span types
Define Span types explicitly as either variable- or fixed-sized. This introduces a new convention for defining Span dimensions in the property and control value definitions and generates Span types as variable-sized Span<T> or as fixed-sized Span<T,N>. Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi')
-rw-r--r--src/ipa/raspberrypi/raspberrypi.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 6befdd71..69c73f8c 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -567,18 +567,19 @@ void IPARPi::reportMetadata()
AwbStatus *awbStatus = rpiMetadata_.getLocked<AwbStatus>("awb.status");
if (awbStatus) {
- libcameraMetadata_.set(controls::ColourGains, { static_cast<float>(awbStatus->gainR),
- static_cast<float>(awbStatus->gainB) });
+ libcameraMetadata_.set(controls::ColourGains,
+ Span<const float, 2>({ static_cast<float>(awbStatus->gainR),
+ static_cast<float>(awbStatus->gainB) }));
libcameraMetadata_.set(controls::ColourTemperature, awbStatus->temperatureK);
}
BlackLevelStatus *blackLevelStatus = rpiMetadata_.getLocked<BlackLevelStatus>("black_level.status");
if (blackLevelStatus)
libcameraMetadata_.set(controls::SensorBlackLevels,
- { static_cast<int32_t>(blackLevelStatus->blackLevelR),
- static_cast<int32_t>(blackLevelStatus->blackLevelG),
- static_cast<int32_t>(blackLevelStatus->blackLevelG),
- static_cast<int32_t>(blackLevelStatus->blackLevelB) });
+ Span<const int32_t, 4>({ static_cast<int32_t>(blackLevelStatus->blackLevelR),
+ static_cast<int32_t>(blackLevelStatus->blackLevelG),
+ static_cast<int32_t>(blackLevelStatus->blackLevelG),
+ static_cast<int32_t>(blackLevelStatus->blackLevelB) }));
FocusStatus *focusStatus = rpiMetadata_.getLocked<FocusStatus>("focus.status");
if (focusStatus && focusStatus->num == 12) {
@@ -883,7 +884,7 @@ void IPARPi::queueRequest(const ControlList &controls)
if (gains[0] != 0.0f && gains[1] != 0.0f)
/* A gain of 0.0f will switch back to auto mode. */
libcameraMetadata_.set(controls::ColourGains,
- { gains[0], gains[1] });
+ Span<const float, 2>({ gains[0], gains[1] }));
break;
}
@@ -1167,8 +1168,8 @@ void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDur
/* Return the validated limits via metadata. */
libcameraMetadata_.set(controls::FrameDurationLimits,
- { static_cast<int64_t>(minFrameDuration_.get<std::micro>()),
- static_cast<int64_t>(maxFrameDuration_.get<std::micro>()) });
+ Span<const int64_t, 2>({ static_cast<int64_t>(minFrameDuration_.get<std::micro>()),
+ static_cast<int64_t>(maxFrameDuration_.get<std::micro>()) }));
/*
* Calculate the maximum exposure time possible for the AGC to use.