Show a patch.

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

{
    "id": 24856,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24856/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24856/",
    "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": "<20251028170847.2673396-4-rui.wang@ideasonboard.com>",
    "date": "2025-10-28T17:08:33",
    "name": "[v1,04/16] ipa: rkisp1: algorithms: Add YAML parsing helper utilities",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "bdb047a57f9245400b0dd37b8b98bcaeddb575c5",
    "submitter": {
        "id": 241,
        "url": "https://patchwork.libcamera.org/api/1.1/people/241/?format=api",
        "name": "Rui Wang",
        "email": "rui.wang@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24856/mbox/",
    "series": [
        {
            "id": 5539,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5539/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5539",
            "date": "2025-10-28T17:08:30",
            "name": "[v1,01/16] ipa: rkisp1: algorithms: add Denoise base class shell",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5539/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24856/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24856/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 AC8CCBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Oct 2025 17:09:12 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5FA3B60818;\n\tTue, 28 Oct 2025 18:09:12 +0100 (CET)",
            "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 ED32860805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Oct 2025 18:09:09 +0100 (CET)",
            "from rui-Precision-7560.local (unknown [209.216.122.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0925B1AED;\n\tTue, 28 Oct 2025 18:07:20 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qbQGOM36\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761671241;\n\tbh=+eyGqc5p9uACWenOcU/Wnu+Z5BE8b3Mww6kmViso+Wk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qbQGOM3668kAd1A6/r9n3b7l5VA1vJkuVJAIzJktR6fHM9SKsHj7G3T6+DsAFEbdk\n\tRa9zqUD9LpsvLWh+s0vJ9DKT0qulVS7k4c0DkH8l3ApDhGjvnL65ZPksjaT9ZsuImJ\n\tGXxzkworPGUmFGeqcjs4AVoF/M6QxE3oozMUmhM0=",
        "From": "Rui Wang <rui.wang@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Rui Wang <rui.wang@ideasonboard.com>",
        "Subject": "[PATCH v1 04/16] ipa: rkisp1: algorithms: Add YAML parsing helper\n\tutilities",
        "Date": "Tue, 28 Oct 2025 13:08:33 -0400",
        "Message-ID": "<20251028170847.2673396-4-rui.wang@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20251028170847.2673396-1-rui.wang@ideasonboard.com>",
        "References": "<20251028170847.2673396-1-rui.wang@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": "Introduce yaml_helper.h with standardized functions for parsing YAML\nconfiguration data in RkISP1 IPA algorithms. Provides type-safe parsing\nfor optional values, lists, enums, and specialized filter coefficients.\n\nKey functions:\n- opt8/16/32/bool: Type-safe optional value parsing with defaults\n- optList8/16: List parsing with size validation\n- optEnum: String-to-enum mapping with validation\n- optFilterCoeffs: Specialized filter coefficient parsing\n\nSigned-off-by: Rui Wang <rui.wang@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/yaml_helper.h | 123 ++++++++++++++++++++++++\n 1 file changed, 123 insertions(+)\n create mode 100644 src/ipa/rkisp1/algorithms/yaml_helper.h",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/yaml_helper.h b/src/ipa/rkisp1/algorithms/yaml_helper.h\nnew file mode 100644\nindex 00000000..ed2ba926\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/yaml_helper.h\n@@ -0,0 +1,123 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2025, Ideas On Board\n+ *\n+ * RkISP1 YAML parsing helper functions\n+ */\n+\n+#pragma once\n+\n+#include <map>\n+#include <optional>\n+#include <vector>\n+\n+#include \"libcamera/internal/yaml_parser.h\"\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+namespace yamlHelper {\n+\n+inline void opt32(const YamlObject &level, const char *key, std::optional<uint32_t> &dst)\n+{\n+\tdst = level[key].get<uint32_t>();\n+}\n+\n+inline void opt16(const YamlObject &level, const char *key, std::optional<uint16_t> &dst)\n+{\n+\tdst = level[key].get<uint16_t>();\n+}\n+\n+inline void opt8(const YamlObject &level, const char *key, std::optional<uint8_t> &dst)\n+{\n+\tdst = level[key].get<uint8_t>();\n+}\n+\n+inline void optbool(const YamlObject &level, const char *key, std::optional<bool> &dst)\n+{\n+\tdst = level[key].get<bool>();\n+}\n+\n+inline void optbool(const YamlObject &level, const char *key, bool &dst, bool defaultVal)\n+{\n+\tstd::optional<bool> val = level[key].get<bool>();\n+\tdst = val.value_or(defaultVal);\n+}\n+\n+inline void opt8(const YamlObject &level, const char *key, uint8_t &dst, uint8_t defaultVal)\n+{\n+\tstd::optional<uint8_t> val = level[key].get<uint8_t>();\n+\tdst = val.value_or(defaultVal);\n+}\n+\n+inline void opt16(const YamlObject &level, const char *key, uint16_t &dst, uint16_t defaultVal)\n+{\n+\tstd::optional<uint16_t> val = level[key].get<uint16_t>();\n+\tdst = val.value_or(defaultVal);\n+}\n+\n+inline void opt32(const YamlObject &level, const char *key, uint32_t &dst, uint32_t defaultVal)\n+{\n+\tstd::optional<uint32_t> val = level[key].get<uint32_t>();\n+\tdst = val.value_or(defaultVal);\n+}\n+\n+inline bool optList8(const YamlObject &level, const char *key, std::vector<uint8_t> &dst, size_t expectedSize)\n+{\n+\tstd::optional<std::vector<uint8_t>> val = level[key].getList<uint8_t>();\n+\tif (!val || val->size() != expectedSize)\n+\t\treturn false;\n+\tdst = *val;\n+\treturn true;\n+}\n+\n+inline bool optList16(const YamlObject &level, const char *key, std::vector<uint16_t> &dst, size_t expectedSize)\n+{\n+\tstd::optional<std::vector<uint16_t>> val = level[key].getList<uint16_t>();\n+\tif (!val || val->size() != expectedSize)\n+\t\treturn false;\n+\tdst = *val;\n+\treturn true;\n+}\n+\n+template<typename EnumType>\n+inline bool optEnum(const YamlObject &level, const char *key, EnumType &dst, EnumType defaultVal,\n+\t\t    const std::map<std::string, EnumType> &enumMap)\n+{\n+\tstd::optional<std::string> val = level[key].get<std::string>();\n+\tif (!val) {\n+\t\tdst = defaultVal;\n+\t\treturn true;\n+\t}\n+\tauto it = enumMap.find(*val);\n+\tif (it == enumMap.end())\n+\t\treturn false;\n+\tdst = it->second;\n+\treturn true;\n+}\n+\n+inline bool optFilterCoeffs(const YamlObject &level, const char *key, uint8_t *coeffs, uint32_t &filterSize, size_t maxCoeffs)\n+{\n+\tstd::optional<std::vector<uint8_t>> val = level[key].getList<uint8_t>();\n+\tif (!val)\n+\t\treturn false;\n+\n+\tsize_t size = val->size();\n+\tif (size == maxCoeffs - 1) {\n+\t\tfilterSize = 0; // 9x9 filter\n+\t} else if (size == maxCoeffs) {\n+\t\tfilterSize = 1; // 13x9 filter\n+\t} else {\n+\t\treturn false; // Invalid size\n+\t}\n+\n+\tstd::copy_n(val->begin(), size, coeffs);\n+\treturn true;\n+}\n+\n+} /* namespace yamlHelper */\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+\n+} /* namespace libcamera */\n",
    "prefixes": [
        "v1",
        "04/16"
    ]
}