OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_COLOR_SPACE_H_ | 5 #ifndef UI_GFX_COLOR_SPACE_H_ |
6 #define UI_GFX_COLOR_SPACE_H_ | 6 #define UI_GFX_COLOR_SPACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 bool operator==(const ColorSpace& other) const; | 137 bool operator==(const ColorSpace& other) const; |
138 bool operator!=(const ColorSpace& other) const; | 138 bool operator!=(const ColorSpace& other) const; |
139 bool operator<(const ColorSpace& other) const; | 139 bool operator<(const ColorSpace& other) const; |
140 | 140 |
141 bool IsHDR() const; | 141 bool IsHDR() const; |
142 | 142 |
143 // This will return nullptr for non-RGB spaces, spaces with non-FULL | 143 // This will return nullptr for non-RGB spaces, spaces with non-FULL |
144 // range, and unspecified spaces. | 144 // range, and unspecified spaces. |
145 sk_sp<SkColorSpace> ToSkColorSpace() const; | 145 sk_sp<SkColorSpace> ToSkColorSpace() const; |
146 | 146 |
| 147 // Populate |icc_profile| with an ICC profile that represents this color |
| 148 // space. Returns false if this space is not representable. This ICC profile |
| 149 // will be constructed ignoring the range adjust and transfer matrices (this |
| 150 // is to match the IOSurface interface which takes the ICC profile and range |
| 151 // and transfer matrices separately). |
| 152 bool GetICCProfile(ICCProfile* icc_profile) const; |
| 153 |
147 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; | 154 void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const; |
148 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; | 155 bool GetTransferFunction(SkColorSpaceTransferFn* fn) const; |
149 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; | 156 bool GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const; |
150 | 157 |
151 // For most formats, this is the RGB to YUV matrix. | 158 // For most formats, this is the RGB to YUV matrix. |
152 void GetTransferMatrix(SkMatrix44* matrix) const; | 159 void GetTransferMatrix(SkMatrix44* matrix) const; |
153 void GetRangeAdjustMatrix(SkMatrix44* matrix) const; | 160 void GetRangeAdjustMatrix(SkMatrix44* matrix) const; |
154 | 161 |
155 private: | 162 private: |
156 PrimaryID primaries_ = PrimaryID::INVALID; | 163 PrimaryID primaries_ = PrimaryID::INVALID; |
(...skipping 18 matching lines...) Expand all Loading... |
175 friend class ColorTransform; | 182 friend class ColorTransform; |
176 friend class ColorTransformInternal; | 183 friend class ColorTransformInternal; |
177 friend class ColorSpaceWin; | 184 friend class ColorSpaceWin; |
178 friend struct IPC::ParamTraits<gfx::ColorSpace>; | 185 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
179 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 186 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
180 }; | 187 }; |
181 | 188 |
182 } // namespace gfx | 189 } // namespace gfx |
183 | 190 |
184 #endif // UI_GFX_COLOR_SPACE_H_ | 191 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |