Show a patch.

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

{
    "id": 27347,
    "url": "https://patchwork.libcamera.org/api/patches/27347/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/27347/",
    "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": "<20260708201816.299983-3-mzamazal@redhat.com>",
    "date": "2026-07-08T20:18:10",
    "name": "[RFC,v7,2/6] libcamera: software_isp: Add LSC data to DebayerParams",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "217cbf93231d26c76c760b397b779447744e2fa8",
    "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/27347/mbox/",
    "series": [
        {
            "id": 6049,
            "url": "https://patchwork.libcamera.org/api/series/6049/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6049",
            "date": "2026-07-08T20:18:08",
            "name": "LSC for SoftISP simple pipeline",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/6049/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/27347/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/27347/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 8EB97C3329\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Jul 2026 20:18:50 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 30AFA660C1;\n\tWed,  8 Jul 2026 22:18:50 +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 B18A1660B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Jul 2026 22:18:48 +0200 (CEST)",
            "from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-677-VMWQIqftNs-EMpYYBUOpLg-1;\n\tWed, 08 Jul 2026 16:18:44 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 8DBC9195606D; Wed,  8 Jul 2026 20:18:42 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.48.228])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id F096D1800598; Wed,  8 Jul 2026 20:18:39 +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=\"YZWlDcYv\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1783541927;\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=TUIcMpgf9APFr5dug558yTUPvLAJp7pdfg+T2+cuJjg=;\n\tb=YZWlDcYv8RrDRa1sCN3vhsZ1LlqGbNpGIAVEOKS2cLPcyrXk3AWX/HT+OIXU8sKBKgeyDi\n\twF/tJNmUcXJnYFYEb2KS8n6FMvkHYwUkXn5hPcsraEXidHnBB6sooFMbtOYvJqbvbO/ptG\n\t8jx9kspGC0GA/LiRaD0pJTuZuZxYNsA=",
        "X-MC-Unique": "VMWQIqftNs-EMpYYBUOpLg-1",
        "X-Mimecast-MFC-AGG-ID": "VMWQIqftNs-EMpYYBUOpLg_1783541923",
        "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 v7 2/6] libcamera: software_isp: Add LSC data to\n\tDebayerParams",
        "Date": "Wed,  8 Jul 2026 22:18:10 +0200",
        "Message-ID": "<20260708201816.299983-3-mzamazal@redhat.com>",
        "In-Reply-To": "<20260708201816.299983-1-mzamazal@redhat.com>",
        "References": "<20260708201816.299983-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": "4foX1syElrvXWXn9aBV_CSNWffDRBefHWkkPTnyuin4_1783541923",
        "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    |  9 +++++\n src/libcamera/software_isp/debayer.cpp        | 33 +++++++++++++++++++\n 2 files changed, 42 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 1074720d7..4eb6c7e8d 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,14 @@ struct DebayerParams {\n \tfloat gamma = 1.0;\n \tfloat contrastExp = 1.0;\n \tRGB<double> gains = RGB<double>({ 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+\tbool lscEnabled;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 56446f55d..5a0102a27 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -43,6 +43,39 @@ 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+ * \\var DebayerParams::lscEnabled\n+ * \\brief Whether lens shading should be applied\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n",
    "prefixes": [
        "RFC",
        "v7",
        "2/6"
    ]
}