OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkBlurMask_DEFINED | 10 #ifndef SkBlurMask_DEFINED |
11 #define SkBlurMask_DEFINED | 11 #define SkBlurMask_DEFINED |
12 | 12 |
13 #include "SkShader.h" | 13 #include "SkShader.h" |
14 #include "SkMask.h" | 14 #include "SkMask.h" |
15 #include "SkRRect.h" | |
15 | 16 |
16 class SkBlurMask { | 17 class SkBlurMask { |
17 public: | 18 public: |
18 enum Style { | 19 enum Style { |
19 kNormal_Style, //!< fuzzy inside and outside | 20 kNormal_Style, //!< fuzzy inside and outside |
20 kSolid_Style, //!< solid inside, fuzzy outside | 21 kSolid_Style, //!< solid inside, fuzzy outside |
21 kOuter_Style, //!< nothing inside, fuzzy outside | 22 kOuter_Style, //!< nothing inside, fuzzy outside |
22 kInner_Style, //!< fuzzy inside, nothing outside | 23 kInner_Style, //!< fuzzy inside, nothing outside |
23 | 24 |
24 kStyleCount | 25 kStyleCount |
25 }; | 26 }; |
26 | 27 |
27 enum Quality { | 28 enum Quality { |
28 kLow_Quality, //!< box blur | 29 kLow_Quality, //!< box blur |
29 kHigh_Quality //!< three pass box blur (similar to gaussian) | 30 kHigh_Quality //!< three pass box blur (similar to gaussian) |
30 }; | 31 }; |
31 | 32 |
32 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, | 33 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, |
33 Style style, | 34 Style style, |
34 SkIPoint *margin = NULL, | 35 SkIPoint *margin = NULL, |
35 SkMask::CreateMode createMode = | 36 SkMask::CreateMode createMode = |
36 SkMask::kComputeBoundsAndRenderI mage_CreateMode); | 37 SkMask::kComputeBoundsAndRenderI mage_CreateMode); |
38 static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src, | |
39 Style style, | |
40 SkIPoint *margin = NULL, | |
41 SkMask::CreateMode createMode = | |
42 SkMask::kComputeBoundsAndRenderI mage_CreateMode); | |
37 static bool BoxBlur(SkMask* dst, const SkMask& src, | 43 static bool BoxBlur(SkMask* dst, const SkMask& src, |
38 SkScalar sigma, Style style, Quality quality, | 44 SkScalar sigma, Style style, Quality quality, |
39 SkIPoint* margin = NULL); | 45 SkIPoint* margin = NULL); |
40 | 46 |
41 // the "ground truth" blur does a gaussian convolution; it's slow | 47 // the "ground truth" blur does a gaussian convolution; it's slow |
42 // but useful for comparison purposes. | 48 // but useful for comparison purposes. |
43 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, | 49 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, |
44 Style style, | 50 Style style, |
45 SkIPoint* margin = NULL); | 51 SkIPoint* margin = NULL); |
46 | 52 |
47 SK_ATTR_DEPRECATED("use sigma version") | 53 SK_ATTR_DEPRECATED("use sigma version") |
48 static bool BlurRect(SkMask *dst, const SkRect &src, | 54 static bool BlurRect(SkMask *dst, const SkRect &src, |
49 SkScalar radius, Style style, | 55 SkScalar radius, Style style, |
50 SkIPoint *margin = NULL, | 56 SkIPoint *margin = NULL, |
51 SkMask::CreateMode createMode = | 57 SkMask::CreateMode createMode = |
52 SkMask::kComputeBoundsAndRenderI mage_CreateMode); | 58 SkMask::kComputeBoundsAndRenderI mage_CreateMode); |
59 SK_ATTR_DEPRECATED("use sigma version") | |
bsalomon
2014/03/10 16:03:09
Do we need to add the deprecated version?
reed1
2014/03/10 16:08:35
-1
no deprecated version
| |
60 static bool BlurRRect(SkMask *dst, const SkRRect &src, | |
61 SkScalar radius, Style style, | |
62 SkIPoint *margin = NULL, | |
63 SkMask::CreateMode createMode = | |
64 SkMask::kComputeBoundsAndRenderI mage_CreateMode); | |
53 | 65 |
54 SK_ATTR_DEPRECATED("use sigma version") | 66 SK_ATTR_DEPRECATED("use sigma version") |
55 static bool Blur(SkMask* dst, const SkMask& src, | 67 static bool Blur(SkMask* dst, const SkMask& src, |
56 SkScalar radius, Style style, Quality quality, | 68 SkScalar radius, Style style, Quality quality, |
57 SkIPoint* margin = NULL); | 69 SkIPoint* margin = NULL); |
58 | 70 |
59 SK_ATTR_DEPRECATED("use sigma version") | 71 SK_ATTR_DEPRECATED("use sigma version") |
60 static bool BlurGroundTruth(SkMask* dst, const SkMask& src, | 72 static bool BlurGroundTruth(SkMask* dst, const SkMask& src, |
61 SkScalar radius, Style style, | 73 SkScalar radius, Style style, |
62 SkIPoint* margin = NULL); | 74 SkIPoint* margin = NULL); |
(...skipping 30 matching lines...) Expand all Loading... | |
93 */ | 105 */ |
94 | 106 |
95 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 107 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
96 unsigned int width, SkScalar sigma); | 108 unsigned int width, SkScalar sigma); |
97 | 109 |
98 | 110 |
99 | 111 |
100 }; | 112 }; |
101 | 113 |
102 #endif | 114 #endif |
OLD | NEW |