From patchwork Tue Aug 23 17:43:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17188 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5FC27C327D for ; Tue, 23 Aug 2022 17:43:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BF31561FC8; Tue, 23 Aug 2022 19:43:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661276605; bh=Oh0AzzCP/2ZLxH8JAjx6bwvDB0Ud+PZUBvRC08ZUfg8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VXY6j/JaSnp9XqU7w+gLcdjaj33VYRi8mJt4Ph9U26fqFZ185voFciTOpqKhldZ51 M+I6bySUaZl5dvbLp0E7M9SU7N9KtVvf2qN1DA149iKltIyKFPKjlgCyl6cRgA0PDR YGu3eTItWoieM8KAtk7tIOtaectif0le2tOaQug7mZ2TDsIWXLpFY2YLD555pW6qsH 8DTdIQ3wiaLHyHI71tDDd0U/h7MkOIPxHXYbWdIPapV+sSn9BUR2MVJoBhl1g47Jm0 kV0s6qJt/nU1I1HZrwSUcC8VNL2ctd2aLCrthYSg3qLxzDqc7LsfBeO7O6fsaa+iMP CgcHeEYBjvwfQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 12D4B61FA1 for ; Tue, 23 Aug 2022 19:43:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gqyx01s8"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 931EB2B3 for ; Tue, 23 Aug 2022 19:43:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1661276602; bh=Oh0AzzCP/2ZLxH8JAjx6bwvDB0Ud+PZUBvRC08ZUfg8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gqyx01s8VqDUpiFGtFmXdfWDpEFyaoADs22whBILV3euswbFVTrBf+x6YzkkSyk3/ 0gfRm4AxQ0wFKiH9zY45MHxIo4qDNlNCdYTKspN9E0HB+KbdJfY0NQ6iqMlP0vcv7q O1P7ti7dZ0i3DAZluL1LCfbyPMBTyR6j3tn6YvHw= To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Aug 2022 20:43:10 +0300 Message-Id: <20220823174314.14881-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220823174314.14881-1-laurent.pinchart@ideasonboard.com> References: <20220823174314.14881-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/6] libcamera: color_space: Reorder members in the same order as the header X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- 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) 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