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

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

Issue 2203213002: ICC profile color translations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@color_correction7
Patch Set: win compile fix 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/gfx.gyp ('k') | ui/gfx/icc_profile.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ICC_PROFILE_H_ 5 #ifndef UI_GFX_ICC_PROFILE_H_
6 #define UI_GFX_ICC_PROFILE_H_ 6 #define UI_GFX_ICC_PROFILE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/gtest_prod_util.h"
11 #include "ui/gfx/color_space.h" 12 #include "ui/gfx/color_space.h"
12 13
13 #if defined(OS_MACOSX) 14 #if defined(OS_MACOSX)
14 #include <CoreGraphics/CGColorSpace.h> 15 #include <CoreGraphics/CGColorSpace.h>
15 #endif 16 #endif
16 17
17 namespace gfx { 18 namespace gfx {
18 19
19 // Used to represent a full ICC profile, usually retrieved from a monitor. It 20 // Used to represent a full ICC profile, usually retrieved from a monitor. It
20 // can be lossily compressed into a ColorSpace object. This structure should 21 // can be lossily compressed into a ColorSpace object. This structure should
(...skipping 29 matching lines...) Expand all
50 const std::vector<char>& GetData() const; 51 const std::vector<char>& GetData() const;
51 52
52 #if defined(OS_WIN) 53 #if defined(OS_WIN)
53 // This will read monitor ICC profiles from disk and cache the results for the 54 // This will read monitor ICC profiles from disk and cache the results for the
54 // other functions to read. This should not be called on the UI or IO thread. 55 // other functions to read. This should not be called on the UI or IO thread.
55 static void UpdateCachedProfilesOnBackgroundThread(); 56 static void UpdateCachedProfilesOnBackgroundThread();
56 static bool CachedProfilesNeedUpdate(); 57 static bool CachedProfilesNeedUpdate();
57 #endif 58 #endif
58 59
59 private: 60 private:
60 static ICCProfile FromData(const std::vector<char>& icc_profile); 61 static ICCProfile FromData(const char* icc_profile, size_t size);
61 static bool IsValidProfileLength(size_t length); 62 static bool IsValidProfileLength(size_t length);
62 63
63 bool valid_ = false; 64 bool valid_ = false;
64 std::vector<char> data_; 65 std::vector<char> data_;
65 66
66 // This globally identifies this ICC profile. It is used to look up this ICC 67 // This globally identifies this ICC profile. It is used to look up this ICC
67 // profile from a ColorSpace object created from it. 68 // profile from a ColorSpace object created from it.
68 uint64_t id_ = 0; 69 uint64_t id_ = 0;
69 70
71 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, BT709toSRGBICC);
70 friend class ColorSpace; 72 friend class ColorSpace;
71 friend struct IPC::ParamTraits<gfx::ICCProfile>; 73 friend struct IPC::ParamTraits<gfx::ICCProfile>;
72 }; 74 };
73 75
74 } // namespace gfx 76 } // namespace gfx
75 77
76 #endif // UI_GFX_ICC_PROFILE_H_ 78 #endif // UI_GFX_ICC_PROFILE_H_
OLDNEW
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/icc_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698