[{"id":29888,"web_url":"https://patchwork.libcamera.org/comment/29888/","msgid":"<ZmqiVtcx1C_Rrmew@pyrite.rasen.tech>","date":"2024-06-13T07:40:06","subject":"Re: [PATCH 07/11] ipa: libipa: pwl: Add a size() function","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Thu, Jun 13, 2024 at 04:39:40AM +0300, Laurent Pinchart wrote:\n> Add a size() function to the Pwl class to return the number of points in\n> the piecewise linear function. This is useful, for instance, to validate\n> that all points added with append() or prepend() have been taken into\n> account.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/pwl.cpp | 6 ++++++\n>  src/ipa/libipa/pwl.h   | 2 ++\n>  2 files changed, 8 insertions(+)\n> \n> diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp\n> index d8ea92be0a86..8b437dd1a650 100644\n> --- a/src/ipa/libipa/pwl.cpp\n> +++ b/src/ipa/libipa/pwl.cpp\n> @@ -188,6 +188,12 @@ void Pwl::prepend(double x, double y, const double eps)\n>   * \\return True if there are no points in the function, false otherwise\n>   */\n>  \n> +/**\n> + * \\fn Pwl::size() const\n> + * \\brief Retrieve the number of points in the piecewise linear function\n> + * \\return The number of points in the piecewise linear function\n> + */\n> +\n>  /**\n>   * \\brief Get the domain of the piecewise linear function\n>   * \\return An interval representing the domain\n> diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h\n> index b4de00cf88f0..028342314fca 100644\n> --- a/src/ipa/libipa/pwl.h\n> +++ b/src/ipa/libipa/pwl.h\n> @@ -52,6 +52,8 @@ public:\n>  \tvoid append(double x, double y, double eps = 1e-6);\n>  \n>  \tbool empty() const { return points_.empty(); }\n> +\tsize_t size() const { return points_.size(); }\n> +\n>  \tInterval domain() const;\n>  \tInterval range() const;\n>","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 23383BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 07:40:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE35365492;\n\tThu, 13 Jun 2024 09:40:14 +0200 (CEST)","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 23CAF6548B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 09:40:13 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E40D84CF;\n\tThu, 13 Jun 2024 09:39:57 +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=\"VsjTyl4X\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718264399;\n\tbh=SWByp5xJhtncsJpcMdUFCWfBSDpiLB3pxZqxG0HYnhM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VsjTyl4XKHFgp3K78WPPX3MNUZ5vmYEX1voi4fLTWI+SJ7TQ6GouJTFrLlecu4XCf\n\tNnb+4LcW/25qUsu4XgvmQYhVwVkW/ZzTu9hqQPsgMygG1041ECxYkiQXDBoNWtGMoa\n\t+beM0d4h5NJ/unB+1ib59/Q+XK8DgJTo8cnt2LEg=","Date":"Thu, 13 Jun 2024 16:40:06 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Subject":"Re: [PATCH 07/11] ipa: libipa: pwl: Add a size() function","Message-ID":"<ZmqiVtcx1C_Rrmew@pyrite.rasen.tech>","References":"<20240613013944.23344-1-laurent.pinchart@ideasonboard.com>\n\t<20240613013944.23344-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240613013944.23344-8-laurent.pinchart@ideasonboard.com>","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>"}},{"id":29913,"web_url":"https://patchwork.libcamera.org/comment/29913/","msgid":"<171827738380.1550852.12508096503250489166@ping.linuxembedded.co.uk>","date":"2024-06-13T11:16:23","subject":"Re: [PATCH 07/11] ipa: libipa: pwl: Add a size() function","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-06-13 02:39:40)\n> Add a size() function to the Pwl class to return the number of points in\n> the piecewise linear function. This is useful, for instance, to validate\n> that all points added with append() or prepend() have been taken into\n> account.\n> \n\nSounds fine to me. I expect there are some anticipated use of this in\nthe future, but even still it's a reasonable and straightforward\naccessor.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/libipa/pwl.cpp | 6 ++++++\n>  src/ipa/libipa/pwl.h   | 2 ++\n>  2 files changed, 8 insertions(+)\n> \n> diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp\n> index d8ea92be0a86..8b437dd1a650 100644\n> --- a/src/ipa/libipa/pwl.cpp\n> +++ b/src/ipa/libipa/pwl.cpp\n> @@ -188,6 +188,12 @@ void Pwl::prepend(double x, double y, const double eps)\n>   * \\return True if there are no points in the function, false otherwise\n>   */\n>  \n> +/**\n> + * \\fn Pwl::size() const\n> + * \\brief Retrieve the number of points in the piecewise linear function\n> + * \\return The number of points in the piecewise linear function\n> + */\n> +\n>  /**\n>   * \\brief Get the domain of the piecewise linear function\n>   * \\return An interval representing the domain\n> diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h\n> index b4de00cf88f0..028342314fca 100644\n> --- a/src/ipa/libipa/pwl.h\n> +++ b/src/ipa/libipa/pwl.h\n> @@ -52,6 +52,8 @@ public:\n>         void append(double x, double y, double eps = 1e-6);\n>  \n>         bool empty() const { return points_.empty(); }\n> +       size_t size() const { return points_.size(); }\n> +\n>         Interval domain() const;\n>         Interval range() const;\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 527B9C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 11:16:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 03CA565496;\n\tThu, 13 Jun 2024 13:16:28 +0200 (CEST)","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 CBD4965462\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 13:16:26 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DC8894CF;\n\tThu, 13 Jun 2024 13:16:12 +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=\"YjtQwFV2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718277373;\n\tbh=pDZW0+bQbaiU6OtYeEhxnrU49Z6P2EcxQVxcZPK+Jx4=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=YjtQwFV2bn/0Sb/62VP6Q35lgIiuUgx1+Nqk4RyOVId4M61TcADBIzEIXoQyMlCk0\n\t+J0uEyrbes3fiSf4L7pxoba9xAZKSiOw1Uwuo3g6wFkKUzeLLqR7b3UQTY2PppPxjC\n\tnUvkCqTnvPFHOTrCFKyo8RSvlydukBE473cx5GSY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240613013944.23344-8-laurent.pinchart@ideasonboard.com>","References":"<20240613013944.23344-1-laurent.pinchart@ideasonboard.com>\n\t<20240613013944.23344-8-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 07/11] ipa: libipa: pwl: Add a size() function","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 13 Jun 2024 12:16:23 +0100","Message-ID":"<171827738380.1550852.12508096503250489166@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]