Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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>
12
13namespace impeller {
14
16 public:
18
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
54
57};
58
59} // namespace impeller
60
61#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_
std::optional< Entity > RenderFilter(const FilterInput::Vector &input_textures, const ContentContext &renderer, const Entity &entity, const Matrix &effect_transform, const Rect &coverage, const std::optional< Rect > &coverage_hint) const override
Converts zero or more filter inputs into a render instruction.
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...
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...
std::vector< FilterInput::Ref > Vector
A 4x4 matrix using column-major storage.
Definition matrix.h:37
For convolution filters, the "radius" is the size of the convolution kernel to use on the local space...
Definition sigma.h:48