#include <SkColorSpace.h>
◆ deref()
◆ Deserialize()
static sk_sp<SkColorSpace> SkColorSpace::Deserialize |
( |
const void * |
data, |
|
|
size_t |
length |
|
) |
| |
|
static |
◆ Equals()
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.
◆ gammaCloseToSRGB()
bool SkColorSpace::gammaCloseToSRGB |
( |
| ) |
const |
Returns true if the color space gamma is near enough to be approximated as sRGB.
◆ gammaIsLinear()
bool SkColorSpace::gammaIsLinear |
( |
| ) |
const |
Returns true if the color space gamma is linear.
◆ gamutTransformTo()
void SkColorSpace::gamutTransformTo |
( |
const SkColorSpace * |
dst, |
|
|
skcms_Matrix3x3 * |
src_to_dst |
|
) |
| const |
◆ hash()
uint64_t SkColorSpace::hash |
( |
| ) |
const |
|
inline |
◆ invTransferFn()
void SkColorSpace::invTransferFn |
( |
skcms_TransferFunction * |
fn | ) |
const |
◆ isNumericalTransferFn()
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).
◆ isSRGB()
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.
◆ Make()
◆ makeColorSpin()
Returns a color space with the same transfer function as this one, but with the primary colors rotated.
For any XYZ space, 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). For other types of color spaces, returns nullptr.
This is used for testing, to construct color spaces that have severe and testable behavior.
◆ makeLinearGamma()
Returns a color space with the same gamut as this one, but with a linear gamma.
For color spaces whose gamut can not be described in terms of XYZ D50, returns linear sRGB.
◆ MakeRGB()
static sk_sp<SkColorSpace> SkColorSpace::MakeRGB |
( |
const skcms_TransferFunction & |
transferFn, |
|
|
const skcms_Matrix3x3 & |
toXYZ |
|
) |
| |
|
static |
Create an SkColorSpace from a transfer function and a row-major 3x3 transformation to XYZ.
◆ MakeSRGB()
Create the sRGB color space.
◆ makeSRGBGamma()
Returns a color space with the same gamut as this one, with with the sRGB transfer function.
For color spaces whose gamut can not be described in terms of XYZ D50, returns sRGB.
◆ MakeSRGBLinear()
Colorspace with the sRGB primaries, but a linear (1.0) gamma.
◆ ref()
◆ refCntGreaterThan()
◆ serialize()
Returns nullptr on failure.
Fails when we fallback to serializing ICC data and the data is too large to serialize.
◆ toProfile()
void SkColorSpace::toProfile |
( |
skcms_ICCProfile * |
| ) |
const |
Convert this color space to an skcms ICC profile struct.
◆ toXYZD50()
bool SkColorSpace::toXYZD50 |
( |
skcms_Matrix3x3 * |
toXYZD50 | ) |
const |
Returns true and sets |toXYZD50| if the color gamut can be described as a matrix.
Returns false otherwise.
◆ toXYZD50Hash()
uint32_t SkColorSpace::toXYZD50Hash |
( |
| ) |
const |
|
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.
◆ transferFn() [1/2]
void SkColorSpace::transferFn |
( |
float |
gabcdef[7] | ) |
const |
◆ transferFn() [2/2]
void SkColorSpace::transferFn |
( |
skcms_TransferFunction * |
fn | ) |
const |
◆ transferFnHash()
uint32_t SkColorSpace::transferFnHash |
( |
| ) |
const |
|
inline |
◆ unique()
◆ unref()
◆ writeToMemory()
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.
◆ SkColorSpaceSingletonFactory
friend class SkColorSpaceSingletonFactory |
|
friend |
The documentation for this class was generated from the following file: