| 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 SkAlphaThresholdFilter_DEFINED | 8 #ifndef SkAlphaThresholdFilter_DEFINED |
| 9 #define SkAlphaThresholdFilter_DEFINED | 9 #define SkAlphaThresholdFilter_DEFINED |
| 10 | 10 |
| 11 #include "SkRegion.h" | 11 #include "SkRegion.h" |
| 12 #include "SkImageFilter.h" | 12 #include "SkImageFilter.h" |
| 13 | 13 |
| 14 class SK_API SkAlphaThresholdFilter { | 14 class SK_API SkAlphaThresholdFilter { |
| 15 public: | 15 public: |
| 16 /** | 16 /** |
| 17 * Creates an image filter that samples a region. If the sample is inside th
e | 17 * Creates an image filter that samples a region. If the sample is inside th
e |
| 18 * region the alpha of the image is boosted up to a threshold value. If it i
s | 18 * region the alpha of the image is boosted up to a threshold value. If it i
s |
| 19 * outside the region then the alpha is decreased to the threshold value. | 19 * outside the region then the alpha is decreased to the threshold value. |
| 20 * The 0,0 point of the region corresponds to the upper left corner of the | 20 * The 0,0 point of the region corresponds to the upper left corner of the |
| 21 * source image. | 21 * source image. |
| 22 */ | 22 */ |
| 23 static SkImageFilter* Create(const SkRegion& region, SkScalar innerThreshold
, SkScalar outerThreshold); | 23 static SkImageFilter* Create(const SkRegion& region, SkScalar innerThreshold
, SkScalar outerThreshold); |
| 24 |
| 25 /** |
| 26 * Creates an image filter that samples a region. If the sample is inside th
e |
| 27 * region the alpha of the image is boosted up to a threshold value. If it i
s |
| 28 * outside the region then the alpha is decreased to the threshold value. |
| 29 * The 0,0 point of the region corresponds to the upper left corner of the |
| 30 * source image. |
| 31 * The |scale| factor is applied to the region before the filter is applied. |
| 32 */ |
| 33 static SkImageFilter* Create(const SkRegion& region, const SkMatrix& scale, |
| 34 SkScalar innerThreshold, SkScalar outerThreshol
d); |
| 24 }; | 35 }; |
| 25 | 36 |
| 26 #endif | 37 #endif |
| OLD | NEW |