OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkBlurMask_DEFINED | 8 #ifndef SkBlurMask_DEFINED |
9 #define SkBlurMask_DEFINED | 9 #define SkBlurMask_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 static bool BoxBlur(SkMask* dst, const SkMask& src, | 33 static bool BoxBlur(SkMask* dst, const SkMask& src, |
34 SkScalar sigma, SkBlurStyle style, SkBlurQuality quality
, | 34 SkScalar sigma, SkBlurStyle style, SkBlurQuality quality
, |
35 SkIPoint* margin = NULL, bool force_quality=false); | 35 SkIPoint* margin = NULL, bool force_quality=false); |
36 | 36 |
37 // the "ground truth" blur does a gaussian convolution; it's slow | 37 // the "ground truth" blur does a gaussian convolution; it's slow |
38 // but useful for comparison purposes. | 38 // but useful for comparison purposes. |
39 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src,
SkBlurStyle, | 39 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src,
SkBlurStyle, |
40 SkIPoint* margin = NULL); | 40 SkIPoint* margin = NULL); |
41 | 41 |
| 42 // If radius > 0, return the corresponding sigma, else return 0 |
42 static SkScalar ConvertRadiusToSigma(SkScalar radius); | 43 static SkScalar ConvertRadiusToSigma(SkScalar radius); |
| 44 // If sigma > 0.5, return the corresponding radius, else return 0 |
| 45 static SkScalar ConvertSigmaToRadius(SkScalar sigma); |
43 | 46 |
44 /* Helper functions for analytic rectangle blurs */ | 47 /* Helper functions for analytic rectangle blurs */ |
45 | 48 |
46 /** Look up the intensity of the (one dimnensional) blurred half-plane. | 49 /** Look up the intensity of the (one dimnensional) blurred half-plane. |
47 @param profile The precomputed 1D blur profile; memory allocated by and
managed by | 50 @param profile The precomputed 1D blur profile; memory allocated by and
managed by |
48 ComputeBlurProfile below. | 51 ComputeBlurProfile below. |
49 @param loc the location to look up; The lookup will clamp invalid inputs
, but | 52 @param loc the location to look up; The lookup will clamp invalid inputs
, but |
50 meaningful data are available between 0 and blurred_width | 53 meaningful data are available between 0 and blurred_width |
51 @param blurred_width The width of the final, blurred rectangle | 54 @param blurred_width The width of the final, blurred rectangle |
52 @param sharp_width The width of the original, unblurred rectangle. | 55 @param sharp_width The width of the original, unblurred rectangle. |
(...skipping 18 matching lines...) Expand all Loading... |
71 */ | 74 */ |
72 | 75 |
73 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 76 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
74 unsigned int width, SkScalar sigma); | 77 unsigned int width, SkScalar sigma); |
75 | 78 |
76 | 79 |
77 | 80 |
78 }; | 81 }; |
79 | 82 |
80 #endif | 83 #endif |
OLD | NEW |