| 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 "include/core/SkImageFilter.h" |
| 12 | |
| 13 | class SkRegion; |
| 14 | |
| 15 | // DEPRECATED: Use include/effects/SkImageFilters::AlphaThreshold |
| 16 | class SK_API SkAlphaThresholdFilter { |
| 17 | public: |
| 18 | /** |
| 19 | * Creates an image filter that samples a region. If the sample is inside the |
| 20 | * region the alpha of the image is boosted up to a threshold value. If it is |
| 21 | * outside the region then the alpha is decreased to the threshold value. |
| 22 | * The 0,0 point of the region corresponds to the upper left corner of the |
| 23 | * source image. |
| 24 | */ |
| 25 | static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin, |
| 26 | SkScalar outerMax, sk_sp<SkImageFilter> input, |
| 27 | const SkImageFilter::CropRect* cropRect = nullptr); |
| 28 | |
| 29 | |
| 30 | static void RegisterFlattenables(); |
| 31 | |
| 32 | private: |
| 33 | SkAlphaThresholdFilter() = delete; |
| 34 | }; |
| 35 | |
| 36 | #endif |
| 37 | |