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

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

Issue 2169913003: Video: Plumb media::VideoFrame color space to cc and GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use static ctors 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 unified diff | Download patch
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 #ifndef UI_GFX_COLOR_SPACE_H_ 5 #ifndef UI_GFX_COLOR_SPACE_H_
6 #define UI_GFX_COLOR_SPACE_H_ 6 #define UI_GFX_COLOR_SPACE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "ui/gfx/gfx_export.h" 12 #include "ui/gfx/gfx_export.h"
13 13
14 namespace IPC { 14 namespace IPC {
15 template <class P> 15 template <class P>
16 struct ParamTraits; 16 struct ParamTraits;
17 } // namespace IPC 17 } // namespace IPC
18 18
19 namespace gfx { 19 namespace gfx {
20 20
21 class ICCProfile; 21 class ICCProfile;
22 22
23 enum class ColorTransferFunction { UNSUPPORTED, LAST = UNSUPPORTED }; 23 enum class ColorTransferFunction { UNSUPPORTED, LAST = UNSUPPORTED };
24 24
25 // Used to represet a color space for the purpose of color conversion. 25 // Used to represet a color space for the purpose of color conversion.
26 class GFX_EXPORT ColorSpace { 26 class GFX_EXPORT ColorSpace {
27 public: 27 public:
28 ColorSpace(); 28 ColorSpace();
29 static ColorSpace CreateSRGB();
30
31 // TODO: Remove these, and replace with more generic constructors.
ccameron 2016/07/21 22:07:03 This sort-of helps me with some of my hacking/plum
hubbe 2016/07/21 22:12:35 Sure.
32 static ColorSpace CreateJpeg();
33 static ColorSpace CreateREC601();
34 static ColorSpace CreateREC709();
35
29 bool operator==(const ColorSpace& other) const; 36 bool operator==(const ColorSpace& other) const;
30 37
31 private: 38 private:
32 bool valid_ = false; 39 bool valid_ = false;
33 ColorTransferFunction transfer_function_ = ColorTransferFunction::UNSUPPORTED; 40 ColorTransferFunction transfer_function_ = ColorTransferFunction::UNSUPPORTED;
34 // 3x4 affine transformation matrix in row-major order. 41 // 3x4 affine transformation matrix in row-major order.
35 float xyz_d50_matrix_[12]; 42 float xyz_d50_matrix_[12];
36 // This is used to look up the ICCProfile from which this ColorSpace was 43 // This is used to look up the ICCProfile from which this ColorSpace was
37 // created, if possible. 44 // created, if possible.
38 uint64_t icc_profile_id_ = 0; 45 uint64_t icc_profile_id_ = 0;
39 46
40 friend class ICCProfile; 47 friend class ICCProfile;
41 friend struct IPC::ParamTraits<gfx::ColorSpace>; 48 friend struct IPC::ParamTraits<gfx::ColorSpace>;
42 }; 49 };
43 50
44 } // namespace gfx 51 } // namespace gfx
45 52
46 #endif // UI_GFX_COLOR_SPACE_H_ 53 #endif // UI_GFX_COLOR_SPACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698