| Flutter Impeller |

gaussian_blur_filter_contents.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include <memory>
8 #include <optional>
9 #include "impeller/entity/contents/filters/filter_contents.h"
10 #include "impeller/entity/contents/filters/inputs/filter_input.h"
11
12 namespace impeller {
13
14 class DirectionalGaussianBlurFilterContents final : public FilterContents {
15 public:
16 DirectionalGaussianBlurFilterContents();
17
18 ~DirectionalGaussianBlurFilterContents() override;
19
20 void SetSigma(Sigma sigma);
21
22 void SetSecondarySigma(Sigma sigma);
23
24 void SetDirection(Vector2 direction);
25
26 void SetBlurStyle(BlurStyle blur_style);
27
28 void SetTileMode(Entity::TileMode tile_mode);
29
30 void SetIsSecondPass(bool is_second_pass);
31
32 // |FilterContents|
33 std::optional<Rect> GetFilterCoverage(
34 const FilterInput::Vector& inputs,
35 const Entity& entity,
36 const Matrix& effect_transform) const override;
37
38 private:
39 // |FilterContents|
40 std::optional<Entity> RenderFilter(
41 const FilterInput::Vector& input_textures,
42 const ContentContext& renderer,
43 const Entity& entity,
44 const Matrix& effect_transform,
45 const Rect& coverage,
46 const std::optional<Rect>& coverage_hint) const override;
47 Sigma blur_sigma_;
48 Sigma secondary_blur_sigma_;
49 Vector2 blur_direction_;
50 BlurStyle blur_style_ = BlurStyle::kNormal;
51 Entity::TileMode tile_mode_ = Entity::TileMode::kDecal;
52 bool is_second_pass_ = false;
53
54 FML_DISALLOW_COPY_AND_ASSIGN(DirectionalGaussianBlurFilterContents);
55 };
56
57 } // namespace impeller
impeller::DirectionalGaussianBlurFilterContents::SetIsSecondPass
void SetIsSecondPass(bool is_second_pass)
Definition: gaussian_blur_filter_contents.cc:56
impeller::DirectionalGaussianBlurFilterContents::SetBlurStyle
void SetBlurStyle(BlurStyle blur_style)
Definition: gaussian_blur_filter_contents.cc:47
impeller::DirectionalGaussianBlurFilterContents::SetSecondarySigma
void SetSecondarySigma(Sigma sigma)
Definition: gaussian_blur_filter_contents.cc:36
impeller::FilterContents::BlurStyle
BlurStyle
Definition: filter_contents.h:21
impeller::Entity::TileMode::kDecal
@ kDecal
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::Entity
Definition: entity.h:21
filter_contents.h
impeller::Sigma
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
Definition: sigma.h:31
filter_input.h
impeller::Entity::TileMode
TileMode
Definition: entity.h:40
impeller::DirectionalGaussianBlurFilterContents::SetTileMode
void SetTileMode(Entity::TileMode tile_mode)
Definition: gaussian_blur_filter_contents.cc:51
impeller::DirectionalGaussianBlurFilterContents::DirectionalGaussianBlurFilterContents
DirectionalGaussianBlurFilterContents()
impeller::DirectionalGaussianBlurFilterContents::SetSigma
void SetSigma(Sigma sigma)
Definition: gaussian_blur_filter_contents.cc:32
impeller::DirectionalGaussianBlurFilterContents::~DirectionalGaussianBlurFilterContents
~DirectionalGaussianBlurFilterContents() override
impeller::DirectionalGaussianBlurFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Definition: gaussian_blur_filter_contents.cc:279
impeller::DirectionalGaussianBlurFilterContents::SetDirection
void SetDirection(Vector2 direction)
Definition: gaussian_blur_filter_contents.cc:40
impeller::TPoint< Scalar >
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:32
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::TRect< Scalar >
impeller::DirectionalGaussianBlurFilterContents
Definition: gaussian_blur_filter_contents.h:14
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36
impeller::FilterContents
Definition: filter_contents.h:19