[libcamera-devel,v3,5/5] libcamera: controls: Add AWB related controls

Message ID 20200403145305.10288-6-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Patchset for libcamera controls
Related show

Commit Message

Naushir Patuck April 3, 2020, 2:53 p.m. UTC
AwbMode is a new enum type to specify operating mode of the AWB
algorithm. All modes may not be supported by all platforms.

ColourGains is a new float array type used to specify manual red
and blue (in that order) colour channel gains when AWB is disabled.

ColourTemperature is a new control to return the current estimate of the
colour temperature.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/control_ids.yaml | 55 +++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart April 23, 2020, 7:47 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Fri, Apr 03, 2020 at 03:53:05PM +0100, Naushir Patuck wrote:
> AwbMode is a new enum type to specify operating mode of the AWB
> algorithm. All modes may not be supported by all platforms.
> 
> ColourGains is a new float array type used to specify manual red
> and blue (in that order) colour channel gains when AWB is disabled.
> 
> ColourTemperature is a new control to return the current estimate of the
> colour temperature.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  src/libcamera/control_ids.yaml | 55 +++++++++++++++++++++++++++++++++-
>  1 file changed, 54 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index 50f9e07b..d2e1820a 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -162,7 +162,60 @@ controls:
>        description: |
>          Enable or disable the AWB.
>  
> -        \sa ManualGain
> +        \sa ColourGains
> +
> +  # AwbMode needs further attention:
> +  # - Auto-generate max enum value.
> +  # - Better handling of custom types.
> +  - AwbMode:
> +      type: int32_t
> +      description: |
> +        Specify the range of illumants to use for the AWB algorithm. The modes
> +        supported are platform specific, and not all modes may be supported.
> +      enum:
> +        - name: AwbAuto
> +          value: 0
> +          description: Search over the whole CT range.

Maybe s/CT/colour temperature/ ?

> +        - name: AwbIncandescent
> +          value: 1
> +          description: Incandescent AWB lamp mode.
> +        - name: AwbTungsten
> +          value: 2
> +          description: Tungsten AWB lamp mode.
> +        - name: AwbFluorescent
> +          value: 3
> +          description: Fluorescent AWB lamp mode.
> +        - name: AwbIndoor
> +          value: 4
> +          description: Indoor AWB lighting mode.
> +        - name: AwbDaylight
> +          value: 5
> +          description: Daylight AWB lighting mode.
> +        - name: AwbCloudy
> +          value: 6
> +          description: Cloudy AWB lighting mode.
> +        - name: AwbCustom
> +          value: 7
> +          description: Custom AWB mode.
> +        - name: AwbModeMax
> +          value: 7
> +          description: Maximum allowed value (place any new values above here).
> +
> +  - ColourGains:
> +      type: float
> +      description: |
> +        Pair of gain values for the Red and Blue colour channels, in that
> +        order. ColourGains can only be applied in a Request when the AWB is
> +        disabled.
> +
> +        \sa AwbEnable
> +      size: [2]
> +
> +  # ColourTemperature can only be returned in Metadata
> +  - ColourTemperature:
> +      type: float
> +      description: Report the current estimate of the colour temperature for
> +        this frame.

s/this frame./this frame, in kelvin./ or
s/colour temperature/colour temperature, in kelvin,/ ?

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

>  
>    - Saturation:
>        type: int32_t
Naushir Patuck April 24, 2020, 9:42 a.m. UTC | #2
Hi Laurent,

On Thu, 23 Apr 2020 at 20:48, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Naush,
>
> Thank you for the patch.
>
> On Fri, Apr 03, 2020 at 03:53:05PM +0100, Naushir Patuck wrote:
> > AwbMode is a new enum type to specify operating mode of the AWB
> > algorithm. All modes may not be supported by all platforms.
> >
> > ColourGains is a new float array type used to specify manual red
> > and blue (in that order) colour channel gains when AWB is disabled.
> >
> > ColourTemperature is a new control to return the current estimate of the
> > colour temperature.
> >
> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > ---
> >  src/libcamera/control_ids.yaml | 55 +++++++++++++++++++++++++++++++++-
> >  1 file changed, 54 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> > index 50f9e07b..d2e1820a 100644
> > --- a/src/libcamera/control_ids.yaml
> > +++ b/src/libcamera/control_ids.yaml
> > @@ -162,7 +162,60 @@ controls:
> >        description: |
> >          Enable or disable the AWB.
> >
> > -        \sa ManualGain
> > +        \sa ColourGains
> > +
> > +  # AwbMode needs further attention:
> > +  # - Auto-generate max enum value.
> > +  # - Better handling of custom types.
> > +  - AwbMode:
> > +      type: int32_t
> > +      description: |
> > +        Specify the range of illumants to use for the AWB algorithm. The modes
> > +        supported are platform specific, and not all modes may be supported.
> > +      enum:
> > +        - name: AwbAuto
> > +          value: 0
> > +          description: Search over the whole CT range.
>
> Maybe s/CT/colour temperature/ ?

