| 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/macros.h" | 10 #include "base/macros.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "ui/gfx/gfx_export.h" | 12 #include "ui/gfx/gfx_export.h" |
| 13 | 13 |
| 14 namespace IPC { | 14 namespace IPC { |
| 15 template <class P> | 15 template <class P> |
| 16 struct ParamTraits; | 16 struct ParamTraits; |
| 17 } // namespace IPC | 17 } // namespace IPC |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 | 20 |
| 21 class ICCProfile; | 21 class ICCProfile; |
| 22 class ColorSpaceToColorSpaceTransform; |
| 22 | 23 |
| 23 // Used to represet a color space for the purpose of color conversion. | 24 // Used to represet a color space for the purpose of color conversion. |
| 24 // This is designed to be safe and compact enough to send over IPC | 25 // This is designed to be safe and compact enough to send over IPC |
| 25 // between any processes. | 26 // between any processes. |
| 26 class GFX_EXPORT ColorSpace { | 27 class GFX_EXPORT ColorSpace { |
| 27 public: | 28 public: |
| 28 enum class PrimaryID : uint16_t { | 29 enum class PrimaryID : uint16_t { |
| 29 // The first 0-255 values should match the H264 specification. | 30 // The first 0-255 values should match the H264 specification. |
| 30 RESERVED0 = 0, | 31 RESERVED0 = 0, |
| 31 BT709 = 1, | 32 BT709 = 1, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 LAST = LIMITED | 108 LAST = LIMITED |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 ColorSpace(); | 111 ColorSpace(); |
| 111 ColorSpace(PrimaryID primaries, | 112 ColorSpace(PrimaryID primaries, |
| 112 TransferID transfer, | 113 TransferID transfer, |
| 113 MatrixID matrix, | 114 MatrixID matrix, |
| 114 RangeID full_range); | 115 RangeID full_range); |
| 115 | 116 |
| 116 static ColorSpace CreateSRGB(); | 117 static ColorSpace CreateSRGB(); |
| 118 static ColorSpace CreateXYZD50(); |
| 117 | 119 |
| 118 // TODO: Remove these, and replace with more generic constructors. | 120 // TODO: Remove these, and replace with more generic constructors. |
| 119 static ColorSpace CreateJpeg(); | 121 static ColorSpace CreateJpeg(); |
| 120 static ColorSpace CreateREC601(); | 122 static ColorSpace CreateREC601(); |
| 121 static ColorSpace CreateREC709(); | 123 static ColorSpace CreateREC709(); |
| 122 | 124 |
| 123 bool operator==(const ColorSpace& other) const; | 125 bool operator==(const ColorSpace& other) const; |
| 124 | 126 |
| 125 private: | 127 private: |
| 126 PrimaryID primaries_; | 128 PrimaryID primaries_; |
| 127 TransferID transfer_; | 129 TransferID transfer_; |
| 128 MatrixID matrix_; | 130 MatrixID matrix_; |
| 129 RangeID range_; | 131 RangeID range_; |
| 130 | 132 |
| 131 // This is used to look up the ICCProfile from which this ColorSpace was | 133 // This is used to look up the ICCProfile from which this ColorSpace was |
| 132 // created, if possible. | 134 // created, if possible. |
| 133 uint64_t icc_profile_id_ = 0; | 135 uint64_t icc_profile_id_ = 0; |
| 134 | 136 |
| 135 friend class ICCProfile; | 137 friend class ICCProfile; |
| 138 friend class ColorSpaceToColorSpaceTransform; |
| 136 friend struct IPC::ParamTraits<gfx::ColorSpace>; | 139 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 } // namespace gfx | 142 } // namespace gfx |
| 140 | 143 |
| 141 #endif // UI_GFX_COLOR_SPACE_H_ | 144 #endif // UI_GFX_COLOR_SPACE_H_ |
| OLD | NEW |