Show a patch.

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

{
    "id": 1399,
    "url": "https://patchwork.libcamera.org/api/patches/1399/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1399/",
    "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": "<20190612004359.15772-4-niklas.soderlund@ragnatech.se>",
    "date": "2019-06-12T00:43:46",
    "name": "[libcamera-devel,v2,03/16] libcamera: geometry: SizeRange: Add toString()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "cd302114d8f03a8631f9f2cfef322554c432a144",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1399/mbox/",
    "series": [
        {
            "id": 351,
            "url": "https://patchwork.libcamera.org/api/series/351/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=351",
            "date": "2019-06-12T00:43:43",
            "name": "libcamera: Add support for format information and validation",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/351/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1399/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1399/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1011161F83\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Jun 2019 02:44:55 +0200 (CEST)",
            "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 35356679-8cab-11e9-8601-0050569116f7;\n\tWed, 12 Jun 2019 02:44:17 +0200 (CEST)"
        ],
        "X-Halon-ID": "35356679-8cab-11e9-8601-0050569116f7",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 12 Jun 2019 02:43:46 +0200",
        "Message-Id": "<20190612004359.15772-4-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190612004359.15772-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190612004359.15772-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 03/16] libcamera: geometry: SizeRange:\n\tAdd toString()",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Wed, 12 Jun 2019 00:44:55 -0000"
    },
    "content": "It's useful to be able to print a string representation of a SizeRange\nto the log or console, add a toString() method. While at it turn the\nstructure into a class as it contains functions as well as data.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/geometry.h |  6 +++++-\n src/libcamera/geometry.cpp   | 14 ++++++++++++++\n 2 files changed, 19 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex b2a8e5b0e005e4db..03962d7d09fac2b0 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -67,7 +67,9 @@ static inline bool operator>=(const Size &lhs, const Size &rhs)\n \treturn !(lhs < rhs);\n }\n \n-struct SizeRange {\n+class SizeRange\n+{\n+public:\n \tSizeRange()\n \t{\n \t}\n@@ -90,6 +92,8 @@ struct SizeRange {\n \t{\n \t}\n \n+\tstd::string toString() const;\n+\n \tSize min;\n \tSize max;\n \tunsigned int hStep;\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex c56c4e399ef307f5..6a1d1d78870b23ec 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -261,6 +261,20 @@ bool operator<(const Size &lhs, const Size &rhs)\n  * \\brief The vertical step\n  */\n \n+/**\n+ * \\brief Assemble and return a string describing the size range\n+ * \\return A string describing the SizeRange\n+ */\n+std::string SizeRange::toString() const\n+{\n+\tstd::stringstream ss;\n+\n+\tss << \"(\" << min.toString() << \")-(\" << max.toString() << \")/(+\"\n+\t   << hStep << \",+\" << vStep << \")\";\n+\n+\treturn ss.str();\n+}\n+\n /**\n  * \\brief Compare size ranges for equality\n  * \\return True if the two size ranges are equal, false otherwise\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "03/16"
    ]
}