OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkBitmapScaler_DEFINED | 8 #ifndef SkBitmapScaler_DEFINED |
9 #define SkBitmapScaler_DEFINED | 9 #define SkBitmapScaler_DEFINED |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 RESIZE_HAMMING, | 72 RESIZE_HAMMING, |
73 RESIZE_MITCHELL, | 73 RESIZE_MITCHELL, |
74 | 74 |
75 // enum aliases for first and last methods by algorithm or by quality. | 75 // enum aliases for first and last methods by algorithm or by quality. |
76 RESIZE_FIRST_QUALITY_METHOD = RESIZE_GOOD, | 76 RESIZE_FIRST_QUALITY_METHOD = RESIZE_GOOD, |
77 RESIZE_LAST_QUALITY_METHOD = RESIZE_BEST, | 77 RESIZE_LAST_QUALITY_METHOD = RESIZE_BEST, |
78 RESIZE_FIRST_ALGORITHM_METHOD = RESIZE_BOX, | 78 RESIZE_FIRST_ALGORITHM_METHOD = RESIZE_BOX, |
79 RESIZE_LAST_ALGORITHM_METHOD = RESIZE_MITCHELL, | 79 RESIZE_LAST_ALGORITHM_METHOD = RESIZE_MITCHELL, |
80 }; | 80 }; |
81 | 81 |
82 // Resizes the given source bitmap using the specified resize method, so tha
t | |
83 // the entire image is (dest_size) big. The dest_subset is the rectangle in | |
84 // this destination image that should actually be returned. | |
85 // | |
86 // The output image will be (dest_subset.width(), dest_subset.height()). Thi
s | |
87 // will save work if you do not need the entire bitmap. | |
88 // | |
89 // The destination subset must be smaller than the destination image. | |
90 static bool Resize(SkBitmap* result, | 82 static bool Resize(SkBitmap* result, |
91 const SkBitmap& source, | 83 const SkBitmap& source, |
92 ResizeMethod method, | 84 ResizeMethod method, |
93 int dest_width, int dest_height, | 85 float dest_width, float dest_height, |
94 const SkIRect& dest_subset, | |
95 const SkConvolutionProcs&, | |
96 SkBitmap::Allocator* allocator = NULL); | |
97 | |
98 // Alternate version for resizing and returning the entire bitmap rather tha
n | |
99 // a subset. | |
100 static bool Resize(SkBitmap* result, | |
101 const SkBitmap& source, | |
102 ResizeMethod method, | |
103 int dest_width, int dest_height, | |
104 const SkConvolutionProcs&, | 86 const SkConvolutionProcs&, |
105 SkBitmap::Allocator* allocator = NULL); | 87 SkBitmap::Allocator* allocator = NULL); |
106 }; | 88 }; |
107 | 89 |
108 #endif | 90 #endif |
OLD | NEW |