Show a patch.

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

{
    "id": 26617,
    "url": "https://patchwork.libcamera.org/api/patches/26617/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26617/",
    "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": "<20260504182658.590233-3-mzamazal@redhat.com>",
    "date": "2026-05-04T18:26:51",
    "name": "[RFC,v4,2/7] libcamera: software_isp: Add LSC data to DebayerParams",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d1e9eaa4d015717b5a7cfcec81bc55c7975b1944",
    "submitter": {
        "id": 177,
        "url": "https://patchwork.libcamera.org/api/people/177/?format=api",
        "name": "Milan Zamazal",
        "email": "mzamazal@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26617/mbox/",
    "series": [
        {
            "id": 5903,
            "url": "https://patchwork.libcamera.org/api/series/5903/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5903",
            "date": "2026-05-04T18:26:49",
            "name": "LSC for SoftISP simple pipeline",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/5903/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26617/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26617/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 2DB54BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 18:27:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CED5A62FEC;\n\tMon,  4 May 2026 20:27:22 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BDB662FE8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 20:27:20 +0200 (CEST)",
            "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-547--0QIuDOzPC6u6D39-L9m8Q-1;\n\tMon, 04 May 2026 14:27:16 -0400",
            "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.93])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 6E96A1800348; Mon,  4 May 2026 18:27:14 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.69])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 4C07A180154B; Mon,  4 May 2026 18:27:11 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"YnM3Qnu/\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777919239;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=GMpTRJkAeYb5u4p7zVG3zTLovAUt5iXhXpZDwDhZzFI=;\n\tb=YnM3Qnu/nJ6QJPlq01r9u9/Y2ThC3EqzD7MGRDN/Zz6QrKcuggNjIRfKeaZg7jDsB5G1rQ\n\tzyzIpITXX4dms/b8VdRyvIalvyRTHzC6qkIhwV0plqT9T7D2cK6xZANIvE4CkKBaodgJGl\n\tYIai1RQtOooKLtl7UvRQClgwau4j0Xo=",
        "X-MC-Unique": "-0QIuDOzPC6u6D39-L9m8Q-1",
        "X-Mimecast-MFC-AGG-ID": "-0QIuDOzPC6u6D39-L9m8Q_1777919234",
        "From": "Milan Zamazal <mzamazal@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Xander Pronk <xander.c.pronk@gmail.com>,\n\tBryan O'Donoghue <bod.linux@nxsw.ie>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[RFC PATCH v4 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams",
        "Date": "Mon,  4 May 2026 20:26:51 +0200",
        "Message-ID": "<20260504182658.590233-3-mzamazal@redhat.com>",
        "In-Reply-To": "<20260504182658.590233-1-mzamazal@redhat.com>",
        "References": "<20260504182658.590233-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "N9TIk51VznXRz8UY-MqqznJM3IljFINLK-PGV0hu0go_1777919234",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "From: Xander Pronk <xander.c.pronk@gmail.com>\n\nAdd a lookup table for grid-based lens shading correction to debayer\nparams.  The lookup table is in the format of an RGB texture to be\npassed to debayering.\n\nThe parameter is filled in by LSC algorithm implemented in a followup\npatch.  If the algorithm is not enabled, the parameter content is\narbitrary and the parameter may not be used.  The parameter is currently\nunused, its handling is implemented in a followup patch.\n\nThere is no special meaning about the selected grid size, it's\njust one of the smaller common sizes.\n\nCo-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Xander Pronk <xander.c.pronk@gmail.com>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/debayer_params.h    |  8 ++++++\n src/libcamera/software_isp/debayer.cpp        | 28 +++++++++++++++++++\n 2 files changed, 36 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 6772b43bc..47f2c3ac2 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -10,6 +10,7 @@\n \n #pragma once\n \n+#include <array>\n #include <stdint.h>\n \n #include \"libcamera/internal/matrix.h\"\n@@ -25,6 +26,13 @@ struct DebayerParams {\n \tfloat gamma = 1.0;\n \tfloat contrastExp = 1.0;\n \tRGB<float> gains = RGB<float>({ 1.0, 1.0, 1.0 });\n+\n+\tstatic constexpr unsigned int kLscGridSize = 16;\n+\tstatic constexpr unsigned int kLscValuesPerCell = 3;\n+\tusing LscValueType = float;\n+\tusing LscLookupTable =\n+\t\tstd::array<LscValueType, kLscGridSize * kLscGridSize * kLscValuesPerCell>;\n+\tLscLookupTable lscLut{};\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 2d7abfb83..d91a7aff5 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -43,6 +43,34 @@ namespace libcamera {\n  * \\brief Contrast value to be used as an exponent\n  */\n \n+/**\n+ * \\var DebayerParams::kLscGridSize\n+ * \\brief Number of lens shading grid areas in one direction\n+ */\n+\n+/**\n+ * \\var DebayerParams::kLscValuesPerCell\n+ * \\brief Number of pixel values per each of the lens shading grid areas\n+ */\n+\n+/**\n+ * \\typedef DebayerParams::LscValueType\n+ * \\brief Type of LSC grid values\n+ */\n+\n+/**\n+ * \\typedef DebayerParams::LscLookupTable\n+ * \\brief Lookup table for lens shading correction\n+ *\n+ * It's an array of values to be later used as a texture.\n+ * The values are in row - column - RGB order.\n+ */\n+\n+/**\n+ * \\var DebayerParams::lscLut\n+ * \\brief Lens shading lookup table\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n",
    "prefixes": [
        "RFC",
        "v4",
        "2/7"
    ]
}