Patch Detail
Show a patch.
GET /api/1.1/patches/27007/?format=api
{ "id": 27007, "url": "https://patchwork.libcamera.org/api/1.1/patches/27007/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27007/", "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": "<20260621002305.3763752-4-laurent.pinchart@ideasonboard.com>", "date": "2026-06-21T00:23:04", "name": "[3/4] libcamera: vector: Support multiple scalar arguments to apply()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d4f327b215e2dad0ef3c0ca8cd5e833e6aa37e35", "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/27007/mbox/", "series": [ { "id": 6010, "url": "https://patchwork.libcamera.org/api/1.1/series/6010/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6010", "date": "2026-06-21T00:23:01", "name": "libcamera: vector: Add clamp() function", "version": 1, "mbox": "https://patchwork.libcamera.org/series/6010/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27007/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27007/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 9116CC3306\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 21 Jun 2026 00:23:16 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06B0A656E5;\n\tSun, 21 Jun 2026 02:23:15 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F1BAD656E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 21 Jun 2026 02:23:11 +0200 (CEST)", "from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 84E6AB8B;\n\tSun, 21 Jun 2026 02:22: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=\"XRQ3XkX4\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782001354;\n\tbh=0WMvP4YZu3wStzAx0c8cs6xCUyzGowBc//PCpN3eih8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XRQ3XkX4zwJi1N+IDqAOwDVlRM7xrUg0Pc/mSbiU9Q1QtUCVxHU4G5M61F0lVt8uH\n\txZgejhoi1Au50rUU2zTryjPWMM+imO6omNIwYRsnjDu7GRUUg+MYp3P8wVIUNGOWJf\n\tp71W/riGIPKNUV0ky624MV3UVo70yxZQJNP62cio=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Subject": "[PATCH 3/4] libcamera: vector: Support multiple scalar arguments to\n\tapply()", "Date": "Sun, 21 Jun 2026 03:23:04 +0300", "Message-ID": "<20260621002305.3763752-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260621002305.3763752-1-laurent.pinchart@ideasonboard.com>", "References": "<20260621002305.3763752-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": "In preparation for the addition of a clamp() function to the vector\nclass, extend the apply() function to support multiple scalar arguments.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/vector.h | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h\nindex 256de1d1c53a..7c90d6542352 100644\n--- a/include/libcamera/internal/vector.h\n+++ b/include/libcamera/internal/vector.h\n@@ -274,13 +274,13 @@ private:\n \t\treturn result;\n \t}\n \n-\ttemplate<typename BinaryOp, typename U>\n-\tstatic constexpr Vector apply(const Vector &lhs, BinaryOp op, U rhs)\n+\ttemplate<typename Op, typename... U>\n+\tstatic constexpr Vector apply(const Vector &vector, Op op, U... scalar)\n \t{\n \t\tVector result;\n-\t\tstd::transform(lhs.data_.begin(), lhs.data_.end(),\n+\t\tstd::transform(vector.data_.begin(), vector.data_.end(),\n \t\t\t result.data_.begin(),\n-\t\t\t [&op, rhs](T v) { return op(v, rhs); });\n+\t\t\t [&op, scalar...](T v) { return op(v, scalar...); });\n \n \t\treturn result;\n \t}\n@@ -295,11 +295,11 @@ private:\n \t\treturn *this;\n \t}\n \n-\ttemplate<typename BinaryOp, typename U>\n-\tVector &apply(BinaryOp op, U scalar)\n+\ttemplate<typename Op, typename... U>\n+\tVector &apply(Op op, U... scalar)\n \t{\n \t\tstd::for_each(data_.begin(), data_.end(),\n-\t\t\t [&op, scalar](T &v) { v = op(v, scalar); });\n+\t\t\t [&op, scalar...](T &v) { v = op(v, scalar...); });\n \n \t\treturn *this;\n \t}\n", "prefixes": [ "3/4" ] }