{"id":21532,"url":"https://patchwork.libcamera.org/api/patches/21532/?format=json","web_url":"https://patchwork.libcamera.org/patch/21532/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241008081317.24602-1-naush@raspberrypi.com>","date":"2024-10-08T08:13:16","name":"[v3,1/2] ipa: rpi: awb: Add a const for the default colour temperature","commit_ref":"692d0d66ac83ce24eaf8249687e47ef861f73b90","pull_url":null,"state":"accepted","archived":false,"hash":"99191550f144eccc657296d81df2365dba90f8a8","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21532/mbox/","series":[{"id":4663,"url":"https://patchwork.libcamera.org/api/series/4663/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4663","date":"2024-10-08T08:13:16","name":"[v3,1/2] ipa: rpi: awb: Add a const for the default colour temperature","version":3,"mbox":"https://patchwork.libcamera.org/series/4663/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21532/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21532/checks/","tags":{},"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 C02EEBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Oct 2024 08:13:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3B5D63537;\n\tTue,  8 Oct 2024 10:13:30 +0200 (CEST)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 37C6A62C8E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Oct 2024 10:13:28 +0200 (CEST)","by mail-wr1-x42e.google.com with SMTP id\n\tffacd0b85a97d-37d371840efso91f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Oct 2024 01:13:28 -0700 (PDT)","from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-37d1695e62bsm7492587f8f.81.2024.10.08.01.13.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Oct 2024 01:13:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"Avlsvkxg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1728375207; x=1728980007;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=pT1XzziQ0sR/LBkzMPdWZArxo/iYlN07w1b9fXTe5o0=;\n\tb=Avlsvkxg53mSf+MqvqxcFeKmx8eInmeBvkRknRZbj54898RWOZVmacKU/+jTyRDf6y\n\tCWV3e42U8WOVssl+KCwhCKwmIQNG3C7AeCbWodNSj5CvE6PIhbbONVq0IiwsR+lrkkdc\n\tK7NvKOtgm3bjKsK4ThCWP7HB19Kbu4MP1wNcpgV4B3YWcM09B8w5AWpK+a+V8lIwgaw2\n\tN2/vqKnzjD3xXBst0Zb7ZcCXcoChJxQY3EIbFhlXLgB0rte6g2ROMNR/HQTGZjcQQ+wX\n\tL2WforiTpB2x2cpsHn1Xr+72NUfxkaG0DYG80gNgRexBrtIlg9llzEnSXVLnWFUGhtY+\n\tvx2A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1728375207; x=1728980007;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=pT1XzziQ0sR/LBkzMPdWZArxo/iYlN07w1b9fXTe5o0=;\n\tb=ODqhpZ7SlJHOwT0wRSxPHy+4Jmek37avCnYJ5sXl2jLFYAQWP0QyFUvSzoO1jMTooc\n\tuO8gsrlBY6Npkw3B6iIwVnu2n5mB4bzuxthALw3EoGwLCzQUtf1rHJRyQi1cqX98Bk+x\n\tuZVsDgBuAizEEDiwJehEXKvY6DQKtGnmp/1eYDYJvQeWMp4HvNFCJhWAgsHSIhOov1Hg\n\tEkIAldigs8Lfp5jYyjSwlCX0Pw0b72h8U4yDEHQcLa7SVBHMouIaGZORWrr/5tFUG3ni\n\tYpMhJ5pWsuQWxFEFlWs3Qn5Fe1aObJmCdHoH+DGjTPf5/bfvsAz3Iqewwf90yBkDN7VQ\n\tAlAA==","X-Gm-Message-State":"AOJu0YyLsMcnemA92ycJ4TvrnpAMpMlPocsN9VBlhJtC9CUesM8hIP/S\n\tqN9EHeqgNEO7zLLbgGky/08SQCZw4MOLxHdROtJHjmtMQEoDNXk5h47AN3YoJpjdu/K35D9B3ZT\n\t8","X-Google-Smtp-Source":"AGHT+IHnODnGqQCehHs3xiRSygzegT/3LQgP2MhxZ9Ac8WEudjpTvTKXF7iJFIetEi3X0jCZHLFIfQ==","X-Received":"by 2002:a5d:5887:0:b0:374:c2ce:eb1e with SMTP id\n\tffacd0b85a97d-37d0e7d66aamr4329684f8f.8.1728375207313; \n\tTue, 08 Oct 2024 01:13:27 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v3 1/2] ipa: rpi: awb: Add a const for the default colour\n\ttemperature","Date":"Tue,  8 Oct 2024 09:13:16 +0100","Message-Id":"<20241008081317.24602-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"A default CT of 4500K is used in a couple of places. Add a constexpr\nvalue for the default CT value and use it instead.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-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(-)","diff":"diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\nindex e5d51092605e..65416d05b28e 100644\n--- a/src/ipa/rpi/controller/rpi/awb.cpp\n+++ b/src/ipa/rpi/controller/rpi/awb.cpp\n@@ -21,6 +21,8 @@ using namespace libcamera;\n \n LOG_DEFINE_CATEGORY(RPiAwb)\n \n+constexpr double kDefaultCT = 4500.0;\n+\n #define NAME \"rpi.awb\"\n \n /*\n@@ -215,7 +217,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 = kDefaultCT;\n \t\tsyncResults_.gainR = syncResults_.gainG = syncResults_.gainB = 1.0;\n \t}\n \tprevSyncResults_ = syncResults_;\n@@ -717,7 +719,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 = kDefaultCT;\n \tasyncResults_.gainR = gainR;\n \tasyncResults_.gainG = 1.0;\n \tasyncResults_.gainB = gainB;\n","prefixes":["v3","1/2"]}