OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_GFX_COLOR_PROFILE_H_ | |
6 #define UI_GFX_COLOR_PROFILE_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "build/build_config.h" | |
12 #include "ui/gfx/gfx_export.h" | |
13 | |
14 namespace gfx { | |
15 | |
16 class GFX_EXPORT ColorProfile { | |
17 public: | |
18 ColorProfile(const std::vector<char>& profile); | |
19 ColorProfile(); | |
20 ColorProfile(ColorProfile&& other); | |
21 ColorProfile(const ColorProfile& other); | |
22 ColorProfile& operator=(const ColorProfile& other); | |
23 ~ColorProfile(); | |
24 | |
25 const std::vector<char>& profile() const { return profile_; } | |
26 | |
27 #if defined(OS_WIN) | |
28 // This will read color profile information from disk and cache the results | |
29 // for the other functions to read. This should not be called on the UI or IO | |
30 // thread. | |
31 static void UpdateCachedProfilesOnBackgroundThread(); | |
32 static bool CachedProfilesNeedUpdate(); | |
33 #endif | |
34 | |
35 // Returns the color profile of the monitor that can best represent color. | |
36 // This profile should be used for creating content that does not know on | |
37 // which monitor it will be displayed. | |
38 static ColorProfile GetFromBestMonitor(); | |
39 | |
40 static bool IsValidProfileLength(size_t length); | |
41 | |
42 private: | |
43 std::vector<char> profile_; | |
44 }; | |
45 | |
46 } // namespace gfx | |
47 | |
48 #endif // UI_GFX_COLOR_PROFILE_H_ | |
OLD | NEW |