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

Unified Diff: ui/gfx/color_space.h

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 | « no previous file | ui/gfx/color_space.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_space.h
diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h
index 4e166e17f404f184f7dcb1ba38f1f98e32a67cd7..4c669a4f149d454424f676080daeb13b6d929c5d 100644
--- a/ui/gfx/color_space.h
+++ b/ui/gfx/color_space.h
@@ -25,7 +25,94 @@ class ICCProfile;
// between any processes.
class GFX_EXPORT ColorSpace {
public:
+ enum class PrimaryID : uint16_t {
+ // The first 0-255 values should match the H264 specification.
+ RESERVED0 = 0,
+ BT709 = 1,
+ UNSPECIFIED = 2,
+ RESERVED = 3,
+ BT470M = 4,
+ BT470BG = 5,
+ SMPTE170M = 6,
+ SMPTE240M = 7,
+ FILM = 8,
+ BT2020 = 9,
+ SMPTEST428_1 = 10,
+ SMPTEST431_2 = 11,
+ SMPTEST432_1 = 12,
+
+ // Chrome-specific values start at 1000.
+ XYZ_D50 = 1000,
+ // TODO(hubbe): We need to store the primaries.
+ CUSTOM = 1001,
+ LAST = CUSTOM
+ };
+
+ enum class TransferID : uint16_t {
+ // The first 0-255 values should match the H264 specification.
+ RESERVED0 = 0,
+ BT709 = 1,
+ UNSPECIFIED = 2,
+ RESERVED = 3,
+ GAMMA22 = 4,
+ GAMMA28 = 5,
+ SMPTE170M = 6,
+ SMPTE240M = 7,
+ LINEAR = 8,
+ LOG = 9,
+ LOG_SQRT = 10,
+ IEC61966_2_4 = 11,
+ BT1361_ECG = 12,
+ IEC61966_2_1 = 13,
+ BT2020_10 = 14,
+ BT2020_12 = 15,
+ SMPTEST2084 = 16,
+ SMPTEST428_1 = 17,
+
+ // Chrome-specific values start at 1000.
+ GAMMA24 = 1000,
+
+ // TODO(hubbe): Need to store an approximation of the gamma function(s).
+ CUSTOM = 1001,
+ LAST = CUSTOM,
+ };
+
+ enum class MatrixID : int16_t {
+ // The first 0-255 values should match the H264 specification.
+ RGB = 0,
+ BT709 = 1,
+ UNSPECIFIED = 2,
+ RESERVED = 3,
+ FCC = 4,
+ BT470BG = 5,
+ SMPTE170M = 6,
+ SMPTE240M = 7,
+ YCOCG = 8,
+ BT2020_NCL = 9,
+ BT2020_CL = 10,
+ YDZDX = 11,
+
+ // Chrome-specific values start at 1000
+ LAST = YDZDX,
+ };
+
+ // The h264 spec declares this as bool, so only the the first two values
+ // correspond to the h264 spec. Chrome-specific values can start at 2.
+ // We use an enum instead of a bool becuase different bit depths may have
+ // different definitions of what "limited" means.
+ enum class RangeID : int8_t {
+ FULL = 0,
+ LIMITED = 1,
+
+ LAST = LIMITED
+ };
+
ColorSpace();
+ ColorSpace(PrimaryID primaries,
+ TransferID transfer,
+ MatrixID matrix,
+ RangeID full_range);
+
static ColorSpace CreateSRGB();
// TODO: Remove these, and replace with more generic constructors.
@@ -36,7 +123,11 @@ class GFX_EXPORT ColorSpace {
bool operator==(const ColorSpace& other) const;
private:
- bool valid_ = false;
+ PrimaryID primaries_;
+ TransferID transfer_;
+ MatrixID matrix_;
+ RangeID range_;
+
// This is used to look up the ICCProfile from which this ColorSpace was
// created, if possible.
uint64_t icc_profile_id_ = 0;
« no previous file with comments | « no previous file | ui/gfx/color_space.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698