[libcamera-devel,2/6] libcamera: color_space: Reorder members in the same order as the header
diff mbox series

Message ID 20220823174314.14881-3-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Add support for color spaces to rkisp1 pipeline handler
Related show

Commit Message

Laurent Pinchart Aug. 23, 2022, 5:43 p.m. UTC
Sort the members of the ColorSpace class in color_space.cpp to match the
color_space.h order. No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/color_space.cpp | 168 +++++++++++++++++-----------------
 1 file changed, 84 insertions(+), 84 deletions(-)

Comments

Umang Jain Aug. 23, 2022, 11:21 p.m. UTC | #1
hi Laurent,
Thank you for the patch

On 8/23/22 11:13 PM, Laurent Pinchart via libcamera-devel wrote:
> Sort the members of the ColorSpace class in color_space.cpp to match the
> color_space.h order. No functional change intended.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/libcamera/color_space.cpp | 168 +++++++++++++++++-----------------
>   1 file changed, 84 insertions(+), 84 deletions(-)
>
> diff --git a/src/libcamera/color_space.cpp b/src/libcamera/color_space.cpp
> index f0d6109ac4fb..1b2dd2404452 100644
> --- a/src/libcamera/color_space.cpp
> +++ b/src/libcamera/color_space.cpp
> @@ -124,6 +124,90 @@ namespace libcamera {
>    * \param[in] r The range of the pixel values in this color space
>    */
>   
> +/**
> + * \brief A constant representing a raw color space (from a sensor)
> + */
> +const ColorSpace ColorSpace::Raw = {
> +	Primaries::Raw,
> +	TransferFunction::Linear,
> +	YcbcrEncoding::None,
> +	Range::Full
> +};
> +
> +/**
> + * \brief A constant representing the sRGB color space
> + *
> + * This is identical to the sYCC color space except that the Y'CbCr
> + * range is limited rather than full.
> + */
> +const ColorSpace ColorSpace::Srgb = {
> +	Primaries::Rec709,
> +	TransferFunction::Srgb,
> +	YcbcrEncoding::Rec601,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the sYCC color space, typically used for
> + * encoding JPEG images
> + */
> +const ColorSpace ColorSpace::Sycc = {
> +	Primaries::Rec709,
> +	TransferFunction::Srgb,
> +	YcbcrEncoding::Rec601,
> +	Range::Full
> +};
> +
> +/**
> + * \brief A constant representing the SMPTE170M color space
> + */
> +const ColorSpace ColorSpace::Smpte170m = {
> +	Primaries::Smpte170m,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec601,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the Rec.709 color space
> + */
> +const ColorSpace ColorSpace::Rec709 = {
> +	Primaries::Rec709,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec709,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the Rec.2020 color space
> + */
> +const ColorSpace ColorSpace::Rec2020 = {
> +	Primaries::Rec2020,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec2020,
> +	Range::Limited
> +};
> +
> +/**
> + * \var ColorSpace::primaries
> + * \brief The color primaries of this color space
> + */
> +
> +/**
> + * \var ColorSpace::transferFunction
> + * \brief The transfer function used by this color space
> + */
> +
> +/**
> + * \var ColorSpace::ycbcrEncoding
> + * \brief The Y'CbCr encoding used by this color space
> + */
> +
> +/**
> + * \var ColorSpace::range
> + * \brief The pixel range used with by color space
> + */
> +
>   /**
>    * \brief Assemble and return a readable string representation of the
>    * ColorSpace
> @@ -219,90 +303,6 @@ std::string ColorSpace::toString(const std::optional<ColorSpace> &colorSpace)
>   	return colorSpace->toString();
>   }
>   
> -/**
> - * \var ColorSpace::primaries
> - * \brief The color primaries of this color space
> - */
> -
> -/**
> - * \var ColorSpace::transferFunction
> - * \brief The transfer function used by this color space
> - */
> -
> -/**
> - * \var ColorSpace::ycbcrEncoding
> - * \brief The Y'CbCr encoding used by this color space
> - */
> -
> -/**
> - * \var ColorSpace::range
> - * \brief The pixel range used with by color space
> - */
> -
> -/**
> - * \brief A constant representing a raw color space (from a sensor)
> - */
> -const ColorSpace ColorSpace::Raw = {
> -	Primaries::Raw,
> -	TransferFunction::Linear,
> -	YcbcrEncoding::None,
> -	Range::Full
> -};
> -
> -/**
> - * \brief A constant representing the sRGB color space
> - *
> - * This is identical to the sYCC color space except that the Y'CbCr
> - * range is limited rather than full.
> - */
> -const ColorSpace ColorSpace::Srgb = {
> -	Primaries::Rec709,
> -	TransferFunction::Srgb,
> -	YcbcrEncoding::Rec601,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the sYCC color space, typically used for
> - * encoding JPEG images
> - */
> -const ColorSpace ColorSpace::Sycc = {
> -	Primaries::Rec709,
> -	TransferFunction::Srgb,
> -	YcbcrEncoding::Rec601,
> -	Range::Full
> -};
> -
> -/**
> - * \brief A constant representing the SMPTE170M color space
> - */
> -const ColorSpace ColorSpace::Smpte170m = {
> -	Primaries::Smpte170m,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec601,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the Rec.709 color space
> - */
> -const ColorSpace ColorSpace::Rec709 = {
> -	Primaries::Rec709,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec709,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the Rec.2020 color space
> - */
> -const ColorSpace ColorSpace::Rec2020 = {
> -	Primaries::Rec2020,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec2020,
> -	Range::Limited
> -};
> -
>   /**
>    * \brief Compare color spaces for equality
>    * \return True if the two color spaces are identical, false otherwise
Nicolas Dufresne via libcamera-devel Aug. 25, 2022, 6:55 p.m. UTC | #2
On Tue, Aug 23, 2022 at 08:43:10PM +0300, Laurent Pinchart via libcamera-devel wrote:
> Sort the members of the ColorSpace class in color_space.cpp to match the
> color_space.h order. No functional change intended.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/libcamera/color_space.cpp | 168 +++++++++++++++++-----------------
>  1 file changed, 84 insertions(+), 84 deletions(-)
> 
> diff --git a/src/libcamera/color_space.cpp b/src/libcamera/color_space.cpp
> index f0d6109ac4fb..1b2dd2404452 100644
> --- a/src/libcamera/color_space.cpp
> +++ b/src/libcamera/color_space.cpp
> @@ -124,6 +124,90 @@ namespace libcamera {
>   * \param[in] r The range of the pixel values in this color space
>   */
>  
> +/**
> + * \brief A constant representing a raw color space (from a sensor)
> + */
> +const ColorSpace ColorSpace::Raw = {
> +	Primaries::Raw,
> +	TransferFunction::Linear,
> +	YcbcrEncoding::None,
> +	Range::Full
> +};
> +
> +/**
> + * \brief A constant representing the sRGB color space
> + *
> + * This is identical to the sYCC color space except that the Y'CbCr
> + * range is limited rather than full.
> + */
> +const ColorSpace ColorSpace::Srgb = {
> +	Primaries::Rec709,
> +	TransferFunction::Srgb,
> +	YcbcrEncoding::Rec601,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the sYCC color space, typically used for
> + * encoding JPEG images
> + */
> +const ColorSpace ColorSpace::Sycc = {
> +	Primaries::Rec709,
> +	TransferFunction::Srgb,
> +	YcbcrEncoding::Rec601,
> +	Range::Full
> +};
> +
> +/**
> + * \brief A constant representing the SMPTE170M color space
> + */
> +const ColorSpace ColorSpace::Smpte170m = {
> +	Primaries::Smpte170m,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec601,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the Rec.709 color space
> + */
> +const ColorSpace ColorSpace::Rec709 = {
> +	Primaries::Rec709,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec709,
> +	Range::Limited
> +};
> +
> +/**
> + * \brief A constant representing the Rec.2020 color space
> + */
> +const ColorSpace ColorSpace::Rec2020 = {
> +	Primaries::Rec2020,
> +	TransferFunction::Rec709,
> +	YcbcrEncoding::Rec2020,
> +	Range::Limited
> +};
> +
> +/**
> + * \var ColorSpace::primaries
> + * \brief The color primaries of this color space
> + */
> +
> +/**
> + * \var ColorSpace::transferFunction
> + * \brief The transfer function used by this color space
> + */
> +
> +/**
> + * \var ColorSpace::ycbcrEncoding
> + * \brief The Y'CbCr encoding used by this color space
> + */
> +
> +/**
> + * \var ColorSpace::range
> + * \brief The pixel range used with by color space
> + */
> +
>  /**
>   * \brief Assemble and return a readable string representation of the
>   * ColorSpace
> @@ -219,90 +303,6 @@ std::string ColorSpace::toString(const std::optional<ColorSpace> &colorSpace)
>  	return colorSpace->toString();
>  }
>  
> -/**
> - * \var ColorSpace::primaries
> - * \brief The color primaries of this color space
> - */
> -
> -/**
> - * \var ColorSpace::transferFunction
> - * \brief The transfer function used by this color space
> - */
> -
> -/**
> - * \var ColorSpace::ycbcrEncoding
> - * \brief The Y'CbCr encoding used by this color space
> - */
> -
> -/**
> - * \var ColorSpace::range
> - * \brief The pixel range used with by color space
> - */
> -
> -/**
> - * \brief A constant representing a raw color space (from a sensor)
> - */
> -const ColorSpace ColorSpace::Raw = {
> -	Primaries::Raw,
> -	TransferFunction::Linear,
> -	YcbcrEncoding::None,
> -	Range::Full
> -};
> -
> -/**
> - * \brief A constant representing the sRGB color space
> - *
> - * This is identical to the sYCC color space except that the Y'CbCr
> - * range is limited rather than full.
> - */
> -const ColorSpace ColorSpace::Srgb = {
> -	Primaries::Rec709,
> -	TransferFunction::Srgb,
> -	YcbcrEncoding::Rec601,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the sYCC color space, typically used for
> - * encoding JPEG images
> - */
> -const ColorSpace ColorSpace::Sycc = {
> -	Primaries::Rec709,
> -	TransferFunction::Srgb,
> -	YcbcrEncoding::Rec601,
> -	Range::Full
> -};
> -
> -/**
> - * \brief A constant representing the SMPTE170M color space
> - */
> -const ColorSpace ColorSpace::Smpte170m = {
> -	Primaries::Smpte170m,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec601,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the Rec.709 color space
> - */
> -const ColorSpace ColorSpace::Rec709 = {
> -	Primaries::Rec709,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec709,
> -	Range::Limited
> -};
> -
> -/**
> - * \brief A constant representing the Rec.2020 color space
> - */
> -const ColorSpace ColorSpace::Rec2020 = {
> -	Primaries::Rec2020,
> -	TransferFunction::Rec709,
> -	YcbcrEncoding::Rec2020,
> -	Range::Limited
> -};
> -
>  /**
>   * \brief Compare color spaces for equality
>   * \return True if the two color spaces are identical, false otherwise

Patch
diff mbox series

diff --git a/src/libcamera/color_space.cpp b/src/libcamera/color_space.cpp
index f0d6109ac4fb..1b2dd2404452 100644
--- a/src/libcamera/color_space.cpp
+++ b/src/libcamera/color_space.cpp
@@ -124,6 +124,90 @@  namespace libcamera {
  * \param[in] r The range of the pixel values in this color space
  */
 
+/**
+ * \brief A constant representing a raw color space (from a sensor)
+ */
+const ColorSpace ColorSpace::Raw = {
+	Primaries::Raw,
+	TransferFunction::Linear,
+	YcbcrEncoding::None,
+	Range::Full
+};
+
+/**
+ * \brief A constant representing the sRGB color space
+ *
+ * This is identical to the sYCC color space except that the Y'CbCr
+ * range is limited rather than full.
+ */
+const ColorSpace ColorSpace::Srgb = {
+	Primaries::Rec709,
+	TransferFunction::Srgb,
+	YcbcrEncoding::Rec601,
+	Range::Limited
+};
+
+/**
+ * \brief A constant representing the sYCC color space, typically used for
+ * encoding JPEG images
+ */
+const ColorSpace ColorSpace::Sycc = {
+	Primaries::Rec709,
+	TransferFunction::Srgb,
+	YcbcrEncoding::Rec601,
+	Range::Full
+};
+
+/**
+ * \brief A constant representing the SMPTE170M color space
+ */
+const ColorSpace ColorSpace::Smpte170m = {
+	Primaries::Smpte170m,
+	TransferFunction::Rec709,
+	YcbcrEncoding::Rec601,
+	Range::Limited
+};
+
+/**
+ * \brief A constant representing the Rec.709 color space
+ */
+const ColorSpace ColorSpace::Rec709 = {
+	Primaries::Rec709,
+	TransferFunction::Rec709,
+	YcbcrEncoding::Rec709,
+	Range::Limited
+};
+
+/**
+ * \brief A constant representing the Rec.2020 color space
+ */
+const ColorSpace ColorSpace::Rec2020 = {
+	Primaries::Rec2020,
+	TransferFunction::Rec709,
+	YcbcrEncoding::Rec2020,
+	Range::Limited
+};
+
+/**
+ * \var ColorSpace::primaries
+ * \brief The color primaries of this color space
+ */
+
+/**
+ * \var ColorSpace::transferFunction
+ * \brief The transfer function used by this color space
+ */
+
+/**
+ * \var ColorSpace::ycbcrEncoding
+ * \brief The Y'CbCr encoding used by this color space
+ */
+
+/**
+ * \var ColorSpace::range
+ * \brief The pixel range used with by color space
+ */
+
 /**
  * \brief Assemble and return a readable string representation of the
  * ColorSpace
@@ -219,90 +303,6 @@  std::string ColorSpace::toString(const std::optional<ColorSpace> &colorSpace)
 	return colorSpace->toString();
 }
 
-/**
- * \var ColorSpace::primaries
- * \brief The color primaries of this color space
- */
-
-/**
- * \var ColorSpace::transferFunction
- * \brief The transfer function used by this color space
- */
-
-/**
- * \var ColorSpace::ycbcrEncoding
- * \brief The Y'CbCr encoding used by this color space
- */
-
-/**
- * \var ColorSpace::range
- * \brief The pixel range used with by color space
- */
-
-/**
- * \brief A constant representing a raw color space (from a sensor)
- */
-const ColorSpace ColorSpace::Raw = {
-	Primaries::Raw,
-	TransferFunction::Linear,
-	YcbcrEncoding::None,
-	Range::Full
-};
-
-/**
- * \brief A constant representing the sRGB color space
- *
- * This is identical to the sYCC color space except that the Y'CbCr
- * range is limited rather than full.
- */
-const ColorSpace ColorSpace::Srgb = {
-	Primaries::Rec709,
-	TransferFunction::Srgb,
-	YcbcrEncoding::Rec601,
-	Range::Limited
-};
-
-/**
- * \brief A constant representing the sYCC color space, typically used for
- * encoding JPEG images
- */
-const ColorSpace ColorSpace::Sycc = {
-	Primaries::Rec709,
-	TransferFunction::Srgb,
-	YcbcrEncoding::Rec601,
-	Range::Full
-};
-
-/**
- * \brief A constant representing the SMPTE170M color space
- */
-const ColorSpace ColorSpace::Smpte170m = {
-	Primaries::Smpte170m,
-	TransferFunction::Rec709,
-	YcbcrEncoding::Rec601,
-	Range::Limited
-};
-
-/**
- * \brief A constant representing the Rec.709 color space
- */
-const ColorSpace ColorSpace::Rec709 = {
-	Primaries::Rec709,
-	TransferFunction::Rec709,
-	YcbcrEncoding::Rec709,
-	Range::Limited
-};
-
-/**
- * \brief A constant representing the Rec.2020 color space
- */
-const ColorSpace ColorSpace::Rec2020 = {
-	Primaries::Rec2020,
-	TransferFunction::Rec709,
-	YcbcrEncoding::Rec2020,
-	Range::Limited
-};
-
 /**
  * \brief Compare color spaces for equality
  * \return True if the two color spaces are identical, false otherwise