Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
SkColorSpace.cpp File Reference
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/private/base/SkTemplates.h"
#include "modules/skcms/skcms.h"
#include "src/core/SkChecksum.h"
#include "src/core/SkColorSpacePriv.h"
#include <cmath>
#include <cstring>

Go to the source code of this file.

Classes

class  SkColorSpaceSingletonFactory
 
struct  ColorSpaceHeader
 

Enumerations

enum  Version { k0_Version , k1_Version , kCurrent_Version = k1_Version }
 

Functions

static bool xyz_almost_equal (const skcms_Matrix3x3 &mA, const skcms_Matrix3x3 &mB)
 
SkColorSpacesk_srgb_singleton ()
 
SkColorSpacesk_srgb_linear_singleton ()
 

Enumeration Type Documentation

◆ Version

enum Version
Enumerator
k0_Version 
k1_Version 
kCurrent_Version 

Definition at line 230 of file SkColorSpace.cpp.

230 {
231 k0_Version, // Initial (deprecated) version, no longer supported
232 k1_Version, // Simple header (version tag) + 16 floats
233
235};
@ k0_Version
@ k1_Version
@ kCurrent_Version

Function Documentation

◆ sk_srgb_linear_singleton()

SkColorSpace * sk_srgb_linear_singleton ( )

Definition at line 81 of file SkColorSpace.cpp.

81 {
84 return cs;
85}
static SkColorSpace * Make(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &to_xyz)
static constexpr skcms_Matrix3x3 kSRGB
Definition: SkColorSpace.h:67
static constexpr skcms_TransferFunction kLinear
Definition: SkColorSpace.h:51

◆ sk_srgb_singleton()

SkColorSpace * sk_srgb_singleton ( )

Definition at line 75 of file SkColorSpace.cpp.

75 {
78 return cs;
79}
static constexpr skcms_TransferFunction kSRGB
Definition: SkColorSpace.h:45

◆ xyz_almost_equal()

static bool xyz_almost_equal ( const skcms_Matrix3x3 mA,
const skcms_Matrix3x3 mB 
)
static

Definition at line 30 of file SkColorSpace.cpp.

30 {
31 for (int r = 0; r < 3; ++r) {
32 for (int c = 0; c < 3; ++c) {
33 if (!color_space_almost_equal(mA.vals[r][c], mB.vals[r][c])) {
34 return false;
35 }
36 }
37 }
38
39 return true;
40}
static bool color_space_almost_equal(float a, float b)
float vals[3][3]
Definition: skcms_public.h:27