Show a patch.

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

{
    "id": 1453,
    "url": "https://patchwork.libcamera.org/api/patches/1453/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1453/",
    "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": "<20190619025129.21164-3-niklas.soderlund@ragnatech.se>",
    "date": "2019-06-19T02:51:15",
    "name": "[libcamera-devel,v4,02/16] libcamera: geometry: SizeRange: Extend with step information",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a2b132786e684ced842aa77b73d47200a61114b0",
    "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/1453/mbox/",
    "series": [
        {
            "id": 361,
            "url": "https://patchwork.libcamera.org/api/series/361/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=361",
            "date": "2019-06-19T02:51:13",
            "name": "libcamera: Add support for format information and validation",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/361/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1453/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1453/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A4A0561A2F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Jun 2019 04:52:24 +0200 (CEST)",
            "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 3b53e2e9-923d-11e9-8ab4-005056917a89;\n\tWed, 19 Jun 2019 04:52:10 +0200 (CEST)"
        ],
        "X-Halon-ID": "3b53e2e9-923d-11e9-8ab4-005056917a89",
        "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, 19 Jun 2019 04:51:15 +0200",
        "Message-Id": "<20190619025129.21164-3-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190619025129.21164-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190619025129.21164-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 02/16] libcamera: geometry: SizeRange:\n\tExtend with step information",
        "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, 19 Jun 2019 02:52:25 -0000"
    },
    "content": "The size range described might be subject to certain step\nlimitations. Make it possible to record this information.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/geometry.h | 13 ++++++++--\n src/libcamera/geometry.cpp   | 49 +++++++++++++++++++++++++++++++++---\n 2 files changed, 57 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex ec5ed2bee196c82d..b2a8e5b0e005e4db 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -73,18 +73,27 @@ struct SizeRange {\n \t}\n \n \tSizeRange(unsigned int width, unsigned int height)\n-\t\t: min(width, height), max(width, height)\n+\t\t: min(width, height), max(width, height), hStep(1), vStep(1)\n \t{\n \t}\n \n \tSizeRange(unsigned int minW, unsigned int minH,\n \t\t  unsigned int maxW, unsigned int maxH)\n-\t\t: min(minW, minH), max(maxW, maxH)\n+\t\t: min(minW, minH), max(maxW, maxH), hStep(1), vStep(1)\n+\t{\n+\t}\n+\n+\tSizeRange(unsigned int minW, unsigned int minH,\n+\t\t  unsigned int maxW, unsigned int maxH,\n+\t\t  unsigned int hstep, unsigned int vstep)\n+\t\t: min(minW, minH), max(maxW, maxH), hStep(hstep), vStep(vstep)\n \t{\n \t}\n \n \tSize min;\n \tSize max;\n+\tunsigned int hStep;\n+\tunsigned int vStep;\n };\n \n bool operator==(const SizeRange &lhs, const SizeRange &rhs);\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex 26a05b9e7d800077..1ea102935bdb256c 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -186,9 +186,29 @@ bool operator<(const Size &lhs, const Size &rhs)\n  * \\struct SizeRange\n  * \\brief Describe a range of sizes\n  *\n- * SizeRange describes a range of sizes included in the [min, max]\n- * interval for both the width and the height. If the minimum and\n- * maximum sizes are identical it represents a single size.\n+ * A SizeRange describes a range of sizes included in the [min, max] interval\n+ * for both the width and the height. If the minimum and maximum sizes are\n+ * identical it represents a single size.\n+ *\n+ * Size ranges may further limit the valid sizes through steps in the horizontal\n+ * and vertical direction. The step values represent the increase in pixels\n+ * between two valid width or height values, starting from the minimum. Valid\n+ * sizes within the range are thus expressed as\n+ *\n+ *\twidth = min.width + hStep * x\n+ *\theight = min.height + vStep * y\n+ *\n+ *\tWhere\n+ *\n+ *\twidth <= max.width\n+ *\theight < max.height\n+ *\n+ * Note that the step values are not equivalent to alignments, as the minimum\n+ * width or height may not be a multiple of the corresponding step.\n+ *\n+ * The step values may be zero when the range describes only minimum and\n+ * maximum sizes without implying that all, or any, intermediate size is valid.\n+ * SizeRange instances the describe a single size have both set values set to 1.\n  */\n \n /**\n@@ -213,6 +233,19 @@ bool operator<(const Size &lhs, const Size &rhs)\n  * \\param[in] maxH The maximum height\n  */\n \n+/**\n+ * \\fn SizeRange::SizeRange(unsigned int minW, unsigned int minH,\n+ *\t\t\t    unsigned int maxW, unsigned int maxH,\n+ *\t\t\t    unsigned int hstep, unsigned int vstep)\n+ * \\brief Construct an initialized size range\n+ * \\param[in] minW The minimum width\n+ * \\param[in] minH The minimum height\n+ * \\param[in] maxW The maximum width\n+ * \\param[in] maxH The maximum height\n+ * \\param[in] hstep The horizontal step\n+ * \\param[in] vstep The vertical step\n+ */\n+\n /**\n  * \\var SizeRange::min\n  * \\brief The minimum size\n@@ -223,6 +256,16 @@ bool operator<(const Size &lhs, const Size &rhs)\n  * \\brief The maximum size\n  */\n \n+/**\n+ * \\var SizeRange::hStep\n+ * \\brief The horizontal step\n+ */\n+\n+/**\n+ * \\var SizeRange::vStep\n+ * \\brief The vertical step\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",
        "v4",
        "02/16"
    ]
}