diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-27 21:12:42 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-27 21:12:42 +0000 |
commit | f3b1eb4ea262e48c93db8f0975e16341596cd8ec (patch) | |
tree | 52cae295117d4a63017a1d7d6de7acdf15cc45ec /src/core/SkBitmapScaler.h | |
parent | 3089004cc88e919526e43a8122a74db8f0a7790b (diff) |
Manual SVN revert of https://code.google.com/p/skia/source/detail?r=14905
git-svn-id: http://skia.googlecode.com/svn/trunk@14907 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmapScaler.h')
-rw-r--r-- | src/core/SkBitmapScaler.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/SkBitmapScaler.h b/src/core/SkBitmapScaler.h index d6636cf34e..c8d8a84185 100644 --- a/src/core/SkBitmapScaler.h +++ b/src/core/SkBitmapScaler.h @@ -79,10 +79,28 @@ public: RESIZE_LAST_ALGORITHM_METHOD = RESIZE_MITCHELL, }; + // Resizes the given source bitmap using the specified resize method, so that + // the entire image is (dest_size) big. The dest_subset is the rectangle in + // this destination image that should actually be returned. + // + // The output image will be (dest_subset.width(), dest_subset.height()). This + // will save work if you do not need the entire bitmap. + // + // The destination subset must be smaller than the destination image. static bool Resize(SkBitmap* result, const SkBitmap& source, ResizeMethod method, - float dest_width, float dest_height, + int dest_width, int dest_height, + const SkIRect& dest_subset, + const SkConvolutionProcs&, + SkBitmap::Allocator* allocator = NULL); + + // Alternate version for resizing and returning the entire bitmap rather than + // a subset. + static bool Resize(SkBitmap* result, + const SkBitmap& source, + ResizeMethod method, + int dest_width, int dest_height, const SkConvolutionProcs&, SkBitmap::Allocator* allocator = NULL); }; |