Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkColorSpace Class Reference
Inheritance diagram for SkColorSpace:
SkRefCnt SkRefCntBase

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< SkColorSpacemakeLinearGamma ()
 Create an SkColorSpace with the same gamut as this color space, but with linear gamma.
 
GammaNamed gammaNamed () const
 
const SkMatrix44xyz () 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< SkDataserialize () 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< SkColorSpaceNewRGB (GammaNamed gammaNamed, const SkMatrix44 &toXYZD50)
 Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ.
 
static sk_sp< SkColorSpaceNewNamed (Named)
 Create a common, named SkColorSpace.
 
static sk_sp< SkColorSpaceNewICC (const void *, size_t)
 Create an SkColorSpace from an ICC profile.
 
static sk_sp< SkColorSpaceDeserialize (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
 

Member Enumeration Documentation

Enumerator
kSRGB_GammaNamed 

Gamma curve is a close match to the canonical sRGB curve, which has a short linear segment followed by a 2.4f exponential.

k2Dot2Curve_GammaNamed 

Gamma curve is a close match to the 2.2f exponential curve.

This is used by Adobe RGB profiles and is common on monitors as well.

kNonStandard_GammaNamed 

Gamma is represented by a look-up table, a parametric curve, or an uncommon exponential curve.

Or the R, G, and B gammas do not match.

kInvalid_GammaNamed 

To be used by UMA code only.

ICC profiles lacks valid gamma representation.

Member Function Documentation

static bool SkColorSpace::Equals ( const SkColorSpace src,
const SkColorSpace dst 
)
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.

sk_sp<SkData> SkColorSpace::serialize ( ) const

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.


The documentation for this class was generated from the following file: