Flutter Engine
The Flutter Engine
|
#include <SkColorSpace.h>
Public Member Functions | |
void | toProfile (skcms_ICCProfile *) const |
bool | gammaCloseToSRGB () const |
bool | gammaIsLinear () const |
bool | isNumericalTransferFn (skcms_TransferFunction *fn) const |
bool | toXYZD50 (skcms_Matrix3x3 *toXYZD50) const |
uint32_t | toXYZD50Hash () const |
sk_sp< SkColorSpace > | makeLinearGamma () const |
sk_sp< SkColorSpace > | makeSRGBGamma () const |
sk_sp< SkColorSpace > | makeColorSpin () const |
bool | isSRGB () const |
sk_sp< SkData > | serialize () const |
size_t | writeToMemory (void *memory) const |
void | transferFn (float gabcdef[7]) const |
void | transferFn (skcms_TransferFunction *fn) const |
void | invTransferFn (skcms_TransferFunction *fn) const |
void | gamutTransformTo (const SkColorSpace *dst, skcms_Matrix3x3 *src_to_dst) const |
uint32_t | transferFnHash () const |
uint64_t | hash () const |
Public Member Functions inherited from SkNVRefCnt< SkColorSpace > | |
SkNVRefCnt () | |
~SkNVRefCnt () | |
bool | unique () const |
void | ref () const |
void | unref () const |
void | deref () const |
bool | refCntGreaterThan (int32_t threadIsolatedTestCnt) const |
Static Public Member Functions | |
static sk_sp< SkColorSpace > | MakeSRGB () |
static sk_sp< SkColorSpace > | MakeSRGBLinear () |
static sk_sp< SkColorSpace > | MakeRGB (const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ) |
static sk_sp< SkColorSpace > | Make (const skcms_ICCProfile &) |
static sk_sp< SkColorSpace > | Deserialize (const void *data, size_t length) |
static bool | Equals (const SkColorSpace *, const SkColorSpace *) |
Friends | |
class | SkColorSpaceSingletonFactory |
Definition at line 107 of file SkColorSpace.h.
|
static |
Definition at line 266 of file SkColorSpace.cpp.
|
static |
If both are null, we return true. If one is null and the other is not, we return false. If both are non-null, we do a deeper compare.
Definition at line 291 of file SkColorSpace.cpp.
bool SkColorSpace::gammaCloseToSRGB | ( | ) | const |
Returns true if the color space gamma is near enough to be approximated as sRGB.
Definition at line 151 of file SkColorSpace.cpp.
bool SkColorSpace::gammaIsLinear | ( | ) | const |
Returns true if the color space gamma is linear.
Definition at line 156 of file SkColorSpace.cpp.
void SkColorSpace::gamutTransformTo | ( | const SkColorSpace * | dst, |
skcms_Matrix3x3 * | src_to_dst | ||
) | const |
Definition at line 142 of file SkColorSpace.cpp.
|
inline |
Definition at line 222 of file SkColorSpace.h.
void SkColorSpace::invTransferFn | ( | skcms_TransferFunction * | fn | ) | const |
Definition at line 132 of file SkColorSpace.cpp.
bool SkColorSpace::isNumericalTransferFn | ( | skcms_TransferFunction * | fn | ) | const |
Sets |fn| to the transfer function from this color space. Returns true if the transfer function can be represented as coefficients to the standard ICC 7-parameter equation. Returns false otherwise (eg, PQ, HLG).
Definition at line 116 of file SkColorSpace.cpp.
bool SkColorSpace::isSRGB | ( | ) | const |
Returns true if the color space is sRGB. Returns false otherwise.
This allows a little bit of tolerance, given that we might see small numerical error in some cases: converting ICC fixed point to float, converting white point to D50, rounding decisions on transfer function and matrix.
This does not consider a 2.2f exponential transfer function to be sRGB. While these functions are similar (and it is sometimes useful to consider them together), this function checks for logical equality.
Definition at line 147 of file SkColorSpace.cpp.
|
static |
Create an SkColorSpace from a parsed (skcms) ICC profile.
Definition at line 193 of file SkColorSpace.cpp.
sk_sp< SkColorSpace > SkColorSpace::makeColorSpin | ( | ) | const |
Returns a color space with the same transfer function as this one, but with the primary colors rotated. In other words, this produces a new color space that maps RGB to GBR (when applied to a source), and maps RGB to BRG (when applied to a destination).
This is used for testing, to construct color spaces that have severe and testable behavior.
Definition at line 175 of file SkColorSpace.cpp.
sk_sp< SkColorSpace > SkColorSpace::makeLinearGamma | ( | ) | const |
Returns a color space with the same gamut as this one, but with a linear gamma.
Definition at line 161 of file SkColorSpace.cpp.
|
static |
Create an SkColorSpace from a transfer function and a row-major 3x3 transformation to XYZ.
Definition at line 42 of file SkColorSpace.cpp.
|
static |
Create the sRGB color space.
Definition at line 87 of file SkColorSpace.cpp.
sk_sp< SkColorSpace > SkColorSpace::makeSRGBGamma | ( | ) | const |
Returns a color space with the same gamut as this one, but with the sRGB transfer function.
Definition at line 168 of file SkColorSpace.cpp.
|
static |
Colorspace with the sRGB primaries, but a linear (1.0) gamma.
Definition at line 91 of file SkColorSpace.cpp.
Returns a serialized representation of this color space.
Definition at line 260 of file SkColorSpace.cpp.
void SkColorSpace::toProfile | ( | skcms_ICCProfile * | profile | ) | const |
Convert this color space to an skcms ICC profile struct.
Definition at line 187 of file SkColorSpace.cpp.
bool SkColorSpace::toXYZD50 | ( | skcms_Matrix3x3 * | toXYZD50 | ) | const |
Returns true and sets |toXYZD50|.
Definition at line 137 of file SkColorSpace.cpp.
|
inline |
Returns a hash of the gamut transformation to XYZ D50. Allows for fast equality checking of gamuts, at the (very small) risk of collision.
Definition at line 161 of file SkColorSpace.h.
void SkColorSpace::transferFn | ( | float | gabcdef[7] | ) | const |
Definition at line 124 of file SkColorSpace.cpp.
void SkColorSpace::transferFn | ( | skcms_TransferFunction * | fn | ) | const |
Definition at line 128 of file SkColorSpace.cpp.
|
inline |
Definition at line 221 of file SkColorSpace.h.
size_t SkColorSpace::writeToMemory | ( | void * | memory | ) | const |
If |memory| is nullptr, returns the size required to serialize. Otherwise, serializes into |memory| and returns the size.
Definition at line 246 of file SkColorSpace.cpp.
|
friend |
Definition at line 225 of file SkColorSpace.h.