From patchwork Thu Jun 13 01:39:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20283 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 9FBA1C3237 for ; Thu, 13 Jun 2024 01:40:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A3B136549D; Thu, 13 Jun 2024 03:40:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hTz5uDl+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 84619654A1 for ; Thu, 13 Jun 2024 03:40:19 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C2EE614F6; Thu, 13 Jun 2024 03:40:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718242805; bh=+wDculNBA42w46q7XROhdckmjwuZrNAg860CH+vBi2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hTz5uDl+WDcgJBOePD6ASOArqdNCow6A345psH+yx8XV+oMHpBYNyEtDcN2CpYGCN Se5UbfI1beCwaWF1JK7i9wOUb1fFHIlY/Tbm8cImhNdJo3+0xJKGWpeRL7wHZaCUME 8aCSpc1ijTIwz4/0ouU2uLm3M66u+6d7TBI1DZ7U= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , David Plowman , Naushir Patuck Subject: [PATCH 11/11] ipa: libipa: pwl: Drop readYaml() function Date: Thu, 13 Jun 2024 04:39:44 +0300 Message-ID: <20240613013944.23344-12-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 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" All users of the Pwl::readYaml() function have been removed. The function is not used, and is deprecated in favour of YamlObject::get(). Drop it. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- src/ipa/libipa/pwl.cpp | 38 -------------------------------------- src/ipa/libipa/pwl.h | 2 -- 2 files changed, 40 deletions(-) diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 3c639645fa3d..9b213754ec7d 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -125,44 +125,6 @@ Pwl::Pwl(std::vector &&points) { } -/** - * \brief Populate the piecewise linear function from yaml data - * \param[in] params Yaml data to populate the piecewise linear function with - * - * Any existing points in the piecewise linear function *will* be overwritten. - * - * The yaml data is expected to be a list with an even number of numerical - * elements. These will be parsed in pairs into x and y points in the piecewise - * linear function, and added in order. x must be monotonically increasing. - * - * \return 0 on success, negative error code otherwise - */ -int Pwl::readYaml(const libcamera::YamlObject ¶ms) -{ - if (!params.size() || params.size() % 2) - return -EINVAL; - - const auto &list = params.asList(); - - points_.clear(); - - for (auto it = list.begin(); it != list.end(); it++) { - auto x = it->get(); - if (!x) - return -EINVAL; - if (it != list.begin() && *x <= points_.back().x()) - return -EINVAL; - - auto y = (++it)->get(); - if (!y) - return -EINVAL; - - points_.push_back(Point({ *x, *y })); - } - - return 0; -} - /** * \brief Append a point to the end of the piecewise linear function * \param[in] x x-coordinate of the point to add to the piecewise linear function diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h index 8edb4d33dc71..b6f93494d807 100644 --- a/src/ipa/libipa/pwl.h +++ b/src/ipa/libipa/pwl.h @@ -49,8 +49,6 @@ public: Pwl(const std::vector &points); Pwl(std::vector &&points); - int readYaml(const libcamera::YamlObject ¶ms); - void append(double x, double y, double eps = 1e-6); bool empty() const { return points_.empty(); }