[02/12] ipa: libipa: agc_mean_luminance: Fix enumerator names
diff mbox series

Message ID 20240616163910.5506-3-laurent.pinchart@ideasonboard.com
State Accepted
Commit 3faa04fe48b394e0c73056183293a5b77116e539
Headers show
Series
  • ipa: rkisp1: Miscellaneous AGC fixes
Related show

Commit Message

Laurent Pinchart June 16, 2024, 4:39 p.m. UTC
Enumerators in libcamera start with an upper case letter. Fix the
AgcConstraint::Bound enumerators.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/libipa/agc_mean_luminance.cpp | 10 +++++-----
 src/ipa/libipa/agc_mean_luminance.h   |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Kieran Bingham June 17, 2024, 8:58 a.m. UTC | #1
Quoting Laurent Pinchart (2024-06-16 17:39:00)
> Enumerators in libcamera start with an upper case letter. Fix the
> AgcConstraint::Bound enumerators.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/ipa/libipa/agc_mean_luminance.cpp | 10 +++++-----
>  src/ipa/libipa/agc_mean_luminance.h   |  4 ++--
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
> index 271b5ae4bc97..f97ef11771c4 100644
> --- a/src/ipa/libipa/agc_mean_luminance.cpp
> +++ b/src/ipa/libipa/agc_mean_luminance.cpp
> @@ -59,9 +59,9 @@ static constexpr double kDefaultRelativeLuminanceTarget = 0.16;
>  /**
>   * \enum AgcMeanLuminance::AgcConstraint::Bound
>   * \brief Specify whether the constraint defines a lower or upper bound
> - * \var AgcMeanLuminance::AgcConstraint::lower
> + * \var AgcMeanLuminance::AgcConstraint::Lower
>   * \brief The constraint defines a lower bound
> - * \var AgcMeanLuminance::AgcConstraint::upper
> + * \var AgcMeanLuminance::AgcConstraint::Upper
>   * \brief The constraint defines an upper bound
>   */
>  
> @@ -209,7 +209,7 @@ int AgcMeanLuminance::parseConstraintModes(const YamlObject &tuningData)
>          */
>         if (constraintModes_.empty()) {
>                 AgcConstraint constraint = {
> -                       AgcConstraint::Bound::lower,
> +                       AgcConstraint::Bound::Lower,
>                         0.98,
>                         1.0,
>                         0.5
> @@ -467,11 +467,11 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
>                 double newGain = constraint.yTarget * hist.bins() /
>                                  hist.interQuantileMean(constraint.qLo, constraint.qHi);
>  
> -               if (constraint.bound == AgcConstraint::Bound::lower &&
> +               if (constraint.bound == AgcConstraint::Bound::Lower &&
>                     newGain > gain)
>                         gain = newGain;
>  
> -               if (constraint.bound == AgcConstraint::Bound::upper &&
> +               if (constraint.bound == AgcConstraint::Bound::Upper &&
>                     newGain < gain)
>                         gain = newGain;
>         }
> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h
> index 0a81c6d285b8..d1bddda5d162 100644
> --- a/src/ipa/libipa/agc_mean_luminance.h
> +++ b/src/ipa/libipa/agc_mean_luminance.h
> @@ -31,8 +31,8 @@ public:
>  
>         struct AgcConstraint {
>                 enum class Bound {
> -                       lower = 0,
> -                       upper = 1
> +                       Lower = 0,
> +                       Upper = 1
>                 };
>                 Bound bound;
>                 double qLo;
> -- 
> Regards,
> 
> Laurent Pinchart
>
Paul Elder June 17, 2024, 10:10 a.m. UTC | #2
On Sun, Jun 16, 2024 at 07:39:00PM +0300, Laurent Pinchart wrote:
> Enumerators in libcamera start with an upper case letter. Fix the
> AgcConstraint::Bound enumerators.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/ipa/libipa/agc_mean_luminance.cpp | 10 +++++-----
>  src/ipa/libipa/agc_mean_luminance.h   |  4 ++--
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
> index 271b5ae4bc97..f97ef11771c4 100644
> --- a/src/ipa/libipa/agc_mean_luminance.cpp
> +++ b/src/ipa/libipa/agc_mean_luminance.cpp
> @@ -59,9 +59,9 @@ static constexpr double kDefaultRelativeLuminanceTarget = 0.16;
>  /**
>   * \enum AgcMeanLuminance::AgcConstraint::Bound
>   * \brief Specify whether the constraint defines a lower or upper bound
> - * \var AgcMeanLuminance::AgcConstraint::lower
> + * \var AgcMeanLuminance::AgcConstraint::Lower
>   * \brief The constraint defines a lower bound
> - * \var AgcMeanLuminance::AgcConstraint::upper
> + * \var AgcMeanLuminance::AgcConstraint::Upper
>   * \brief The constraint defines an upper bound
>   */
>  
> @@ -209,7 +209,7 @@ int AgcMeanLuminance::parseConstraintModes(const YamlObject &tuningData)
>  	 */
>  	if (constraintModes_.empty()) {
>  		AgcConstraint constraint = {
> -			AgcConstraint::Bound::lower,
> +			AgcConstraint::Bound::Lower,
>  			0.98,
>  			1.0,
>  			0.5
> @@ -467,11 +467,11 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
>  		double newGain = constraint.yTarget * hist.bins() /
>  				 hist.interQuantileMean(constraint.qLo, constraint.qHi);
>  
> -		if (constraint.bound == AgcConstraint::Bound::lower &&
> +		if (constraint.bound == AgcConstraint::Bound::Lower &&
>  		    newGain > gain)
>  			gain = newGain;
>  
> -		if (constraint.bound == AgcConstraint::Bound::upper &&
> +		if (constraint.bound == AgcConstraint::Bound::Upper &&
>  		    newGain < gain)
>  			gain = newGain;
>  	}
> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h
> index 0a81c6d285b8..d1bddda5d162 100644
> --- a/src/ipa/libipa/agc_mean_luminance.h
> +++ b/src/ipa/libipa/agc_mean_luminance.h
> @@ -31,8 +31,8 @@ public:
>  
>  	struct AgcConstraint {
>  		enum class Bound {
> -			lower = 0,
> -			upper = 1
> +			Lower = 0,
> +			Upper = 1
>  		};
>  		Bound bound;
>  		double qLo;
Daniel Scally June 17, 2024, 10:11 a.m. UTC | #3
Hi Laurent

On 16/06/2024 17:39, Laurent Pinchart wrote:
> Enumerators in libcamera start with an upper case letter. Fix the
> AgcConstraint::Bound enumerators.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

> ---
>   src/ipa/libipa/agc_mean_luminance.cpp | 10 +++++-----
>   src/ipa/libipa/agc_mean_luminance.h   |  4 ++--
>   2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
> index 271b5ae4bc97..f97ef11771c4 100644
> --- a/src/ipa/libipa/agc_mean_luminance.cpp
> +++ b/src/ipa/libipa/agc_mean_luminance.cpp
> @@ -59,9 +59,9 @@ static constexpr double kDefaultRelativeLuminanceTarget = 0.16;
>   /**
>    * \enum AgcMeanLuminance::AgcConstraint::Bound
>    * \brief Specify whether the constraint defines a lower or upper bound
> - * \var AgcMeanLuminance::AgcConstraint::lower
> + * \var AgcMeanLuminance::AgcConstraint::Lower
>    * \brief The constraint defines a lower bound
> - * \var AgcMeanLuminance::AgcConstraint::upper
> + * \var AgcMeanLuminance::AgcConstraint::Upper
>    * \brief The constraint defines an upper bound
>    */
>   
> @@ -209,7 +209,7 @@ int AgcMeanLuminance::parseConstraintModes(const YamlObject &tuningData)
>   	 */
>   	if (constraintModes_.empty()) {
>   		AgcConstraint constraint = {
> -			AgcConstraint::Bound::lower,
> +			AgcConstraint::Bound::Lower,
>   			0.98,
>   			1.0,
>   			0.5
> @@ -467,11 +467,11 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
>   		double newGain = constraint.yTarget * hist.bins() /
>   				 hist.interQuantileMean(constraint.qLo, constraint.qHi);
>   
> -		if (constraint.bound == AgcConstraint::Bound::lower &&
> +		if (constraint.bound == AgcConstraint::Bound::Lower &&
>   		    newGain > gain)
>   			gain = newGain;
>   
> -		if (constraint.bound == AgcConstraint::Bound::upper &&
> +		if (constraint.bound == AgcConstraint::Bound::Upper &&
>   		    newGain < gain)
>   			gain = newGain;
>   	}
> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h
> index 0a81c6d285b8..d1bddda5d162 100644
> --- a/src/ipa/libipa/agc_mean_luminance.h
> +++ b/src/ipa/libipa/agc_mean_luminance.h
> @@ -31,8 +31,8 @@ public:
>   
>   	struct AgcConstraint {
>   		enum class Bound {
> -			lower = 0,
> -			upper = 1
> +			Lower = 0,
> +			Upper = 1
>   		};
>   		Bound bound;
>   		double qLo;

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
index 271b5ae4bc97..f97ef11771c4 100644
--- a/src/ipa/libipa/agc_mean_luminance.cpp
+++ b/src/ipa/libipa/agc_mean_luminance.cpp
@@ -59,9 +59,9 @@  static constexpr double kDefaultRelativeLuminanceTarget = 0.16;
 /**
  * \enum AgcMeanLuminance::AgcConstraint::Bound
  * \brief Specify whether the constraint defines a lower or upper bound
- * \var AgcMeanLuminance::AgcConstraint::lower
+ * \var AgcMeanLuminance::AgcConstraint::Lower
  * \brief The constraint defines a lower bound
- * \var AgcMeanLuminance::AgcConstraint::upper
+ * \var AgcMeanLuminance::AgcConstraint::Upper
  * \brief The constraint defines an upper bound
  */
 
@@ -209,7 +209,7 @@  int AgcMeanLuminance::parseConstraintModes(const YamlObject &tuningData)
 	 */
 	if (constraintModes_.empty()) {
 		AgcConstraint constraint = {
-			AgcConstraint::Bound::lower,
+			AgcConstraint::Bound::Lower,
 			0.98,
 			1.0,
 			0.5
@@ -467,11 +467,11 @@  double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
 		double newGain = constraint.yTarget * hist.bins() /
 				 hist.interQuantileMean(constraint.qLo, constraint.qHi);
 
-		if (constraint.bound == AgcConstraint::Bound::lower &&
+		if (constraint.bound == AgcConstraint::Bound::Lower &&
 		    newGain > gain)
 			gain = newGain;
 
-		if (constraint.bound == AgcConstraint::Bound::upper &&
+		if (constraint.bound == AgcConstraint::Bound::Upper &&
 		    newGain < gain)
 			gain = newGain;
 	}
diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h
index 0a81c6d285b8..d1bddda5d162 100644
--- a/src/ipa/libipa/agc_mean_luminance.h
+++ b/src/ipa/libipa/agc_mean_luminance.h
@@ -31,8 +31,8 @@  public:
 
 	struct AgcConstraint {
 		enum class Bound {
-			lower = 0,
-			upper = 1
+			Lower = 0,
+			Upper = 1
 		};
 		Bound bound;
 		double qLo;