[libcamera-devel] libcamera: controls: Add sensor black levels reporting through metadata

Message ID 20200428081140.5242-1-naush@raspberrypi.com
State Accepted
Commit 668cefa7e601f345ac34d90cd6c0bf908ab4f825
Headers show
Series
  • [libcamera-devel] libcamera: controls: Add sensor black levels reporting through metadata
Related show

Commit Message

Naushir Patuck April 28, 2020, 8:11 a.m. UTC
From: David Plowman <david.plowman@raspberrypi.com>

The black levels will be used when saving RAW data in DNG containers.

Four values are reported, one for each channel, in the order R, Gr, Gb
and B. The values are reported as being out of a 16-bit pixel range
(a fully saturated pixel would be 65535), so may need subsequent
re-scaling, depending on use.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/control_ids.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Laurent Pinchart April 29, 2020, 12:50 a.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Tue, Apr 28, 2020 at 09:11:40AM +0100, Naushir Patuck wrote:
> From: David Plowman <david.plowman@raspberrypi.com>
> 
> The black levels will be used when saving RAW data in DNG containers.
> 
> Four values are reported, one for each channel, in the order R, Gr, Gb
> and B. The values are reported as being out of a 16-bit pixel range
> (a fully saturated pixel would be 65535), so may need subsequent
> re-scaling, depending on use.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

And pushed to master.

> ---
>  src/libcamera/control_ids.yaml | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index b419f8a7..77ebc3f9 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -230,4 +230,13 @@ controls:
>          Specify a fixed saturation parameter. Normal saturation is given by
>          the value 1.0; larger values produce more saturated colours; 0.0
>          produces a greyscale image.
> +
> +  - SensorBlackLevels:
> +      type: int32_t
> +      description: |
> +        Reports the sensor black levels used for processing a frame, in the
> +        order R, Gr, Gb, B. These values are returned as numbers out of a 16-bit
> +        pixel range (as if pixels ranged from 0 to 65535). The SensorBlackLevels
> +        control can only be returned in metadata.
> +      size: [4]
>  ...

Patch

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index b419f8a7..77ebc3f9 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -230,4 +230,13 @@  controls:
         Specify a fixed saturation parameter. Normal saturation is given by
         the value 1.0; larger values produce more saturated colours; 0.0
         produces a greyscale image.
+
+  - SensorBlackLevels:
+      type: int32_t
+      description: |
+        Reports the sensor black levels used for processing a frame, in the
+        order R, Gr, Gb, B. These values are returned as numbers out of a 16-bit
+        pixel range (as if pixels ranged from 0 to 65535). The SensorBlackLevels
+        control can only be returned in metadata.
+      size: [4]
 ...