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 | |
commit-bot@chromium.org | 40eb3c1 | 2014-01-06 23:41:14 +0000 | [diff] [blame] | 11 | #include "SkImageFilter.h" |
robertphillips | f7142e7 | 2016-04-18 07:20:05 -0700 | [diff] [blame] | 12 | |
| 13 | class SkRegion; |
commit-bot@chromium.org | 40eb3c1 | 2014-01-06 23:41:14 +0000 | [diff] [blame] | 14 | |
| 15 | class SK_API SkAlphaThresholdFilter { |
| 16 | public: |
| 17 | /** |
| 18 | * Creates an image filter that samples a region. If the sample is inside the |
| 19 | * region the alpha of the image is boosted up to a threshold value. If it is |
| 20 | * outside the region then the alpha is decreased to the threshold value. |
| 21 | * The 0,0 point of the region corresponds to the upper left corner of the |
| 22 | * source image. |
| 23 | */ |
robertphillips | f624204 | 2016-04-01 10:34:43 -0700 | [diff] [blame] | 24 | static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin, |
robertphillips | af9b8c8 | 2016-04-12 11:02:25 -0700 | [diff] [blame] | 25 | SkScalar outerMax, sk_sp<SkImageFilter> input, |
| 26 | const SkImageFilter::CropRect* cropRect = nullptr); |
robertphillips | f624204 | 2016-04-01 10:34:43 -0700 | [diff] [blame] | 27 | |
| 28 | |
Cary Clark | 4dc5a45 | 2018-05-21 11:56:57 -0400 | [diff] [blame] | 29 | static void InitializeFlattenables(); |
commit-bot@chromium.org | 40eb3c1 | 2014-01-06 23:41:14 +0000 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | #endif |