| Flutter Impeller |

Public Member Functions | List of all members
impeller::LinearToSrgbColorFilter Class Referencefinal

`#include <color_filter.h>`

Inheritance diagram for impeller::LinearToSrgbColorFilter:

## Public Member Functions
| LinearToSrgbColorFilter ()
| ~LinearToSrgbColorFilter () 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. The given input will first be rendered to a texture and then filtered. More...
ColorFilterProc | GetCPUColorFilterProc () const override
| Returns a function that can be used to filter unpremultiplied Impeller Colors on the CPU. More...
std::shared_ptr< ColorFilter > | Clone () const override
Public Member Functions inherited from impeller::ColorFilter
| ColorFilter ()
virtual | ~ColorFilter ()

## Additional Inherited Members
Public Types inherited from impeller::ColorFilter
using | ColorFilterProc = std::function< Color(Color)>
Static Public Member Functions inherited from impeller::ColorFilter
static std::shared_ptr< ColorFilter > | MakeBlend (BlendMode blend_mode, Color color)
static std::shared_ptr< ColorFilter > | MakeMatrix (ColorMatrix color_matrix)
static std::shared_ptr< ColorFilter > | MakeSrgbToLinear ()
static std::shared_ptr< ColorFilter > | MakeLinearToSrgb ()
static std::shared_ptr< ColorFilter > | MakeComposed (const std::shared_ptr< ColorFilter > &outer, const std::shared_ptr< ColorFilter > &inner)

## Detailed Description

Definition at line 137 of file color_filter.h.

## Constructor & Destructor Documentation

## ◆ LinearToSrgbColorFilter()

impeller::LinearToSrgbColorFilter::LinearToSrgbColorFilter | ( |  | ) |
| explicit default

## ◆ ~LinearToSrgbColorFilter()

impeller::LinearToSrgbColorFilter::~LinearToSrgbColorFilter | ( |  | ) |
| override default

## Member Function Documentation

## ◆ Clone()

std::shared_ptr< ColorFilter > impeller::LinearToSrgbColorFilter::Clone | ( |  | ) | const
| override virtual

Implements impeller::ColorFilter.

Definition at line 150 of file color_filter.cc.

150 {
151 return std::make_shared<LinearToSrgbColorFilter>(*this);
152 }

## ◆ GetCPUColorFilterProc()

ColorFilter::ColorFilterProc impeller::LinearToSrgbColorFilter::GetCPUColorFilterProc | ( |  | ) | const
| override virtual

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

Implements impeller::ColorFilter.

Definition at line 145 of file color_filter.cc.

146 {
147 return [](Color color) { return color.LinearToSRGB(); };
148 }

References color.

## ◆ WrapWithGPUColorFilter()

std::shared_ptr< ColorFilterContents > impeller::LinearToSrgbColorFilter::WrapWithGPUColorFilter | ( | std::shared_ptr< FilterInput > | input,
|  | ColorFilterContents::AbsorbOpacity | absorb_opacity
| ) |  | const
| override 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.

Implements impeller::ColorFilter.

Definition at line 137 of file color_filter.cc.

139 {
140 auto filter = ColorFilterContents::MakeSrgbToLinearFilter({std::move(input)});
141 filter->SetAbsorbOpacity(absorb_opacity);
142 return filter;
143 }

References impeller::ColorFilterContents::MakeSrgbToLinearFilter().

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

- impeller/aiks/color_filter.h
- impeller/aiks/color_filter.cc

impeller::ColorFilterContents::MakeSrgbToLinearFilter
static std::shared_ptr< ColorFilterContents > MakeSrgbToLinearFilter(FilterInput::Ref input)
Definition: color_filter_contents.cc:75
color
DlColor color
Definition: dl_golden_blur_unittests.cc:23