Index: ui/gfx/color_analysis.h |
diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h |
index dcbfabc9d7757d20ee6e0cf8f26c986fe5fd843f..55ba3a4502fe5084f8c675d47313d56326836e64 100644 |
--- a/ui/gfx/color_analysis.h |
+++ b/ui/gfx/color_analysis.h |
@@ -52,10 +52,11 @@ class GFX_EXPORT GridSampler : public KMeanImageSampler { |
GFX_EXPORT SkColor FindClosestColor(const uint8_t* image, int width, int height, |
SkColor color); |
-// Returns an SkColor that represents the calculated dominant color in the png. |
+// Returns an SkColor that represents the calculated dominant color in the |
+// image. |
Matt Giuca
2014/05/22 06:10:42
nit: Join the next line onto this one.
calamity
2014/05/22 07:46:53
Done.
|
// This uses a KMean clustering algorithm to find clusters of pixel colors in |
// RGB space. |
-// |png| represents the data of a png encoded image. |
+// |png/bitmap| represents the data of a png/bitmap encoded image. |
// |darkness_limit| represents the minimum sum of the RGB components that is |
// acceptable as a color choice. This can be from 0 to 765. |
// |brightness_limit| represents the maximum sum of the RGB components that is |
@@ -94,9 +95,15 @@ GFX_EXPORT SkColor CalculateKMeanColorOfPNG( |
uint32_t darkness_limit, |
uint32_t brightness_limit, |
KMeanImageSampler* sampler); |
- |
-// Computes a dominant color for an SkBitmap using the above algorithm and |
-// reasonable defaults for |darkness_limit|, |brightness_limit| and |sampler|. |
+GFX_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap, |
+ uint32_t darkness_limit, |
+ uint32_t brightness_limit, |
+ KMeanImageSampler* sampler); |
+ |
+// Computes a dominant color using the above algorithm and reasonable defaults |
+// for |darkness_limit|, |brightness_limit| and |sampler|. |
+GFX_EXPORT SkColor |
+ CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png); |
Matt Giuca
2014/05/22 06:10:42
All overloads of a function should appear together
calamity
2014/05/22 07:46:53
Done.
|
GFX_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap); |
// Compute color covariance matrix for the input bitmap. |