Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkBlurMaskFilter Class Reference

Public Types

enum  BlurFlags { kNone_BlurFlag = 0x00, kIgnoreTransform_BlurFlag = 0x01, kHighQuality_BlurFlag = 0x02, kAll_BlurFlag = 0x03 }
 

Static Public Member Functions

static SkScalar ConvertRadiusToSigma (SkScalar radius)
 If radius > 0, return the corresponding sigma, else return 0. More...
 
static sk_sp< SkMaskFilterMake (SkBlurStyle style, SkScalar sigma, const SkRect &occluder, uint32_t flags=kNone_BlurFlag)
 Create a blur maskfilter. More...
 
static sk_sp< SkMaskFilterMake (SkBlurStyle style, SkScalar sigma, uint32_t flags=kNone_BlurFlag)
 
static sk_sp< SkMaskFilterMakeEmboss (SkScalar blurSigma, const SkScalar direction[3], SkScalar ambient, SkScalar specular)
 Create an emboss maskfilter. More...
 
static bool ComputeBlurredRRectParams (const SkRRect &srcRRect, const SkRRect &devRRect, const SkRect &occluder, SkScalar sigma, SkScalar xformedSigma, SkRRect *rrectToDraw, SkISize *widthHeight, SkScalar rectXs[kMaxDivisions], SkScalar rectYs[kMaxDivisions], SkScalar texXs[kMaxDivisions], SkScalar texYs[kMaxDivisions], int *numXs, int *numYs, uint32_t *skipMask)
 

Static Public Attributes

static const int kMaxDivisions = 6
 

Member Enumeration Documentation

Enumerator
kIgnoreTransform_BlurFlag 

The blur layer's radius is not affected by transforms.

kHighQuality_BlurFlag 

Use a smother, higher qulity blur algorithm.

kAll_BlurFlag 

mask for all blur flags

Member Function Documentation

static SkScalar SkBlurMaskFilter::ConvertRadiusToSigma ( SkScalar  radius)
static

If radius > 0, return the corresponding sigma, else return 0.

Use this to convert from the (legacy) idea of specify the blur "radius" to the standard notion of specifying its sigma.

static sk_sp<SkMaskFilter> SkBlurMaskFilter::Make ( SkBlurStyle  style,
SkScalar  sigma,
const SkRect occluder,
uint32_t  flags = kNone_BlurFlag 
)
static

Create a blur maskfilter.

Parameters
styleThe SkBlurStyle to use
sigmaStandard deviation of the Gaussian blur to apply. Must be > 0.
occluderThe rect for which no pixels need be drawn (b.c. it will be overdrawn with some opaque object. This is just a hint which backends are free to ignore.
flagsFlags to use - defaults to none
Returns
The new blur maskfilter
static sk_sp<SkMaskFilter> SkBlurMaskFilter::MakeEmboss ( SkScalar  blurSigma,
const SkScalar  direction[3],
SkScalar  ambient,
SkScalar  specular 
)
static

Create an emboss maskfilter.

Parameters
blurSigmastandard deviation of the Gaussian blur to apply before applying lighting (e.g. 3)
directionarray of 3 scalars [x, y, z] specifying the direction of the light source
ambient0...1 amount of ambient light
specularcoefficient for specular highlights (e.g. 8)
Returns
the emboss maskfilter

The documentation for this class was generated from the following file: