Chromium Code Reviews| Index: ui/gfx/color_analysis.h |
| diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h |
| index 09a5df6b8b32fe355347ea0418c8ad8fadbf2157..c42773d7bf3461859b9b1ed2a0c70a2621ab7516 100644 |
| --- a/ui/gfx/color_analysis.h |
| +++ b/ui/gfx/color_analysis.h |
| @@ -123,14 +123,22 @@ 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>; |
|
danakj
2017/06/20 23:22:03
It is not too onerous to write out the full type,
Qiang(Joe) Xu
2017/06/21 01:10:52
Done.
|
| + |
| +// Returns a vector of RGB colors that represents the bitmap based on the |
| +// |color_profiles| provided. 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); |