Skia
2D Graphics Library
SkColorFilters Class Reference

#include <SkColorFilter.h>

Static Public Member Functions

static sk_sp< SkColorFilterCompose (const sk_sp< SkColorFilter > &outer, sk_sp< SkColorFilter > inner)
 
static sk_sp< SkColorFilterBlend (const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
 
static sk_sp< SkColorFilterBlend (SkColor c, SkBlendMode mode)
 
static sk_sp< SkColorFilterMatrix (const SkColorMatrix &)
 
static sk_sp< SkColorFilterMatrix (const float rowMajor[20])
 
static sk_sp< SkColorFilterHSLAMatrix (const SkColorMatrix &)
 
static sk_sp< SkColorFilterHSLAMatrix (const float rowMajor[20])
 
static sk_sp< SkColorFilterLinearToSRGBGamma ()
 
static sk_sp< SkColorFilterSRGBToLinearGamma ()
 
static sk_sp< SkColorFilterLerp (float t, sk_sp< SkColorFilter > dst, sk_sp< SkColorFilter > src)
 
static sk_sp< SkColorFilterTable (const uint8_t table[256])
 Create a table colorfilter, copying the table into the filter, and applying it to all 4 components. More...
 
static sk_sp< SkColorFilterTableARGB (const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256])
 Create a table colorfilter, with a different table for each component [A, R, G, B]. More...
 
static sk_sp< SkColorFilterTable (sk_sp< SkColorTable > table)
 Create a table colorfilter that holds a ref to the shared color table. More...
 
static sk_sp< SkColorFilterLighting (SkColor mul, SkColor add)
 Create a colorfilter that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255]. More...
 

Member Function Documentation

◆ Blend() [1/2]

static sk_sp<SkColorFilter> SkColorFilters::Blend ( const SkColor4f c,
sk_sp< SkColorSpace ,
SkBlendMode  mode 
)
static

◆ Blend() [2/2]

static sk_sp<SkColorFilter> SkColorFilters::Blend ( SkColor  c,
SkBlendMode  mode 
)
static

◆ Compose()

static sk_sp<SkColorFilter> SkColorFilters::Compose ( const sk_sp< SkColorFilter > &  outer,
sk_sp< SkColorFilter inner 
)
inlinestatic

◆ HSLAMatrix() [1/2]

static sk_sp<SkColorFilter> SkColorFilters::HSLAMatrix ( const float  rowMajor[20])
static

◆ HSLAMatrix() [2/2]

static sk_sp<SkColorFilter> SkColorFilters::HSLAMatrix ( const SkColorMatrix )
static

◆ Lerp()

static sk_sp<SkColorFilter> SkColorFilters::Lerp ( float  t,
sk_sp< SkColorFilter dst,
sk_sp< SkColorFilter src 
)
static

◆ Lighting()

static sk_sp<SkColorFilter> SkColorFilters::Lighting ( SkColor  mul,
SkColor  add 
)
static

Create a colorfilter that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255].

The alpha components of the mul and add arguments are ignored.

◆ LinearToSRGBGamma()

static sk_sp<SkColorFilter> SkColorFilters::LinearToSRGBGamma ( )
static

◆ Matrix() [1/2]

static sk_sp<SkColorFilter> SkColorFilters::Matrix ( const float  rowMajor[20])
static

◆ Matrix() [2/2]

static sk_sp<SkColorFilter> SkColorFilters::Matrix ( const SkColorMatrix )
static

◆ SRGBToLinearGamma()

static sk_sp<SkColorFilter> SkColorFilters::SRGBToLinearGamma ( )
static

◆ Table() [1/2]

static sk_sp<SkColorFilter> SkColorFilters::Table ( const uint8_t  table[256])
static

Create a table colorfilter, copying the table into the filter, and applying it to all 4 components.

a' = table[a]; r' = table[r]; g' = table[g]; b' = table[b]; Components are operated on in unpremultiplied space. If the incomming colors are premultiplied, they are temporarily unpremultiplied, then the table is applied, and then the result is remultiplied.

◆ Table() [2/2]

static sk_sp<SkColorFilter> SkColorFilters::Table ( sk_sp< SkColorTable table)
static

Create a table colorfilter that holds a ref to the shared color table.

◆ TableARGB()

static sk_sp<SkColorFilter> SkColorFilters::TableARGB ( const uint8_t  tableA[256],
const uint8_t  tableR[256],
const uint8_t  tableG[256],
const uint8_t  tableB[256] 
)
static

Create a table colorfilter, with a different table for each component [A, R, G, B].

If a given table is NULL, then it is treated as identity, with the component left unchanged. If a table is not null, then its contents are copied into the filter.


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