 |
Flutter Impeller
|
|
Go to the documentation of this file.
22 return std::make_shared<BlendColorFilter>(blend_mode, color);
26 return std::make_shared<MatrixColorFilter>(color_matrix);
30 return std::make_shared<SrgbToLinearColorFilter>();
34 return std::make_shared<LinearToSrgbColorFilter>();
42 : blend_mode_(blend_mode), color_(color) {}
47 std::shared_ptr<FilterInput> input,
51 filter->SetAbsorbOpacity(absorb_opacity);
56 return [filter_blend_mode = blend_mode_, filter_color = color_](
Color color) {
57 return color.Blend(filter_color, filter_blend_mode);
62 return std::make_shared<BlendColorFilter>(*
this);
70 : color_matrix_(color_matrix) {}
75 std::shared_ptr<FilterInput> input,
79 filter->SetAbsorbOpacity(absorb_opacity);
84 return [color_matrix = color_matrix_](
Color color) {
85 return color.ApplyColorMatrix(color_matrix);
90 return std::make_shared<MatrixColorFilter>(*
this);
101 std::shared_ptr<ColorFilterContents>
103 std::shared_ptr<FilterInput> input,
106 filter->SetAbsorbOpacity(absorb_opacity);
112 return [](
Color color) {
return color.SRGBToLinear(); };
116 return std::make_shared<SrgbToLinearColorFilter>(*
this);
127 std::shared_ptr<ColorFilterContents>
129 std::shared_ptr<FilterInput> input,
132 filter->SetAbsorbOpacity(absorb_opacity);
138 return [](
Color color) {
return color.LinearToSRGB(); };
142 return std::make_shared<LinearToSrgbColorFilter>(*
this);
~MatrixColorFilter() override
ColorFilterProc GetCPUColorFilterProc() const override
Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.
std::shared_ptr< ColorFilterContents > WrapWithGPUColorFilter(std::shared_ptr< FilterInput > input, ColorFilterContents::AbsorbOpacity absorb_opacity) const override
Wraps the given filter input with a GPU-based filter that will perform the color operation....
BlendColorFilter(BlendMode blend_mode, Color color)
std::function< Color(Color)> ColorFilterProc
MatrixColorFilter(ColorMatrix color_matrix)
std::shared_ptr< ColorFilterContents > WrapWithGPUColorFilter(std::shared_ptr< FilterInput > input, ColorFilterContents::AbsorbOpacity absorb_opacity) const override
Wraps the given filter input with a GPU-based filter that will perform the color operation....
std::shared_ptr< ColorFilter > Clone() const override
std::shared_ptr< ColorFilter > Clone() const override
LinearToSrgbColorFilter()
static std::shared_ptr< ColorFilter > MakeBlend(BlendMode blend_mode, Color color)
std::shared_ptr< ColorFilter > Clone() const override
~BlendColorFilter() override
std::shared_ptr< ColorFilterContents > WrapWithGPUColorFilter(std::shared_ptr< FilterInput > input, ColorFilterContents::AbsorbOpacity absorb_opacity) const override
Wraps the given filter input with a GPU-based filter that will perform the color operation....
~SrgbToLinearColorFilter() override
static std::shared_ptr< ColorFilterContents > MakeSrgbToLinearFilter(FilterInput::Ref input)
std::shared_ptr< ColorFilterContents > WrapWithGPUColorFilter(std::shared_ptr< FilterInput > input, ColorFilterContents::AbsorbOpacity absorb_opacity) const override
Wraps the given filter input with a GPU-based filter that will perform the color operation....
SrgbToLinearColorFilter()
std::shared_ptr< ColorFilter > Clone() const override
static std::shared_ptr< ColorFilter > MakeMatrix(ColorMatrix color_matrix)
ColorFilterProc GetCPUColorFilterProc() const override
Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.
static std::shared_ptr< ColorFilter > MakeLinearToSrgb()
~LinearToSrgbColorFilter() override
static std::shared_ptr< ColorFilterContents > MakeColorMatrix(FilterInput::Ref input, const ColorMatrix &color_matrix)
static std::shared_ptr< ColorFilter > MakeSrgbToLinear()
ColorFilterProc GetCPUColorFilterProc() const override
Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.
ColorFilterProc GetCPUColorFilterProc() const override
Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.
static std::shared_ptr< ColorFilterContents > MakeBlend(BlendMode blend_mode, FilterInput::Vector inputs, std::optional< Color > foreground_color=std::nullopt)
the [inputs] are expected to be in the order of dst, src.