Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::ImageFilter Class Reference

#include <image_filter.h>

Inheritance diagram for flutter::ImageFilter:
flutter::RefCountedDartWrappable< ImageFilter > fml::RefCountedThreadSafe< ImageFilter > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

 ~ImageFilter () override
 
void initBlur (double sigma_x, double sigma_y, DlTileMode tile_mode)
 
void initDilate (double radius_x, double radius_y)
 
void initErode (double radius_x, double radius_y)
 
void initMatrix (const tonic::Float64List &matrix4, int filter_quality_index)
 
void initColorFilter (ColorFilter *colorFilter)
 
void initComposeFilter (ImageFilter *outer, ImageFilter *inner)
 
const std::shared_ptr< const DlImageFilterfilter () const
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< ImageFilter >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< ImageFilter >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
virtual void RetainDartWrappableReference () const =0
 
virtual void ReleaseDartWrappableReference () const =0
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static void Create (Dart_Handle wrapper)
 
static DlImageSampling SamplingFromIndex (int filterQualityIndex)
 
static DlFilterMode FilterModeFromIndex (int index)
 
static void RegisterNatives (tonic::DartLibraryNatives *natives)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields { kPeerIndex , kNumberOfNativeFields }
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< ImageFilter >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 20 of file image_filter.h.

Constructor & Destructor Documentation

◆ ~ImageFilter()

flutter::ImageFilter::~ImageFilter ( )
override

Definition at line 52 of file image_filter.cc.

52{}

Member Function Documentation

◆ Create()

void flutter::ImageFilter::Create ( Dart_Handle  wrapper)
static

Definition at line 19 of file image_filter.cc.

19 {
21 auto res = fml::MakeRefCounted<ImageFilter>();
22 res->AssociateWithDartWrapper(wrapper);
23}
static void ThrowIfUIOperationsProhibited()

◆ filter()

const std::shared_ptr< const DlImageFilter > flutter::ImageFilter::filter ( ) const
inline

Definition at line 38 of file image_filter.h.

38{ return filter_; }

◆ FilterModeFromIndex()

DlFilterMode flutter::ImageFilter::FilterModeFromIndex ( int  index)
static

Definition at line 43 of file image_filter.cc.

43 {
44 if (filterQualityIndex <= 0) {
46 }
48}

◆ initBlur()

void flutter::ImageFilter::initBlur ( double  sigma_x,
double  sigma_y,
DlTileMode  tile_mode 
)

Definition at line 54 of file image_filter.cc.

56 {
57 filter_ = DlBlurImageFilter::Make(SafeNarrow(sigma_x), SafeNarrow(sigma_y),
58 tile_mode);
59}
static std::shared_ptr< DlImageFilter > Make(SkScalar sigma_x, SkScalar sigma_y, DlTileMode tile_mode)
static float SafeNarrow(double value)

◆ initColorFilter()

void flutter::ImageFilter::initColorFilter ( ColorFilter colorFilter)

Definition at line 77 of file image_filter.cc.

77 {
78 FML_DCHECK(colorFilter);
79 filter_ = DlColorFilterImageFilter::Make(colorFilter->filter());
80}
static std::shared_ptr< DlImageFilter > Make(const std::shared_ptr< const DlColorFilter > &filter)
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ initComposeFilter()

void flutter::ImageFilter::initComposeFilter ( ImageFilter outer,
ImageFilter inner 
)

Definition at line 82 of file image_filter.cc.

82 {
83 FML_DCHECK(outer && inner);
84 filter_ = DlComposeImageFilter::Make(outer->filter(), inner->filter());
85}
static std::shared_ptr< const DlImageFilter > Make(std::shared_ptr< const DlImageFilter > outer, std::shared_ptr< const DlImageFilter > inner)

◆ initDilate()

void flutter::ImageFilter::initDilate ( double  radius_x,
double  radius_y 
)

Definition at line 61 of file image_filter.cc.

61 {
62 filter_ =
64}
static std::shared_ptr< DlImageFilter > Make(SkScalar radius_x, SkScalar radius_y)

◆ initErode()

void flutter::ImageFilter::initErode ( double  radius_x,
double  radius_y 
)

Definition at line 66 of file image_filter.cc.

66 {
67 filter_ =
69}
static std::shared_ptr< DlImageFilter > Make(SkScalar radius_x, SkScalar radius_y)

◆ initMatrix()

void flutter::ImageFilter::initMatrix ( const tonic::Float64List &  matrix4,
int  filter_quality_index 
)

Definition at line 71 of file image_filter.cc.

72 {
73 auto sampling = ImageFilter::SamplingFromIndex(filterQualityIndex);
75}
static std::shared_ptr< DlImageFilter > Make(const SkMatrix &matrix, DlImageSampling sampling)
static DlImageSampling SamplingFromIndex(int filterQualityIndex)
Definition: image_filter.cc:32
SkSamplingOptions sampling
Definition: SkRecords.h:337
constexpr SkMatrix ToSkMatrix(const DlMatrix &matrix)

◆ RegisterNatives()

static void flutter::ImageFilter::RegisterNatives ( tonic::DartLibraryNatives natives)
static

◆ SamplingFromIndex()

DlImageSampling flutter::ImageFilter::SamplingFromIndex ( int  filterQualityIndex)
static

Definition at line 32 of file image_filter.cc.

32 {
33 if (filterQualityIndex < 0) {
34 return kFilterQualities.front();
35 } else if (static_cast<size_t>(filterQualityIndex) >=
36 kFilterQualities.size()) {
37 return kFilterQualities.back();
38 } else {
39 return kFilterQualities[filterQualityIndex];
40 }
41}
static const std::array< DlImageSampling, 4 > kFilterQualities
Definition: image_filter.cc:25

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