61 static std::string
toString(
const std::optional<ColorSpace> &colorSpace);
63 static std::optional<ColorSpace>
fromString(
const std::string &str);
Class to describe a color space.
Definition: color_space.h:16
Primaries
The color primaries for this color space.
Definition: color_space.h:18
static std::optional< ColorSpace > fromString(const std::string &str)
Construct a color space from a string.
Definition: color_space.cpp:334
Range range
The pixel range used with by color space.
Definition: color_space.h:58
TransferFunction
The transfer function used for this color space.
Definition: color_space.h:25
@ Linear
This color space uses a linear (identity) transfer function.
YcbcrEncoding ycbcrEncoding
The Y'CbCr encoding used by this color space.
Definition: color_space.h:57
static const ColorSpace Rec2020
A constant representing the Rec.2020 color space.
Definition: color_space.h:53
YcbcrEncoding
The Y'CbCr encoding.
Definition: color_space.h:31
@ None
There is no defined Y'CbCr encoding (used for non-YUV formats)
@ Rec601
Rec.601 Y'CbCr encoding.
static const ColorSpace Rec709
A constant representing the Rec.709 color space.
Definition: color_space.h:52
constexpr ColorSpace(Primaries p, TransferFunction t, YcbcrEncoding e, Range r)
Construct a ColorSpace from explicit values.
Definition: color_space.h:43
static const ColorSpace Smpte170m
A constant representing the SMPTE170M color space.
Definition: color_space.h:51
TransferFunction transferFunction
The transfer function used by this color space.
Definition: color_space.h:56
Primaries primaries
The color primaries of this color space.
Definition: color_space.h:55
static const ColorSpace Raw
A constant representing a raw color space (from a sensor)
Definition: color_space.h:48
Range
The range (sometimes "quantisation") for this color space.
Definition: color_space.h:38
@ Limited
This color space uses limited range pixel values, being 16 to 235 for Y' and 16 to 240 for Cb and Cr ...
@ Full
This color space uses full range pixel values.
static const ColorSpace Srgb
A constant representing the sRGB color space.
Definition: color_space.h:49
std::string toString() const
Assemble and return a readable string representation of the ColorSpace.
Definition: color_space.cpp:263
static const ColorSpace Sycc
A constant representing the sYCC color space, typically used for encoding JPEG images.
Definition: color_space.h:50
Top-level libcamera namespace.
Definition: backtrace.h:17
bool operator==(const ColorSpace &lhs, const ColorSpace &rhs)
Compare color spaces for equality.
Definition: color_space.cpp:403