From patchwork Thu Jan 9 11:53:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22489 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 61548C32EA for ; Thu, 9 Jan 2025 11:55:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9498F684EA; Thu, 9 Jan 2025 12:55:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IpMUMXep"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C4BA684E0 for ; Thu, 9 Jan 2025 12:55:10 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:93b9:eca8:897d:eae6]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E36E46F3; Thu, 9 Jan 2025 12:54:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736423657; bh=4wCwvb9rwqa8z7IgKnIk4/c9q6lnKUjzpR7afccj5/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IpMUMXepxp2KdPXwudx9Ehz7jaSq1XyGciCaugJJWpiCGvZh+cnCY/pXrV5an787L 9x/FcarK5+TcNssCfD9WlXMMLZt4V1q8V8H3t6nWCyRu9cWZ/UHUQ36dBIJDNdngzs U1HIFQHP5tEAG6BR4Ehvja4Rh2wS/F4kZVt+fCbI= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 02/11] libipa: pwl: Add clear() function Date: Thu, 9 Jan 2025 12:53:53 +0100 Message-ID: <20250109115412.356768-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109115412.356768-1-stefan.klug@ideasonboard.com> References: <20250109115412.356768-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sometimes it is necessary to clear a pwl. Add a function for that. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder --- src/ipa/libipa/pwl.cpp | 5 +++++ src/ipa/libipa/pwl.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 88fe2022d66d..3fa005ba92df 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -159,6 +159,11 @@ void Pwl::prepend(double x, double y, const double eps) * \return True if there are no points in the function, false otherwise */ +/** + * \fn Pwl::clear() + * \brief Clear the piecewise linear function + */ + /** * \fn Pwl::size() const * \brief Retrieve the number of points in the piecewise linear function diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h index d4ec9f4f18fb..93ced1a39745 100644 --- a/src/ipa/libipa/pwl.h +++ b/src/ipa/libipa/pwl.h @@ -49,6 +49,7 @@ public: void append(double x, double y, double eps = 1e-6); bool empty() const { return points_.empty(); } + void clear() { points_.clear(); } size_t size() const { return points_.size(); } Interval domain() const;