OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 * to empty. | 297 * to empty. |
298 */ | 298 */ |
299 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 299 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
300 | 300 |
301 /** | 301 /** |
302 * Returns true if the image is backed by an image-generator or other src t
hat creates | 302 * Returns true if the image is backed by an image-generator or other src t
hat creates |
303 * (and caches) its pixels / texture on-demand. | 303 * (and caches) its pixels / texture on-demand. |
304 */ | 304 */ |
305 bool isLazyGenerated() const; | 305 bool isLazyGenerated() const; |
306 | 306 |
| 307 /** |
| 308 * Apply the specified filter to this image, and return the result as a new
image. |
| 309 * |
| 310 * if forceResultToOriginalSize is true, then the resulting image will be t
he same size as the |
| 311 * src, regardless of the normal output of the filter. |
| 312 * |
| 313 * If offset is non-null, it is set to the relative offset needed to draw t
he resulting image |
| 314 * in the same logical place as the original. |
| 315 * |
| 316 * e.g. |
| 317 * If the filter makes the result larger by a margin of 4 the output wo
uld be: |
| 318 * result->width() = this->width + 8 |
| 319 * result->height() = this->height + 8 |
| 320 * offset.x() == -4 |
| 321 * offset.y() == -4 |
| 322 * |
| 323 * If the filter fails to create a resulting image, null is returned, and t
he offset parameter |
| 324 * (if specified) will be undefined. |
| 325 */ |
| 326 SkImage* applyFilter(SkImageFilter* filter, SkIPoint* offset, |
| 327 bool forceResultToOriginalSize) const; |
| 328 |
307 protected: | 329 protected: |
308 SkImage(int width, int height, uint32_t uniqueID); | 330 SkImage(int width, int height, uint32_t uniqueID); |
309 | 331 |
310 private: | 332 private: |
311 const int fWidth; | 333 const int fWidth; |
312 const int fHeight; | 334 const int fHeight; |
313 const uint32_t fUniqueID; | 335 const uint32_t fUniqueID; |
314 | 336 |
315 typedef SkRefCnt INHERITED; | 337 typedef SkRefCnt INHERITED; |
316 }; | 338 }; |
317 | 339 |
318 #endif | 340 #endif |
OLD | NEW |