| Flutter Impeller |

color_matrix_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_COLOR_MATRIX_FILTER_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_MATRIX_FILTER_CONTENTS_H_
7
8 #include <memory>
9 #include <optional>
10
11 #include "impeller/entity/contents/filters/color_filter_contents.h"
12 #include "impeller/entity/contents/filters/inputs/filter_input.h"
13
14 namespace impeller {
15
16 // Look at example at: https://github.com/flutter/impeller/pull/132
17
18 class ColorMatrixFilterContents final : public ColorFilterContents {
19 public:
20 ColorMatrixFilterContents();
21
22 ~ColorMatrixFilterContents() override;
23
24 void SetMatrix(const ColorMatrix& matrix);
25
26 private:
27 // |FilterContents|
28 std::optional<Entity> RenderFilter(
29 const FilterInput::Vector& input_textures,
30 const ContentContext& renderer,
31 const Entity& entity,
32 const Matrix& effect_transform,
33 const Rect& coverage,
34 const std::optional<Rect>& coverage_hint) const override;
35
36 ColorMatrix matrix_;
37
38 ColorMatrixFilterContents(const ColorMatrixFilterContents&) = delete;
39
40 ColorMatrixFilterContents& operator=(const ColorMatrixFilterContents&) =
41 delete;
42 };
43
44 } // namespace impeller
45
46 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_MATRIX_FILTER_CONTENTS_H_
impeller::ColorFilterContents
Definition: color_filter_contents.h:12
impeller::ColorMatrixFilterContents::~ColorMatrixFilterContents
~ColorMatrixFilterContents() override
impeller::ColorMatrixFilterContents::SetMatrix
void SetMatrix(const ColorMatrix &matrix)
Definition: color_matrix_filter_contents.cc:24
impeller::Entity
Definition: entity.h:20
impeller::ColorMatrixFilterContents::ColorMatrixFilterContents
ColorMatrixFilterContents()
impeller::ColorMatrixFilterContents
Definition: color_matrix_filter_contents.h:18
filter_input.h
color_filter_contents.h
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
impeller::ColorMatrix
Definition: color.h:117
impeller
Definition: aiks_blend_unittests.cc:18
impeller::ContentContext
Definition: content_context.h:366
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37