[{"id":34627,"web_url":"https://patchwork.libcamera.org/comment/34627/","msgid":"<20250624184456.GC20757@pendragon.ideasonboard.com>","date":"2025-06-24T18:44:56","subject":"Re: [PATCH 2/3] libcamera: controls: Define a new core Hue control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jun 24, 2025 at 06:12:22PM +0100, Kieran Bingham wrote:\n> From: \"van Veen, Stephan\" <stephan.vanveen@karlstorz.com>\n> \n> Define a new control to support configuration of Hue adjustments when\n> supported by the available platform.\n> \n> Signed-off-by: van Veen, Stephan <stephan.vanveen@karlstorz.com>\n> [Kieran: Split control addition and implementation and refactor commit\n> messages]\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> \n> Open questions\n> \n> How should we standardise the units on this control? Should this be a\n> scale of -1, 0, +1 and scaled to the capability of the hardware by the\n> IPA? Or should we standardise on similar units from a colour wheel and\n> use values in degrees (for RKISP1 use case this would be -90,0,+87.188).\n\nA value in degrees seem more standard.\n\n> As the RKISP1 makes a phase shift adjustment, is this expected to be\n> similar on other pipelines? Or should we also expect anything that would\n> expose a full 360 degree explicit hue? (I assume not now I write that\n> :D)\n\nI wonder why the rkisp1 limits the adjustement to [-90, +90[ range. Any\ninsight ?\n\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/control_ids_core.yaml | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n> \n> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> index 028919ef3d3e..58abf8434eae 100644\n> --- a/src/libcamera/control_ids_core.yaml\n> +++ b/src/libcamera/control_ids_core.yaml\n> @@ -1281,4 +1281,14 @@ controls:\n>  \n>          The FrameWallClock control can only be returned in metadata.\n>  \n> +  - Hue:\n> +      type: float\n> +      direction: inout\n> +      description:  |\n> +        Specify a fixed hue parameter.\n> +\n> +        Positive values (up to 1.0) produce an increase of the hue angle up to\n> +        90 degrees; negative values (up to -1.0) produce a decrease of the hue\n> +        angle down to -90 degrees.\n> +\n>  ...","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B0513C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Jun 2025 18:45:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F375168DC6;\n\tTue, 24 Jun 2025 20:45:18 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4403A61534\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Jun 2025 20:45:17 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 6E2196F3;\n\tTue, 24 Jun 2025 20:44:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Qp+MUSA8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750790699;\n\tbh=o7E97ZnnUKQBiX7Lg4BDqVt5gWvEosLUQ9phG0LVcmY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Qp+MUSA8bgkq0e4wA3oJdiySWt7TeW7wm3TJzEVzaY1AP5VXUtjgnyADQ2PZrgpW9\n\tRAsMa2buQQ1gUHsc2hGTw5aWtljX7wjvVYmgBukmdKu+/FDlzk+9prNc73LhSSlLMZ\n\tz7Apr6jA9724DXiK0gwv4LPdwG8hRYgamjcwfc8M=","Date":"Tue, 24 Jun 2025 21:44:56 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\t\"van Veen, Stephan\" <stephan.vanveen@karlstorz.com>","Subject":"Re: [PATCH 2/3] libcamera: controls: Define a new core Hue control","Message-ID":"<20250624184456.GC20757@pendragon.ideasonboard.com>","References":"<20250624171223.2181226-1-kieran.bingham@ideasonboard.com>\n\t<20250624171223.2181226-3-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250624171223.2181226-3-kieran.bingham@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":34811,"web_url":"https://patchwork.libcamera.org/comment/34811/","msgid":"<175190947888.3123004.6143090240527599856@ping.linuxembedded.co.uk>","date":"2025-07-07T17:31:18","subject":"Re: [PATCH 2/3] libcamera: controls: Define a new core Hue control","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2025-06-24 19:44:56)\n> On Tue, Jun 24, 2025 at 06:12:22PM +0100, Kieran Bingham wrote:\n> > From: \"van Veen, Stephan\" <stephan.vanveen@karlstorz.com>\n> > \n> > Define a new control to support configuration of Hue adjustments when\n> > supported by the available platform.\n> > \n> > Signed-off-by: van Veen, Stephan <stephan.vanveen@karlstorz.com>\n> > [Kieran: Split control addition and implementation and refactor commit\n> > messages]\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > ---\n> > \n> > Open questions\n> > \n> > How should we standardise the units on this control? Should this be a\n> > scale of -1, 0, +1 and scaled to the capability of the hardware by the\n> > IPA? Or should we standardise on similar units from a colour wheel and\n> > use values in degrees (for RKISP1 use case this would be -90,0,+87.188).\n> \n> A value in degrees seem more standard.\n> \n> > As the RKISP1 makes a phase shift adjustment, is this expected to be\n> > similar on other pipelines? Or should we also expect anything that would\n> > expose a full 360 degree explicit hue? (I assume not now I write that\n> > :D)\n> \n> I wonder why the rkisp1 limits the adjustement to [-90, +90[ range. Any\n> insight ?\n\nNo, the datasheets are ... very thin on context...\n\nI also think this implementation is backwards.\n\nUsing this https://i.sstatic.net/pSUUV.jpg as a color wheel, I can see\nthat applying +90 Orange goes to Magenta - which I would expect from a\n'-90' Hue, and Blue goes to Green, which is also a '-90' Hue adjustment.\n\nSimilarly applying -1.0/-90 to the control - orange becomes green in the\nresulting image, which I would consider a +90 hue adjustment.\n\nStill - the resulting colour changes are consistent although reversed\nfrom my expectations.\n\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  src/libcamera/control_ids_core.yaml | 10 ++++++++++\n> >  1 file changed, 10 insertions(+)\n> > \n> > diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> > index 028919ef3d3e..58abf8434eae 100644\n> > --- a/src/libcamera/control_ids_core.yaml\n> > +++ b/src/libcamera/control_ids_core.yaml\n> > @@ -1281,4 +1281,14 @@ controls:\n> >  \n> >          The FrameWallClock control can only be returned in metadata.\n> >  \n> > +  - Hue:\n> > +      type: float\n> > +      direction: inout\n> > +      description:  |\n> > +        Specify a fixed hue parameter.\n> > +\n> > +        Positive values (up to 1.0) produce an increase of the hue angle up to\n> > +        90 degrees; negative values (up to -1.0) produce a decrease of the hue\n> > +        angle down to -90 degrees.\n> > +\n> >  ...\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1B1A7C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jul 2025 17:31:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 12DCE68EC0;\n\tMon,  7 Jul 2025 19:31:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B59D66151E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jul 2025 19:31:22 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8861F289;\n\tMon,  7 Jul 2025 19:30:55 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MQYe4b8R\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751909455;\n\tbh=ckkSrKysKoC5XXudvcg6MH5egpxbdyK1Pie+TgsWP2A=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=MQYe4b8RtTHKiQger2q2nN03UvH0d91IZ5RBU/gne06TJ2bpd85eb3mSfd2K/HjQi\n\tBhz5DKMR1Lc1Wr6YhsJbMRe1YbIfENEz+S1NkRC9D7pX0PngelOaNxUSstlxh1wkg4\n\t/pQPP2054GsY5mWyxqNXargquM4vLK/EtcE2xHPE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250624184456.GC20757@pendragon.ideasonboard.com>","References":"<20250624171223.2181226-1-kieran.bingham@ideasonboard.com>\n\t<20250624171223.2181226-3-kieran.bingham@ideasonboard.com>\n\t<20250624184456.GC20757@pendragon.ideasonboard.com>","Subject":"Re: [PATCH 2/3] libcamera: controls: Define a new core Hue control","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>, \"van Veen,\n\tStephan\" <stephan.vanveen@karlstorz.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 07 Jul 2025 18:31:18 +0100","Message-ID":"<175190947888.3123004.6143090240527599856@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]