From patchwork Mon Jul 20 14:59:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 27421 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 D8B0CC333E for ; Mon, 20 Jul 2026 15:00:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 71C0D67EC0; Mon, 20 Jul 2026 17:00:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vzATD6+Y"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B2FC67E52 for ; Mon, 20 Jul 2026 16:59:57 +0200 (CEST) Received: from [192.168.1.106] (mob-5-90-63-152.net.vodafone.it [5.90.63.152]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6FEDD33A5; Mon, 20 Jul 2026 16:58:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1784559538; bh=z/2FHW4blFgIZFDkrKhTDQPDwONQEdKNRjBHv0iCkEQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vzATD6+YIhrU3l2A9SyJZ9GgQ0YoJ3tslvR0YfCkmXRxgwgN+S1GHN81mM5yAkEhE CVleia5UKua9MuCnks+ofqRilgnMgTOR/fZYU0RUsI3dUDujoI903XxHq5TPtUuy9M oKFE9/ou9KWpPJDDLg5TjWFSECuA6i9CMKnI+FXI= From: Jacopo Mondi Date: Mon, 20 Jul 2026 16:59:47 +0200 Subject: [PATCH v6 29/31] ipa: libipa: lsc: Re-sort LscAlgorithmBase documentation MIME-Version: 1.0 Message-Id: <20260720-libipa-algorithms-v6-29-ececb73f97cb@ideasonboard.com> References: <20260720-libipa-algorithms-v6-0-ececb73f97cb@ideasonboard.com> In-Reply-To: <20260720-libipa-algorithms-v6-0-ececb73f97cb@ideasonboard.com> To: libcamera-devel@lists.libcamera.org, Stefan Klug , Milan Zamazal Cc: Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6638; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=z/2FHW4blFgIZFDkrKhTDQPDwONQEdKNRjBHv0iCkEQ=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqXjfb+IlfP7c8YOh4yFppclv2NuORoaWnmzG+j VegZ6u8aDGJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCal432wAKCRByNAaPFqFW PMhmD/9ek6XyI1uP1HE0gkFZPyCiUtH+/SIWk6imtmzpIcEAIgY8uIK0Y0vD/nNhA2s7fmyDdKh 1cdxhJ5YbXFh8CfXZMgVQopUc8hNzU15fvCJzPlKW18X3Wd+2ysoDJ8MzdMEPihDrB3Dx2zcbUJ K5YHbveguugy/M1rtABU5i8DMo8bX3sGrhEjqg6ao1yrUE/W5edot/FIQbPbdOClovhPg9LU/oW 2cl5A5bBg73vnyEU6qEKA91tDgwb5t+L3xFDKhD20cTHmxMMhS3fqssibX9wC/4mf1+WZNMP89g i3YziHYzwKUvgcuZEhjRflGidXmSbiMnkbE82K7NN8XAMVA9rtsycxO2i+nmfTptGeCNjoio1hA Xv44+h5q4B6EOVOT4o5Pgy6e3LpwoDwQo0X4TR6u3CITLjok77zphdbBVRRouIcL9zBKdfHQeI+ exvRKOI5Vyw4lcvOYYNyvbAObImtHIldQWLnrLz/xt9kR0ZAFl93mUMegGUQb43HUYidbBmD8Dk wKtTV8zTGcaWHnWYoKL98Kb6SJH80KP8OKBTDNET2vYdgCvr9y6YvLrawTtIhGESWI4/0g7ZUh0 5IybK1IYJkT6cQty3eUs018cGmWNEoV+olkDUkVFedVekuWhSFlLRuorTCvBmFeba1LP35/Qov3 6uZiSVTnpshByRg== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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" The documentation had not been resorted in the previous patch to keep the diff short. Re-sort the documentation of the LscAlgorithmBase and LscAlgorithm classes to match the declaration order. Signed-off-by: Jacopo Mondi --- src/ipa/libipa/lsc.cpp | 168 ++++++++++++++++++++++++------------------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp index 8f881edef94c..adaae253b740 100644 --- a/src/ipa/libipa/lsc.cpp +++ b/src/ipa/libipa/lsc.cpp @@ -55,6 +55,90 @@ namespace lsc { * Base class for LscAlgorithm for non-templated functions implementation */ +/** + * \param[in] tuningData The tuning data + * \param[in] controls The IPA list of supported controls + * \param[in] descriptor The LSC engine descriptor + * + * Parse \a tuningData according to the settings specified in \a descriptor to + * populate the LSC data and registers LSC controls in \a controls. + * + * \return 0 on success, a negative error code otherwise + */ +int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &controls, + const LscDescriptor &descriptor) +{ + polynomial_ = false; + + std::string type = tuningData["type"].get("table"); + if (type == "table") { + impl_ = std::make_unique(); + LOG(Lsc, Debug) << "Using table-based Lsc"; + } else if (type == "polynomial") { + impl_ = std::make_unique(); + polynomial_ = true; + LOG(Lsc, Debug) << "Using polynomial Lsc"; + } else { + LOG(Lsc, Error) << "Unsupported Lsc algorithm '" + << type << "'"; + return -EINVAL; + } + + const ValueNode &yamlSets = tuningData["sets"]; + if (!yamlSets.isList()) { + LOG(Lsc, Error) << "'sets' parameter not found in tuning file"; + return -EINVAL; + } + + int ret = impl_->parseLscData(yamlSets, descriptor); + if (ret) + return ret; + + controls[&controls::LensShadingCorrectionEnable] = + ControlInfo(false, true, true); + + return 0; +} + +/** + * \brief Queue a request to the lsc algorithm + * \param[in] state The lsc active state + * \param[in] context The lsc frame context + * \param[in] controls The list of controls associated with a Request + * + * Queue a new list of \a controls to the lsc algorithm. + * The only supported control is controls::LensShadingCorrectionEnable. + */ +void LscAlgorithmBase::queueRequest(lsc::ActiveState &state, + lsc::FrameContext &context, + const ControlList &controls) +{ + const auto &lscEnable = controls.get(controls::LensShadingCorrectionEnable); + if (lscEnable && *lscEnable != state.enabled) { + state.enabled = *lscEnable; + + LOG(Lsc, Debug) + << (state.enabled ? "Enabling" : "Disabling") << " Lsc"; + + context.update = true; + } + + context.enabled = state.enabled; +} + +/** + * \brief Populate the list of lsc metadata + * \param[in] context The lsc frame context + * \param[in] metadata The list of metadata + * + * Populates the list of \a metadata with controls handled by the LscAlgorithm + * class. The only supported metadata is controls::LensShadingCorrectionEnable. + */ +void LscAlgorithmBase::process(lsc::FrameContext &context, ControlList &metadata) +{ + metadata.set(controls::LensShadingCorrectionEnable, context.enabled); +} + /** * \var LscAlgorithmBase::impl_ * \brief The LSC algorithm implementation @@ -232,51 +316,6 @@ namespace lsc { * \brief Map a colour temperature to an LSC componenet */ -/** - * \param[in] tuningData The tuning data - * \param[in] controls The IPA list of supported controls - * \param[in] descriptor The LSC engine descriptor - * - * Parse \a tuningData according to the settings specified in \a descriptor to - * populate the LSC data and registers LSC controls in \a controls. - * - * \return 0 on success, a negative error code otherwise - */ -int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &controls, - const LscDescriptor &descriptor) -{ - polynomial_ = false; - - std::string type = tuningData["type"].get("table"); - if (type == "table") { - impl_ = std::make_unique(); - LOG(Lsc, Debug) << "Using table-based Lsc"; - } else if (type == "polynomial") { - impl_ = std::make_unique(); - polynomial_ = true; - LOG(Lsc, Debug) << "Using polynomial Lsc"; - } else { - LOG(Lsc, Error) << "Unsupported Lsc algorithm '" - << type << "'"; - return -EINVAL; - } - - const ValueNode &yamlSets = tuningData["sets"]; - if (!yamlSets.isList()) { - LOG(Lsc, Error) << "'sets' parameter not found in tuning file"; - return -EINVAL; - } - - int ret = impl_->parseLscData(yamlSets, descriptor); - if (ret) - return ret; - - controls[&controls::LensShadingCorrectionEnable] = - ControlInfo(false, true, true); - - return 0; -} - /** * \fn LscAlgorithm::configure() * \param[in] state The LSC active state @@ -300,45 +339,6 @@ int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &con * \return 0 on success, a negative error code otherwise */ -/** - * \brief Queue a request to the lsc algorithm - * \param[in] state The lsc active state - * \param[in] context The lsc frame context - * \param[in] controls The list of controls associated with a Request - * - * Queue a new list of \a controls to the lsc algorithm. - * The only supported control is controls::LensShadingCorrectionEnable. - */ -void LscAlgorithmBase::queueRequest(lsc::ActiveState &state, - lsc::FrameContext &context, - const ControlList &controls) -{ - const auto &lscEnable = controls.get(controls::LensShadingCorrectionEnable); - if (lscEnable && *lscEnable != state.enabled) { - state.enabled = *lscEnable; - - LOG(Lsc, Debug) - << (state.enabled ? "Enabling" : "Disabling") << " Lsc"; - - context.update = true; - } - - context.enabled = state.enabled; -} - -/** - * \brief Populate the list of lsc metadata - * \param[in] context The lsc frame context - * \param[in] metadata The list of metadata - * - * Populates the list of \a metadata with controls handled by the LscAlgorithm - * class. The only supported metadata is controls::LensShadingCorrectionEnable. - */ -void LscAlgorithmBase::process(lsc::FrameContext &context, ControlList &metadata) -{ - metadata.set(controls::LensShadingCorrectionEnable, context.enabled); -} - /** * \fn LscAlgorithm::getInterpolator * \brief Retrieve the LSC tables interpolator