Flutter Engine
The Flutter Engine
Functions | Variables
SkColorSpacePriv.h File Reference
#include "include/core/SkColorSpace.h"
#include "include/private/base/SkTemplates.h"
#include "modules/skcms/skcms.h"

Go to the source code of this file.

Functions

static bool color_space_almost_equal (float a, float b)
 
static bool transfer_fn_almost_equal (float a, float b)
 
static bool is_almost_srgb (const skcms_TransferFunction &coeffs)
 
static bool is_almost_2dot2 (const skcms_TransferFunction &coeffs)
 
static bool is_almost_linear (const skcms_TransferFunction &coeffs)
 
SkColorSpacesk_srgb_singleton ()
 
SkColorSpacesk_srgb_linear_singleton ()
 

Variables

static constexpr skcms_Matrix3x3 gNarrow_toXYZD50
 

Function Documentation

◆ color_space_almost_equal()

static bool color_space_almost_equal ( float  a,
float  b 
)
inlinestatic

Definition at line 21 of file SkColorSpacePriv.h.

21 {
22 return SkTAbs(a - b) < 0.01f;
23}
static T SkTAbs(T value)
Definition: SkTemplates.h:43
static bool b
struct MyStruct a[10]

◆ is_almost_2dot2()

static bool is_almost_2dot2 ( const skcms_TransferFunction coeffs)
inlinestatic

Definition at line 41 of file SkColorSpacePriv.h.

41 {
42 return transfer_fn_almost_equal(1.0f, coeffs.a) &&
46 coeffs.d <= 0.0f;
47}
static bool transfer_fn_almost_equal(float a, float b)

◆ is_almost_linear()

static bool is_almost_linear ( const skcms_TransferFunction coeffs)
inlinestatic

Definition at line 49 of file SkColorSpacePriv.h.

49 {
50 // OutputVal = InputVal ^ 1.0f
51 const bool linearExp =
56 coeffs.d <= 0.0f;
57
58 // OutputVal = 1.0f * InputVal
59 const bool linearFn =
62 coeffs.d >= 1.0f;
63
64 return linearExp || linearFn;
65}

◆ is_almost_srgb()

static bool is_almost_srgb ( const skcms_TransferFunction coeffs)
inlinestatic

◆ 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.

◆ transfer_fn_almost_equal()

static bool transfer_fn_almost_equal ( float  a,
float  b 
)
inlinestatic

Definition at line 27 of file SkColorSpacePriv.h.

27 {
28 return SkTAbs(a - b) < 0.001f;
29}

Variable Documentation

◆ gNarrow_toXYZD50

constexpr skcms_Matrix3x3 gNarrow_toXYZD50
staticconstexpr
Initial value:
= {{
{ 0.190974f, 0.404865f, 0.368380f },
{ 0.114746f, 0.582937f, 0.302318f },
{ 0.032925f, 0.153615f, 0.638669f },
}}

Definition at line 15 of file SkColorSpacePriv.h.