[{"id":32589,"web_url":"https://patchwork.libcamera.org/comment/32589/","msgid":"<173349752384.312267.2057904780056348599@ping.linuxembedded.co.uk>","date":"2024-12-06T15:05:23","subject":"Re: [PATCH v5 1/8] libcamera: controls: Update the ColourTemperature\n\tcontrol to be writable","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2024-12-06 14:52:21)\n> For manual control it is helpful to be able to specify a fixed colour\n> temperature. It also provides an easy way to apply the temperature\n> specific CCMs and colour gains that are contained in the tuning files.\n> \n> Document this and update the control dependencies.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> ---\n> Changes in v5:\n> - Improve documentation\n> ---\n>  src/libcamera/control_ids_core.yaml | 29 +++++++++++++++++++++++++++--\n>  1 file changed, 27 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> index d45cf8e56187..3795f7169911 100644\n> --- a/src/libcamera/control_ids_core.yaml\n> +++ b/src/libcamera/control_ids_core.yaml\n> @@ -283,7 +283,19 @@ controls:\n>        description: |\n>          Enable or disable the AWB.\n>  \n> +        When AWB is enabled, the algorithm estimates the colour temperature of\n> +        the scene, and computes colour gains and the colour correction matrix\n> +        automatically. The computed colour temperate, gains and correction\n> +        matrix are reported in metadata. The corresponding controls are ignored\n> +        if set in a request.\n> +\n> +        When AWB is disabled, the colour temperature, gains and correction\n> +        matrix are not updated automatically and can be set manually in\n> +        requests.\n> +\n> +        \\sa ColourCorrectionMatrix\n>          \\sa ColourGains\n> +        \\sa ColourTemperature\n>  \n>    # AwbMode needs further attention:\n>    # - Auto-generate max enum value.\n> @@ -341,14 +353,25 @@ controls:\n>          ColourGains can only be applied in a Request when the AWB is disabled.\n>  \n>          \\sa AwbEnable\n> +        \\sa ColourTemperature\n>        size: [2]\n>  \n>    - ColourTemperature:\n>        type: int32_t\n>        description: |\n> -        Report the estimate of the colour temperature for the frame, in kelvin.\n> +        Report the current estimate of the colour temperature, in kelvin, for\n\nI think I recall we need to keep the 'first line' as the brief and short\nwhich gets used in the generated documentation.\n\nPerhaps the first line could be simply:\n\n\"\"\"\n\t   ColourTemperature of the Frame.\n\"\"\"\n\nWith that (as in, 'a brief' - you can change it if you prefer)\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n> +        this frame. An implementation may allow this control to be set when AWB\n> +        is disabled. In that case ColourGains and the ColourCorrectionMatrix get\n> +        set accordingly. If ColourGains and ColourTemperature are specified at\n> +        the same time, ColourGains takes precedence. The same applies to\n> +        ColourCorrectionMatrix.\n> +\n> +        The metadata will only report measured colour temperature values when\n> +        available, even if set manually.\n>  \n> -        The ColourTemperature control can only be returned in metadata.\n> +        \\sa AwbEnable\n> +        \\sa ColourCorrectionMatrix\n> +        \\sa ColourGains\n>  \n>    - Saturation:\n>        type: float\n> @@ -405,6 +428,8 @@ controls:\n>          stored in conventional reading order in an array of 9 floating point\n>          values.\n>  \n> +        \\sa AwbEnable\n> +        \\sa ColourTemperature\n>        size: [3,3]\n>  \n>    - ScalerCrop:\n> -- \n> 2.43.0\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 5D05FBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Dec 2024 15:05:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B43D66167;\n\tFri,  6 Dec 2024 16:05:28 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E774618B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Dec 2024 16:05:27 +0100 (CET)","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 7558974C;\n\tFri,  6 Dec 2024 16:04:57 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RjYiyUcG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733497497;\n\tbh=BuzyCbCoZXuKctar1ZaxBlAj5T26lHQZWVH8Ia2kd/c=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=RjYiyUcGXuR8PUrx7dWQ80m+evlhdEFPDUDMlnIG61nofiJkGVHaHABamdFQyt7DS\n\tY4I/JDSoDBxumiv09lZYnhnUXLHd3wwOvM9nddaoNSuuHDSdgEMAj3FMonYc4PGqIb\n\thwD7ojcTJ3OqQeKqBlpZxV1EupzRae3G3X2H1hUc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241206145242.827886-2-stefan.klug@ideasonboard.com>","References":"<20241206145242.827886-1-stefan.klug@ideasonboard.com>\n\t<20241206145242.827886-2-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v5 1/8] libcamera: controls: Update the ColourTemperature\n\tcontrol to be writable","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 06 Dec 2024 15:05:23 +0000","Message-ID":"<173349752384.312267.2057904780056348599@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":32612,"web_url":"https://patchwork.libcamera.org/comment/32612/","msgid":"<20241209013411.GL17570@pendragon.ideasonboard.com>","date":"2024-12-09T01:34:11","subject":"Re: [PATCH v5 1/8] libcamera: controls: Update the ColourTemperature\n\tcontrol to be writable","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Fri, Dec 06, 2024 at 03:05:23PM +0000, Kieran Bingham wrote:\n> Quoting Stefan Klug (2024-12-06 14:52:21)\n> > For manual control it is helpful to be able to specify a fixed colour\n> > temperature. It also provides an easy way to apply the temperature\n> > specific CCMs and colour gains that are contained in the tuning files.\n> > \n> > Document this and update the control dependencies.\n> > \n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> > \n> > ---\n> > Changes in v5:\n> > - Improve documentation\n> > ---\n> >  src/libcamera/control_ids_core.yaml | 29 +++++++++++++++++++++++++++--\n> >  1 file changed, 27 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> > index d45cf8e56187..3795f7169911 100644\n> > --- a/src/libcamera/control_ids_core.yaml\n> > +++ b/src/libcamera/control_ids_core.yaml\n> > @@ -283,7 +283,19 @@ controls:\n> >        description: |\n> >          Enable or disable the AWB.\n> >  \n> > +        When AWB is enabled, the algorithm estimates the colour temperature of\n> > +        the scene, and computes colour gains and the colour correction matrix\n> > +        automatically. The computed colour temperate, gains and correction\n> > +        matrix are reported in metadata. The corresponding controls are ignored\n> > +        if set in a request.\n> > +\n> > +        When AWB is disabled, the colour temperature, gains and correction\n> > +        matrix are not updated automatically and can be set manually in\n> > +        requests.\n> > +\n> > +        \\sa ColourCorrectionMatrix\n> >          \\sa ColourGains\n> > +        \\sa ColourTemperature\n> >  \n> >    # AwbMode needs further attention:\n> >    # - Auto-generate max enum value.\n> > @@ -341,14 +353,25 @@ controls:\n> >          ColourGains can only be applied in a Request when the AWB is disabled.\n> >  \n> >          \\sa AwbEnable\n> > +        \\sa ColourTemperature\n> >        size: [2]\n> >  \n> >    - ColourTemperature:\n> >        type: int32_t\n> >        description: |\n> > -        Report the estimate of the colour temperature for the frame, in kelvin.\n> > +        Report the current estimate of the colour temperature, in kelvin, for\n> \n> I think I recall we need to keep the 'first line' as the brief and short\n> which gets used in the generated documentation.\n> \n> Perhaps the first line could be simply:\n> \n> \"\"\"\n> \t   ColourTemperature of the Frame.\n\ns/Frame/frame, in kelvin/\n\n> \"\"\"\n> \n> With that (as in, 'a brief' - you can change it if you prefer)\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > +        this frame. An implementation may allow this control to be set when AWB\n> > +        is disabled. In that case ColourGains and the ColourCorrectionMatrix get\n> > +        set accordingly. If ColourGains and ColourTemperature are specified at\n> > +        the same time, ColourGains takes precedence. The same applies to\n> > +        ColourCorrectionMatrix.\n> > +\n> > +        The metadata will only report measured colour temperature values when\n> > +        available, even if set manually.\n\nI had to re-read the whole discussion thread for the previous version of\nthis patch to understand this sentence, so we still have unresolved\nissues with the control documentation.\n\nI'll reply to the last e-mails in v4, there's unfinished business there.\n\n> >  \n> > -        The ColourTemperature control can only be returned in metadata.\n> > +        \\sa AwbEnable\n> > +        \\sa ColourCorrectionMatrix\n> > +        \\sa ColourGains\n> >  \n> >    - Saturation:\n> >        type: float\n> > @@ -405,6 +428,8 @@ controls:\n> >          stored in conventional reading order in an array of 9 floating point\n> >          values.\n> >  \n> > +        \\sa AwbEnable\n> > +        \\sa ColourTemperature\n> >        size: [3,3]\n> >  \n> >    - ScalerCrop:","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 A8F6CC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Dec 2024 01:34:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CB76267E3E;\n\tMon,  9 Dec 2024 02:34:28 +0100 (CET)","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 21ED3660E7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Dec 2024 02:34:27 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 937AD496;\n\tMon,  9 Dec 2024 02:33:55 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"l+nSXzfm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733708035;\n\tbh=pqZnXjDTN/ebq+t6kCnxqPEOZP/gaFTBllBXEV3Pw7Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=l+nSXzfmf7kVAKUng1zJZnkSHS1/8jJFGl+fjgpW/mEL5UfBvWoCfF5fFULxARAkg\n\tdDfeY84pIWqWM4+15LujiUgY886ValBlYf826u+2Yj0p3gMb99AyLPzg5Wd5GlqSKm\n\teO+Mlg48bqcj9KqfJy8JLvmfmKJ0vrMb3Brlaa+k=","Date":"Mon, 9 Dec 2024 03:34:11 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v5 1/8] libcamera: controls: Update the ColourTemperature\n\tcontrol to be writable","Message-ID":"<20241209013411.GL17570@pendragon.ideasonboard.com>","References":"<20241206145242.827886-1-stefan.klug@ideasonboard.com>\n\t<20241206145242.827886-2-stefan.klug@ideasonboard.com>\n\t<173349752384.312267.2057904780056348599@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<173349752384.312267.2057904780056348599@ping.linuxembedded.co.uk>","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>"}}]