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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // TODO: Remove these, and replace with more generic constructors. | 126 // TODO: Remove these, and replace with more generic constructors. |
127 static ColorSpace CreateJpeg(); | 127 static ColorSpace CreateJpeg(); |
128 static ColorSpace CreateREC601(); | 128 static ColorSpace CreateREC601(); |
129 static ColorSpace CreateREC709(); | 129 static ColorSpace CreateREC709(); |
130 | 130 |
131 bool operator==(const ColorSpace& other) const; | 131 bool operator==(const ColorSpace& other) const; |
132 bool operator!=(const ColorSpace& other) const; | 132 bool operator!=(const ColorSpace& other) const; |
133 bool operator<(const ColorSpace& other) const; | 133 bool operator<(const ColorSpace& other) const; |
134 | 134 |
| 135 PrimaryID primaries() const { return primaries_; } |
| 136 TransferID transfer_function() const { return transfer_; } |
| 137 MatrixID matrix() const { return matrix_; } |
| 138 RangeID range() const { return range_; } |
| 139 |
135 private: | 140 private: |
136 PrimaryID primaries_ = PrimaryID::UNSPECIFIED; | 141 PrimaryID primaries_ = PrimaryID::UNSPECIFIED; |
137 TransferID transfer_ = TransferID::UNSPECIFIED; | 142 TransferID transfer_ = TransferID::UNSPECIFIED; |
138 MatrixID matrix_ = MatrixID::UNSPECIFIED; | 143 MatrixID matrix_ = MatrixID::UNSPECIFIED; |
139 RangeID range_ = RangeID::LIMITED; | 144 RangeID range_ = RangeID::LIMITED; |
140 | 145 |
141 // Only used if primaries_ == PrimaryID::CUSTOM | 146 // Only used if primaries_ == PrimaryID::CUSTOM |
142 float custom_primary_matrix_[12]; | 147 float custom_primary_matrix_[12]; |
143 | 148 |
144 // This is used to look up the ICCProfile from which this ColorSpace was | 149 // This is used to look up the ICCProfile from which this ColorSpace was |
145 // created, if possible. | 150 // created, if possible. |
146 uint64_t icc_profile_id_ = 0; | 151 uint64_t icc_profile_id_ = 0; |
147 | 152 |
148 friend class ICCProfile; | 153 friend class ICCProfile; |
149 friend class ColorSpaceToColorSpaceTransform; | 154 friend class ColorSpaceToColorSpaceTransform; |
150 friend struct IPC::ParamTraits<gfx::ColorSpace>; | 155 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
151 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 156 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
152 }; | 157 }; |
153 | 158 |
154 } // namespace gfx | 159 } // namespace gfx |
155 | 160 |
156 #endif // UI_GFX_COLOR_SPACE_H_ | 161 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |