| Flutter Impeller |

morphology_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 DirectionalMorphologyFilterContents final : public FilterContents {
15 public:
16 DirectionalMorphologyFilterContents();
17
18 ~DirectionalMorphologyFilterContents() override;
19
20 void SetRadius(Radius radius);
21
22 void SetDirection(Vector2 direction);
23
24 void SetMorphType(MorphType morph_type);
25
26 // |FilterContents|
27 std::optional<Rect> GetFilterCoverage(
28 const FilterInput::Vector& inputs,
29 const Entity& entity,
30 const Matrix& effect_transform) const override;
31
32 private:
33 // |FilterContents|
34 std::optional<Entity> RenderFilter(
35 const FilterInput::Vector& input_textures,
36 const ContentContext& renderer,
37 const Entity& entity,
38 const Matrix& effect_transform,
39 const Rect& coverage,
40 const std::optional<Rect>& coverage_hint) const override;
41
42 Radius radius_;
43 Vector2 direction_;
44 MorphType morph_type_;
45
46 FML_DISALLOW_COPY_AND_ASSIGN(DirectionalMorphologyFilterContents);
47 };
48
49 } // namespace impeller
impeller::DirectionalMorphologyFilterContents::~DirectionalMorphologyFilterContents
~DirectionalMorphologyFilterContents() override
impeller::DirectionalMorphologyFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Definition: morphology_filter_contents.cc:159
impeller::DirectionalMorphologyFilterContents::SetRadius
void SetRadius(Radius radius)
Definition: morphology_filter_contents.cc:22
impeller::Entity
Definition: entity.h:21
filter_contents.h
impeller::Radius
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
Definition: sigma.h:47
impeller::DirectionalMorphologyFilterContents::DirectionalMorphologyFilterContents
DirectionalMorphologyFilterContents()
filter_input.h
impeller::DirectionalMorphologyFilterContents::SetDirection
void SetDirection(Vector2 direction)
Definition: morphology_filter_contents.cc:26
impeller::FilterContents::MorphType
MorphType
Definition: filter_contents.h:32
impeller::TPoint< Scalar >
impeller::DirectionalMorphologyFilterContents::SetMorphType
void SetMorphType(MorphType morph_type)
Definition: morphology_filter_contents.cc:33
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:32
impeller::DirectionalMorphologyFilterContents
Definition: morphology_filter_contents.h:14
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36
impeller::FilterContents
Definition: filter_contents.h:19