1 | /* |
2 | * Copyright 2011 The Android Open Source Project |
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 SkBlurImageFilter_DEFINED |
9 | #define SkBlurImageFilter_DEFINED |
10 | |
11 | #include "include/core/SkImageFilter.h" |
12 | |
13 | enum class SkTileMode; |
14 | |
15 | // DEPRECATED: Use include/effects/SkImageFilters::Blur |
16 | class SK_API SkBlurImageFilter { |
17 | public: |
18 | /*! \enum TileMode |
19 | * DEPRECATED: Use SkTileMode instead. */ |
20 | enum TileMode { |
21 | kClamp_TileMode = 0, /*!< Clamp to the image's edge pixels. */ |
22 | /*!< This re-weights the filter so samples outside have no effect */ |
23 | kRepeat_TileMode, /*!< Wrap around to the image's opposite edge. */ |
24 | kClampToBlack_TileMode, /*!< Fill with transparent black. */ |
25 | kLast_TileMode = kClampToBlack_TileMode, |
26 | |
27 | // TODO: remove kMax - it is non-standard but Chromium uses it |
28 | kMax_TileMode = kClampToBlack_TileMode |
29 | }; |
30 | |
31 | static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, |
32 | sk_sp<SkImageFilter> input, |
33 | const SkImageFilter::CropRect* cropRect = nullptr, |
34 | TileMode tileMode = TileMode::kClampToBlack_TileMode); |
35 | // EXPERIMENTAL: kMirror is not yet supported |
36 | static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, |
37 | sk_sp<SkImageFilter> input, |
38 | const SkImageFilter::CropRect* cropRect = nullptr); |
39 | |
40 | static void RegisterFlattenables(); |
41 | |
42 | private: |
43 | SkBlurImageFilter() = delete; |
44 | }; |
45 | |
46 | #endif |
47 | |