[libcamera-devel,v2,0/1] libcamera: set ControlInfo for Span Controls
mbox series

Message ID 20220816191752.109151-1-Rauch.Christian@gmx.de
Headers show
Series
  • libcamera: set ControlInfo for Span Controls
Related show

Message

Christian Rauch Aug. 16, 2022, 7:17 p.m. UTC
Hello,

I sent this a while ago before some control values were defined as fixed-sized Spans. My original motivation for making the min/max/def values the same size as the Span was that I would be able to determine the Span size online. This is not a requirement anymore, since I can obtain the Span size from its 'extent'.

However, back then, there was also a discussion about the semantics of min/max values for vectors and matrices. I am sending this now again to ask if there is interest in having control value bounds of the same dimensionality as the Span itself. I envision that the min/max/def values could, per control value, either be scalar, meaning that the same min/max/def applies to all elements in the Span, or it could be a vector of the same dimensionality as the Span, meaning that the min/max/def is taken elementwise.

I see a couple, of use cases for elementwise bounds.

Example 1: The 'FrameDurationLimits' stores two elements, the minimum and maximum frame duration. In the current setting, both can range from 33333 to 120000 on the Raspberry Pi. This allows setting the minimum and maximum frame duration to the same value, effectively setting it fixed just like the 'FrameDuration'. It also allows for the maximum frame duration to be lower than the minimum frame duration, which does not make sense.

Example 2: The 'ColourCorrectionMatrix' is a 3x3 matrix, linearly mapping (r,g,b) colour values. By default, this should be the identity matrix with the diagonal elements set to 1 and the rest to 0. Using a scalar to express min/max/def values for this matrix also does not make sense.

What do you think about allowing vector types for min/max/def control values? In such a case, we could probably also make sure that the bounds have the same dimensionality as the Span via the extent.

Best,

Christian Rauch (1):
  libcamera: set ControlInfo for Span Controls

 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