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 #include <ostream> | 9 #include <ostream> |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 ColorSpace(PrimaryID primaries, TransferID transfer); | 116 ColorSpace(PrimaryID primaries, TransferID transfer); |
117 ColorSpace(PrimaryID primaries, | 117 ColorSpace(PrimaryID primaries, |
118 TransferID transfer, | 118 TransferID transfer, |
119 MatrixID matrix, | 119 MatrixID matrix, |
120 RangeID full_range); | 120 RangeID full_range); |
121 ColorSpace(const ColorSpace& other); | 121 ColorSpace(const ColorSpace& other); |
122 ColorSpace(ColorSpace&& other); | 122 ColorSpace(ColorSpace&& other); |
123 ColorSpace& operator=(const ColorSpace& other); | 123 ColorSpace& operator=(const ColorSpace& other); |
124 ~ColorSpace(); | 124 ~ColorSpace(); |
125 | 125 |
126 // Create a color space with primary, transfer and matrix values from the | |
127 // H264 specification (Table E-3 Colour Primaries, E-4 Transfer | |
128 // Characteristics, and E-5 Matrix Coefficients in | |
129 // https://www.itu.int/rec/T-REC-H.264/en). | |
130 static ColorSpace CreateVideo(int h264_primary, | |
131 int h264_transfer, | |
132 int h264_matrix, | |
133 RangeID range_id); | |
134 | |
135 // Returns true if this is not the default-constructor object. | 126 // Returns true if this is not the default-constructor object. |
136 bool IsValid() const; | 127 bool IsValid() const; |
137 | 128 |
138 static ColorSpace CreateSRGB(); | 129 static ColorSpace CreateSRGB(); |
139 static ColorSpace CreateCustom(const SkMatrix44& to_XYZD50, | 130 static ColorSpace CreateCustom(const SkMatrix44& to_XYZD50, |
140 const SkColorSpaceTransferFn& fn); | 131 const SkColorSpaceTransferFn& fn); |
141 static ColorSpace CreateXYZD50(); | 132 static ColorSpace CreateXYZD50(); |
142 | 133 |
143 // Extended sRGB matches sRGB for values in [0, 1], and extends the transfer | 134 // Extended sRGB matches sRGB for values in [0, 1], and extends the transfer |
144 // function to all real values. | 135 // function to all real values. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 205 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
215 }; | 206 }; |
216 | 207 |
217 // Stream operator so ColorSpace can be used in assertion statements. | 208 // Stream operator so ColorSpace can be used in assertion statements. |
218 GFX_EXPORT std::ostream& operator<<(std::ostream& out, | 209 GFX_EXPORT std::ostream& operator<<(std::ostream& out, |
219 const ColorSpace& color_space); | 210 const ColorSpace& color_space); |
220 | 211 |
221 } // namespace gfx | 212 } // namespace gfx |
222 | 213 |
223 #endif // UI_GFX_COLOR_SPACE_H_ | 214 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |