[libcamera-devel,v4,07/13] libcamera: controls: Add a set of initial controls

Message ID 20190701201504.28487-8-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera Controls
Related show

Commit Message

Laurent Pinchart July 1, 2019, 8:14 p.m. UTC
Add an initial set of controls to demonstrate how controls are defined.

Proper documentation for each control is missing.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/control_ids.h |  6 +++++
 src/libcamera/controls.cpp      | 42 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

Comments

Niklas Söderlund July 2, 2019, 12:17 a.m. UTC | #1
Hi Laurent,

On 2019-07-01 23:14:58 +0300, Laurent Pinchart wrote:
> Add an initial set of controls to demonstrate how controls are defined.
> 
> Proper documentation for each control is missing.

This could be improved moving forward, defining controls we know we need 
even with sparse documentation allows us to move forward.

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  include/libcamera/control_ids.h |  6 +++++
>  src/libcamera/controls.cpp      | 42 +++++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+)
> 
> diff --git a/include/libcamera/control_ids.h b/include/libcamera/control_ids.h
> index d0e700da9844..75b6a2d5cafe 100644
> --- a/include/libcamera/control_ids.h
> +++ b/include/libcamera/control_ids.h
> @@ -13,6 +13,12 @@
>  namespace libcamera {
>  
>  enum ControlId {
> +	AwbEnable,
> +	Brightness,
> +	Contrast,
> +	Saturation,
> +	ManualExposure,
> +	ManualGain,
>  };
>  
>  } /* namespace libcamera */
> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
> index 42a2f8990bf6..d9fbd46d81c9 100644
> --- a/src/libcamera/controls.cpp
> +++ b/src/libcamera/controls.cpp
> @@ -186,6 +186,48 @@ std::string ControlValue::toString() const
>   * \brief Numerical control ID
>   */
>  
> +/**
> + * \var AwbEnable
> + * ControlType: Bool
> + *
> + * Enables or disables the AWB. See also \a libcamera::ControlId::ManualGain
> + */
> +
> +/**
> + * \var Brightness
> + * ControlType: Integer
> + *
> + * Specify a fixed brightness parameter.
> + */
> +
> +/**
> + * \var Contrast
> + * ControlType: Integer
> + *
> + * Specify a fixed constrast parameter.
> + */
> +
> +/**
> + * \var Saturation
> + * ControlType: Integer
> + *
> + * Specify a fixed saturation parameter.
> + */
> +
> +/**
> + * \var ManualExposure
> + * ControlType: Integer
> + *
> + * Specify a fixed exposure time in milli-seconds
> + */
> +
> +/**
> + * \var ManualGain
> + * ControlType: Integer
> + *
> + * Specify a fixed gain parameter
> + */
> +
>  /**
>   * \struct ControlIdentifier
>   * \brief Describe a ControlId with control specific constant meta-data
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham July 2, 2019, 7:50 a.m. UTC | #2
Hi Laurent,

On 02/07/2019 01:17, Niklas Söderlund wrote:
> Hi Laurent,
> 
> On 2019-07-01 23:14:58 +0300, Laurent Pinchart wrote:
>> Add an initial set of controls to demonstrate how controls are defined.
>>
>> Proper documentation for each control is missing.
> 
> This could be improved moving forward, defining controls we know we need 
> even with sparse documentation allows us to move forward.

I agree here, I agree that we want lots of documentation for controls -
but I don't think now is the right time to write lots of verboseness on
things that we do not yet have nailed down. It's better to get these
enums in and actually develop.

We will have lots of controls to add, so once we get in the flow of how
they all come together adding the documentation will come more naturally.

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


> 
>>
>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> 
>> ---
>>  include/libcamera/control_ids.h |  6 +++++
>>  src/libcamera/controls.cpp      | 42 +++++++++++++++++++++++++++++++++
>>  2 files changed, 48 insertions(+)
>>
>> diff --git a/include/libcamera/control_ids.h b/include/libcamera/control_ids.h
>> index d0e700da9844..75b6a2d5cafe 100644
>> --- a/include/libcamera/control_ids.h
>> +++ b/include/libcamera/control_ids.h
>> @@ -13,6 +13,12 @@
>>  namespace libcamera {
>>  
>>  enum ControlId {
>> +	AwbEnable,
>> +	Brightness,
>> +	Contrast,
>> +	Saturation,
>> +	ManualExposure,
>> +	ManualGain,
>>  };
>>  
>>  } /* namespace libcamera */
>> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
>> index 42a2f8990bf6..d9fbd46d81c9 100644
>> --- a/src/libcamera/controls.cpp
>> +++ b/src/libcamera/controls.cpp
>> @@ -186,6 +186,48 @@ std::string ControlValue::toString() const
>>   * \brief Numerical control ID
>>   */
>>  
>> +/**
>> + * \var AwbEnable
>> + * ControlType: Bool
>> + *
>> + * Enables or disables the AWB. See also \a libcamera::ControlId::ManualGain
>> + */
>> +
>> +/**
>> + * \var Brightness
>> + * ControlType: Integer
>> + *
>> + * Specify a fixed brightness parameter.
>> + */
>> +
>> +/**
>> + * \var Contrast
>> + * ControlType: Integer
>> + *
>> + * Specify a fixed constrast parameter.
>> + */
>> +
>> +/**
>> + * \var Saturation
>> + * ControlType: Integer
>> + *
>> + * Specify a fixed saturation parameter.
>> + */
>> +
>> +/**
>> + * \var ManualExposure
>> + * ControlType: Integer
>> + *
>> + * Specify a fixed exposure time in milli-seconds
>> + */
>> +
>> +/**
>> + * \var ManualGain
>> + * ControlType: Integer
>> + *
>> + * Specify a fixed gain parameter
>> + */
>> +
>>  /**
>>   * \struct ControlIdentifier
>>   * \brief Describe a ControlId with control specific constant meta-data
>> -- 
>> Regards,
>>
>> Laurent Pinchart
>>
>> _______________________________________________
>> libcamera-devel mailing list
>> libcamera-devel@lists.libcamera.org
>> https://lists.libcamera.org/listinfo/libcamera-devel
>

Patch

diff --git a/include/libcamera/control_ids.h b/include/libcamera/control_ids.h
index d0e700da9844..75b6a2d5cafe 100644
--- a/include/libcamera/control_ids.h
+++ b/include/libcamera/control_ids.h
@@ -13,6 +13,12 @@ 
 namespace libcamera {
 
 enum ControlId {
+	AwbEnable,
+	Brightness,
+	Contrast,
+	Saturation,
+	ManualExposure,
+	ManualGain,
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index 42a2f8990bf6..d9fbd46d81c9 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -186,6 +186,48 @@  std::string ControlValue::toString() const
  * \brief Numerical control ID
  */
 
+/**
+ * \var AwbEnable
+ * ControlType: Bool
+ *
+ * Enables or disables the AWB. See also \a libcamera::ControlId::ManualGain
+ */
+
+/**
+ * \var Brightness
+ * ControlType: Integer
+ *
+ * Specify a fixed brightness parameter.
+ */
+
+/**
+ * \var Contrast
+ * ControlType: Integer
+ *
+ * Specify a fixed constrast parameter.
+ */
+
+/**
+ * \var Saturation
+ * ControlType: Integer
+ *
+ * Specify a fixed saturation parameter.
+ */
+
+/**
+ * \var ManualExposure
+ * ControlType: Integer
+ *
+ * Specify a fixed exposure time in milli-seconds
+ */
+
+/**
+ * \var ManualGain
+ * ControlType: Integer
+ *
+ * Specify a fixed gain parameter
+ */
+
 /**
  * \struct ControlIdentifier
  * \brief Describe a ControlId with control specific constant meta-data