Show a patch.

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

{
    "id": 26455,
    "url": "https://patchwork.libcamera.org/api/patches/26455/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26455/",
    "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": "<20260407153427.1825999-16-laurent.pinchart@ideasonboard.com>",
    "date": "2026-04-07T15:34:00",
    "name": "[v2,15/42] libcamera: yaml_parser: Move Size handling to geometry.cpp",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "20543b7ccb788ea1bf465720afdd204cc4c36f05",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26455/mbox/",
    "series": [
        {
            "id": 5873,
            "url": "https://patchwork.libcamera.org/api/series/5873/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5873",
            "date": "2026-04-07T15:33:45",
            "name": "libcamera: Global configuration file improvements",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5873/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26455/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26455/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 42C92C3300\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Apr 2026 15:34:52 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8545162DD4;\n\tTue,  7 Apr 2026 17:34:51 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA59B62DE5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Apr 2026 17:34:48 +0200 (CEST)",
            "from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 109C498A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Apr 2026 17:33:21 +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=\"M4438fYb\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1775576001;\n\tbh=KgSje6QVWRqdn0N+xzAWeZ1L8NrPB2FXHp79Rqrq7mg=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=M4438fYbDV82H/q4IpMhRdbFmD4rW8uAkI1cgfjz0CgaegxaBsK0Puy1plCWpq2gT\n\ty8SfWKzXTC1ER9I83eU5v6Pghd/2kWVCbGho4JgJEWiFWWmCOzf/q6el5uty0mfQcf\n\tNcpMsGVxaMSL4swZgPflEc7f0/A/kk92p58yZghc=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v2 15/42] libcamera: yaml_parser: Move Size handling to\n\tgeometry.cpp",
        "Date": "Tue,  7 Apr 2026 18:34:00 +0300",
        "Message-ID": "<20260407153427.1825999-16-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260407153427.1825999-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20260407153427.1825999-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "The YamlObject::Accessor structure is designed to extend the YamlObject\nclass with new getter and setter types without modifying\nyaml_parser.cpp. This feature is used for various libcamera classes,\nwhile standard C++ types are handled in yaml_parser.cpp.\n\nThe Size class is an outlier: it is a libcamera class, but is handled in\nyaml_parser.cpp. Move it to geometry.cpp. Drop the std::vector<Size>\nspecialization as it is currently unused.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/internal/yaml_parser.h |  2 --\n src/ipa/libipa/lsc_polynomial.h          |  2 ++\n src/libcamera/geometry.cpp               | 29 ++++++++++++++++++++++++\n src/libcamera/yaml_parser.cpp            | 22 ------------------\n test/yaml-parser.cpp                     |  2 ++\n 5 files changed, 33 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\nindex c41397df67ab..7707e7469aca 100644\n--- a/include/libcamera/internal/yaml_parser.h\n+++ b/include/libcamera/internal/yaml_parser.h\n@@ -17,8 +17,6 @@\n \n #include <libcamera/base/class.h>\n \n-#include <libcamera/geometry.h>\n-\n namespace libcamera {\n \n class File;\ndiff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h\nindex df3a0d4b39c4..c71f215de3fc 100644\n--- a/src/ipa/libipa/lsc_polynomial.h\n+++ b/src/ipa/libipa/lsc_polynomial.h\n@@ -14,6 +14,8 @@\n #include <libcamera/base/log.h>\n #include <libcamera/base/span.h>\n \n+#include <libcamera/geometry.h>\n+\n #include \"libcamera/internal/yaml_parser.h\"\n \n namespace libcamera {\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 2763967a6e57..2e8e9e33ea78 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -12,6 +12,8 @@\n \n #include <libcamera/base/log.h>\n \n+#include \"libcamera/internal/yaml_parser.h\"\n+\n /**\n  * \\file geometry.h\n  * \\brief Data structures related to geometric objects\n@@ -924,4 +926,31 @@ std::ostream &operator<<(std::ostream &out, const Rectangle &r)\n \treturn out;\n }\n \n+#ifndef __DOXYGEN__\n+/*\n+ * The YAML data shall be a list of two numerical values containing the x and y\n+ * coordinates, in that order.\n+ */\n+template<>\n+std::optional<Size>\n+YamlObject::Accessor<Size>::get(const YamlObject &obj) const\n+{\n+\tif (obj.type_ != Type::List)\n+\t\treturn std::nullopt;\n+\n+\tif (obj.list_.size() != 2)\n+\t\treturn std::nullopt;\n+\n+\tauto width = obj.list_[0].value->get<uint32_t>();\n+\tif (!width)\n+\t\treturn std::nullopt;\n+\n+\tauto height = obj.list_[1].value->get<uint32_t>();\n+\tif (!height)\n+\t\treturn std::nullopt;\n+\n+\treturn Size(*width, *height);\n+}\n+#endif /* __DOXYGEN__ */\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\nindex 6caacc3111c4..bf098360191b 100644\n--- a/src/libcamera/yaml_parser.cpp\n+++ b/src/libcamera/yaml_parser.cpp\n@@ -284,27 +284,6 @@ void YamlObject::Accessor<std::string>::set(YamlObject &obj, std::string value)\n \tobj.value_ = std::move(value);\n }\n \n-template<>\n-std::optional<Size>\n-YamlObject::Accessor<Size>::get(const YamlObject &obj) const\n-{\n-\tif (obj.type_ != Type::List)\n-\t\treturn std::nullopt;\n-\n-\tif (obj.list_.size() != 2)\n-\t\treturn std::nullopt;\n-\n-\tauto width = obj.list_[0].value->get<uint32_t>();\n-\tif (!width)\n-\t\treturn std::nullopt;\n-\n-\tauto height = obj.list_[1].value->get<uint32_t>();\n-\tif (!height)\n-\t\treturn std::nullopt;\n-\n-\treturn Size(*width, *height);\n-}\n-\n template<typename T>\n struct YamlObject::Accessor<std::vector<T>> {\n \tstd::optional<std::vector<T>> get(const YamlObject &obj) const\n@@ -336,7 +315,6 @@ template struct YamlObject::Accessor<std::vector<uint16_t>>;\n template struct YamlObject::Accessor<std::vector<int32_t>>;\n template struct YamlObject::Accessor<std::vector<uint32_t>>;\n template struct YamlObject::Accessor<std::vector<std::string>>;\n-template struct YamlObject::Accessor<std::vector<Size>>;\n #endif /* __DOXYGEN__ */\n \n /**\ndiff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 566401afcab6..01e734d23059 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -14,6 +14,8 @@\n #include <libcamera/base/file.h>\n #include <libcamera/base/utils.h>\n \n+#include <libcamera/geometry.h>\n+\n #include \"libcamera/internal/yaml_parser.h\"\n \n #include \"test.h\"\n",
    "prefixes": [
        "v2",
        "15/42"
    ]
}