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

Unified Diff: ui/gfx/color_space.cc

Issue 2183953002: Add some actual data to gfx::ColorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix LAST Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/icc_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_space.cc
diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
index 5c1825ea74bb3a4a5469a311dad483c879e31879..a146686d875ae26109c6f6e56166904f2b52df89 100644
--- a/ui/gfx/color_space.cc
+++ b/ui/gfx/color_space.cc
@@ -12,45 +12,50 @@
namespace gfx {
-ColorSpace::ColorSpace() = default;
+ColorSpace::ColorSpace()
+ : primaries_(PrimaryID::UNSPECIFIED),
+ transfer_(TransferID::UNSPECIFIED),
+ matrix_(MatrixID::UNSPECIFIED),
+ range_(RangeID::LIMITED) {}
+
+ColorSpace::ColorSpace(PrimaryID primaries,
+ TransferID transfer,
+ MatrixID matrix,
+ RangeID range)
+ : primaries_(primaries),
+ transfer_(transfer),
+ matrix_(matrix),
+ range_(range) {
+ // TODO: Set profile_id_
+}
// static
ColorSpace ColorSpace::CreateSRGB() {
- ColorSpace color_space;
- color_space.valid_ = true;
- color_space.icc_profile_id_ = ICCProfile::kSRGBId;
- return color_space;
+ return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::RGB,
+ RangeID::FULL);
}
// static
ColorSpace ColorSpace::CreateJpeg() {
- ColorSpace color_space;
- color_space.valid_ = true;
- color_space.icc_profile_id_ = ICCProfile::kJpegId;
- return color_space;
+ return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1, MatrixID::BT709,
+ RangeID::FULL);
}
// static
ColorSpace ColorSpace::CreateREC601() {
- ColorSpace color_space;
- color_space.valid_ = true;
- color_space.icc_profile_id_ = ICCProfile::kRec601Id;
- return color_space;
+ return ColorSpace(PrimaryID::SMPTE170M, TransferID::SMPTE170M,
+ MatrixID::SMPTE170M, RangeID::LIMITED);
}
// static
ColorSpace ColorSpace::CreateREC709() {
- ColorSpace color_space;
- color_space.valid_ = true;
- color_space.icc_profile_id_ = ICCProfile::kRec709Id;
- return color_space;
+ return ColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709,
+ RangeID::LIMITED);
}
bool ColorSpace::operator==(const ColorSpace& other) const {
- // TODO(ccameron): The |icc_profile_id_| should eventually not factor in
- // to equality comparison at all, because it's just an optimization, but
- // for now there is no other data in this structure.
- return valid_ == other.valid_ && icc_profile_id_ == other.icc_profile_id_;
+ return primaries_ == other.primaries_ && transfer_ == other.transfer_ &&
+ matrix_ == other.matrix_ && range_ == other.range_;
}
} // namespace gfx
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/icc_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698