Flutter Impeller
impeller::TextureFilterInput Class Referencefinal

#include <texture_filter_input.h>

Inheritance diagram for impeller::TextureFilterInput:
impeller::FilterInput

Public Member Functions

 ~TextureFilterInput () override
 
std::optional< SnapshotGetSnapshot (std::string_view label, const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit, int32_t mip_count) const override
 
std::optional< RectGetCoverage (const Entity &entity) const override
 
Matrix GetLocalTransform (const Entity &entity) const override
 Get the local transform of this filter input. This transform is relative to the Entity transform space. More...
 
- Public Member Functions inherited from impeller::FilterInput
virtual ~FilterInput ()
 
std::optional< RectGetLocalCoverage (const Entity &entity) const
 
virtual std::optional< RectGetSourceCoverage (const Matrix &effect_transform, const Rect &output_limit) const
 
virtual Matrix GetTransform (const Entity &entity) const
 Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocalTransform(). More...
 
virtual void SetEffectTransform (const Matrix &matrix)
 Sets the effect transform of filter inputs. More...
 
virtual void SetRenderingMode (Entity::RenderingMode rendering_mode)
 Turns on subpass mode for filter inputs. More...
 

Additional Inherited Members

- Public Types inherited from impeller::FilterInput
using Ref = std::shared_ptr< FilterInput >
 
using Vector = std::vector< FilterInput::Ref >
 
using Variant = std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect >
 
- Static Public Member Functions inherited from impeller::FilterInput
static FilterInput::Ref Make (Variant input, bool msaa_enabled=true)
 
static FilterInput::Ref Make (std::shared_ptr< Texture > input, Matrix local_transform)
 
static FilterInput::Vector Make (std::initializer_list< Variant > inputs)
 

Detailed Description

Definition at line 14 of file texture_filter_input.h.

Constructor & Destructor Documentation

◆ ~TextureFilterInput()

impeller::TextureFilterInput::~TextureFilterInput ( )
overridedefault

Member Function Documentation

◆ GetCoverage()

std::optional< Rect > impeller::TextureFilterInput::GetCoverage ( const Entity entity) const
overridevirtual

Implements impeller::FilterInput.

Definition at line 34 of file texture_filter_input.cc.

35  {
36  return Rect::MakeSize(texture_->GetSize())
37  .TransformBounds(GetTransform(entity));
38 }
virtual Matrix GetTransform(const Entity &entity) const
Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocal...
Definition: filter_input.cc:75
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:476
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:150

◆ GetLocalTransform()

Matrix impeller::TextureFilterInput::GetLocalTransform ( const Entity entity) const
overridevirtual

Get the local transform of this filter input. This transform is relative to the Entity transform space.

Reimplemented from impeller::FilterInput.

Definition at line 40 of file texture_filter_input.cc.

40  {
41  return local_transform_;
42 }

◆ GetSnapshot()

std::optional< Snapshot > impeller::TextureFilterInput::GetSnapshot ( std::string_view  label,
const ContentContext renderer,
const Entity entity,
std::optional< Rect coverage_limit,
int32_t  mip_count 
) const
overridevirtual

Implements impeller::FilterInput.

Definition at line 19 of file texture_filter_input.cc.

24  {
25  auto snapshot =
26  Snapshot{.texture = texture_, .transform = GetTransform(entity)};
27  if (texture_->GetMipCount() > 1) {
28  snapshot.sampler_descriptor.label = "TextureFilterInput Trilinear Sampler";
29  snapshot.sampler_descriptor.mip_filter = MipFilter::kLinear;
30  }
31  return snapshot;
32 }
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.

References impeller::Snapshot::texture.


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