Done

>
> > +        - name: AwbIncandescent
> > +          value: 1
> > +          description: Incandescent AWB lamp mode.
> > +        - name: AwbTungsten
> > +          value: 2
> > +          description: Tungsten AWB lamp mode.
> > +        - name: AwbFluorescent
> > +          value: 3
> > +          description: Fluorescent AWB lamp mode.
> > +        - name: AwbIndoor
> > +          value: 4
> > +          description: Indoor AWB lighting mode.
> > +        - name: AwbDaylight
> > +          value: 5
> > +          description: Daylight AWB lighting mode.
> > +        - name: AwbCloudy
> > +          value: 6
> > +          description: Cloudy AWB lighting mode.
> > +        - name: AwbCustom
> > +          value: 7
> > +          description: Custom AWB mode.
> > +        - name: AwbModeMax
> > +          value: 7
> > +          description: Maximum allowed value (place any new values above here).
> > +
> > +  - ColourGains:
> > +      type: float
> > +      description: |
> > +        Pair of gain values for the Red and Blue colour channels, in that
> > +        order. ColourGains can only be applied in a Request when the AWB is
> > +        disabled.
> > +
> > +        \sa AwbEnable
> > +      size: [2]
> > +
> > +  # ColourTemperature can only be returned in Metadata
> > +  - ColourTemperature:
> > +      type: float
> > +      description: Report the current estimate of the colour temperature for
> > +        this frame.
>
> s/this frame./this frame, in kelvin./ or
> s/colour temperature/colour temperature, in kelvin,/ ?

Done, using the second suggestion.  To be consistent with the previous
change for "Lux", I've removed the comment and updated the description
to say the same.

Regards,
Naush


>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> >
> >    - Saturation:
> >        type: int32_t
>
> --
> Regards,
>
> Laurent Pinchart

Patch

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index 50f9e07b..d2e1820a 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -162,7 +162,60 @@  controls:
       description: |
         Enable or disable the AWB.
 
-        \sa ManualGain
+        \sa ColourGains
+
+  # AwbMode needs further attention:
+  # - Auto-generate max enum value.
+  # - Better handling of custom types.
+  - AwbMode:
+      type: int32_t
+      description: |
+        Specify the range of illumants to use for the AWB algorithm. The modes
+        supported are platform specific, and not all modes may be supported.
+      enum:
+        - name: AwbAuto
+          value: 0
+          description: Search over the whole CT range.
+        - name: AwbIncandescent
+          value: 1
+          description: Incandescent AWB lamp mode.
+        - name: AwbTungsten
+          value: 2
+          description: Tungsten AWB lamp mode.
+        - name: AwbFluorescent
+          value: 3
+          description: Fluorescent AWB lamp mode.
+        - name: AwbIndoor
+          value: 4
+          description: Indoor AWB lighting mode.
+        - name: AwbDaylight
+          value: 5
+          description: Daylight AWB lighting mode.
+        - name: AwbCloudy
+          value: 6
+          description: Cloudy AWB lighting mode.
+        - name: AwbCustom
+          value: 7
+          description: Custom AWB mode.
+        - name: AwbModeMax
+          value: 7
+          description: Maximum allowed value (place any new values above here).
+
+  - ColourGains:
+      type: float
+      description: |
+        Pair of gain values for the Red and Blue colour channels, in that
+        order. ColourGains can only be applied in a Request when the AWB is
+        disabled.
+
+        \sa AwbEnable
+      size: [2]
+
+  # ColourTemperature can only be returned in Metadata
+  - ColourTemperature:
+      type: float
+      description: Report the current estimate of the colour temperature for
+        this frame.
 
   - Saturation:
       type: int32_t