Patch Detail
Show a patch.
GET /api/1.1/patches/19842/?format=api
{ "id": 19842, "url": "https://patchwork.libcamera.org/api/1.1/patches/19842/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19842/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20240405080259.1806453-2-paul.elder@ideasonboard.com>", "date": "2024-04-05T08:02:56", "name": "[1/4] libcamera: geometry: Add floating-point version of Point class", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "27a0c31279e6e2885f8c396ffac0dad7df486260", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19842/mbox/", "series": [ { "id": 4249, "url": "https://patchwork.libcamera.org/api/1.1/series/4249/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4249", "date": "2024-04-05T08:02:55", "name": "ipa: Move Pwl from Raspberry Pi to libipa", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4249/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19842/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19842/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 58A57C327C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 5 Apr 2024 08:03:17 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF94961C33;\n\tFri, 5 Apr 2024 10:03:16 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0442261C21\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 5 Apr 2024 10:03:14 +0200 (CEST)", "from pyrite.hamster-moth.ts.net (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 965C622A;\n\tFri, 5 Apr 2024 10:02:34 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MOECJvuC\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1712304155;\n\tbh=+hKCEVO6/gp2mzXNZcS47f1+xGV4P6WzFYL4XF2WrsY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=MOECJvuCYlRZKmKEF4bk7SmhNh0bqXw7WgVnRr6cXEc85143hAN+Ry6XtAtq1LzTh\n\tJcAdUBNFP7l/cFcdXQwoLB7l81fIhqLV7WjKW7XsEOBZepysYH0Hf/9YaXAndacxWe\n\t3WimxcMubk9Ebm88WUcuWAqoudVIjE2Gs+Smbdg4=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Paul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH 1/4] libcamera: geometry: Add floating-point version of Point\n\tclass", "Date": "Fri, 5 Apr 2024 17:02:56 +0900", "Message-Id": "<20240405080259.1806453-2-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.39.2", "In-Reply-To": "<20240405080259.1806453-1-paul.elder@ideasonboard.com>", "References": "<20240405080259.1806453-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The piecewise linear function (Pwl) class from the Raspberry Pi IPA has\nits own Point class while one already exists in libcamera's geometry.h\nheader. The reason is because libcamera's Point is on the plane of\ninteger, while Raspberry Pi's is on the plane of reals.\n\nWhile making this a template class might be cleaner, it was deemed to be\ntoo intrusive of a change, and it might not feel nice to need to specify\nthe type from a public API point of view. Hence we introduce a FPoint\nclass to designate a Point class on the plane of reals.\n\nThis is in preparation for copying/moving the Pwl class from the\nRaspberry Pi IPA to libipa.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n include/libcamera/geometry.h | 50 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 50 insertions(+)", "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex d7fdbe70..7d0c0f23 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -8,6 +8,7 @@\n #pragma once\n \n #include <algorithm>\n+#include <cmath>\n #include <ostream>\n #include <string>\n \n@@ -49,6 +50,55 @@ static inline bool operator!=(const Point &lhs, const Point &rhs)\n \n std::ostream &operator<<(std::ostream &out, const Point &p);\n \n+struct FPoint {\n+\tconstexpr FPoint()\n+\t\t: x(0), y(0)\n+\t{\n+\t}\n+\n+\tconstexpr FPoint(double _x, double _y)\n+\t\t: x(_x), y(_y)\n+\t{\n+\t}\n+\n+\tconstexpr FPoint operator-(FPoint const &p) const\n+\t{\n+\t\treturn FPoint(x - p.x, y - p.y);\n+\t}\n+\n+\tconstexpr FPoint operator+(FPoint const &p) const\n+\t{\n+\t\treturn FPoint(x + p.x, y + p.y);\n+\t}\n+\n+\tconstexpr double operator%(FPoint const &p) const\n+\t{\n+\t\treturn x * p.x + y * p.y;\n+\t}\n+\n+\tconstexpr FPoint operator*(double f) const\n+\t{\n+\t\treturn FPoint(x * f, y * f);\n+\t}\n+\n+\tconstexpr FPoint operator/(double f) const\n+\t{\n+\t\treturn FPoint(x / f, y / f);\n+\t}\n+\n+\tconstexpr double len2() const\n+\t{\n+\t\treturn x * x + y * y;\n+\t}\n+\n+\tconstexpr double len() const\n+\t{\n+\t\treturn std::sqrt(len2());\n+\t}\n+\n+\tdouble x, y;\n+};\n+\n class Size\n {\n public:\n", "prefixes": [ "1/4" ] }