libipa: agc_mean_luminance: Rename yaml key from exposure-time to exposureTime
diff mbox series

Message ID 20241204102119.335089-1-stefan.klug@ideasonboard.com
State Accepted
Commit 9fc86dc02ac227a5af14e19f7f6253df377fd2e8
Headers show
Series
  • libipa: agc_mean_luminance: Rename yaml key from exposure-time to exposureTime
Related show

Commit Message

Stefan Klug Dec. 4, 2024, 10:21 a.m. UTC
In d0478c41f432 ("libcamera: Rename "shutter speed" to "exposure time"")
the tuning file entry "shutter" was renamed to "exposure-time". As the
tuning files use camel cased key names, change "exposure-time" to
"exposureTime" for consitency. It doesn't break our users setups as
there are no tuning files using that entry in the wild (at least
officially).

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/libipa/agc_mean_luminance.cpp        | 8 ++++----
 utils/tuning/libtuning/modules/agc/rkisp1.py | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Dan Scally Dec. 4, 2024, 10:23 a.m. UTC | #1
Hi Stefan

On 04/12/2024 10:21, Stefan Klug wrote:
> In d0478c41f432 ("libcamera: Rename "shutter speed" to "exposure time"")
> the tuning file entry "shutter" was renamed to "exposure-time". As the
> tuning files use camel cased key names, change "exposure-time" to
> "exposureTime" for consitency. It doesn't break our users setups as
s/consitency/consistency
> there are no tuning files using that entry in the wild (at least
> officially).
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>   src/ipa/libipa/agc_mean_luminance.cpp        | 8 ++++----
>   utils/tuning/libtuning/modules/agc/rkisp1.py | 4 ++--
>   2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
> index cd17570861e9..02555a44d271 100644
> --- a/src/ipa/libipa/agc_mean_luminance.cpp
> +++ b/src/ipa/libipa/agc_mean_luminance.cpp
> @@ -248,7 +248,7 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
>   			}
>   
>   			std::vector<uint32_t> exposureTimes =
> -				modeValues["exposure-time"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
> +				modeValues["exposureTime"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
>   			std::vector<double> gains =
>   				modeValues["gain"].getList<double>().value_or(std::vector<double>{});
>   
> @@ -338,7 +338,7 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
>    * For the AeExposureMode control the data should contain a dictionary called
>    * AeExposureMode containing per-mode setting dictionaries with the key being a
>    * value from \ref controls::AeExposureModeNameValueMap. Each mode dict should
> - * contain an array of exposure times with the key "exposure-time" and an array
> + * contain an array of exposure times with the key "exposureTime" and an array
>    * of gain values with the key "gain", in this format:
>    *
>    * \code{.unparsed}
> @@ -346,10 +346,10 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
>    *   - Agc:
>    *       AeExposureMode:
>    *         ExposureNormal:
> - *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
> + *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
>    *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
>    *         ExposureShort:
> - *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
> + *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
>    *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
>    *
>    * \endcode
> diff --git a/utils/tuning/libtuning/modules/agc/rkisp1.py b/utils/tuning/libtuning/modules/agc/rkisp1.py
> index 1a4dbe7b416a..2dad3a09cecb 100644
> --- a/utils/tuning/libtuning/modules/agc/rkisp1.py
> +++ b/utils/tuning/libtuning/modules/agc/rkisp1.py
> @@ -47,9 +47,9 @@ class AGCRkISP1(AGC):
>           }
>   
>       def _generate_exposure_modes(self) -> dict:
> -        normal = {'exposure-time': [100, 10000, 30000, 60000, 120000],
> +        normal = {'exposureTime': [100, 10000, 30000, 60000, 120000],
>                     'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
> -        short = {'exposure-time': [100, 5000, 10000, 20000, 120000],
> +        short = {'exposureTime': [100, 5000, 10000, 20000, 120000],
>                    'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
>   
>           return {'ExposureNormal': normal, 'ExposureShort': short}
Kieran Bingham Dec. 4, 2024, 11:25 a.m. UTC | #2
Quoting Stefan Klug (2024-12-04 10:21:17)
> In d0478c41f432 ("libcamera: Rename "shutter speed" to "exposure time"")
> the tuning file entry "shutter" was renamed to "exposure-time". As the
> tuning files use camel cased key names, change "exposure-time" to
> "exposureTime" for consitency. It doesn't break our users setups as
> there are no tuning files using that entry in the wild (at least
> officially).
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

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

> 
> > ---
> >  src/ipa/libipa/agc_mean_luminance.cpp        | 8 ++++----
> >  utils/tuning/libtuning/modules/agc/rkisp1.py | 4 ++--
> >  2 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
> > index cd17570861e9..02555a44d271 100644
> > --- a/src/ipa/libipa/agc_mean_luminance.cpp
> > +++ b/src/ipa/libipa/agc_mean_luminance.cpp
> > @@ -248,7 +248,7 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
> >                         }
> >  
> >                         std::vector<uint32_t> exposureTimes =
> > -                               modeValues["exposure-time"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
> > +                               modeValues["exposureTime"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
> >                         std::vector<double> gains =
> >                                 modeValues["gain"].getList<double>().value_or(std::vector<double>{});
> >  
> > @@ -338,7 +338,7 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
> >   * For the AeExposureMode control the data should contain a dictionary called
> >   * AeExposureMode containing per-mode setting dictionaries with the key being a
> >   * value from \ref controls::AeExposureModeNameValueMap. Each mode dict should
> > - * contain an array of exposure times with the key "exposure-time" and an array
> > + * contain an array of exposure times with the key "exposureTime" and an array
> >   * of gain values with the key "gain", in this format:
> >   *
> >   * \code{.unparsed}
> > @@ -346,10 +346,10 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
> >   *   - Agc:
> >   *       AeExposureMode:
> >   *         ExposureNormal:
> > - *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
> > + *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
> >   *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
> >   *         ExposureShort:
> > - *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
> > + *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
> >   *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
> >   *
> >   * \endcode
> > diff --git a/utils/tuning/libtuning/modules/agc/rkisp1.py b/utils/tuning/libtuning/modules/agc/rkisp1.py
> > index 1a4dbe7b416a..2dad3a09cecb 100644
> > --- a/utils/tuning/libtuning/modules/agc/rkisp1.py
> > +++ b/utils/tuning/libtuning/modules/agc/rkisp1.py
> > @@ -47,9 +47,9 @@ class AGCRkISP1(AGC):
> >          }
> >  
> >      def _generate_exposure_modes(self) -> dict:
> > -        normal = {'exposure-time': [100, 10000, 30000, 60000, 120000],
> > +        normal = {'exposureTime': [100, 10000, 30000, 60000, 120000],
> >                    'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
> > -        short = {'exposure-time': [100, 5000, 10000, 20000, 120000],
> > +        short = {'exposureTime': [100, 5000, 10000, 20000, 120000],
> >                   'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
> >  
> >          return {'ExposureNormal': normal, 'ExposureShort': short}
> > -- 
> > 2.43.0
> >

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
index cd17570861e9..02555a44d271 100644
--- a/src/ipa/libipa/agc_mean_luminance.cpp
+++ b/src/ipa/libipa/agc_mean_luminance.cpp
@@ -248,7 +248,7 @@  int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
 			}
 
 			std::vector<uint32_t> exposureTimes =
-				modeValues["exposure-time"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
+				modeValues["exposureTime"].getList<uint32_t>().value_or(std::vector<uint32_t>{});
 			std::vector<double> gains =
 				modeValues["gain"].getList<double>().value_or(std::vector<double>{});
 
@@ -338,7 +338,7 @@  int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
  * For the AeExposureMode control the data should contain a dictionary called
  * AeExposureMode containing per-mode setting dictionaries with the key being a
  * value from \ref controls::AeExposureModeNameValueMap. Each mode dict should
- * contain an array of exposure times with the key "exposure-time" and an array
+ * contain an array of exposure times with the key "exposureTime" and an array
  * of gain values with the key "gain", in this format:
  *
  * \code{.unparsed}
@@ -346,10 +346,10 @@  int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
  *   - Agc:
  *       AeExposureMode:
  *         ExposureNormal:
- *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
+ *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
  *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
  *         ExposureShort:
- *           exposure-time: [ 100, 10000, 30000, 60000, 120000 ]
+ *           exposureTime: [ 100, 10000, 30000, 60000, 120000 ]
  *           gain: [ 2.0, 4.0, 6.0, 8.0, 10.0 ]
  *
  * \endcode
diff --git a/utils/tuning/libtuning/modules/agc/rkisp1.py b/utils/tuning/libtuning/modules/agc/rkisp1.py
index 1a4dbe7b416a..2dad3a09cecb 100644
--- a/utils/tuning/libtuning/modules/agc/rkisp1.py
+++ b/utils/tuning/libtuning/modules/agc/rkisp1.py
@@ -47,9 +47,9 @@  class AGCRkISP1(AGC):
         }
 
     def _generate_exposure_modes(self) -> dict:
-        normal = {'exposure-time': [100, 10000, 30000, 60000, 120000],
+        normal = {'exposureTime': [100, 10000, 30000, 60000, 120000],
                   'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
-        short = {'exposure-time': [100, 5000, 10000, 20000, 120000],
+        short = {'exposureTime': [100, 5000, 10000, 20000, 120000],
                  'gain': [2.0, 4.0, 6.0, 6.0, 6.0]}
 
         return {'ExposureNormal': normal, 'ExposureShort': short}