| Flutter Impeller |

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

`#include <color_source.h>`

Inheritance diagram for impeller::interop::ColorSource:

## Public Member Functions
| ColorSource (std::shared_ptr< flutter::DlColorSource > source)
| ~ColorSource () override
| ColorSource (const ColorSource &)=delete
ColorSource & | operator= (const ColorSource &)=delete
bool | IsValid () const
const std::shared_ptr< flutter::DlColorSource > & | GetColorSource () 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< ColorSource > | MakeLinearGradient (const Point &start_point, const Point &end_point, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
static ScopedObject< ColorSource > | MakeRadialGradient (const Point &center, Scalar radius, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
static ScopedObject< ColorSource > | MakeConicalGradient (const Point &start_center, Scalar start_radius, const Point &end_center, Scalar end_radius, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
static ScopedObject< ColorSource > | MakeSweepGradient (const Point &center, Scalar start, Scalar end, const std::vector< flutter::DlColor > &colors, const std::vector< Scalar > &stops, flutter::DlTileMode tile_mode, const Matrix &transformation)
static ScopedObject< ColorSource > | MakeImage (const Texture &image, flutter::DlTileMode horizontal_tile_mode, flutter::DlTileMode vertical_tile_mode, flutter::DlImageSampling sampling, const Matrix &transformation)
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< ColorSource, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerColorSource)>
using | InteropClass = ColorSource
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerColorSource)

## Detailed Description

Definition at line 21 of file color_source.h.

## Constructor & Destructor Documentation

## ◆ ColorSource() [1/2]

impeller::interop::ColorSource::ColorSource | ( | std::shared_ptr< flutter::DlColorSource > | source | ) |
| explicit

Definition at line 114 of file color_source.cc.

115 : color_source_(std::move(source)) {}

## ◆ ~ColorSource()

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

## ◆ ColorSource() [2/2]

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

## Member Function Documentation

## ◆ GetColorSource()

const std::shared_ptr< flutter::DlColorSource > & impeller::interop::ColorSource::GetColorSource | ( |  | ) | const

Definition at line 123 of file color_source.cc.

124 {
125 return color_source_;
126 }

Referenced by impeller::interop::Paint::SetColorSource().

## ◆ IsValid()

bool impeller::interop::ColorSource::IsValid | ( |  | ) | const

Definition at line 119 of file color_source.cc.

119 {
120 return !!color_source_;
121 }

## ◆ MakeConicalGradient()

ScopedObject< ColorSource > impeller::interop::ColorSource::MakeConicalGradient | ( | const Point & | start_center,
|  | Scalar | start_radius,
|  | const Point & | end_center,
|  | Scalar | end_radius,
|  | const std::vector< flutter::DlColor > & | colors,
|  | const std::vector< Scalar > & | stops,
|  | flutter::DlTileMode | tile_mode,
|  | const Matrix & | transformation
| ) |  |
| static

Definition at line 51 of file color_source.cc.

59 {
60 auto dl_filter = flutter::DlColorSource::MakeConical(start_center, //
61 start_radius, //
62 end_center, //
63 end_radius, //
64 stops.size(), //
65 colors.data(), //
66 stops.data(), //
67 tile_mode, //
68 &transformation //
69 );
70 if (!dl_filter) {
71 return nullptr;
72 }
73 return Create<ColorSource>(std::move(dl_filter));
74 }

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

## ◆ MakeImage()

ScopedObject< ColorSource > impeller::interop::ColorSource::MakeImage | ( | const Texture & | image,
|  | flutter::DlTileMode | horizontal_tile_mode,
|  | flutter::DlTileMode | vertical_tile_mode,
|  | flutter::DlImageSampling | sampling,
|  | const Matrix & | transformation
| ) |  |
| static

Definition at line 99 of file color_source.cc.

104 {
105 auto dl_filter = flutter::DlColorSource::MakeImage(image.MakeImage(), //
106 horizontal_tile_mode, //
107 vertical_tile_mode, //
108 sampling, //
109 &transformation //
110 );
111 return Create<ColorSource>(std::move(dl_filter));
112 }

References impeller::interop::Texture::MakeImage().

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

## ◆ MakeLinearGradient()

ScopedObject< ColorSource > impeller::interop::ColorSource::MakeLinearGradient | ( | const Point & | start_point,
|  | const Point & | end_point,
|  | const std::vector< flutter::DlColor > & | colors,
|  | const std::vector< Scalar > & | stops,
|  | flutter::DlTileMode | tile_mode,
|  | const Matrix & | transformation
| ) |  |
| static

Definition at line 9 of file color_source.cc.

15 {
16 auto dl_filter = flutter::DlColorSource::MakeLinear(start_point, //
17 end_point, //
18 stops.size(), //
19 colors.data(), //
20 stops.data(), //
21 tile_mode, //
22 &transformation //
23 );
24 if (!dl_filter) {
25 return nullptr;
26 }
27 return Create<ColorSource>(std::move(dl_filter));
28 }

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

## ◆ MakeRadialGradient()

ScopedObject< ColorSource > impeller::interop::ColorSource::MakeRadialGradient | ( | const Point & | center,
|  | Scalar | radius,
|  | const std::vector< flutter::DlColor > & | colors,
|  | const std::vector< Scalar > & | stops,
|  | flutter::DlTileMode | tile_mode,
|  | const Matrix & | transformation
| ) |  |
| static

Definition at line 30 of file color_source.cc.

36 {
37 auto dl_filter = flutter::DlColorSource::MakeRadial(center, //
38 radius, //
39 stops.size(), //
40 colors.data(), //
41 stops.data(), //
42 tile_mode, //
43 &transformation //
44 );
45 if (!dl_filter) {
46 return nullptr;
47 }
48 return Create<ColorSource>(std::move(dl_filter));
49 }

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

## ◆ MakeSweepGradient()

ScopedObject< ColorSource > impeller::interop::ColorSource::MakeSweepGradient | ( | const Point & | center,
|  | Scalar | start,
|  | Scalar | end,
|  | const std::vector< flutter::DlColor > & | colors,
|  | const std::vector< Scalar > & | stops,
|  | flutter::DlTileMode | tile_mode,
|  | const Matrix & | transformation
| ) |  |
| static

Definition at line 76 of file color_source.cc.

83 {
84 auto dl_filter = flutter::DlColorSource::MakeSweep(center, //
85 start, //
86 end, //
87 stops.size(), //
88 colors.data(), //
89 stops.data(), //
90 tile_mode, //
91 &transformation //
92 );
93 if (!dl_filter) {
94 return nullptr;
95 }
96 return Create<ColorSource>(std::move(dl_filter));
97 }

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

## ◆ operator=()

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

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

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