[{"id":32890,"web_url":"https://patchwork.libcamera.org/comment/32890/","msgid":"<20241220093410.GA6745@pendragon.ideasonboard.com>","date":"2024-12-20T09:34:10","subject":"Re: [PATCH v6 1/9] 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":"Hi Stefan,\n\nThank you for the patch.\n\nOn Thu, Dec 19, 2024 at 06:57:18PM +0100, Stefan Klug wrote:\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> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> Changes in v6:\n> - Clarify interdependencies between ColourTemperature, ColourGains and\n>   ColourCorrectionMatrix\n> \n> Changes in v5:\n> - Improve documentation\n> ---\n>  src/libcamera/control_ids_core.yaml | 38 +++++++++++++++++++++++++++--\n>  1 file changed, 36 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> index 073e0611d47c..1dfaee0c6327 100644\n> --- a/src/libcamera/control_ids_core.yaml\n> +++ b/src/libcamera/control_ids_core.yaml\n> @@ -298,7 +298,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 temperature, 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> @@ -357,17 +369,34 @@ controls:\n>          order.\n>  \n>          ColourGains can only be applied in a Request when the AWB is disabled.\n> +        If ColourGains is set in a request but ColourTemperature is not, the\n> +        implementation shall calculate and set the ColourTemperature based on\n> +        the ColourGains.\n>  \n>          \\sa AwbEnable\n> +        \\sa ColourTemperature\n>        size: [2]\n>  \n>    - ColourTemperature:\n>        type: int32_t\n>        direction: out\n>        description: |\n> -        Report the estimate of the colour temperature for the frame, in kelvin.\n> +        ColourTemperature of the frame, in kelvin.\n> +\n> +        ColourTemperature can only be applied in a Request when the AWB is\n> +        disabled.\n>  \n> -        The ColourTemperature control can only be returned in metadata.\n> +        If ColourTemperature is set in a request but ColourGains is not, the\n> +        implementation shall calculate and set the ColourGains based on the\n> +        given ColourTemperature. If ColourTemperature is set (either directly,\n> +        or indirectly by setting ColourGains) but ColourCorrectionMatrix is not,\n> +        the ColourCorrectionMatrix is updated based on the ColourTemperature.\n> +\n> +        The ColourTemperature used to process the frame is reported in metadata.\n> +\n> +        \\sa AwbEnable\n> +        \\sa ColourCorrectionMatrix\n> +        \\sa ColourGains\n>  \n>    - Saturation:\n>        type: float\n> @@ -429,6 +458,11 @@ controls:\n>          stored in conventional reading order in an array of 9 floating point\n>          values.\n>  \n> +        ColourCorrectionMatrix can only be applied in a Request when the AWB is \n> +        disabled.\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 195ACC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 09:34:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C5DA68488;\n\tFri, 20 Dec 2024 10:34:27 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B2D262C8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 10:34:17 +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 AC48CABE;\n\tFri, 20 Dec 2024 10:33:37 +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=\"Pvd8RuhG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734687217;\n\tbh=9XAIMCwM4CtAxGTffoObp6ddCIqjZthVdLUCYzUs5FM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Pvd8RuhGiuEZbc5qOSPDD+cArRGJXj7ghLh6ksW07IXfSHfzAXTePXEPpY1CvN+97\n\tSJZtznFxO64P8ySmFQkhI/UapaQnsXHeY7OLfTSzVpNZT9afC8IC1LOBEYm90g2HVy\n\tLIlFLOcxyBYpGdpA1lOXgVA4Nsj493j/RykWDubE=","Date":"Fri, 20 Dec 2024 11:34:10 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v6 1/9] libcamera: controls: Update the ColourTemperature\n\tcontrol to be writable","Message-ID":"<20241220093410.GA6745@pendragon.ideasonboard.com>","References":"<20241219175729.293782-1-stefan.klug@ideasonboard.com>\n\t<20241219175729.293782-2-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241219175729.293782-2-stefan.klug@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>"}}]