[v2,08/15] ipa: rkisp1: lsc: Move local types into anonymous namespace
diff mbox series

Message ID 20260108-sklug-lsc-resampling-v2-dev-v2-8-e682ec4b9893@ideasonboard.com
State New
Headers show
Series
  • Add resampling support for polynomial LSC data
Related show

Commit Message

Stefan Klug Jan. 8, 2026, 4:05 p.m. UTC
Move all local helpers into an anonymous namespace and drop a static
modifier that is no longer needed.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

---

Changes in v2:
- Added this patch
---
 src/ipa/rkisp1/algorithms/lsc.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Kieran Bingham Jan. 8, 2026, 4:52 p.m. UTC | #1
Quoting Stefan Klug (2026-01-08 16:05:51)
> Move all local helpers into an anonymous namespace and drop a static
> modifier that is no longer needed.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> ---
> 
> Changes in v2:
> - Added this patch
> ---
>  src/ipa/rkisp1/algorithms/lsc.cpp | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index 1962d18d148b4abac6e601ec36e0c68944a6191c..c42f74557c7364935254d75ee1fb923d176e0dbd 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -27,8 +27,6 @@ namespace libcamera {
>  
>  namespace ipa {
>  
> -constexpr int kColourTemperatureChangeThreshhold = 10;
> -
>  template<typename T>
>  void interpolateVector(const std::vector<T> &a, const std::vector<T> &b,
>                        std::vector<T> &dest, double lambda)
> @@ -70,6 +68,10 @@ namespace ipa::rkisp1::algorithms {
>  
>  LOG_DEFINE_CATEGORY(RkISP1Lsc)
>  
> +namespace {
> +
> +constexpr int kColourTemperatureChangeThreshhold = 10;
> +
>  class LscPolynomialLoader
>  {
>  public:
> @@ -276,8 +278,8 @@ std::vector<uint16_t> LscTableLoader::parseTable(const YamlObject &tuningData,
>         return table;
>  }
>  
> -static std::vector<double> parseSizes(const YamlObject &tuningData,
> -                                     const char *prop)
> +std::vector<double> parseSizes(const YamlObject &tuningData,
> +                              const char *prop)
>  {
>         std::vector<double> sizes =
>                 tuningData[prop].getList<double>().value_or(std::vector<double>{});
> @@ -306,6 +308,8 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,
>         return sizes;
>  }
>  
> +} /* namespace */
> +
>  LensShadingCorrection::LensShadingCorrection()
>         : lastAppliedCt_(0), lastAppliedQuantizedCt_(0)
>  {
> 
> -- 
> 2.51.0
>
Barnabás Pőcze Jan. 9, 2026, 9:37 a.m. UTC | #2
2026. 01. 08. 17:05 keltezéssel, Stefan Klug írta:
> Move all local helpers into an anonymous namespace and drop a static
> modifier that is no longer needed.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> 
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


> 
> Changes in v2:
> - Added this patch
> ---
>   src/ipa/rkisp1/algorithms/lsc.cpp | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index 1962d18d148b4abac6e601ec36e0c68944a6191c..c42f74557c7364935254d75ee1fb923d176e0dbd 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -27,8 +27,6 @@ namespace libcamera {
> 
>   namespace ipa {
> 
> -constexpr int kColourTemperatureChangeThreshhold = 10;
> -
>   template<typename T>
>   void interpolateVector(const std::vector<T> &a, const std::vector<T> &b,
>   		       std::vector<T> &dest, double lambda)
> @@ -70,6 +68,10 @@ namespace ipa::rkisp1::algorithms {
> 
>   LOG_DEFINE_CATEGORY(RkISP1Lsc)
> 
> +namespace {
> +
> +constexpr int kColourTemperatureChangeThreshhold = 10;
> +
>   class LscPolynomialLoader
>   {
>   public:
> @@ -276,8 +278,8 @@ std::vector<uint16_t> LscTableLoader::parseTable(const YamlObject &tuningData,
>   	return table;
>   }
> 
> -static std::vector<double> parseSizes(const YamlObject &tuningData,
> -				      const char *prop)
> +std::vector<double> parseSizes(const YamlObject &tuningData,
> +			       const char *prop)
>   {
>   	std::vector<double> sizes =
>   		tuningData[prop].getList<double>().value_or(std::vector<double>{});
> @@ -306,6 +308,8 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,
>   	return sizes;
>   }
> 
> +} /* namespace */
> +
>   LensShadingCorrection::LensShadingCorrection()
>   	: lastAppliedCt_(0), lastAppliedQuantizedCt_(0)
>   {
> 
> --
> 2.51.0
>

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index 1962d18d148b4abac6e601ec36e0c68944a6191c..c42f74557c7364935254d75ee1fb923d176e0dbd 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -27,8 +27,6 @@  namespace libcamera {
 
 namespace ipa {
 
-constexpr int kColourTemperatureChangeThreshhold = 10;
-
 template<typename T>
 void interpolateVector(const std::vector<T> &a, const std::vector<T> &b,
 		       std::vector<T> &dest, double lambda)
@@ -70,6 +68,10 @@  namespace ipa::rkisp1::algorithms {
 
 LOG_DEFINE_CATEGORY(RkISP1Lsc)
 
+namespace {
+
+constexpr int kColourTemperatureChangeThreshhold = 10;
+
 class LscPolynomialLoader
 {
 public:
@@ -276,8 +278,8 @@  std::vector<uint16_t> LscTableLoader::parseTable(const YamlObject &tuningData,
 	return table;
 }
 
-static std::vector<double> parseSizes(const YamlObject &tuningData,
-				      const char *prop)
+std::vector<double> parseSizes(const YamlObject &tuningData,
+			       const char *prop)
 {
 	std::vector<double> sizes =
 		tuningData[prop].getList<double>().value_or(std::vector<double>{});
@@ -306,6 +308,8 @@  static std::vector<double> parseSizes(const YamlObject &tuningData,
 	return sizes;
 }
 
+} /* namespace */
+
 LensShadingCorrection::LensShadingCorrection()
 	: lastAppliedCt_(0), lastAppliedQuantizedCt_(0)
 {