{"id":20280,"url":"https://patchwork.libcamera.org/api/1.1/patches/20280/?format=json","web_url":"https://patchwork.libcamera.org/patch/20280/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240613013944.23344-9-laurent.pinchart@ideasonboard.com>","date":"2024-06-13T01:39:41","name":"[08/11] ipa: libipa: pwl: Add a constructor that moves a Point vector","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"496b0cf5029837cf7389f1d80f6c69c9c7ee3b0a","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/20280/mbox/","series":[{"id":4386,"url":"https://patchwork.libcamera.org/api/1.1/series/4386/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4386","date":"2024-06-13T01:39:33","name":"ipa: libipa: Vector and Pwl improvements","version":1,"mbox":"https://patchwork.libcamera.org/series/4386/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/20280/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/20280/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 80D02C3293\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 01:40:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0305F6549D;\n\tThu, 13 Jun 2024 03:40:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9110A6549D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 03:40:15 +0200 (CEST)","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 C4726D77;\n\tThu, 13 Jun 2024 03:40:01 +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=\"quBFpeAC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718242802;\n\tbh=sB1nvilvtB2BVEco4UCdHl1jKNcmGdGTbSSCICTpOwg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=quBFpeACenKSRA3Mi5VD9sfj3TKprIO6dAj8EP4RT741gBYE8AjehtkTGExFFCj8O\n\tDA/R84lPLiOh10nSrp454OqE2p8bkaTnY6tJ18wLTQHjEEudQjlD+OJh8XZK+8awSI\n\ttcfv3smnMmqAMhDsDZr2ihi6kJ6LRO8mD+j+PpHk=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Subject":"[PATCH 08/11] ipa: libipa: pwl: Add a constructor that moves a Point\n\tvector","Date":"Thu, 13 Jun 2024 04:39:41 +0300","Message-ID":"<20240613013944.23344-9-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.44.2","In-Reply-To":"<20240613013944.23344-1-laurent.pinchart@ideasonboard.com>","References":"<20240613013944.23344-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 Pwl::Pwl(const std::vector<Point> &) constructor is inefficient as\nit makes a copy of the given points vector. Add a second constructor\nthat takes an rvalue reference to a points vector to provide move\nsemantics.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/libipa/pwl.cpp | 11 +++++++++++\n src/ipa/libipa/pwl.h   |  2 ++\n 2 files changed, 13 insertions(+)","diff":"diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp\nindex 8b437dd1a650..cf864fbb3889 100644\n--- a/src/ipa/libipa/pwl.cpp\n+++ b/src/ipa/libipa/pwl.cpp\n@@ -114,6 +114,17 @@ Pwl::Pwl(const std::vector<Point> &points)\n {\n }\n \n+/**\n+ * \\copydoc Pwl::Pwl(const std::vector<Point> &points)\n+ *\n+ * The contents of the \\a points vector is moved to the newly constructed Pwl\n+ * instance.\n+ */\n+Pwl::Pwl(std::vector<Point> &&points)\n+\t: points_(std::move(points))\n+{\n+}\n+\n /**\n  * \\brief Populate the piecewise linear function from yaml data\n  * \\param[in] params Yaml data to populate the piecewise linear function with\ndiff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h\nindex 028342314fca..8edb4d33dc71 100644\n--- a/src/ipa/libipa/pwl.h\n+++ b/src/ipa/libipa/pwl.h\n@@ -47,6 +47,8 @@ public:\n \n \tPwl();\n \tPwl(const std::vector<Point> &points);\n+\tPwl(std::vector<Point> &&points);\n+\n \tint readYaml(const libcamera::YamlObject &params);\n \n \tvoid append(double x, double y, double eps = 1e-6);\n","prefixes":["08/11"]}