| 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" |
| 11 #include "ui/gfx/icc_profile.h" | 11 #include "ui/gfx/icc_profile.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 | 14 |
| 15 ColorSpace::ColorSpace() | 15 ColorSpace::ColorSpace() { |
| 16 : primaries_(PrimaryID::UNSPECIFIED), | 16 memset(custom_primary_matrix_, 0, sizeof(custom_primary_matrix_)); |
| 17 transfer_(TransferID::UNSPECIFIED), | 17 } |
| 18 matrix_(MatrixID::UNSPECIFIED), | |
| 19 range_(RangeID::LIMITED) {} | |
| 20 | 18 |
| 21 ColorSpace::ColorSpace(PrimaryID primaries, | 19 ColorSpace::ColorSpace(PrimaryID primaries, |
| 22 TransferID transfer, | 20 TransferID transfer, |
| 23 MatrixID matrix, | 21 MatrixID matrix, |
| 24 RangeID range) | 22 RangeID range) |
| 25 : primaries_(primaries), | 23 : primaries_(primaries), |
| 26 transfer_(transfer), | 24 transfer_(transfer), |
| 27 matrix_(matrix), | 25 matrix_(matrix), |
| 28 range_(range) { | 26 range_(range) { |
| 27 memset(custom_primary_matrix_, 0, sizeof(custom_primary_matrix_)); |
| 29 // TODO: Set profile_id_ | 28 // TODO: Set profile_id_ |
| 30 } | 29 } |
| 31 | 30 |
| 32 // static | 31 // static |
| 33 ColorSpace ColorSpace::CreateSRGB() { | 32 ColorSpace ColorSpace::CreateSRGB() { |
| 34 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::RGB, | 33 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::RGB, |
| 35 RangeID::FULL); | 34 RangeID::FULL); |
| 36 } | 35 } |
| 37 | 36 |
| 38 // Static | 37 // Static |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 if (range_ > other.range_) | 85 if (range_ > other.range_) |
| 87 return true; | 86 return true; |
| 88 | 87 |
| 89 // TODO(hubbe): For "CUSTOM" primaries or tranfer functions, compare their | 88 // TODO(hubbe): For "CUSTOM" primaries or tranfer functions, compare their |
| 90 // coefficients here | 89 // coefficients here |
| 91 | 90 |
| 92 return false; | 91 return false; |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace gfx | 94 } // namespace gfx |
| OLD | NEW |