@@ -273,9 +273,9 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);
}
- controls[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],
- frameDurations[1],
- frameDurations[2]);
+ controls[&controls::FrameDurationLimits] = ControlInfo{ Span<const int64_t>({ frameDurations[0], frameDurations[0] }),
+ Span<const int64_t>({ frameDurations[1], frameDurations[1] }),
+ Span<const int64_t>({ frameDurations[2], frameDurations[2] }) };
*ipaControls = ControlInfoMap(std::move(controls), controls::controls);
}
@@ -82,15 +82,23 @@ static const ControlInfoMap::Map ipaControls{
{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },
{ &controls::ExposureValue, ControlInfo(-8.0f, 8.0f, 0.0f) },
{ &controls::AwbEnable, ControlInfo(false, true) },
- { &controls::ColourGains, ControlInfo(0.0f, 32.0f) },
+ { &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },
{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },
{ &controls::Brightness, ControlInfo(-1.0f, 1.0f, 0.0f) },
{ &controls::Contrast, ControlInfo(0.0f, 32.0f, 1.0f) },
{ &controls::Saturation, ControlInfo(0.0f, 32.0f, 1.0f) },
{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
- { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
+ { &controls::ColourCorrectionMatrix, ControlInfo{
+ Span<const float>({ -16, -16, -16, -16, -16, -16, -16, -16, -16 }),
+ Span<const float>({ 16, 16, 16, 16, 16, 16, 16, 16, 16 }),
+ Span<const float>({ 1, 0, 0, 0, 1, 0, 0, 0, 1 }),
+ } },
{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
- { &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) },
+ { &controls::FrameDurationLimits, ControlInfo{
+ Span<const int64_t>({ 33333, 33333 }),
+ Span<const int64_t>({ 120000, 120000 }),
+ Span<const int64_t>({ 33333, 33333 }),
+ } },
{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }
};
@@ -36,7 +36,7 @@ static const ControlInfoMap Controls = ControlInfoMap({
{ &controls::AeEnable, ControlInfo(false, true) },
{ &controls::ExposureTime, ControlInfo(0, 999999) },
{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },
- { &controls::ColourGains, ControlInfo(0.0f, 32.0f) },
+ { &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },
{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },
}, controls::controls);
Some control properties are typed with a Span to store an array of values. Currently those are ColourGains, SensorBlackLevels, ColourCorrectionMatrix and FrameDurationLimits. The value range and defaults in the ControlInfo of those Controls is currently defined as scalar. This prevents accessing the ControlInfo via the native Span type. By defining the ControlInfo in terms of Spans, we can avoid this issue. Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de> --- src/ipa/ipu3/ipu3.cpp | 6 +++--- src/ipa/raspberrypi/raspberrypi.cpp | 14 +++++++++++--- test/serialization/ipa_data_serializer_test.cpp | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) -- 2.34.1