summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations.h
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 04:40:23 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 04:40:23 +0000
commitd7dd9842e776eb4d512355d3b4eb1b2918cc2ea1 (patch)
tree34cce0405b64335470d5a7d7c077d06916d2f3a3 /skia/ext/image_operations.h
parentf8fc5885250b5cbe1026b13b23452d278b8c058e (diff)
downloadchromium_src-d7dd9842e776eb4d512355d3b4eb1b2918cc2ea1.zip
chromium_src-d7dd9842e776eb4d512355d3b4eb1b2918cc2ea1.tar.gz
chromium_src-d7dd9842e776eb4d512355d3b4eb1b2918cc2ea1.tar.bz2
Redo of http://codereview.chromium.org/100097 to make work on Linux and Mac.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.h')
-rw-r--r--skia/ext/image_operations.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/skia/ext/image_operations.h b/skia/ext/image_operations.h
index 5188dba..5c46b36 100644
--- a/skia/ext/image_operations.h
+++ b/skia/ext/image_operations.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/gfx/rect.h"
+#include "SkColor.h"
class SkBitmap;
@@ -46,13 +47,47 @@ class ImageOperations {
ResizeMethod method,
int dest_width, int dest_height);
-
// Create a bitmap that is a blend of two others. The alpha argument
// specifies the opacity of the second bitmap. The provided bitmaps must
// use have the kARGB_8888_Config config and be of equal dimensions.
static SkBitmap CreateBlendedBitmap(const SkBitmap& first,
const SkBitmap& second,
double alpha);
+
+ // Create a bitmap that is the original bitmap masked out by the mask defined
+ // in the alpha bitmap. The images must use the kARGB_8888_Config config and
+ // be of equal dimensions.
+ static SkBitmap CreateMaskedBitmap(const SkBitmap& first,
+ const SkBitmap& alpha);
+
+ // Blur a bitmap using an average-blur algorithm over the rectangle defined
+ // by |blur_amount|. The blur will wrap around image edges.
+ static SkBitmap CreateBlurredBitmap(const SkBitmap& bitmap, int blur_amount);
+
+ // Shift a bitmap'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 SkBitmap CreateHSLShiftedBitmap(const SkBitmap& bitmap,
+ float hsl_shift[3]);
+
+ // Create a bitmap that is cropped from another bitmap. This is special
+ // because it tiles the original bitmap, so your coordinates can extend
+ // outside the bounds of the original image.
+ static SkBitmap CreateTiledBitmap(const SkBitmap& bitmap,
+ int src_x, int src_y,
+ int dst_w, int dst_h);
private:
ImageOperations(); // Class for scoping only.
};