| Flutter Impeller |

Public Member Functions | Static Public Member Functions | List of all members
impeller::interop::ImageFilter Class Referencefinal

`#include <image_filter.h>`

Inheritance diagram for impeller::interop::ImageFilter:

## Public Member Functions
| ImageFilter (std::shared_ptr< flutter::DlImageFilter > filter)
| ~ImageFilter () override
| ImageFilter (const ImageFilter &)=delete
ImageFilter & | operator= (const ImageFilter &)=delete
const std::shared_ptr< flutter::DlImageFilter > & | GetImageFilter () const
Public Member Functions inherited from impeller::interop::ObjectBase
| ObjectBase ()=default
virtual | ~ObjectBase ()=default
| ObjectBase (const ObjectBase &)=delete
| ObjectBase (ObjectBase &&)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
ObjectBase & | operator= (ObjectBase &&)=delete
void | Retain ()
void | Release ()
uint64_t | GetRefCountForTests () const

## Static Public Member Functions
static ScopedObject< ImageFilter > | MakeBlur (Scalar x_sigma, Scalar y_sigma, flutter::DlTileMode tile_mode)
static ScopedObject< ImageFilter > | MakeDilate (Scalar x_radius, Scalar y_radius)
static ScopedObject< ImageFilter > | MakeErode (Scalar x_radius, Scalar y_radius)
static ScopedObject< ImageFilter > | MakeMatrix (const Matrix &matrix, flutter::DlImageSampling sampling)
static ScopedObject< ImageFilter > | MakeCompose (const ImageFilter &outer, const ImageFilter &inner)
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)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Additional Inherited Members
Public Types inherited from impeller::interop::Object< ImageFilter, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerImageFilter)>
using | InteropClass = ImageFilter
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerImageFilter)

## Detailed Description

Definition at line 16 of file image_filter.h.

## Constructor & Destructor Documentation

## ◆ ImageFilter() [1/2]

impeller::interop::ImageFilter::ImageFilter | ( | std::shared_ptr< flutter::DlImageFilter > | filter | ) |
| explicit

Definition at line 13 of file image_filter.cc.

14 : filter_(std::move(filter)) {}

## ◆ ~ImageFilter()

impeller::interop::ImageFilter::~ImageFilter | ( |  | ) |
| override default

## ◆ ImageFilter() [2/2]

impeller::interop::ImageFilter::ImageFilter | ( | const ImageFilter & |  | ) |
| delete

## Member Function Documentation

## ◆ GetImageFilter()

const std::shared_ptr< flutter::DlImageFilter > & impeller::interop::ImageFilter::GetImageFilter | ( |  | ) | const

Definition at line 95 of file image_filter.cc.

96 {
97 return filter_;
98 }

Referenced by MakeCompose(), impeller::interop::DisplayListBuilder::SaveLayer(), and impeller::interop::Paint::SetImageFilter().

## ◆ MakeBlur()

ScopedObject< ImageFilter > impeller::interop::ImageFilter::MakeBlur | ( | Scalar | x_sigma,
|  | Scalar | y_sigma,
|  | flutter::DlTileMode | tile_mode
| ) |  |
| static

Definition at line 18 of file image_filter.cc.

20 {
21 auto filter = flutter::DlBlurImageFilter::Make(x_sigma, y_sigma, tile_mode);
22 if (!filter) {
23 return nullptr;
24 }
25 return Create<ImageFilter>(std::move(filter));
26 }

Referenced by impeller::interop::ImpellerImageFilterCreateBlurNew().

## ◆ MakeCompose()

ScopedObject< ImageFilter > impeller::interop::ImageFilter::MakeCompose | ( | const ImageFilter & | outer,
|  | const ImageFilter & | inner
| ) |  |
| static

Definition at line 85 of file image_filter.cc.

86 {
87 auto filter = flutter::DlComposeImageFilter::Make(outer.GetImageFilter(),
88 inner.GetImageFilter());
89 if (!filter) {
90 return nullptr;
91 }
92 return Create<ImageFilter>(std::move(filter));
93 }

References GetImageFilter().

Referenced by impeller::interop::ImpellerImageFilterCreateComposeNew().

## ◆ MakeDilate()

ScopedObject< ImageFilter > impeller::interop::ImageFilter::MakeDilate | ( | Scalar | x_radius,
|  | Scalar | y_radius
| ) |  |
| static

Definition at line 28 of file image_filter.cc.

29 {
30 auto filter = flutter::DlDilateImageFilter::Make(x_radius, y_radius);
31 if (!filter) {
32 return nullptr;
33 }
34 return Create<ImageFilter>(std::move(filter));
35 }

Referenced by impeller::interop::ImpellerImageFilterCreateDilateNew().

## ◆ MakeErode()

ScopedObject< ImageFilter > impeller::interop::ImageFilter::MakeErode | ( | Scalar | x_radius,
|  | Scalar | y_radius
| ) |  |
| static

Definition at line 37 of file image_filter.cc.

38 {
39 auto filter = flutter::DlErodeImageFilter::Make(x_radius, y_radius);
40 if (!filter) {
41 return nullptr;
42 }
43 return Create<ImageFilter>(std::move(filter));
44 }

Referenced by impeller::interop::ImpellerImageFilterCreateErodeNew().

## ◆ MakeFragmentProgram()

ScopedObject< ImageFilter > impeller::interop::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
| ) |  |
| static

Definition at line 56 of file image_filter.cc.

60 {
61 auto runtime_stage =
62 program.FindRuntimeStage(context.GetContext()->GetRuntimeStageBackend());
63 if (!runtime_stage) {
64 VALIDATION_LOG << "Could not find runtime stage for backend.";
65 return nullptr;
66 }
67 auto runtime_effect =
68 flutter::DlRuntimeEffect::MakeImpeller(std::move(runtime_stage));
69 if (!runtime_effect) {
70 VALIDATION_LOG << "Could not make runtime effect.";
71 return nullptr;
72 }
73 auto filter =
74 flutter::DlRuntimeEffectImageFilter::Make(std::move(runtime_effect), //
75 std::move(samplers), //
76 std::move(uniform_data) //
77 );
78 if (!filter) {
79 VALIDATION_LOG << "Could not create runtime effect image filter.";
80 return nullptr;
81 }
82 return Create<ImageFilter>(std::move(filter));
83 }
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91

References impeller::interop::FragmentProgram::FindRuntimeStage(), impeller::interop::Context::GetContext(), and VALIDATION_LOG.

Referenced by impeller::interop::ImpellerImageFilterCreateFragmentProgramNew().

## ◆ MakeMatrix()

ScopedObject< ImageFilter > impeller::interop::ImageFilter::MakeMatrix | ( | const Matrix & | matrix,
|  | flutter::DlImageSampling | sampling
| ) |  |
| static

Definition at line 46 of file image_filter.cc.

48 {
49 auto filter = flutter::DlMatrixImageFilter::Make(matrix, sampling);
50 if (!filter) {
51 return nullptr;
52 }
53 return Create<ImageFilter>(std::move(filter));
54 }

Referenced by impeller::interop::ImpellerImageFilterCreateMatrixNew().

## ◆ operator=()

ImageFilter& impeller::interop::ImageFilter::operator= | ( | const ImageFilter & |  | ) |
| delete

The documentation for this class was generated from the following files:

- impeller/toolkit/interop/image_filter.h
- impeller/toolkit/interop/image_filter.cc