commit-bot@chromium.org | 40eb3c1 | 2014-01-06 23:41:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkAlphaThresholdFilter_DEFINED |
| 9 | #define SkAlphaThresholdFilter_DEFINED |
| 10 | |
| 11 | #include "SkRegion.h" |
| 12 | #include "SkImageFilter.h" |
| 13 | |
| 14 | class SK_API SkAlphaThresholdFilter { |
| 15 | public: |
| 16 | /** |
| 17 | * Creates an image filter that samples a region. If the sample is inside the |
| 18 | * region the alpha of the image is boosted up to a threshold value. If it is |
| 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 |
| 21 | * source image. |
| 22 | */ |
senorblanco | 9ea3d57 | 2014-07-08 09:16:22 -0700 | [diff] [blame] | 23 | static SkImageFilter* Create(const SkRegion& region, SkScalar innerThreshold, |
| 24 | SkScalar outerThreshold, SkImageFilter* input = NULL); |
commit-bot@chromium.org | 40eb3c1 | 2014-01-06 23:41:14 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | #endif |