Chromium Code Reviews| Index: ui/gfx/color_analysis.h |
| diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h |
| index 7ac91464e1890b06b8c2c955d7fbb29b28e7ecc3..74e7bcc74c164ea56c5206b2f40b670dd80398af 100644 |
| --- a/ui/gfx/color_analysis.h |
| +++ b/ui/gfx/color_analysis.h |
| @@ -108,6 +108,27 @@ GFX_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap, |
| // for |lower_bound|, |upper_bound| and |sampler|. |
| GFX_EXPORT SkColor CalculateKMeanColorOfBitmap(const SkBitmap& bitmap); |
| +// These enums specify general values to look for when calculating prominent |
| +// colors from an image. |
| +enum class LumaRange { |
|
sky
2017/02/17 21:42:20
Without any context and looking at these enum valu
Evan Stade
2017/02/17 23:23:19
CalculateProminentColorOfBitmap() translates these
sky
2017/02/18 00:01:34
If you only intend to call with one value, I recom
Evan Stade
2017/02/18 00:05:00
There is no default. Each consumer of the API (i.e
|
| + LIGHT, |
| + NORMAL, |
| + DARK, |
| +}; |
|
oshima
2017/02/14 02:18:08
nit: newline
Evan Stade
2017/02/17 23:23:19
Done.
|
| +enum class SaturationRange { |
| + VIBRANT, |
| + 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. |
|
Nico
2017/02/17 21:37:06
Maybe base::Optional<SkColor> or bool and SkColor
Evan Stade
2017/02/17 23:23:19
This function should only return fully opaque colo
|
| +// 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); |
| + |
| // Compute color covariance matrix for the input bitmap. |
| GFX_EXPORT gfx::Matrix3F ComputeColorCovariance(const SkBitmap& bitmap); |