| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "third_party/skia/include/core/SkColorSpace.h" | 13 #include "third_party/skia/include/core/SkColorSpace.h" |
| 14 #include "ui/gfx/gfx_export.h" | 14 #include "ui/gfx/gfx_export.h" |
| 15 | 15 |
| 16 namespace IPC { | 16 namespace IPC { |
| 17 template <class P> | 17 template <class P> |
| 18 struct ParamTraits; | 18 struct ParamTraits; |
| 19 } // namespace IPC | 19 } // namespace IPC |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 | 22 |
| 23 class ICCProfile; | 23 class ICCProfile; |
| 24 class ColorSpaceToColorSpaceTransform; | |
| 25 | 24 |
| 26 // Used to represet a color space for the purpose of color conversion. | 25 // Used to represet a color space for the purpose of color conversion. |
| 27 // This is designed to be safe and compact enough to send over IPC | 26 // This is designed to be safe and compact enough to send over IPC |
| 28 // between any processes. | 27 // between any processes. |
| 29 class GFX_EXPORT ColorSpace { | 28 class GFX_EXPORT ColorSpace { |
| 30 public: | 29 public: |
| 31 enum class PrimaryID : uint16_t { | 30 enum class PrimaryID : uint16_t { |
| 32 // The first 0-255 values should match the H264 specification (see Table E-3 | 31 // The first 0-255 values should match the H264 specification (see Table E-3 |
| 33 // Colour Primaries in https://www.itu.int/rec/T-REC-H.264/en). | 32 // Colour Primaries in https://www.itu.int/rec/T-REC-H.264/en). |
| 34 RESERVED0 = 0, | 33 RESERVED0 = 0, |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // through G entries of the SkColorSpaceTransferFn structure in alphabetical | 199 // through G entries of the SkColorSpaceTransferFn structure in alphabetical |
| 201 // order. | 200 // order. |
| 202 float custom_transfer_params_[7] = {0, 0, 0, 0, 0, 0, 0}; | 201 float custom_transfer_params_[7] = {0, 0, 0, 0, 0, 0, 0}; |
| 203 | 202 |
| 204 // This is used to look up the ICCProfile from which this ColorSpace was | 203 // This is used to look up the ICCProfile from which this ColorSpace was |
| 205 // created, if possible. | 204 // created, if possible. |
| 206 uint64_t icc_profile_id_ = 0; | 205 uint64_t icc_profile_id_ = 0; |
| 207 sk_sp<SkColorSpace> icc_profile_sk_color_space_; | 206 sk_sp<SkColorSpace> icc_profile_sk_color_space_; |
| 208 | 207 |
| 209 friend class ICCProfile; | 208 friend class ICCProfile; |
| 210 friend class ColorSpaceToColorSpaceTransform; | 209 friend class ColorTransform; |
| 210 friend class ColorTransformInternal; |
| 211 friend class ColorSpaceWin; | 211 friend class ColorSpaceWin; |
| 212 friend struct IPC::ParamTraits<gfx::ColorSpace>; | 212 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
| 213 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); | 213 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace gfx | 216 } // namespace gfx |
| 217 | 217 |
| 218 #endif // UI_GFX_COLOR_SPACE_H_ | 218 #endif // UI_GFX_COLOR_SPACE_H_ |
| OLD | NEW |