Patch Detail
Show a patch.
GET /api/1.1/patches/21944/?format=api
{ "id": 21944, "url": "https://patchwork.libcamera.org/api/1.1/patches/21944/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21944/", "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": "<20241118000738.18977-3-laurent.pinchart@ideasonboard.com>", "date": "2024-11-18T00:07:28", "name": "[RFC,v2,02/12] ipa: libipa: vector: Add r(), g() and b() accessors", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "04a62ba1e00158ba78ad0bed433f041ead776040", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21944/mbox/", "series": [ { "id": 4796, "url": "https://patchwork.libcamera.org/api/1.1/series/4796/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4796", "date": "2024-11-18T00:07:26", "name": "Improve linear algebra helpers in libipa", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4796/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21944/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21944/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 E2E59C32E0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Nov 2024 00:07:56 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64EE4658BA;\n\tMon, 18 Nov 2024 01:07:54 +0100 (CET)", "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 DB369600F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 01:07:50 +0100 (CET)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A19775A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 01:07:33 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZJbk3X/O\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731888454;\n\tbh=bQ7ZbcMrSrv8caa5LEKyJWsdOzVNQkrKgUatyJjxc4E=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=ZJbk3X/OpPRYhyUdraFvWeJlSFCrhTapQKRGscLXFrlRCS9vs1cnOLexgBvr297/6\n\t7MRXz6mXrpIwYEz1jXQX4v9A/zGbDw6riPUfyy9rJiGV3d8NAEAkDe9duICqQ08tV7\n\tpeFUXmRNhh2icfuyuf+WGFZGLgWzh7Qa3hQ/9DKo=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC PATCH v2 02/12] ipa: libipa: vector: Add r(),\n\tg() and b() accessors", "Date": "Mon, 18 Nov 2024 02:07:28 +0200", "Message-ID": "<20241118000738.18977-3-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.2", "In-Reply-To": "<20241118000738.18977-1-laurent.pinchart@ideasonboard.com>", "References": "<20241118000738.18977-1-laurent.pinchart@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 Vector class can be useful to represent RGB pixel values. Add r(),\ng() and b() accessors, similar to x(), y() and z(), along with an RGB\ntype that aliases Vector<T, 3>.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/libipa/vector.cpp | 38 ++++++++++++++++++++++++++++++++++++++\n src/ipa/libipa/vector.h | 28 ++++++++++++++++++++++++++++\n 2 files changed, 66 insertions(+)", "diff": "diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp\nindex 8a39bfd27f90..f14f155216f3 100644\n--- a/src/ipa/libipa/vector.cpp\n+++ b/src/ipa/libipa/vector.cpp\n@@ -126,6 +126,39 @@ namespace ipa {\n * \\copydoc Vector::z()\n */\n \n+/**\n+ * \\fn T &Vector::r()\n+ * \\brief Convenience function to access the first element of the vector\n+ * \\return The first element of the vector\n+ */\n+\n+/**\n+ * \\fn T &Vector::g()\n+ * \\brief Convenience function to access the second element of the vector\n+ * \\return The second element of the vector\n+ */\n+\n+/**\n+ * \\fn T &Vector::b()\n+ * \\brief Convenience function to access the third element of the vector\n+ * \\return The third element of the vector\n+ */\n+\n+/**\n+ * \\fn constexpr const T &Vector::r() const\n+ * \\copydoc Vector::r()\n+ */\n+\n+/**\n+ * \\fn constexpr const T &Vector::g() const\n+ * \\copydoc Vector::g()\n+ */\n+\n+/**\n+ * \\fn constexpr const T &Vector::b() const\n+ * \\copydoc Vector::b()\n+ */\n+\n /**\n * \\fn Vector::length2()\n * \\brief Get the squared length of the vector\n@@ -149,6 +182,11 @@ namespace ipa {\n * \\return Product of matrix \\a m and vector \\a v\n */\n \n+/**\n+ * \\typedef RGB\n+ * \\brief A Vector of 3 elements representing an RGB pixel value\n+ */\n+\n /**\n * \\fn bool operator==(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)\n * \\brief Compare vectors for equality\ndiff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h\nindex 1b11a34deee4..b72ab9851aa3 100644\n--- a/src/ipa/libipa/vector.h\n+++ b/src/ipa/libipa/vector.h\n@@ -126,6 +126,31 @@ public:\n #endif /* __DOXYGEN__ */\n \tT &z() { return data_[2]; }\n \n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 1>>\n+#endif /* __DOXYGEN__ */\n+\tconstexpr const T &r() const { return data_[0]; }\n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 2>>\n+#endif /* __DOXYGEN__ */\n+\tconstexpr const T &g() const { return data_[1]; }\n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 3>>\n+#endif /* __DOXYGEN__ */\n+\tconstexpr const T &b() const { return data_[2]; }\n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 1>>\n+#endif /* __DOXYGEN__ */\n+\tT &r() { return data_[0]; }\n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 2>>\n+#endif /* __DOXYGEN__ */\n+\tT &g() { return data_[1]; }\n+#ifndef __DOXYGEN__\n+\ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 3>>\n+#endif /* __DOXYGEN__ */\n+\tT &b() { return data_[2]; }\n+\n \tconstexpr double length2() const\n \t{\n \t\tdouble ret = 0;\n@@ -143,6 +168,9 @@ private:\n \tstd::array<T, Rows> data_;\n };\n \n+template<typename T>\n+using RGB = Vector<T, 3>;\n+\n template<typename T, unsigned int Rows, unsigned int Cols>\n Vector<T, Rows> operator*(const Matrix<T, Rows, Cols> &m, const Vector<T, Cols> &v)\n {\n", "prefixes": [ "RFC", "v2", "02/12" ] }