From patchwork Tue Oct 14 14:24:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24641 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 0A997BE080 for ; Tue, 14 Oct 2025 14:24:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ABA3C60605; Tue, 14 Oct 2025 16:24:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SQ20sqSw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BA1D8605F3 for ; Tue, 14 Oct 2025 16:24:34 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:61fb:8e55:ff1e:be62]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 5B347741; Tue, 14 Oct 2025 16:22:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760451776; bh=lYJKih6OAxqqpu1s/AsK4pIrkBG5o2wRtCxuXW32Ejw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQ20sqSwre/d5vg4oHaivFCgx6dncoOZrAljMgHmxx4dKSqEzUb2y5iZ2wHm/b2Tf nIXGhb0gaocGaYH4J9ZqnklQT51qHNQepBaFbWKwjmPcQJYQNYlK6Idi4zYIrYRjKI nOSWISJ3peav5cHArBovAdbc8QKAOBAXGxmDSpJU= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 1/4] ipa: libipa: pwl: Add swap() function Date: Tue, 14 Oct 2025 16:24:16 +0200 Message-ID: <20251014142427.3107490-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251014142427.3107490-1-stefan.klug@ideasonboard.com> References: <20251014142427.3107490-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" Add a swap() function to easily swap the contents of two PWLs. Signed-off-by: Stefan Klug Reviewed-by: Barnabás Pőcze --- src/ipa/libipa/pwl.cpp | 6 ++++++ src/ipa/libipa/pwl.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 69a9334112e8..1858ab37b101 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -169,6 +169,12 @@ void Pwl::prepend(double x, double y, const double eps) * \return The number of points in the piecewise linear function */ +/** + * \fn Pwl::swap(Pwl &other) + * \brief Swap the contents with another PWL + * \param[in] other The PWL to swap with + */ + /** * \brief Get the domain of the piecewise linear function * \return An interval representing the domain diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h index c1496c300ee0..add20b5867af 100644 --- a/src/ipa/libipa/pwl.h +++ b/src/ipa/libipa/pwl.h @@ -51,6 +51,7 @@ public: bool empty() const { return points_.empty(); } void clear() { points_.clear(); } size_t size() const { return points_.size(); } + void swap(Pwl &other) { points_.swap(other.points_); } Interval domain() const; Interval range() const;