Patch Detail
Show a patch.
GET /api/patches/799/?format=api
{ "id": 799, "url": "https://patchwork.libcamera.org/api/patches/799/?format=api", "web_url": "https://patchwork.libcamera.org/patch/799/", "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": "<20190326083902.26121-5-jacopo@jmondi.org>", "date": "2019-03-26T08:38:47", "name": "[libcamera-devel,v5,04/19] libcamera: geometry: Add toString to Rectangle", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "883703ca6f4afbe69ef6b6996898a117ceccdb8a", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/799/mbox/", "series": [ { "id": 219, "url": "https://patchwork.libcamera.org/api/series/219/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=219", "date": "2019-03-26T08:38:43", "name": "libcamera: ipu3: Add ImgU support", "version": 5, "mbox": "https://patchwork.libcamera.org/series/219/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/799/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/799/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 85989611A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2019 09:38:32 +0100 (CET)", "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 12826240014;\n\tTue, 26 Mar 2019 08:38:31 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Mar 2019 09:38:47 +0100", "Message-Id": "<20190326083902.26121-5-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190326083902.26121-1-jacopo@jmondi.org>", "References": "<20190326083902.26121-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 04/19] libcamera: geometry: Add\n\ttoString to Rectangle", "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": "Tue, 26 Mar 2019 08:38:32 -0000" }, "content": "Add toString() helpers to pretty print out the sizes of a Rectangle.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/geometry.cpp | 16 ++++++++++++++++\n src/libcamera/include/geometry.h | 4 ++++\n 2 files changed, 20 insertions(+)", "diff": "diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex dbc37ca8e3f4..f76001d94562 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -5,6 +5,8 @@\n * geometry.cpp - Geometry-related structures\n */\n \n+#include <sstream>\n+\n #include \"geometry.h\"\n \n /**\n@@ -46,6 +48,20 @@ namespace libcamera {\n * \\brief The distance between the top and bottom sides\n */\n \n+/**\n+ * \\brief Assemble and return a string describing the rectangle\n+ *\n+ * \\return A string describing the Rectangle\n+ */\n+const std::string Rectangle::toString() const\n+{\n+\tstd::stringstream ss;\n+\n+\tss << \"(\" << x << \"x\" << y << \")/\" << w << \"x\" << h;\n+\n+\treturn ss.str();\n+}\n+\n /**\n * \\struct SizeRange\n * \\brief Describe a range of image sizes\ndiff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h\nindex 749746495204..567a54299b24 100644\n--- a/src/libcamera/include/geometry.h\n+++ b/src/libcamera/include/geometry.h\n@@ -8,6 +8,8 @@\n #ifndef __LIBCAMERA_GEOMETRY_H__\n #define __LIBCAMERA_GEOMETRY_H__\n \n+#include <string>\n+\n namespace libcamera {\n \n struct Rectangle {\n@@ -15,6 +17,8 @@ struct Rectangle {\n \tint y;\n \tunsigned int w;\n \tunsigned int h;\n+\n+\tconst std::string toString() const;\n };\n \n struct SizeRange {\n", "prefixes": [ "libcamera-devel", "v5", "04/19" ] }