OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkColorSpace_DEFINED | 8 #ifndef SkColorSpace_DEFINED |
9 #define SkColorSpace_DEFINED | 9 #define SkColorSpace_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 kSRGB_Named, | 46 kSRGB_Named, |
47 }; | 47 }; |
48 | 48 |
49 /** | 49 /** |
50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D
50_XYZ | 50 * Return a colorspace instance, given a 3x3 transform from linear_RGB to D
50_XYZ |
51 * and the src-gamma, return a ColorSpace | 51 * and the src-gamma, return a ColorSpace |
52 */ | 52 */ |
53 static SkColorSpace* NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3& gamm
a); | 53 static SkColorSpace* NewRGB(const SkFloat3x3& toXYZD50, const SkFloat3& gamm
a); |
54 | 54 |
55 static SkColorSpace* NewNamed(Named); | 55 static SkColorSpace* NewNamed(Named); |
56 static SkColorSpace* NewICC(const void*, size_t); | 56 static SkColorSpace* NewICCProfile(const void*, size_t); |
57 | 57 |
58 SkFloat3 gamma() const { return fGamma; } | 58 SkFloat3 gamma() const { return fGamma; } |
59 Named named() const { return fNamed; } | 59 Named named() const { return fNamed; } |
60 uint32_t uniqueID() const { return fUniqueID; } | 60 uint32_t uniqueID() const { return fUniqueID; } |
61 | 61 |
62 enum Result { | 62 enum Result { |
63 kFailure_Result, | 63 kFailure_Result, |
64 kIdentity_Result, | 64 kIdentity_Result, |
65 kNormal_Result, | 65 kNormal_Result, |
66 }; | 66 }; |
67 | 67 |
68 /** | 68 /** |
69 * Given a src and dst colorspace, return the 3x3 matrix that will convert
src_linear_RGB | 69 * Given a src and dst colorspace, return the 3x3 matrix that will convert
src_linear_RGB |
70 * values into dst_linear_RGB values. | 70 * values into dst_linear_RGB values. |
71 */ | 71 */ |
72 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo
at3x3* result); | 72 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo
at3x3* result); |
73 | 73 |
74 static void Test(); | 74 static void Test(); |
75 void dump() const; | 75 void dump() const; |
76 | 76 |
77 protected: | 77 protected: |
78 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); | 78 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); |
79 | 79 |
80 private: | 80 private: |
| 81 static SkColorSpace* NewICCProfile32(const uint32_t*, size_t); |
| 82 |
81 const SkFloat3x3 fToXYZD50; | 83 const SkFloat3x3 fToXYZD50; |
82 const SkFloat3 fGamma; | 84 const SkFloat3 fGamma; |
83 const uint32_t fUniqueID; | 85 const uint32_t fUniqueID; |
84 const Named fNamed; | 86 const Named fNamed; |
85 }; | 87 }; |
86 | 88 |
87 #endif | 89 #endif |
OLD | NEW |