| Flutter Impeller |

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_IMPELLER_TOOLKIT_INTEROP_IMAGE_FILTER_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMAGE_FILTER_H_
7
8 #include "flutter/display_list/effects/dl_image_filter.h"
9 #include "impeller/toolkit/interop/context.h"
10 #include "impeller/toolkit/interop/fragment_program.h"
11 #include "impeller/toolkit/interop/impeller.h"
12 #include "impeller/toolkit/interop/object.h"
13
14 namespace impeller::interop {
15
16 class ImageFilter final
17 : public Object<ImageFilter,
18 IMPELLER_INTERNAL_HANDLE_NAME(ImpellerImageFilter)> {
19 public:
20 static ScopedObject<ImageFilter> MakeBlur(Scalar x_sigma,
21 Scalar y_sigma,
22 flutter::DlTileMode tile_mode);
23
24 static ScopedObject<ImageFilter> MakeDilate(Scalar x_radius, Scalar y_radius);
25
26 static ScopedObject<ImageFilter> MakeErode(Scalar x_radius, Scalar y_radius);
27
28 static ScopedObject<ImageFilter> MakeMatrix(
29 const Matrix& matrix,
30 flutter::DlImageSampling sampling);
31
32 static ScopedObject<ImageFilter> MakeCompose(const ImageFilter& outer,
33 const ImageFilter& inner);
34
35 static ScopedObject<ImageFilter> MakeFragmentProgram(
36 const Context& context,
37 const FragmentProgram& program,
38 std::vector<std::shared_ptr<flutter::DlColorSource>> samplers,
39 std::shared_ptr<std::vector<uint8_t>> uniform_data);
40
41 explicit ImageFilter(std::shared_ptr<flutter::DlImageFilter> filter);
42
43 ~ImageFilter() override;
44
45 ImageFilter(const ImageFilter&) = delete;
46
47 ImageFilter& operator=(const ImageFilter&) = delete;
48
49 const std::shared_ptr<flutter::DlImageFilter>& GetImageFilter() const;
50
51 private:
52 std::shared_ptr<flutter::DlImageFilter> filter_;
53 };
54
55 } // namespace impeller::interop
56
57 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_IMAGE_FILTER_H_
impeller::interop::Context
Definition: context.h:16
impeller::interop::FragmentProgram
Definition: fragment_program.h:17
impeller::interop::ImageFilter
Definition: image_filter.h:18
impeller::interop::ImageFilter::MakeDilate
static ScopedObject< ImageFilter > MakeDilate(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:28
impeller::interop::ImageFilter::~ImageFilter
~ImageFilter() override
impeller::interop::ImageFilter::ImageFilter
ImageFilter(std::shared_ptr< flutter::DlImageFilter > filter)
Definition: image_filter.cc:13
impeller::interop::ImageFilter::MakeFragmentProgram
static ScopedObject< ImageFilter > MakeFragmentProgram(const Context &context, const FragmentProgram &program, std::vector< std::shared_ptr< flutter::DlColorSource >> samplers, std::shared_ptr< std::vector< uint8_t >> uniform_data)
Definition: image_filter.cc:56
impeller::interop::ImageFilter::operator=
ImageFilter & operator=(const ImageFilter &)=delete
impeller::interop::ImageFilter::MakeErode
static ScopedObject< ImageFilter > MakeErode(Scalar x_radius, Scalar y_radius)
Definition: image_filter.cc:37
impeller::interop::ImageFilter::GetImageFilter
const std::shared_ptr< flutter::DlImageFilter > & GetImageFilter() const
Definition: image_filter.cc:95
impeller::interop::ImageFilter::MakeCompose
static ScopedObject< ImageFilter > MakeCompose(const ImageFilter &outer, const ImageFilter &inner)
Definition: image_filter.cc:85
impeller::interop::ImageFilter::ImageFilter
ImageFilter(const ImageFilter &)=delete
impeller::interop::ImageFilter::MakeBlur
static ScopedObject< ImageFilter > MakeBlur(Scalar x_sigma, Scalar y_sigma, flutter::DlTileMode tile_mode)
Definition: image_filter.cc:18
impeller::interop::ImageFilter::MakeMatrix
static ScopedObject< ImageFilter > MakeMatrix(const Matrix &matrix, flutter::DlImageSampling sampling)
Definition: image_filter.cc:46
impeller::interop::Object
Definition: object.h:56
impeller::interop::ScopedObject
Definition: object.h:67
fragment_program.h
impeller.h
impeller::interop
Definition: context_gles.cc:12
impeller::Scalar
float Scalar
Definition: scalar.h:19
object.h
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
context.h