[{"id":40062,"web_url":"https://patchwork.libcamera.org/comment/40062/","msgid":"<178595041991.2300677.4305868050417289917@ping.linuxembedded.co.uk>","date":"2026-08-05T17:20:19","subject":"Re: [PATCH v7 29/32] ipa: libipa: lsc: Re-sort LscAlgorithmBase\n\tdocumentation","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2026-08-05 17:13:11)\n> The documentation had not been resorted in the previous patch\n> to keep the diff short.\n> \n> Re-sort the documentation of the LscAlgorithmBase and LscAlgorithm\n> classes to match the declaration order.\n> \n\nCode move confirmed identical in meld:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/ipa/libipa/lsc.cpp | 168 ++++++++++++++++++++++++-------------------------\n>  1 file changed, 84 insertions(+), 84 deletions(-)\n> \n> diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp\n> index bb02290fc9ad..a8b89bcedf57 100644\n> --- a/src/ipa/libipa/lsc.cpp\n> +++ b/src/ipa/libipa/lsc.cpp\n> @@ -111,6 +111,90 @@ void Interpolator<lsc::Components<uint16_t>>::\n>   * Base class for LscAlgorithm for non-templated functions implementation\n>   */\n>  \n> +/**\n> + * \\param[in] tuningData The tuning data\n> + * \\param[in] controls The IPA list of supported controls\n> + * \\param[in] descriptor The LSC engine descriptor\n> + *\n> + * Parse \\a tuningData according to the settings specified in \\a descriptor to\n> + * populate the LSC data and registers LSC controls in \\a controls.\n> + *\n> + * \\return 0 on success, a negative error code otherwise\n> + */\n> +int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &controls,\n> +                          const LscDescriptor &descriptor)\n> +{\n> +       polynomial_ = false;\n> +\n> +       std::string type = tuningData[\"type\"].get<std::string>(\"table\");\n> +       if (type == \"table\") {\n> +               impl_ = std::make_unique<LscTable>();\n> +               LOG(Lsc, Debug) << \"Using table-based Lsc\";\n> +       } else if (type == \"polynomial\") {\n> +               impl_ = std::make_unique<LscPolynomial>();\n> +               polynomial_ = true;\n> +               LOG(Lsc, Debug) << \"Using polynomial Lsc\";\n> +       } else {\n> +               LOG(Lsc, Error) << \"Unsupported Lsc algorithm '\"\n> +                               << type << \"'\";\n> +               return -EINVAL;\n> +       }\n> +\n> +       const ValueNode &yamlSets = tuningData[\"sets\"];\n> +       if (!yamlSets.isList()) {\n> +               LOG(Lsc, Error) << \"'sets' parameter not found in tuning file\";\n> +               return -EINVAL;\n> +       }\n> +\n> +       int ret = impl_->parseLscData(yamlSets, descriptor);\n> +       if (ret)\n> +               return ret;\n> +\n> +       controls[&controls::LensShadingCorrectionEnable] =\n> +               ControlInfo(false, true, true);\n> +\n> +       return 0;\n> +}\n> +\n> +/**\n> + * \\brief Queue a request to the lsc algorithm\n> + * \\param[in] state The lsc active state\n> + * \\param[in] context The lsc frame context\n> + * \\param[in] controls The list of controls associated with a Request\n> + *\n> + * Queue a new list of \\a controls to the lsc algorithm.\n> + * The only supported control is controls::LensShadingCorrectionEnable.\n> + */\n> +void LscAlgorithmBase::queueRequest(lsc::ActiveState &state,\n> +                                   lsc::FrameContext &context,\n> +                                   const ControlList &controls)\n> +{\n> +       const auto &lscEnable = controls.get(controls::LensShadingCorrectionEnable);\n> +       if (lscEnable && *lscEnable != state.enabled) {\n> +               state.enabled = *lscEnable;\n> +\n> +               LOG(Lsc, Debug)\n> +                       << (state.enabled ? \"Enabling\" : \"Disabling\") << \" Lsc\";\n> +\n> +               context.update = true;\n> +       }\n> +\n> +       context.enabled = state.enabled;\n> +}\n> +\n> +/**\n> + * \\brief Populate the list of lsc metadata\n> + * \\param[in] context The lsc frame context\n> + * \\param[in] metadata The list of metadata\n> + *\n> + * Populates the list of \\a metadata with controls handled by the LscAlgorithm\n> + * class. The only supported metadata is controls::LensShadingCorrectionEnable.\n> + */\n> +void LscAlgorithmBase::process(lsc::FrameContext &context, ControlList &metadata)\n> +{\n> +       metadata.set(controls::LensShadingCorrectionEnable, context.enabled);\n> +}\n> +\n>  /**\n>   * \\var LscAlgorithmBase::impl_\n>   * \\brief The LSC algorithm implementation\n> @@ -287,51 +371,6 @@ void Interpolator<lsc::Components<uint16_t>>::\n>   * can retrieve them using LscAlgorithm::getComponents().\n>   */\n>  \n> -/**\n> - * \\param[in] tuningData The tuning data\n> - * \\param[in] controls The IPA list of supported controls\n> - * \\param[in] descriptor The LSC engine descriptor\n> - *\n> - * Parse \\a tuningData according to the settings specified in \\a descriptor to\n> - * populate the LSC data and registers LSC controls in \\a controls.\n> - *\n> - * \\return 0 on success, a negative error code otherwise\n> - */\n> -int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &controls,\n> -                          const LscDescriptor &descriptor)\n> -{\n> -       polynomial_ = false;\n> -\n> -       std::string type = tuningData[\"type\"].get<std::string>(\"table\");\n> -       if (type == \"table\") {\n> -               impl_ = std::make_unique<LscTable>();\n> -               LOG(Lsc, Debug) << \"Using table-based Lsc\";\n> -       } else if (type == \"polynomial\") {\n> -               impl_ = std::make_unique<LscPolynomial>();\n> -               polynomial_ = true;\n> -               LOG(Lsc, Debug) << \"Using polynomial Lsc\";\n> -       } else {\n> -               LOG(Lsc, Error) << \"Unsupported Lsc algorithm '\"\n> -                               << type << \"'\";\n> -               return -EINVAL;\n> -       }\n> -\n> -       const ValueNode &yamlSets = tuningData[\"sets\"];\n> -       if (!yamlSets.isList()) {\n> -               LOG(Lsc, Error) << \"'sets' parameter not found in tuning file\";\n> -               return -EINVAL;\n> -       }\n> -\n> -       int ret = impl_->parseLscData(yamlSets, descriptor);\n> -       if (ret)\n> -               return ret;\n> -\n> -       controls[&controls::LensShadingCorrectionEnable] =\n> -               ControlInfo(false, true, true);\n> -\n> -       return 0;\n> -}\n> -\n>  /**\n>   * \\fn LscAlgorithm::configure()\n>   * \\brief Re-sample and quantize LSC data\n> @@ -361,45 +400,6 @@ int LscAlgorithmBase::init(const ValueNode &tuningData, ControlInfoMap::Map &con\n>   * \\return 0 on success, a negative error code otherwise\n>   */\n>  \n> -/**\n> - * \\brief Queue a request to the lsc algorithm\n> - * \\param[in] state The lsc active state\n> - * \\param[in] context The lsc frame context\n> - * \\param[in] controls The list of controls associated with a Request\n> - *\n> - * Queue a new list of \\a controls to the lsc algorithm.\n> - * The only supported control is controls::LensShadingCorrectionEnable.\n> - */\n> -void LscAlgorithmBase::queueRequest(lsc::ActiveState &state,\n> -                                   lsc::FrameContext &context,\n> -                                   const ControlList &controls)\n> -{\n> -       const auto &lscEnable = controls.get(controls::LensShadingCorrectionEnable);\n> -       if (lscEnable && *lscEnable != state.enabled) {\n> -               state.enabled = *lscEnable;\n> -\n> -               LOG(Lsc, Debug)\n> -                       << (state.enabled ? \"Enabling\" : \"Disabling\") << \" Lsc\";\n> -\n> -               context.update = true;\n> -       }\n> -\n> -       context.enabled = state.enabled;\n> -}\n> -\n> -/**\n> - * \\brief Populate the list of lsc metadata\n> - * \\param[in] context The lsc frame context\n> - * \\param[in] metadata The list of metadata\n> - *\n> - * Populates the list of \\a metadata with controls handled by the LscAlgorithm\n> - * class. The only supported metadata is controls::LensShadingCorrectionEnable.\n> - */\n> -void LscAlgorithmBase::process(lsc::FrameContext &context, ControlList &metadata)\n> -{\n> -       metadata.set(controls::LensShadingCorrectionEnable, context.enabled);\n> -}\n> -\n>  /**\n>   * \\fn LscAlgorithm::interpolateComponents\n>   * \\brief Interpolate the LSC tables for a given colour temperature\n> \n> -- \n> 2.54.0\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 A462BC3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2026 17:20:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 060886812D;\n\tWed,  5 Aug 2026 19:20:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72B5968124\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2026 19:20:22 +0200 (CEST)","from monstersaurus.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 DE600929;\n\tWed,  5 Aug 2026 19:19:11 +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=\"fA4/oZAI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1785950352;\n\tbh=/ilc3wVgzma+7cVLbXbya6iZilNUYuIFEppPqTp52iA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=fA4/oZAItWASVLrRUd3eDJ/OnnREVgybT6OJo3h2htH6Kllsih6NOI45MX72+AQc2\n\ttS532pSpformm95O1y8PT+KWFK8drNiZpPePAtpjRHsrupSQALBcac/dEJ8mDl5mX+\n\tvHQuyGYl2HlVgaO33Op2p6snaqI1jmKLWpRmq7Jk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260805-libipa-algorithms-v7-29-7425b5b795d4@ideasonboard.com>","References":"<20260805-libipa-algorithms-v7-0-7425b5b795d4@ideasonboard.com>\n\t<20260805-libipa-algorithms-v7-29-7425b5b795d4@ideasonboard.com>","Subject":"Re: [PATCH v7 29/32] ipa: libipa: lsc: Re-sort LscAlgorithmBase\n\tdocumentation","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 05 Aug 2026 18:20:19 +0100","Message-ID":"<178595041991.2300677.4305868050417289917@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}}]