Skia
2DGraphicsLibrary
|
Public Types | |
enum | Named { kUnknown_Named, kSRGB_Named, kAdobeRGB_Named } |
Common, named profiles that we can recognize. | |
enum | GammaNamed { kLinear_GammaNamed, kSRGB_GammaNamed, k2Dot2Curve_GammaNamed, kNonStandard_GammaNamed, kInvalid_GammaNamed } |
Public Member Functions | |
sk_sp< SkColorSpace > | makeLinearGamma () |
Create an SkColorSpace with the same gamut as this color space, but with linear gamma. | |
GammaNamed | gammaNamed () const |
const SkMatrix44 & | xyz () const |
Returns the matrix used to transform src gamut to XYZ D50. | |
bool | gammaCloseToSRGB () const |
Returns true if the color space gamma is near enough to be approximated as sRGB. | |
bool | gammasAreMatching () const |
To be used only by UMA code. | |
bool | gammasAreNamed () const |
bool | gammasAreValues () const |
bool | gammasAreTables () const |
bool | gammasAreParams () const |
sk_sp< SkData > | serialize () const |
Returns nullptr on failure. More... | |
size_t | writeToMemory (void *memory) const |
If |memory| is nullptr, returns the size required to serialize. More... | |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
Default construct, initializing the reference count to 1. | |
virtual | ~SkRefCntBase () |
Destruct, asserting that the reference count is 1. | |
int32_t | getRefCnt () const |
Return the reference count. More... | |
void | validate () const |
bool | unique () const |
May return true if the caller is the only owner. More... | |
void | ref () const |
Increment the reference count. More... | |
void | unref () const |
Decrement the reference count. More... | |
Static Public Member Functions | |
static sk_sp< SkColorSpace > | NewRGB (GammaNamed gammaNamed, const SkMatrix44 &toXYZD50) |
Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ. | |
static sk_sp< SkColorSpace > | NewNamed (Named) |
Create a common, named SkColorSpace. | |
static sk_sp< SkColorSpace > | NewICC (const void *, size_t) |
Create an SkColorSpace from an ICC profile. | |
static sk_sp< SkColorSpace > | Deserialize (const void *data, size_t length) |
static bool | Equals (const SkColorSpace *src, const SkColorSpace *dst) |
If both are null, we return true. More... | |
Protected Member Functions | |
SkColorSpace (GammaNamed gammaNamed, const SkMatrix44 &toXYZD50, Named named) | |
Protected Member Functions inherited from SkRefCntBase | |
void | internal_dispose_restore_refcnt_to_1 () const |
Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More... | |
Protected Attributes | |
const GammaNamed | fGammaNamed |
const SkMatrix44 | fToXYZD50 |
const Named | fNamed |
|
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.
Returns nullptr on failure.
Fails when we fallback to serializing ICC data and the data is too large to serialize.
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.