Show a patch.

GET /api/1.1/patches/20895/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20895,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20895/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20895/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240813084451.44099-3-stefan.klug@ideasonboard.com>",
    "date": "2024-08-13T08:44:19",
    "name": "[v4,2/6] ipa: rkisp1: awb: Load white balance gains from tuning file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "fad95719c9486d7ef31d6af44e75627d840526d2",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20895/mbox/",
    "series": [
        {
            "id": 4514,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4514/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4514",
            "date": "2024-08-13T08:44:17",
            "name": "rkisp1: Add manual colour temperature control",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/4514/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20895/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20895/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 CA842C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Aug 2024 08:45:11 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E7A13633BF;\n\tTue, 13 Aug 2024 10:45:10 +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 6705E6337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Aug 2024 10:45:09 +0200 (CEST)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:7025:8d00:1ffd:751a])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7C6D2A1A;\n\tTue, 13 Aug 2024 10:44:12 +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=\"nBBjVHk8\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723538652;\n\tbh=nezsLkdaQM9qFBjjmieiWNaHqQnHtd/J8wCcftKrbIo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=nBBjVHk8M3n05fTeXNoO9pP/bhtSgKXy1dzD29H7eoQyTxpzDrhEdBjn2f7MpAftd\n\t3cQSAxD3U7hPJ5iCzAAunwEdtz3U3K6tHY80MEzghJrEnMk3H5F7Oid5Wv1DQKZNCd\n\tMaZmkX8FDzCZLvKrtyfKiEM4f7hvu6FCsLJPhec4=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>",
        "Subject": "[PATCH v4 2/6] ipa: rkisp1: awb: Load white balance gains from\n\ttuning file",
        "Date": "Tue, 13 Aug 2024 10:44:19 +0200",
        "Message-ID": "<20240813084451.44099-3-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240813084451.44099-1-stefan.klug@ideasonboard.com>",
        "References": "<20240813084451.44099-1-stefan.klug@ideasonboard.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": "For the implementation of a manual colour temperature setting, it is\nnecessary to read predefined colour gains per colour temperature from\nthe tuning file. Implement this in a backwards compatible way. If no\ngains are contained in the tuning file, loading just continues as\nbefore.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/awb.cpp | 18 ++++++++++++++++++\n src/ipa/rkisp1/algorithms/awb.h   |  6 ++++++\n 2 files changed, 24 insertions(+)",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex 4ccafd48dedd..c23f749c192b 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -39,6 +39,24 @@ Awb::Awb()\n {\n }\n \n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::init\n+ */\n+int Awb::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)\n+{\n+\tMatrixInterpolator<double, 2, 1> gains;\n+\tint ret = gains.readYaml(tuningData[\"gains\"], \"ct\", \"gains\");\n+\tif (ret < 0)\n+\t\tLOG(RkISP1Awb, Warning)\n+\t\t\t<< \"Failed to parse 'gains' \"\n+\t\t\t<< \"parameter from tuning file; \"\n+\t\t\t<< \"rgb gains will not be set based on colour temperature\";\n+\telse\n+\t\tgains_ = gains;\n+\n+\treturn 0;\n+}\n+\n /**\n  * \\copydoc libcamera::ipa::Algorithm::configure\n  */\ndiff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\nindex 06c92896e2dc..a010e6d1cb3c 100644\n--- a/src/ipa/rkisp1/algorithms/awb.h\n+++ b/src/ipa/rkisp1/algorithms/awb.h\n@@ -7,6 +7,10 @@\n \n #pragma once\n \n+#include <optional>\n+\n+#include \"libipa/matrix_interpolator.h\"\n+\n #include \"algorithm.h\"\n \n namespace libcamera {\n@@ -19,6 +23,7 @@ public:\n \tAwb();\n \t~Awb() = default;\n \n+\tint init(IPAContext &context, const YamlObject &tuningData) override;\n \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n \tvoid queueRequest(IPAContext &context, const uint32_t frame,\n \t\t\t  IPAFrameContext &frameContext,\n@@ -34,6 +39,7 @@ public:\n private:\n \tuint32_t estimateCCT(double red, double green, double blue);\n \n+\tstd::optional<MatrixInterpolator<double, 2, 1>> gains_;\n \tbool rgbMode_;\n };\n \n",
    "prefixes": [
        "v4",
        "2/6"
    ]
}