Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
SkBlurEngine Class Referenceabstract

#include <SkBlurEngine.h>

Classes

class  Algorithm
 

Public Member Functions

virtual ~SkBlurEngine ()=default
 
virtual const AlgorithmfindAlgorithm (SkSize sigma, SkColorType colorType) const =0
 

Static Public Member Functions

static constexpr bool IsEffectivelyIdentity (float sigma)
 
static int SigmaToRadius (float sigma)
 

Detailed Description

SkBlurEngine is a backend-agnostic provider of blur algorithms. Each Skia backend defines a blur engine with a set of supported algorithms and/or implementations. A given implementation may be optimized for a particular color type, sigma range, or available hardware. Each engine and its algorithms are assumed to operate only on SkImages corresponding to its Skia backend, and will produce output SkImages of the same type.

Algorithms are allowed to specify a maximum supported sigma. If the desired sigma is higher than this, the input image and output region must be downscaled by the caller before invoking the algorithm. This is to provide the most flexibility for input representation (e.g. directly rasterize at half resolution or apply deferred filter effects during the first downsample pass).

skif::FilterResult::Builder::blur() is a convenient wrapper around the blur engine and automatically handles resizing.

Definition at line 45 of file SkBlurEngine.h.

Constructor & Destructor Documentation

◆ ~SkBlurEngine()

virtual SkBlurEngine::~SkBlurEngine ( )
virtualdefault

Member Function Documentation

◆ findAlgorithm()

virtual const Algorithm * SkBlurEngine::findAlgorithm ( SkSize  sigma,
SkColorType  colorType 
) const
pure virtual

◆ IsEffectivelyIdentity()

static constexpr bool SkBlurEngine::IsEffectivelyIdentity ( float  sigma)
inlinestaticconstexpr

Definition at line 63 of file SkBlurEngine.h.

63{ return sigma <= 0.03f; }

◆ SigmaToRadius()

static int SkBlurEngine::SigmaToRadius ( float  sigma)
inlinestatic

Definition at line 67 of file SkBlurEngine.h.

67 {
68 // sk_float_ceil2int is not constexpr
69 return IsEffectivelyIdentity(sigma) ? 0 : sk_float_ceil2int(3.f * sigma);
70 }
#define sk_float_ceil2int(x)
static constexpr bool IsEffectivelyIdentity(float sigma)
Definition: SkBlurEngine.h:63

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