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

Unified Diff: ui/gfx/image/image_skia_operations.h

Issue 10783015: Add ability to store hidpi theme images in data pack (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/image/image_skia_operations.h
diff --git a/ui/gfx/image/image_skia_operations.h b/ui/gfx/image/image_skia_operations.h
index 1e6a52a66694c6a1735f65f4f9968db518222461..54ba27bdbe390d65d3b703346491704fb1e0b8e3 100644
--- a/ui/gfx/image/image_skia_operations.h
+++ b/ui/gfx/image/image_skia_operations.h
@@ -7,10 +7,12 @@
#include "base/gtest_prod_util.h"
#include "ui/base/ui_export.h"
+#include "ui/gfx/color_utils.h"
#include "ui/gfx/shadow_value.h"
namespace gfx {
class ImageSkia;
+class Rect;
class Size;
class UI_EXPORT ImageSkiaOperations {
@@ -35,6 +37,24 @@ class UI_EXPORT ImageSkiaOperations {
int src_x, int src_y,
int dst_w, int dst_h);
+ // Shift an image's HSL values. The shift values are in the range of 0-1,
+ // with the option to specify -1 for 'no change'. The shift values are
+ // defined as:
+ // hsl_shift[0] (hue): The absolute hue value for the image - 0 and 1 map
+ // to 0 and 360 on the hue color wheel (red).
+ // hsl_shift[1] (saturation): A saturation shift for the image, with the
+ // following key values:
+ // 0 = remove all color.
+ // 0.5 = leave unchanged.
+ // 1 = fully saturate the image.
+ // hsl_shift[2] (lightness): A lightness shift for the image, with the
+ // following key values:
+ // 0 = remove all lightness (make all pixels black).
+ // 0.5 = leave unchanged.
+ // 1 = full lightness (make all pixels white).
+ static ImageSkia CreateHSLShiftedImage(const gfx::ImageSkia& image,
+ const color_utils::HSL& hsl_shift);
+
// Creates an image by resizing |source| to given |target_dip_size|.
static ImageSkia CreateResizedImage(const ImageSkia& source,
const Size& target_dip_size);
@@ -47,6 +67,6 @@ class UI_EXPORT ImageSkiaOperations {
ImageSkiaOperations(); // Class for scoping only.
};
-}
+} // namespace gfx
#endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_

Powered by Google App Engine
This is Rietveld 408576698