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 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static bool BoxBlur(SkMask* dst, const SkMask& src, | 43 static bool BoxBlur(SkMask* dst, const SkMask& src, |
44 SkScalar sigma, Style style, Quality quality, | 44 SkScalar sigma, Style style, Quality quality, |
45 SkIPoint* margin = NULL); | 45 SkIPoint* margin = NULL); |
46 | 46 |
47 // the "ground truth" blur does a gaussian convolution; it's slow | 47 // the "ground truth" blur does a gaussian convolution; it's slow |
48 // but useful for comparison purposes. | 48 // but useful for comparison purposes. |
49 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, | 49 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, |
50 Style style, | 50 Style style, |
51 SkIPoint* margin = NULL); | 51 SkIPoint* margin = NULL); |
52 | 52 |
| 53 // If radius > 0, return the corresponding sigma, else return 0 |
53 static SkScalar ConvertRadiusToSigma(SkScalar radius); | 54 static SkScalar ConvertRadiusToSigma(SkScalar radius); |
| 55 // If sigma > 0.5, return the corresponding radius, else return 0 |
| 56 static SkScalar ConvertSigmaToRadius(SkScalar sigma); |
54 | 57 |
55 /* Helper functions for analytic rectangle blurs */ | 58 /* Helper functions for analytic rectangle blurs */ |
56 | 59 |
57 /** Look up the intensity of the (one dimnensional) blurred half-plane. | 60 /** Look up the intensity of the (one dimnensional) blurred half-plane. |
58 @param profile The precomputed 1D blur profile; memory allocated by and
managed by | 61 @param profile The precomputed 1D blur profile; memory allocated by and
managed by |
59 ComputeBlurProfile below. | 62 ComputeBlurProfile below. |
60 @param loc the location to look up; The lookup will clamp invalid inputs
, but | 63 @param loc the location to look up; The lookup will clamp invalid inputs
, but |
61 meaningful data are available between 0 and blurred_width | 64 meaningful data are available between 0 and blurred_width |
62 @param blurred_width The width of the final, blurred rectangle | 65 @param blurred_width The width of the final, blurred rectangle |
63 @param sharp_width The width of the original, unblurred rectangle. | 66 @param sharp_width The width of the original, unblurred rectangle. |
(...skipping 18 matching lines...) Expand all Loading... |
82 */ | 85 */ |
83 | 86 |
84 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 87 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
85 unsigned int width, SkScalar sigma); | 88 unsigned int width, SkScalar sigma); |
86 | 89 |
87 | 90 |
88 | 91 |
89 }; | 92 }; |
90 | 93 |
91 #endif | 94 #endif |
OLD | NEW |