Flutter Engine
The Flutter Engine
SkMaskBlurFilter.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkMaskBlurFilter_DEFINED
9#define SkMaskBlurFilter_DEFINED
10
11#include <algorithm>
12#include <memory>
13#include <tuple>
14
16#include "src/core/SkMask.h"
17
18// Implement a single channel Gaussian blur. The specifics for implementation are taken from:
19// https://drafts.fxtf.org/filters/#feGaussianBlurElement
21public:
22 // Create an object suitable for filtering an SkMask using a filter with width sigmaW and
23 // height sigmaH.
24 SkMaskBlurFilter(double sigmaW, double sigmaH);
25
26 // returns true iff the sigmas will result in an identity mask (no blurring)
27 bool hasNoBlur() const;
28
29 // Given a src SkMask, generate dst SkMask returning the border width and height.
30 SkIPoint blur(const SkMask& src, SkMaskBuilder* dst) const;
31
32private:
33 const double fSigmaW;
34 const double fSigmaH;
35};
36
37#endif // SkBlurMaskFilter_DEFINED
SkIPoint blur(const SkMask &src, SkMaskBuilder *dst) const
SkMaskBlurFilter(double sigmaW, double sigmaH)
bool hasNoBlur() const
dst
Definition: cp.py:12
Definition: SkMask.h:25