libcamera v0.0.0
Supporting cameras in Linux since 2019
|
Class to describe a color space. More...
Public Types | |
enum class | Primaries { Raw , Smpte170m , Rec709 , Rec2020 } |
The color primaries for this color space. More... | |
enum class | TransferFunction { Linear , Srgb , Rec709 } |
The transfer function used for this color space. More... | |
enum class | YcbcrEncoding { None , Rec601 , Rec709 , Rec2020 } |
The Y'CbCr encoding. More... | |
enum class | Range { Full , Limited } |
The range (sometimes "quantisation") for this color space. More... | |
Public Member Functions | |
constexpr | ColorSpace (Primaries p, TransferFunction t, YcbcrEncoding e, Range r) |
Construct a ColorSpace from explicit values. More... | |
std::string | toString () const |
Assemble and return a readable string representation of the ColorSpace. More... | |
Static Public Member Functions | |
static std::string | toString (const std::optional< ColorSpace > &colorSpace) |
Assemble and return a readable string representation of an optional ColorSpace. More... | |
Public Attributes | |
Primaries | primaries |
The color primaries of this color space. | |
TransferFunction | transferFunction |
The transfer function used by this color space. | |
YcbcrEncoding | ycbcrEncoding |
The Y'CbCr encoding used by this color space. | |
Range | range |
The pixel range used with by color space. | |
Static Public Attributes | |
static const ColorSpace | Raw |
A constant representing a raw color space (from a sensor) More... | |
static const ColorSpace | Jpeg |
A constant representing the JPEG color space used for encoding JPEG images. More... | |
static const ColorSpace | Srgb |
A constant representing the sRGB color space. More... | |
static const ColorSpace | Smpte170m |
A constant representing the SMPTE170M color space. More... | |
static const ColorSpace | Rec709 |
A constant representing the Rec.709 color space. More... | |
static const ColorSpace | Rec2020 |
A constant representing the Rec.2020 color space. More... | |
Class to describe a color space.
The ColorSpace class defines the color primaries, the transfer function, the Y'CbCr encoding associated with the color space, and the range (sometimes also referred to as the quantisation) of the color space.
Certain combinations of these fields form well-known standard color spaces such as "JPEG" or "REC709".
In the strictest sense a "color space" formally only refers to the color primaries and white point. Here, however, the ColorSpace class adopts the common broader usage that includes the transfer function, Y'CbCr encoding method and quantisation.
For more information on the specific color spaces described here, please see:
|
strong |
|
strong |
The range (sometimes "quantisation") for this color space.
|
strong |
|
strong |
|
inlineconstexpr |
Construct a ColorSpace from explicit values.
[in] | p | The color primaries |
[in] | t | The transfer function for the color space |
[in] | e | The Y'CbCr encoding |
[in] | r | The range of the pixel values in this color space |
std::string libcamera::ColorSpace::toString | ( | ) | const |
Assemble and return a readable string representation of the ColorSpace.
If the color space matches a standard ColorSpace (such as ColorSpace::Jpeg) then the short name of the color space ("JPEG") is returned. Otherwise the four constituent parts of the ColorSpace are assembled into a longer string.
|
static |
Assemble and return a readable string representation of an optional ColorSpace.
This is a convenience helper to easily obtain a string representation for a ColorSpace in parts of the libcamera API where it is stored in a std::optional<>. If the ColorSpace is set, this function returns colorSpace.toString(), otherwise it returns "Unset".
|
static |
A constant representing the JPEG color space used for encoding JPEG images.
|
static |
A constant representing a raw color space (from a sensor)
|
static |
A constant representing the Rec.2020 color space.
|
static |
A constant representing the Rec.709 color space.
|
static |
A constant representing the SMPTE170M color space.
|
static |
A constant representing the sRGB color space.
This is identical to the JPEG color space except that the Y'CbCr range is limited rather than full.