Flutter Engine
 
Loading...
Searching...
No Matches
dl_matrix_image_filter.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_DISPLAY_LIST_EFFECTS_IMAGE_FILTERS_DL_MATRIX_IMAGE_FILTER_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_IMAGE_FILTERS_DL_MATRIX_IMAGE_FILTER_H_
7
9
11
12namespace flutter {
13
14class DlMatrixImageFilter final : public DlImageFilter {
15 public:
19 : DlMatrixImageFilter(filter->matrix_, filter->sampling_) {}
22
23 static std::shared_ptr<DlImageFilter> Make(const DlMatrix& matrix,
25
26 std::shared_ptr<DlImageFilter> shared() const override {
27 return std::make_shared<DlMatrixImageFilter>(this);
28 }
29
31 size_t size() const override { return sizeof(*this); }
32
33 const DlMatrix& matrix() const { return matrix_; }
34 DlImageSampling sampling() const { return sampling_; }
35
36 const DlMatrixImageFilter* asMatrix() const override { return this; }
37
38 bool modifies_transparent_black() const override { return false; }
39
40 DlRect* map_local_bounds(const DlRect& input_bounds,
41 DlRect& output_bounds) const override;
42
43 DlIRect* map_device_bounds(const DlIRect& input_bounds,
44 const DlMatrix& ctm,
45 DlIRect& output_bounds) const override;
46
47 DlIRect* get_input_device_bounds(const DlIRect& output_bounds,
48 const DlMatrix& ctm,
49 DlIRect& input_bounds) const override;
50
51 protected:
52 bool equals_(const DlImageFilter& other) const override;
53
54 private:
55 DlMatrix matrix_;
56 DlImageSampling sampling_;
57};
58
59} // namespace flutter
60
61#endif // FLUTTER_DISPLAY_LIST_EFFECTS_IMAGE_FILTERS_DL_MATRIX_IMAGE_FILTER_H_
DlMatrixImageFilter(const DlMatrixImageFilter *filter)
const DlMatrixImageFilter * asMatrix() const override
DlMatrixImageFilter(const DlMatrixImageFilter &filter)
DlIRect * get_input_device_bounds(const DlIRect &output_bounds, const DlMatrix &ctm, DlIRect &input_bounds) const override
DlImageFilterType type() const override
DlMatrixImageFilter(const DlMatrix &matrix, DlImageSampling sampling)
std::shared_ptr< DlImageFilter > shared() const override
bool modifies_transparent_black() const override
DlRect * map_local_bounds(const DlRect &input_bounds, DlRect &output_bounds) const override
DlIRect * map_device_bounds(const DlIRect &input_bounds, const DlMatrix &ctm, DlIRect &output_bounds) const override
bool equals_(const DlImageFilter &other) const override
const DlMatrix & matrix() const
static std::shared_ptr< DlImageFilter > Make(const DlMatrix &matrix, DlImageSampling sampling)
A 4x4 matrix using column-major storage.
Definition matrix.h:37