{"id":21495,"url":"https://patchwork.libcamera.org/api/patches/21495/?format=json","web_url":"https://patchwork.libcamera.org/patch/21495/","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":"<20241003080228.25438-2-naush@raspberrypi.com>","date":"2024-10-03T08:02:26","name":"[v2,1/2] ipa: rpi: awb: Add a const for the default colour temperature","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"5edea64e9fb8adf07c09e789d7a36a2b69b3064d","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/21495/mbox/","series":[{"id":4652,"url":"https://patchwork.libcamera.org/api/series/4652/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4652","date":"2024-10-03T08:02:25","name":"RPi: AWB bias","version":2,"mbox":"https://patchwork.libcamera.org/series/4652/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21495/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21495/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 8778CBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Oct 2024 08:02:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C10D46352D;\n\tThu,  3 Oct 2024 10:02:17 +0200 (CEST)","from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DD1A963522\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2024 10:02:13 +0200 (CEST)","by mail-wm1-x32d.google.com with SMTP id\n\t5b1f17b1804b1-42cb1866c8fso798215e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Oct 2024 01:02:13 -0700 (PDT)","from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-37d082a6b69sm684952f8f.88.2024.10.03.01.02.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 03 Oct 2024 01:02:12 -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=\"USMEPEZK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1727942533; x=1728547333;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=mnstXQUMSR691E+q3p5F12M0QAneWP2DnnxLh2/apK0=;\n\tb=USMEPEZKSI6izwH+H0SzPvMh+F5s6EIOz50+u/BVy6qC+0nbQCeVPMujiTfmt4KGyr\n\tSr5lxS+7iBd4L5UgigTdOZPosezm8Poi8nW27GCpOeTcOO4CJbzHrFOgkqGJlmkkuryu\n\t6NL3s0QaJYTSbtbA56/S3UJlNi189ZIixa/Ph+EV+51DHRLsk3ndDzWxdgXLh8ndHjTc\n\tJ6aezpRESKuMQVrwgtsaFoULtwbWmAPBDhFsENuvm3C5h/jLit/U7p48zLouue7srRz4\n\tzd41gFjT2+qauQK3im2RhRFqMiqfLp6MwIR2wONvajhVvVAu0lg++MvurozlV0f6sArB\n\t+3ew==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727942533; x=1728547333;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=mnstXQUMSR691E+q3p5F12M0QAneWP2DnnxLh2/apK0=;\n\tb=oR/P5XTa3WfvQluOp9n3SESGH1ojXWr3XT4LQfXIAdiT/VgC6m7uMYIxfrNtin9uAT\n\tWFEyAtaQpPGZ8tYoHpVPw7H4DtBoqu0bgdhCevkTNrjZ373Nsu0EKcp6G62cnYsT9C6Z\n\tq6CESblepZp+eIE+YyV/6BaPb/7pBWsm3WA3SZqiHFMqpfL6cMyC3JOIZ1DKzATuN7Dy\n\tH6x2rXuiJI0Z/7v48AxSAsM4XUKazPyOfRawq3kbw10bE9n2fXQ6Nb5UCpmNdoF0Af1H\n\tlttlxgiKqwNgTinjR+EP24icy8PMUQB6JOzMhISWBgq20qL7xFplY/7yoTbRfzypbwRG\n\taMLA==","X-Gm-Message-State":"AOJu0Yw6TFQi2CEBdAGAFILY4JNWEbHqxu7TXehLb2+zYChSzYjJL+Cp\n\tk7yRRLT4N42vpqrAVBjWAy5bGeFiP8ZhIuErst0wBbut2UVOSTUTLZ5S3MrKfBCXpL3nSKmcl8G\n\td","X-Google-Smtp-Source":"AGHT+IEz3L6/sUf4hhhXzoZiwbEuB3uSTD9NJ8Fgx9HDCXulQYz1RXBHRiBNgjIXe6s9FhMZdWIG8g==","X-Received":"by 2002:a05:600c:1d26:b0:42c:bfd6:9d1f with SMTP id\n\t5b1f17b1804b1-42f777b010bmr21761855e9.1.1727942533047; \n\tThu, 03 Oct 2024 01:02:13 -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 v2 1/2] ipa: rpi: awb: Add a const for the default colour\n\ttemperature","Date":"Thu,  3 Oct 2024 09:02:26 +0100","Message-Id":"<20241003080228.25438-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20241003080228.25438-1-naush@raspberrypi.com>","References":"<20241003080228.25438-1-naush@raspberrypi.com>","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 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+\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;\n","prefixes":["v2","1/2"]}