Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: ui/gfx/color_space.cc

Issue 2203663002: ColorTransform, transforms colors from one color space to another (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use floats Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_transform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_transform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698