[v6,29/31] ipa: libipa: lsc: Re-sort LscAlgorithmBase documentation
diff mbox series

Message ID 20260720-libipa-algorithms-v6-29-ececb73f97cb@ideasonboard.com
State New
Headers show
Series
  • ipa: libipa: Introduce libipa algorithms
Related show

Commit Message

Jacopo Mondi July 20, 2026, 2:59 p.m. UTC
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 <jacopo.mondi@ideasonboard.com>
---
 src/ipa/libipa/lsc.cpp | 168 ++++++++++++++++++++++++-------------------------
 1 file changed, 84 insertions(+), 84 deletions(-)

Patch
diff mbox series

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<std::string>("table");
+	if (type == "table") {
+		impl_ = std::make_unique<LscTable>();
+		LOG(Lsc, Debug) << "Using table-based Lsc";
+	} else if (type == "polynomial") {
+		impl_ = std::make_unique<LscPolynomial>();
+		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<std::string>("table");
-	if (type == "table") {
-		impl_ = std::make_unique<LscTable>();
-		LOG(Lsc, Debug) << "Using table-based Lsc";
-	} else if (type == "polynomial") {
-		impl_ = std::make_unique<LscPolynomial>();
-		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