Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
impeller::ColorFilter Class Referenceabstract

#include <color_filter.h>

Inheritance diagram for impeller::ColorFilter:
impeller::BlendColorFilter impeller::ComposedColorFilter impeller::LinearToSrgbColorFilter impeller::MatrixColorFilter impeller::SrgbToLinearColorFilter

Public Types

using ColorFilterProc = std::function< Color(Color)>
 

Public Member Functions

 ColorFilter ()
 
virtual ~ColorFilter ()
 
virtual std::shared_ptr< ColorFilterContentsWrapWithGPUColorFilter (std::shared_ptr< FilterInput > input, ColorFilterContents::AbsorbOpacity absorb_opacity) const =0
 Wraps the given filter input with a GPU-based filter that will perform the color operation. The given input will first be rendered to a texture and then filtered.
 
virtual ColorFilterProc GetCPUColorFilterProc () const =0
 Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.
 
virtual std::shared_ptr< ColorFilterClone () const =0
 

Static Public Member Functions

static std::shared_ptr< ColorFilterMakeBlend (BlendMode blend_mode, Color color)
 
static std::shared_ptr< ColorFilterMakeMatrix (ColorMatrix color_matrix)
 
static std::shared_ptr< ColorFilterMakeSrgbToLinear ()
 
static std::shared_ptr< ColorFilterMakeLinearToSrgb ()
 
static std::shared_ptr< ColorFilterMakeComposed (const std::shared_ptr< ColorFilter > &outer, const std::shared_ptr< ColorFilter > &inner)
 

Detailed Description

Definition at line 19 of file color_filter.h.

Member Typedef Documentation

◆ ColorFilterProc

A procedure that filters a given unpremultiplied color to produce a new unpremultiplied color.

Definition at line 23 of file color_filter.h.

Constructor & Destructor Documentation

◆ ColorFilter()

impeller::ColorFilter::ColorFilter ( )
default

◆ ~ColorFilter()

impeller::ColorFilter::~ColorFilter ( )
virtualdefault

Member Function Documentation

◆ Clone()

virtual std::shared_ptr< ColorFilter > impeller::ColorFilter::Clone ( ) const
pure virtual

◆ GetCPUColorFilterProc()

virtual ColorFilterProc impeller::ColorFilter::GetCPUColorFilterProc ( ) const
pure virtual

Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU.

Implemented in impeller::BlendColorFilter, impeller::MatrixColorFilter, impeller::SrgbToLinearColorFilter, impeller::LinearToSrgbColorFilter, and impeller::ComposedColorFilter.

◆ MakeBlend()

std::shared_ptr< ColorFilter > impeller::ColorFilter::MakeBlend ( BlendMode  blend_mode,
Color  color 
)
static

Definition at line 23 of file color_filter.cc.

24 {
25 return std::make_shared<BlendColorFilter>(blend_mode, color);
26}
SkColor4f color

◆ MakeComposed()

std::shared_ptr< ColorFilter > impeller::ColorFilter::MakeComposed ( const std::shared_ptr< ColorFilter > &  outer,
const std::shared_ptr< ColorFilter > &  inner 
)
static

Definition at line 40 of file color_filter.cc.

42 {
43 return std::make_shared<ComposedColorFilter>(outer, inner);
44}

◆ MakeLinearToSrgb()

std::shared_ptr< ColorFilter > impeller::ColorFilter::MakeLinearToSrgb ( )
static

Definition at line 36 of file color_filter.cc.

36 {
37 return std::make_shared<LinearToSrgbColorFilter>();
38}

◆ MakeMatrix()

std::shared_ptr< ColorFilter > impeller::ColorFilter::MakeMatrix ( ColorMatrix  color_matrix)
static

Definition at line 28 of file color_filter.cc.

28 {
29 return std::make_shared<MatrixColorFilter>(color_matrix);
30}

◆ MakeSrgbToLinear()

std::shared_ptr< ColorFilter > impeller::ColorFilter::MakeSrgbToLinear ( )
static

Definition at line 32 of file color_filter.cc.

32 {
33 return std::make_shared<SrgbToLinearColorFilter>();
34}

◆ WrapWithGPUColorFilter()

virtual std::shared_ptr< ColorFilterContents > impeller::ColorFilter::WrapWithGPUColorFilter ( std::shared_ptr< FilterInput input,
ColorFilterContents::AbsorbOpacity  absorb_opacity 
) const
pure virtual

Wraps the given filter input with a GPU-based filter that will perform the color operation. The given input will first be rendered to a texture and then filtered.

Note that this operation has no consideration for the original geometry mask of the filter input. And the entire input texture is treated as color information.

Implemented in impeller::BlendColorFilter, impeller::MatrixColorFilter, impeller::SrgbToLinearColorFilter, impeller::LinearToSrgbColorFilter, and impeller::ComposedColorFilter.


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