Show a patch.

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

{
    "id": 8802,
    "url": "https://patchwork.libcamera.org/api/patches/8802/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8802/",
    "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": "<20200714234009.16596-3-laurent.pinchart@ideasonboard.com>",
    "date": "2020-07-14T23:40:06",
    "name": "[libcamera-devel,2/5] libcamera: geometry: Define Rectangle after Size",
    "commit_ref": "935aec66ae50ec2448e052c95757b2a83e3999ba",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8d4dae1f7efba51d3b2bad1357287a54ea4efd34",
    "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/8802/mbox/",
    "series": [
        {
            "id": 1107,
            "url": "https://patchwork.libcamera.org/api/series/1107/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1107",
            "date": "2020-07-14T23:40:04",
            "name": "libcamera: Various improvements to geometry classes",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1107/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8802/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8802/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 64678BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Jul 2020 23:40:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F57960930;\n\tWed, 15 Jul 2020 01:40:23 +0200 (CEST)",
            "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 09EAA60905\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 01:40:21 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A7AFB71D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 01:40:20 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EXrnZLsq\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594770020;\n\tbh=SqpJejNoNnCvoQwIv19jm7magFhcAcEfgNRiVJF4qcI=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=EXrnZLsqHXF+Fuo0xF+NdYl98ssrHZcoKRZXSM3U4ATGfcIm9WRUfbLJArKufpBr5\n\taYvD+2nThgHw4nv6PY2AqxpuNJ1NTMrSMvBRUn4n/ioaxPpjmiLNheTTb8kMFBy04m\n\tQkic3JXCL8YwCn8WLdfGEGhQPzm/IcE5mPvcxDrE=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 15 Jul 2020 02:40:06 +0300",
        "Message-Id": "<20200714234009.16596-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200714234009.16596-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20200714234009.16596-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 2/5] libcamera: geometry: Define Rectangle\n\tafter Size",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "A subsequent change to the Rectangle will require the definition of the\nSize to be available. Define Rectangle after Size to ease review of that\nchange. No code change is included.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/geometry.h |  30 ++++-----\n src/libcamera/geometry.cpp   | 122 +++++++++++++++++------------------\n 2 files changed, 76 insertions(+), 76 deletions(-)",
    "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex d217cfd50c86..f3088d33fa2c 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -13,21 +13,6 @@\n \n namespace libcamera {\n \n-struct Rectangle {\n-\tint x;\n-\tint y;\n-\tunsigned int width;\n-\tunsigned int height;\n-\n-\tconst std::string toString() const;\n-};\n-\n-bool operator==(const Rectangle &lhs, const Rectangle &rhs);\n-static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n-{\n-\treturn !(lhs == rhs);\n-}\n-\n struct Size {\n \tSize()\n \t\t: Size(0, 0)\n@@ -141,6 +126,21 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)\n \treturn !(lhs == rhs);\n }\n \n+struct Rectangle {\n+\tint x;\n+\tint y;\n+\tunsigned int width;\n+\tunsigned int height;\n+\n+\tconst std::string toString() const;\n+};\n+\n+bool operator==(const Rectangle &lhs, const Rectangle &rhs);\n+static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n+{\n+\treturn !(lhs == rhs);\n+}\n+\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_GEOMETRY_H__ */\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 4594f9ff435f..5a0bcf7c1e12 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -17,67 +17,6 @@\n \n namespace libcamera {\n \n-/**\n- * \\struct Rectangle\n- * \\brief Describe a rectangle's position and dimensions\n- *\n- * Rectangles are used to identify an area of an image. They are specified by\n- * the coordinates of top-left corner and their horizontal and vertical size.\n- *\n- * The measure unit of the rectangle coordinates and size, as well as the\n- * reference point from which the Rectangle::x and Rectangle::y displacements\n- * refers to, are defined by the context were rectangle is used.\n- */\n-\n-/**\n- * \\var Rectangle::x\n- * \\brief The horizontal coordinate of the rectangle's top-left corner\n- */\n-\n-/**\n- * \\var Rectangle::y\n- * \\brief The vertical coordinate of the rectangle's top-left corner\n- */\n-\n-/**\n- * \\var Rectangle::width\n- * \\brief The distance between the left and right sides\n- */\n-\n-/**\n- * \\var Rectangle::height\n- * \\brief The distance between the top and bottom sides\n- */\n-\n-/**\n- * \\brief Assemble and return a string describing the rectangle\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 << \")/\" << width << \"x\" << height;\n-\n-\treturn ss.str();\n-}\n-\n-/**\n- * \\brief Compare rectangles for equality\n- * \\return True if the two rectangles are equal, false otherwise\n- */\n-bool operator==(const Rectangle &lhs, const Rectangle &rhs)\n-{\n-\treturn lhs.x == rhs.x && lhs.y == rhs.y &&\n-\t       lhs.width == rhs.width && lhs.height == rhs.height;\n-}\n-\n-/**\n- * \\fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n- * \\brief Compare rectangles for inequality\n- * \\return True if the two rectangles are not equal, false otherwise\n- */\n-\n /**\n  * \\struct Size\n  * \\brief Describe a two-dimensional size\n@@ -346,4 +285,65 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs)\n  * \\return True if the two size ranges are not equal, false otherwise\n  */\n \n+/**\n+ * \\struct Rectangle\n+ * \\brief Describe a rectangle's position and dimensions\n+ *\n+ * Rectangles are used to identify an area of an image. They are specified by\n+ * the coordinates of top-left corner and their horizontal and vertical size.\n+ *\n+ * The measure unit of the rectangle coordinates and size, as well as the\n+ * reference point from which the Rectangle::x and Rectangle::y displacements\n+ * refers to, are defined by the context were rectangle is used.\n+ */\n+\n+/**\n+ * \\var Rectangle::x\n+ * \\brief The horizontal coordinate of the rectangle's top-left corner\n+ */\n+\n+/**\n+ * \\var Rectangle::y\n+ * \\brief The vertical coordinate of the rectangle's top-left corner\n+ */\n+\n+/**\n+ * \\var Rectangle::width\n+ * \\brief The distance between the left and right sides\n+ */\n+\n+/**\n+ * \\var Rectangle::height\n+ * \\brief The distance between the top and bottom sides\n+ */\n+\n+/**\n+ * \\brief Assemble and return a string describing the rectangle\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 << \")/\" << width << \"x\" << height;\n+\n+\treturn ss.str();\n+}\n+\n+/**\n+ * \\brief Compare rectangles for equality\n+ * \\return True if the two rectangles are equal, false otherwise\n+ */\n+bool operator==(const Rectangle &lhs, const Rectangle &rhs)\n+{\n+\treturn lhs.x == rhs.x && lhs.y == rhs.y &&\n+\t       lhs.width == rhs.width && lhs.height == rhs.height;\n+}\n+\n+/**\n+ * \\fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n+ * \\brief Compare rectangles for inequality\n+ * \\return True if the two rectangles are not equal, false otherwise\n+ */\n+\n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "2/5"
    ]
}