Show a patch.

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

{
    "id": 25234,
    "url": "https://patchwork.libcamera.org/api/patches/25234/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25234/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20251127022256.178929-21-bryan.odonoghue@linaro.org>",
    "date": "2025-11-27T02:22:52",
    "name": "[v2,20/22] libcamera: software_isp: blacklevel: Make black level available in debayer params",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7e22cfee0adf8cbdcd704f3674587d2382c4c050",
    "submitter": {
        "id": 175,
        "url": "https://patchwork.libcamera.org/api/people/175/?format=api",
        "name": "Bryan O'Donoghue",
        "email": "bryan.odonoghue@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25234/mbox/",
    "series": [
        {
            "id": 5616,
            "url": "https://patchwork.libcamera.org/api/series/5616/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5616",
            "date": "2025-11-27T02:22:32",
            "name": "GPUISP precursor series",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5616/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25234/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25234/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 2EAB9C32DE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Nov 2025 02:23:52 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BFC4D60BDD;\n\tThu, 27 Nov 2025 03:23:51 +0100 (CET)",
            "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6FAF460AA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Nov 2025 03:23:47 +0100 (CET)",
            "by mail-wm1-x331.google.com with SMTP id\n\t5b1f17b1804b1-4775e891b5eso1094725e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Nov 2025 18:23:47 -0800 (PST)",
            "from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4790b0e21e8sm71549495e9.15.2025.11.26.18.23.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 26 Nov 2025 18:23:45 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"BmWJE3aZ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1764210227; x=1764815027;\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=e5IU9i/UgAS6xhFOaLC/MXSw7l83fQor9ApmWEKFJl4=;\n\tb=BmWJE3aZrZQdFASXWKt/M3gCMwNFa0G31mPxLvoKwdatdOY2xEUkfxKUxXMQc3c2aX\n\t9JKIYczGtwxgLKr0Dsfn8mA4ca2S8unGvcR8AClhYjvYRmbA64vKpB7QT26JGmTjmIH3\n\tEqZUrGFzIYkq6Yj4Dpw5aZ1QmmTqJMkvBo/VbOpBZzj6I/o+74e2UL0ZoLR79SlbSzAZ\n\tmt7UGrf/Emd1WSgRZ/sDnNkb8vecTymUdgZvgTOKdwdcU24/V/IvvWnlztMu9P3VGgvX\n\tFOGgosw/Z+jY9R72qcugJ+eO3xLddb4eFEuLh7H42da6QHnjJq/I5nxAQpytHsh5mxFN\n\tLdWw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1764210227; x=1764815027;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=e5IU9i/UgAS6xhFOaLC/MXSw7l83fQor9ApmWEKFJl4=;\n\tb=dWENTCG1rO7kMsxxtLt5coRa10y9l7dGHqlB92/fdbX06zENEl2Bmna3iM/hSGpdPa\n\tGYvipDHDS/GQl6NU40S2XBMJhXZLbC6OADiUowVc/kwN2EaWSLYks16gRBVhN0BXnmck\n\t0QpDppHJFgRX9cS3EsyaptQbE5Zquv9P3eHa8P17DDnB7QLjxE27HKxWtuJEY5j7L27N\n\tzhWdwVnXpOrx7MP6c3NqHV9lvVR1uG62JiqxvIjb3PHQa7miQWxmurJZGl0eN04AygYH\n\tVbXD5IBEv4HJB4QEvZ3bDxbMCL5eNcosjKjHI/JsVFqPVkKE/uN2OyHQ6Ar9xxl1jqf5\n\tXNNQ==",
        "X-Gm-Message-State": "AOJu0YxVF7X7abin1Em8UaZYp6yoZHxdwYwtkvzWHnFupHpu7V+Kfbeu\n\tpJnPATrNUuGnAYkLG+y/RZq2cccwaDkjuma9uGrx+YMptvl2s0d9G48lC1yph9Z6T5py40gtlv2\n\t8vtHGWD4=",
        "X-Gm-Gg": "ASbGncswPO9IhyVPtq5vc8yGMUvFTNnmUFJPSm/HOEU7KMwVURHwzsw0Eh4+mnNlp8A\n\t3y5bwrWJ0rV+C5JYiTpXcNfJ6WsQDWaqg0rxfh3BedhfXBsf2jwK0gl/GFtSndfljunxamamMcH\n\tAb6DTgI7HQri3rLBIo+WwxvCE82T0nOogqvAHzu4yEdNWPtU2nG/V8DSPTaQyWV+2rXpFHg7ht7\n\taKvVLDEA5T2Io1dUZiTTqyXdxaWPr+ZPwlwXmr3zQYQ/re0YOi/IPobNM4hRBYf+/typX1bORHU\n\tAbI6AApcmMLxMBe0WiStCc1/AMg3JF9y7rB5RyE6SsY9pGbNK9WVCGmIPAHBxYO9sh/X6LS1U+B\n\t90dwKewePm/BExGZ2h4G+plZcWBmFIw3XwlITkiFXj26gadrkNC2h7PDuyaLx9miP+5swRgsC3F\n\tY0MVSNdVQoiCdyZ2kOEWC6pcO/d6WDESswSGkyUdORhQ7gy4VteVzRQg39AJOrKwfKTTw=",
        "X-Google-Smtp-Source": "AGHT+IGfnY0V0bfGPHWJnzu6fefqZioIyHSjqL5g8TeGvlMRYc0njvLh8FdFeLCWhT31yRy4sCm11g==",
        "X-Received": "by 2002:a05:600c:1ca0:b0:477:75eb:a643 with SMTP id\n\t5b1f17b1804b1-477c0165b4emr254780965e9.4.1764210226757; \n\tWed, 26 Nov 2025 18:23:46 -0800 (PST)",
        "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "pavel@ucw.cz,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "Subject": "[PATCH v2 20/22] libcamera: software_isp: blacklevel: Make black\n\tlevel available in debayer params",
        "Date": "Thu, 27 Nov 2025 02:22:52 +0000",
        "Message-ID": "<20251127022256.178929-21-bryan.odonoghue@linaro.org>",
        "X-Mailer": "git-send-email 2.51.2",
        "In-Reply-To": "<20251127022256.178929-1-bryan.odonoghue@linaro.org>",
        "References": "<20251127022256.178929-1-bryan.odonoghue@linaro.org>",
        "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": "Populate black level gain in blacklevel::prepare(). A copy is made of the gain\nvalue in the DebayerParams structure.\n\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n include/libcamera/internal/software_isp/debayer_params.h | 2 ++\n src/ipa/simple/algorithms/blc.cpp                        | 9 +++++++++\n src/ipa/simple/algorithms/blc.h                          | 4 ++++\n src/libcamera/software_isp/debayer.cpp                   | 5 +++++\n 4 files changed, 20 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 4b203e211..5a0d9438f 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -14,6 +14,7 @@\n #include <stdint.h>\n \n #include \"libcamera/internal/matrix.h\"\n+#include \"libcamera/internal/vector.h\"\n \n namespace libcamera {\n \n@@ -56,6 +57,7 @@ struct DebayerParams {\n \t * Per frame corrections as calculated by the IPA\n \t */\n \tMatrix<float, 3, 3> ccm;\n+\tRGB<float> blackLevel;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\nindex 370385afc..464e43c27 100644\n--- a/src/ipa/simple/algorithms/blc.cpp\n+++ b/src/ipa/simple/algorithms/blc.cpp\n@@ -47,6 +47,15 @@ int BlackLevel::configure(IPAContext &context,\n \treturn 0;\n }\n \n+void BlackLevel::prepare(IPAContext &context,\n+\t\t\t [[maybe_unused]] const uint32_t frame,\n+\t\t\t [[maybe_unused]] IPAFrameContext &frameContext,\n+\t\t\t DebayerParams *params)\n+{\n+\t/* Latch the blacklevel gain so GPUISP can apply. */\n+\tparams->blackLevel = RGB<float>(context.activeState.blc.level / 255.0f);\n+}\n+\n void BlackLevel::process(IPAContext &context,\n \t\t\t [[maybe_unused]] const uint32_t frame,\n \t\t\t IPAFrameContext &frameContext,\ndiff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\nindex db9e6d639..a5592d087 100644\n--- a/src/ipa/simple/algorithms/blc.h\n+++ b/src/ipa/simple/algorithms/blc.h\n@@ -24,6 +24,10 @@ public:\n \n \tint init(IPAContext &context, const YamlObject &tuningData) override;\n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n+\tvoid prepare(IPAContext &context,\n+\t\t     const uint32_t frame,\n+\t\t     IPAFrameContext &frameContext,\n+\t\t     DebayerParams *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n \t\t     const SwIspStats *stats,\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 4ec76dce6..1034912e7 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -105,6 +105,11 @@ namespace libcamera {\n   * \\brief Per frame colour correction matrix for GPUISP\n   */\n \n+/**\n+ * \\var DebayerParams::blackLevel\n+ * \\brief Blacklevel gains for the GPUISP\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n",
    "prefixes": [
        "v2",
        "20/22"
    ]
}