| 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 17 matching lines...) Expand all Loading... |
| 28 range_(range) { | 28 range_(range) { |
| 29 // TODO: Set profile_id_ | 29 // TODO: Set profile_id_ |
| 30 } | 30 } |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 ColorSpace ColorSpace::CreateSRGB() { | 33 ColorSpace ColorSpace::CreateSRGB() { |
| 34 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::RGB, | 34 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::RGB, |
| 35 RangeID::FULL); | 35 RangeID::FULL); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Static |
| 39 ColorSpace ColorSpace::CreateXYZD50() { |
| 40 return ColorSpace(PrimaryID::XYZ_D50, TransferID::LINEAR, MatrixID::RGB, |
| 41 RangeID::FULL); |
| 42 } |
| 43 |
| 38 // static | 44 // static |
| 39 ColorSpace ColorSpace::CreateJpeg() { | 45 ColorSpace ColorSpace::CreateJpeg() { |
| 40 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::BT709, | 46 return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::BT709, |
| 41 RangeID::FULL); | 47 RangeID::FULL); |
| 42 } | 48 } |
| 43 | 49 |
| 44 // static | 50 // static |
| 45 ColorSpace ColorSpace::CreateREC601() { | 51 ColorSpace ColorSpace::CreateREC601() { |
| 46 return ColorSpace(PrimaryID::SMPTE170M, TransferID::SMPTE170M, | 52 return ColorSpace(PrimaryID::SMPTE170M, TransferID::SMPTE170M, |
| 47 MatrixID::SMPTE170M, RangeID::LIMITED); | 53 MatrixID::SMPTE170M, RangeID::LIMITED); |
| 48 } | 54 } |
| 49 | 55 |
| 50 // static | 56 // static |
| 51 ColorSpace ColorSpace::CreateREC709() { | 57 ColorSpace ColorSpace::CreateREC709() { |
| 52 return ColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709, | 58 return ColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709, |
| 53 RangeID::LIMITED); | 59 RangeID::LIMITED); |
| 54 } | 60 } |
| 55 | 61 |
| 56 bool ColorSpace::operator==(const ColorSpace& other) const { | 62 bool ColorSpace::operator==(const ColorSpace& other) const { |
| 57 return primaries_ == other.primaries_ && transfer_ == other.transfer_ && | 63 return primaries_ == other.primaries_ && transfer_ == other.transfer_ && |
| 58 matrix_ == other.matrix_ && range_ == other.range_; | 64 matrix_ == other.matrix_ && range_ == other.range_; |
| 59 } | 65 } |
| 60 | 66 |
| 61 } // namespace gfx | 67 } // namespace gfx |
| OLD | NEW |