diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 01:14:52 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 01:14:52 +0000 |
commit | cab34d6a13d3044c59cd5dccdf4b04725a395aac (patch) | |
tree | d9c05fd2e59a12cedf72f97d8cb4c420ff4793bb /skia/ext/image_operations.h | |
parent | 37cc1a1eaaa0c425a1ba889cf619f464227f9906 (diff) | |
download | chromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.zip chromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.tar.gz chromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.tar.bz2 |
Move functions from skia/ext to app/gfx where possible: most of skia_utils.* and image_operations.* can be moved because they are not used by WebKit code.
This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights.
This is a re-do of r26975, this time with WebKit update and some fixes to compile on Mac and Linux.
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.h')
-rw-r--r-- | skia/ext/image_operations.h | 73 |
1 files changed, 3 insertions, 70 deletions
diff --git a/skia/ext/image_operations.h b/skia/ext/image_operations.h index 3b172c8..e9f448b 100644 --- a/skia/ext/image_operations.h +++ b/skia/ext/image_operations.h @@ -1,16 +1,12 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SKIA_EXT_IMAGE_OPERATIONS_H_ #define SKIA_EXT_IMAGE_OPERATIONS_H_ -#include "base/basictypes.h" -#include "base/gfx/rect.h" -#include "skia/ext/skia_utils.h" -#include "third_party/skia/include/core/SkColor.h" - class SkBitmap; +struct SkIRect; namespace skia { @@ -40,7 +36,7 @@ class ImageOperations { static SkBitmap Resize(const SkBitmap& source, ResizeMethod method, int dest_width, int dest_height, - const gfx::Rect& dest_subset); + const SkIRect& dest_subset); // Alternate version for resizing and returning the entire bitmap rather than // a subset. @@ -48,69 +44,6 @@ 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); - - // We create a button background image by compositing the color and image - // together, then applying the mask. This is a highly specialized composite - // operation that is the equivalent of drawing a background in |color|, - // tiling |image| over the top, and then masking the result out with |mask|. - // The images must use kARGB_8888_Config config. - static SkBitmap CreateButtonBackground(SkColor color, - const SkBitmap& image, - const SkBitmap& mask); - - // 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, - HSL hsl_shift); - - // 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); - - // Makes a bitmap half has large in each direction by averaging groups of - // 4 pixels. This is one step in generating a mipmap. - static SkBitmap DownsampleByTwo(const SkBitmap& bitmap); - - // Iteratively downsamples by 2 until the bitmap is no smaller than the - // input size. The normal use of this is to downsample the bitmap "close" to - // the final size, and then use traditional resampling on the result. - // Because the bitmap will be closer to the final size, it will be faster, - // and linear interpolation will generally work well as a second step. - static SkBitmap DownsampleByTwoUntilSize(const SkBitmap& bitmap, - int min_w, int min_h); - private: ImageOperations(); // Class for scoping only. }; |