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

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

Issue 12220123: Adds a function computing image color covariance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the reviewer's remarks. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/color_analysis.cc » ('j') | ui/gfx/color_analysis.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ANALYSIS_H_ 5 #ifndef UI_GFX_COLOR_ANALYSIS_H_
6 #define UI_GFX_COLOR_ANALYSIS_H_ 6 #define UI_GFX_COLOR_ANALYSIS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/ref_counted_memory.h" 11 #include "base/memory/ref_counted_memory.h"
12 #include "third_party/skia/include/core/SkColor.h" 12 #include "third_party/skia/include/core/SkColor.h"
13 #include "ui/base/ui_export.h" 13 #include "ui/base/ui_export.h"
14 #include "ui/gfx/matrix3_f.h"
14 15
15 class SkBitmap; 16 class SkBitmap;
16 17
17 namespace color_utils { 18 namespace color_utils {
18 19
19 // This class exposes the sampling method to the caller, which allows 20 // This class exposes the sampling method to the caller, which allows
20 // stubbing out for things like unit tests. Might be useful to pass more 21 // stubbing out for things like unit tests. Might be useful to pass more
21 // arguments into the GetSample method in the future (such as which 22 // arguments into the GetSample method in the future (such as which
22 // cluster is being worked on, etc.). 23 // cluster is being worked on, etc.).
23 // 24 //
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 UI_EXPORT SkColor CalculateKMeanColorOfPNG( 92 UI_EXPORT SkColor CalculateKMeanColorOfPNG(
92 scoped_refptr<base::RefCountedMemory> png, 93 scoped_refptr<base::RefCountedMemory> png,
93 uint32_t darkness_limit, 94 uint32_t darkness_limit,
94 uint32_t brightness_limit, 95 uint32_t brightness_limit,
95 KMeanImageSampler* sampler); 96 KMeanImageSampler* sampler);
96 97
97 // Computes a dominant color for an SkBitmap using the above algorithm and 98 // Computes a dominant color for an SkBitmap using the above algorithm and
98 // reasonable defaults for |darkness_limit|, |brightness_limit| and |sampler|. 99 // reasonable defaults for |darkness_limit|, |brightness_limit| and |sampler|.
99 UI_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap); 100 UI_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap);
100 101
102 // Compute color covariance matrix for the input bitmap.
103 UI_EXPORT gfx::Matrix3F ComputeColorCovariance(const SkBitmap& bitmap);
104
101 } // namespace color_utils 105 } // namespace color_utils
102 106
103 #endif // UI_GFX_COLOR_ANALYSIS_H_ 107 #endif // UI_GFX_COLOR_ANALYSIS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/color_analysis.cc » ('j') | ui/gfx/color_analysis.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698