Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
SkUnPreMultiply Class Reference

#include <SkUnPreMultiply.h>

Public Types

typedef uint32_t Scale
 

Static Public Member Functions

static const ScaleGetScaleTable ()
 
static Scale GetScale (U8CPU alpha)
 
static U8CPU ApplyScale (Scale scale, U8CPU component)
 
static SkColor PMColorToColor (SkPMColor c)
 

Detailed Description

Definition at line 17 of file SkUnPreMultiply.h.

Member Typedef Documentation

◆ Scale

typedef uint32_t SkUnPreMultiply::Scale

Definition at line 19 of file SkUnPreMultiply.h.

Member Function Documentation

◆ ApplyScale()

static U8CPU SkUnPreMultiply::ApplyScale ( Scale  scale,
U8CPU  component 
)
inlinestatic

Usage:

const Scale* table = SkUnPreMultiply::GetScaleTable();

for (...) { unsigned a = ... SkUnPreMultiply::Scale scale = table[a];

red = SkUnPreMultiply::ApplyScale(scale, red); ... now red is unpremultiplied }

Definition at line 44 of file SkUnPreMultiply.h.

44 {
45 SkASSERT(component <= 255);
46 return (scale * component + (1 << 23)) >> 24;
47 }
#define SkASSERT(cond)
Definition SkAssert.h:116
const Scalar scale

◆ GetScale()

static Scale SkUnPreMultiply::GetScale ( U8CPU  alpha)
inlinestatic

Definition at line 26 of file SkUnPreMultiply.h.

26 {
27 SkASSERT(alpha <= 255);
28 return gTable[alpha];
29 }

◆ GetScaleTable()

static const Scale * SkUnPreMultiply::GetScaleTable ( )
inlinestatic

Definition at line 22 of file SkUnPreMultiply.h.

22 {
23 return gTable;
24 }

◆ PMColorToColor()

SkColor SkUnPreMultiply::PMColorToColor ( SkPMColor  c)
static

Definition at line 11 of file SkUnPreMultiply.cpp.

11 {
12 const unsigned a = SkGetPackedA32(c);
13 const Scale scale = GetScale(a);
14 return SkColorSetARGB(a,
18}
#define SkGetPackedB32(packed)
Definition SkColorPriv.h:95
#define SkGetPackedR32(packed)
Definition SkColorPriv.h:93
#define SkGetPackedA32(packed)
Definition SkColorPriv.h:92
#define SkGetPackedG32(packed)
Definition SkColorPriv.h:94
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition SkColor.h:49
static U8CPU ApplyScale(Scale scale, U8CPU component)
static Scale GetScale(U8CPU alpha)
struct MyStruct a[10]

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