Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: ui/gfx/color_space.h

Issue 2349923002: Add getters for gfx::ColorSpace components (Closed)
Patch Set: Added tests for getters Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698