| 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 #ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_
7
8 #include <memory>
9 #include <optional>
10 #include "impeller/entity/contents/filters/filter_contents.h"
11 #include "impeller/entity/contents/filters/inputs/filter_input.h"
12
13 namespace impeller {
14
15 class DirectionalMorphologyFilterContents final : public FilterContents {
16 public:
17 DirectionalMorphologyFilterContents();
18
19 ~DirectionalMorphologyFilterContents() override;
20
21 void SetRadius(Radius radius);
22
23 void SetDirection(Vector2 direction);
24
25 void SetMorphType(MorphType morph_type);
26
27 // |FilterContents|
28 std::optional<Rect> GetFilterCoverage(
29 const FilterInput::Vector& inputs,
30 const Entity& entity,
31 const Matrix& effect_transform) const override;
32
33 // |FilterContents|
34 std::optional<Rect> GetFilterSourceCoverage(
35 const Matrix& effect_transform,
36 const Rect& output_limit) 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
48 Radius radius_;
49 Vector2 direction_;
50 MorphType morph_type_;
51
52 DirectionalMorphologyFilterContents(
53 const DirectionalMorphologyFilterContents&) = delete;
54
55 DirectionalMorphologyFilterContents& operator=(
56 const DirectionalMorphologyFilterContents&) = delete;
57 };
58
59 } // namespace impeller
60
61 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_
impeller::ContentContext
Definition: content_context.h:138
impeller::DirectionalMorphologyFilterContents
Definition: morphology_filter_contents.h:15
impeller::DirectionalMorphologyFilterContents::DirectionalMorphologyFilterContents
DirectionalMorphologyFilterContents()
impeller::DirectionalMorphologyFilterContents::SetRadius
void SetRadius(Radius radius)
Definition: morphology_filter_contents.cc:23
impeller::DirectionalMorphologyFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Internal utility method for |GetLocalCoverage| that computes the output coverage of this filter acros...
Definition: morphology_filter_contents.cc:169
impeller::DirectionalMorphologyFilterContents::SetMorphType
void SetMorphType(MorphType morph_type)
Definition: morphology_filter_contents.cc:34
impeller::DirectionalMorphologyFilterContents::GetFilterSourceCoverage
std::optional< Rect > GetFilterSourceCoverage(const Matrix &effect_transform, const Rect &output_limit) const override
Internal utility method for |GetSourceCoverage| that computes the inverse effect of this transform on...
Definition: morphology_filter_contents.cc:204
impeller::DirectionalMorphologyFilterContents::~DirectionalMorphologyFilterContents
~DirectionalMorphologyFilterContents() override
impeller::DirectionalMorphologyFilterContents::SetDirection
void SetDirection(Vector2 direction)
Definition: morphology_filter_contents.cc:27
impeller::Entity
Definition: entity.h:26
impeller::FilterContents
Definition: filter_contents.h:24
impeller::FilterContents::MorphType
MorphType
Definition: filter_contents.h:39
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
filter_contents.h
filter_input.h
impeller
Definition: allocation.cc:12
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::Radius
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
Definition: sigma.h:48
impeller::TPoint< Scalar >
impeller::TRect< Scalar >