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

Unified Diff: ui/gfx/color_analysis.h

Issue 2943333003: Extracting more than one wallpaper prominent color (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/color_analysis.h
diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h
index 09a5df6b8b32fe355347ea0418c8ad8fadbf2157..280632853271c847809ccb2b9a7282f2d639a380 100644
--- a/ui/gfx/color_analysis.h
+++ b/ui/gfx/color_analysis.h
@@ -123,14 +123,21 @@ enum class SaturationRange {
MUTED,
};
-// Returns a single RGB color that represents the bitmap. If a value is
-// succesfully calculated, the return value is fully opaque. For failure, the
-// return value is transparent. This currently calculates one color at a time.
-// We could save computation by calculating multiple colors at once, but there's
-// currently no need to calculate multiple colors.
-GFX_EXPORT SkColor CalculateProminentColorOfBitmap(const SkBitmap& bitmap,
- LumaRange luma,
- SaturationRange saturation);
+struct ColorProfile {
+ ColorProfile() = default;
+ ColorProfile(LumaRange l, SaturationRange s) : luma(l), saturation(s) {}
+
+ LumaRange luma = LumaRange::DARK;
+ SaturationRange saturation = SaturationRange::MUTED;
+};
+using ColorProfiles = std::vector<ColorProfile>;
+
+// Returns a vector of RGB colors that represents the bitmap. For each value, if
+// a value is succesfully calculated, the calculated value is fully opaque. For
+// failure, the calculated value is transparent.
+GFX_EXPORT std::vector<SkColor> CalculateProminentColorsOfBitmap(
+ const SkBitmap& bitmap,
+ const ColorProfiles& color_profiles);
// Compute color covariance matrix for the input bitmap.
GFX_EXPORT gfx::Matrix3F ComputeColorCovariance(const SkBitmap& bitmap);

Powered by Google App Engine
This is Rietveld 408576698