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 #include "ui/gfx/color_space.h" | 5 #include "ui/gfx/color_space.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 ColorSpace ColorSpace::CreateREC709() { | 57 ColorSpace ColorSpace::CreateREC709() { |
58 return ColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709, | 58 return ColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709, |
59 RangeID::LIMITED); | 59 RangeID::LIMITED); |
60 } | 60 } |
61 | 61 |
62 bool ColorSpace::operator==(const ColorSpace& other) const { | 62 bool ColorSpace::operator==(const ColorSpace& other) const { |
63 return primaries_ == other.primaries_ && transfer_ == other.transfer_ && | 63 return primaries_ == other.primaries_ && transfer_ == other.transfer_ && |
64 matrix_ == other.matrix_ && range_ == other.range_; | 64 matrix_ == other.matrix_ && range_ == other.range_; |
65 } | 65 } |
66 | 66 |
| 67 bool ColorSpace::operator!=(const ColorSpace& other) const { |
| 68 return !(*this == other); |
| 69 } |
| 70 |
67 bool ColorSpace::operator<(const ColorSpace& other) const { | 71 bool ColorSpace::operator<(const ColorSpace& other) const { |
68 if (primaries_ < other.primaries_) | 72 if (primaries_ < other.primaries_) |
69 return true; | 73 return true; |
70 if (primaries_ > other.primaries_) | 74 if (primaries_ > other.primaries_) |
71 return false; | 75 return false; |
72 if (transfer_ < other.transfer_) | 76 if (transfer_ < other.transfer_) |
73 return true; | 77 return true; |
74 if (transfer_ > other.transfer_) | 78 if (transfer_ > other.transfer_) |
75 return false; | 79 return false; |
76 if (matrix_ < other.matrix_) | 80 if (matrix_ < other.matrix_) |
77 return true; | 81 return true; |
78 if (matrix_ > other.matrix_) | 82 if (matrix_ > other.matrix_) |
79 return false; | 83 return false; |
80 if (range_ < other.range_) | 84 if (range_ < other.range_) |
81 return true; | 85 return true; |
82 if (range_ > other.range_) | 86 if (range_ > other.range_) |
83 return true; | 87 return true; |
84 | 88 |
85 // TODO(hubbe): For "CUSTOM" primaries or tranfer functions, compare their | 89 // TODO(hubbe): For "CUSTOM" primaries or tranfer functions, compare their |
86 // coefficients here | 90 // coefficients here |
87 | 91 |
88 return false; | 92 return false; |
89 } | 93 } |
90 | 94 |
91 } // namespace gfx | 95 } // namespace gfx |
OLD | NEW |