[v6,08/16] libcamera: controls: Define a new core Hue control
diff mbox series

Message ID 20260121173737.376113-9-kieran.bingham@ideasonboard.com
State New
Headers show
Series
  • libipa: Introduce a Quantized type
Related show

Commit Message

Kieran Bingham Jan. 21, 2026, 5:37 p.m. UTC
From: "van Veen, Stephan" <stephan.vanveen@karlstorz.com>

Define a new control to support configuration of Hue adjustments when
supported by the available platform.

Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Signed-off-by: van Veen, Stephan <stephan.vanveen@karlstorz.com>
[Kieran: Rework to define as a rotation in degrees]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
v5:
 - Reworked control definition and direction

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/control_ids_core.yaml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Stefan Klug Jan. 23, 2026, 1:37 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

Quoting Kieran Bingham (2026-01-21 18:37:27)
> From: "van Veen, Stephan" <stephan.vanveen@karlstorz.com>
> 
> Define a new control to support configuration of Hue adjustments when
> supported by the available platform.
> 
> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
> Signed-off-by: van Veen, Stephan <stephan.vanveen@karlstorz.com>
> [Kieran: Rework to define as a rotation in degrees]

This looks like a leftover note?

> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> ---
> v5:
>  - Reworked control definition and direction
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  src/libcamera/control_ids_core.yaml | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> index 8e99bd84825f..67a44f8089bd 100644
> --- a/src/libcamera/control_ids_core.yaml
> +++ b/src/libcamera/control_ids_core.yaml
> @@ -1356,4 +1356,19 @@ controls:
>          Enable or disable lens dewarping. This control is only available if lens
>          dewarp parameters are configured in the tuning file.
>  
> +  - Hue:
> +      type: float
> +      direction: inout
> +      description: |
> +        Adjusts the image hue (colour rotation) in degrees, as defined in
> +        the HSL/HSV colour model.
> +
> +        The value represents a rotation around the hue circle in HSL/HSV space:
> +        positive values rotate hues clockwise (for example a +60° turns
> +        Red hues to Yellow hues), and negative values rotate counter-clockwise
> +        (a -60° turns Red hues to Magenta hues).
> +
> +        The nominal range is [-180, 180[, where 0° leaves hues unchanged and the

Should that be ]-180, 180] or maybe just [-180,180]? I think I would be
puzzled to see 180 being returned as -180 in metadata.

With the line in the commit message removed:
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>

Regards,
Stefan

> +        range wraps around continuously, with 180° == -180°.
> +
>  ...
> -- 
> 2.52.0
>
Kieran Bingham Jan. 23, 2026, 3:18 p.m. UTC | #2
Quoting Stefan Klug (2026-01-23 13:37:51)
> Hi Kieran,
> 
> Thank you for the patch.
> 
> Quoting Kieran Bingham (2026-01-21 18:37:27)
> > From: "van Veen, Stephan" <stephan.vanveen@karlstorz.com>
> > 
> > Define a new control to support configuration of Hue adjustments when
> > supported by the available platform.
> > 
> > Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
> > Signed-off-by: van Veen, Stephan <stephan.vanveen@karlstorz.com>
> > [Kieran: Rework to define as a rotation in degrees]
> 
> This looks like a leftover note?

No - that's accurate. Stephan's original patch here used an integer
value between -1 and 1 or such. I have changed this to be based in
degrees.

> 
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > 
> > ---
> > v5:
> >  - Reworked control definition and direction
> > 
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > ---
> >  src/libcamera/control_ids_core.yaml | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> > index 8e99bd84825f..67a44f8089bd 100644
> > --- a/src/libcamera/control_ids_core.yaml
> > +++ b/src/libcamera/control_ids_core.yaml
> > @@ -1356,4 +1356,19 @@ controls:
> >          Enable or disable lens dewarping. This control is only available if lens
> >          dewarp parameters are configured in the tuning file.
> >  
> > +  - Hue:
> > +      type: float
> > +      direction: inout
> > +      description: |
> > +        Adjusts the image hue (colour rotation) in degrees, as defined in
> > +        the HSL/HSV colour model.
> > +
> > +        The value represents a rotation around the hue circle in HSL/HSV space:
> > +        positive values rotate hues clockwise (for example a +60° turns
> > +        Red hues to Yellow hues), and negative values rotate counter-clockwise
> > +        (a -60° turns Red hues to Magenta hues).
> > +
> > +        The nominal range is [-180, 180[, where 0° leaves hues unchanged and the
> 
> Should that be ]-180, 180] or maybe just [-180,180]? I think I would be
> puzzled to see 180 being returned as -180 in metadata.

Yes, good point. I'd probably prefer [-180, 180]


 
> With the line in the commit message removed:
> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
> 
> Regards,
> Stefan
> 
> > +        range wraps around continuously, with 180° == -180°.
> > +
> >  ...
> > -- 
> > 2.52.0
> >

Patch
diff mbox series

diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
index 8e99bd84825f..67a44f8089bd 100644
--- a/src/libcamera/control_ids_core.yaml
+++ b/src/libcamera/control_ids_core.yaml
@@ -1356,4 +1356,19 @@  controls:
         Enable or disable lens dewarping. This control is only available if lens
         dewarp parameters are configured in the tuning file.
 
+  - Hue:
+      type: float
+      direction: inout
+      description: |
+        Adjusts the image hue (colour rotation) in degrees, as defined in
+        the HSL/HSV colour model.
+
+        The value represents a rotation around the hue circle in HSL/HSV space:
+        positive values rotate hues clockwise (for example a +60° turns
+        Red hues to Yellow hues), and negative values rotate counter-clockwise
+        (a -60° turns Red hues to Magenta hues).
+
+        The nominal range is [-180, 180[, where 0° leaves hues unchanged and the
+        range wraps around continuously, with 180° == -180°.
+
 ...