| 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 14 of file image_filter.cc.

15 : 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 96 of file image_filter.cc.

97 {
98 return filter_;
99 }

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 19 of file image_filter.cc.

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

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

## ◆ MakeCompose()

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

Definition at line 86 of file image_filter.cc.

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

References GetImageFilter().

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

## ◆ MakeDilate()

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

Definition at line 29 of file image_filter.cc.

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

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

## ◆ MakeErode()

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

Definition at line 38 of file image_filter.cc.

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

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 57 of file image_filter.cc.

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

References impeller::interop::FragmentProgram::FindRuntimeStage(), impeller::interop::Context::GetContext(), flutter::DlRuntimeEffectImpeller::Make(), 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 47 of file image_filter.cc.

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

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