[{"id":31607,"web_url":"https://patchwork.libcamera.org/comment/31607/","msgid":"<20241007224119.GI30699@pendragon.ideasonboard.com>","date":"2024-10-07T22:41:19","subject":"Re: [PATCH v2 1/2] ipa: rpi: awb: Add a const for the default colour\n\ttemperature","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Thu, Oct 03, 2024 at 09:02:26AM +0100, Naushir Patuck wrote:\n> A default CT of 4500K is used in a couple of places. Add a constexpr\n> value for the default CT value and use it instead.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rpi/controller/rpi/awb.cpp | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\n> index f45525bce2d1..3904fed615f7 100644\n> --- a/src/ipa/rpi/controller/rpi/awb.cpp\n> +++ b/src/ipa/rpi/controller/rpi/awb.cpp\n> @@ -20,6 +20,8 @@ using namespace libcamera;\n>  \n>  LOG_DEFINE_CATEGORY(RPiAwb)\n>  \n> +constexpr double DefaultCT = 4500.0;\n\ns/DefaultCT/kDefaultCT/\n\n> +\n>  #define NAME \"rpi.awb\"\n>  \n>  /*\n> @@ -214,7 +216,7 @@ void Awb::initialise()\n>  \t\tsyncResults_.gainB = 1.0 / config_.ctB.eval(syncResults_.temperatureK);\n>  \t} else {\n>  \t\t/* random values just to stop the world blowing up */\n> -\t\tsyncResults_.temperatureK = 4500;\n> +\t\tsyncResults_.temperatureK = DefaultCT;\n>  \t\tsyncResults_.gainR = syncResults_.gainG = syncResults_.gainB = 1.0;\n>  \t}\n>  \tprevSyncResults_ = syncResults_;\n> @@ -716,7 +718,11 @@ void Awb::awbGrey()\n>  \t\tsumR += *ri, sumB += *bi;\n>  \tdouble gainR = sumR.G / (sumR.R + 1),\n>  \t       gainB = sumB.G / (sumB.B + 1);\n> -\tasyncResults_.temperatureK = 4500; /* don't know what it is */\n> +\t/*\n> +\t * The grey world model can't estimate the colour temperature, use a\n> +\t * default value.\n> +\t */\n> +\tasyncResults_.temperatureK = DefaultCT;\n>  \tasyncResults_.gainR = gainR;\n>  \tasyncResults_.gainG = 1.0;\n>  \tasyncResults_.gainB = gainB;","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 A1B07BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Oct 2024 22:41:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6B4E6353A;\n\tTue,  8 Oct 2024 00:41:27 +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 E430762C91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Oct 2024 00:41:25 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [132.205.230.14])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DB2A2E0;\n\tTue,  8 Oct 2024 00:39:49 +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=\"BJrfzTpp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728340789;\n\tbh=05r92am7ltWW6xxkPuhOA5ZQF5hWYBzSTNFeitMO91w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BJrfzTppIe5G9qSMdhFv3RnyoWcZNmdPsmwVTcxR6oUDcPSksEUNUdlfmstHbXYmK\n\tgk3x5IpzH1hz4E0hxoFvQng2rC5EZo+SQDF8MTcotMOtxgucwUbw3Wml38/ur3Ct21\n\tdllPJGi/OX4+mt6JBykDC0u0nwqwL7funY1WJNXc=","Date":"Tue, 8 Oct 2024 01:41:19 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [PATCH v2 1/2] ipa: rpi: awb: Add a const for the default colour\n\ttemperature","Message-ID":"<20241007224119.GI30699@pendragon.ideasonboard.com>","References":"<20241003080228.25438-1-naush@raspberrypi.com>\n\t<20241003080228.25438-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241003080228.25438-2-naush@raspberrypi.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>"}}]