Patch Detail
Show a patch.
GET /api/patches/1454/?format=api
{ "id": 1454, "url": "https://patchwork.libcamera.org/api/patches/1454/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1454/", "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-5-niklas.soderlund@ragnatech.se>", "date": "2019-06-19T02:51:17", "name": "[libcamera-devel,v4,04/16] libcamera: geometry: SizeRange: Add contains()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "458cecb6cd66bee2e0b86c1b32d08432c6156733", "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/1454/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/1454/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1454/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 1FF2761A31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Jun 2019 04:52:25 +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 3c34d883-923d-11e9-8ab4-005056917a89;\n\tWed, 19 Jun 2019 04:52:11 +0200 (CEST)" ], "X-Halon-ID": "3c34d883-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:17 +0200", "Message-Id": "<20190619025129.21164-5-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 04/16] libcamera: geometry: SizeRange:\n\tAdd contains()", "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": "Add a method to check if a Size can fit inside a SizeRange. When\ndetermining if a size is containable take step values into account if\nthey are not set to 0.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/geometry.h | 2 ++\n src/libcamera/geometry.cpp | 16 ++++++++++++++++\n 2 files changed, 18 insertions(+)", "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex 03962d7d09fac2b0..52f4d010de76f840 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -92,6 +92,8 @@ public:\n \t{\n \t}\n \n+\tbool contains(const Size &size) const;\n+\n \tstd::string toString() const;\n \n \tSize min;\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex e598f6ad66076996..32b0faeadc6376e3 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -266,6 +266,22 @@ bool operator<(const Size &lhs, const Size &rhs)\n * \\brief The vertical step\n */\n \n+/**\n+ * \\brief Test if a size is contained in the range\n+ * \\param[in] size Size to check\n+ * \\returns True if \\a size is contained in the range\n+ */\n+bool SizeRange::contains(const Size &size) const\n+{\n+\tif (size.width < min.width || size.width > max.width ||\n+\t size.height < min.height || size.height > max.height ||\n+\t (hStep && (size.width - min.width) % hStep) ||\n+\t (vStep && (size.height - min.height) % vStep))\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n /**\n * \\brief Assemble and return a string describing the size range\n * \\return A string describing the SizeRange\n", "prefixes": [ "libcamera-devel", "v4", "04/16" ] }