 |
Flutter Impeller
|
|
Go to the documentation of this file.
19 std::unique_ptr<Geometry> geometry;
35 std::shared_ptr<Geometry> geometry)
const {
43 contents->ApplyColorFilter(
color_filter->GetCPUColorFilterProc())) {
44 needs_color_filter =
false;
47 contents->SetGeometry(std::move(geometry));
60 std::shared_ptr<Contents> input)
const {
62 input = WithInvertFilter(input);
72 std::shared_ptr<Contents> input,
73 const Matrix& effect_transform)
const {
84 bool is_solid_color)
const {
94 const Matrix& effect_transform,
100 filter->SetRenderingMode(rendering_mode);
101 filter->SetEffectTransform(effect_transform);
105 std::shared_ptr<Contents> Paint::WithColorFilter(
106 std::shared_ptr<Contents> input,
121 if (input->ApplyColorFilter(
color_filter->GetCPUColorFilterProc())) {
136 1.0, 1.0, 1.0, 1.0, 0
141 std::shared_ptr<Contents> Paint::WithInvertFilter(
142 std::shared_ptr<Contents> input)
const {
152 std::shared_ptr<ColorSourceContents> color_source_contents,
153 const std::shared_ptr<ColorFilter>& color_filter)
const {
156 if (color_source_contents->IsSolidColor() && !
color_filter) {
164 auto mask = std::make_shared<SolidColorContents>();
166 mask->SetGeometry(color_source_contents->GetGeometry());
177 auto expanded_local_bounds = blurred_mask->GetCoverage({});
178 if (!expanded_local_bounds.has_value()) {
181 color_source_contents->SetGeometry(
184 std::shared_ptr<Contents> color_contents = color_source_contents;
203 bool is_solid_color)
const {
204 if (is_solid_color) {
std::shared_ptr< Contents > WithMaskBlur(std::shared_ptr< Contents > input, bool is_solid_color) const
std::shared_ptr< ColorSourceContents > GetContents(const Paint &paint) const
std::shared_ptr< Contents > CreateContentsForEntity(const Path &path={}, bool cover=false) const
FilterContents::BlurStyle style
static std::unique_ptr< Geometry > MakeRect(Rect rect)
std::shared_ptr< FilterContents > CreateMaskBlur(std::shared_ptr< ColorSourceContents > color_source_contents, const std::shared_ptr< ColorFilter > &color_filter) const
std::shared_ptr< ColorFilter > color_filter
static std::shared_ptr< FilterContents > MakeGaussianBlur(const FilterInput::Ref &input, Sigma sigma_x, Sigma sigma_y, BlurStyle blur_style=BlurStyle::kNormal, Entity::TileMode tile_mode=Entity::TileMode::kDecal)
constexpr ColorMatrix kColorInversion
A color matrix which inverts colors.
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
static std::unique_ptr< Geometry > MakeStrokePath(const Path &path, Scalar stroke_width=0.0, Scalar miter_limit=4.0, Cap stroke_cap=Cap::kButt, Join stroke_join=Join::kMiter)
static constexpr Color White()
static std::shared_ptr< FilterContents > MakeBorderMaskBlur(FilterInput::Ref input, Sigma sigma_x, Sigma sigma_y, BlurStyle blur_style=BlurStyle::kNormal)
static std::unique_ptr< Geometry > MakeCover()
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform, Entity::RenderingMode rendering_mode) const
static std::unique_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
std::shared_ptr< Contents > CreateContentsForGeometry(std::shared_ptr< Geometry > geometry) const
static std::shared_ptr< ColorFilterContents > MakeColorMatrix(FilterInput::Ref input, const ColorMatrix &color_matrix)
bool HasColorFilter() const
Whether this paint has a color filter that can apply opacity.
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.
std::optional< MaskBlurDescriptor > mask_blur_descriptor
std::shared_ptr< Contents > WithFilters(std::shared_ptr< Contents > input) const
Wrap this paint's configured filters to the given contents.
A 4x4 matrix using column-major storage.
std::shared_ptr< Contents > WithFiltersForSubpassTarget(std::shared_ptr< Contents > input, const Matrix &effect_transform=Matrix()) const
Wrap this paint's configured filters to the given contents of subpass target.
std::shared_ptr< ImageFilter > image_filter