Flutter Engine
The Flutter Engine
Enumerations | Functions
SkAlphaType.h File Reference

Go to the source code of this file.

Enumerations

enum  SkAlphaType : int {
  kUnknown_SkAlphaType , kOpaque_SkAlphaType , kPremul_SkAlphaType , kUnpremul_SkAlphaType ,
  kLastEnum_SkAlphaType = kUnpremul_SkAlphaType
}
 

Functions

static bool SkAlphaTypeIsOpaque (SkAlphaType at)
 

Enumeration Type Documentation

◆ SkAlphaType

enum SkAlphaType : int

Describes how to interpret the alpha component of a pixel. A pixel may be opaque, or alpha, describing multiple levels of transparency.

In simple blending, alpha weights the draw color and the destination color to create a new color. If alpha describes a weight from zero to one:

new color = draw color * alpha + destination color * (1 - alpha)

In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.

RGB may have alpha included in each component value; the stored value is the original RGB multiplied by alpha. Premultiplied color components improve performance.

Enumerator
kUnknown_SkAlphaType 

uninitialized

kOpaque_SkAlphaType 

pixel is opaque

kPremul_SkAlphaType 

pixel components are premultiplied by alpha

kUnpremul_SkAlphaType 

pixel components are independent of alpha

kLastEnum_SkAlphaType 

last valid value

Definition at line 26 of file SkAlphaType.h.

26 : int {
27 kUnknown_SkAlphaType, //!< uninitialized
28 kOpaque_SkAlphaType, //!< pixel is opaque
29 kPremul_SkAlphaType, //!< pixel components are premultiplied by alpha
30 kUnpremul_SkAlphaType, //!< pixel components are independent of alpha
31 kLastEnum_SkAlphaType = kUnpremul_SkAlphaType, //!< last valid value
32};
@ kUnknown_SkAlphaType
uninitialized
Definition: SkAlphaType.h:27
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kUnpremul_SkAlphaType
pixel components are independent of alpha
Definition: SkAlphaType.h:30
@ kLastEnum_SkAlphaType
last valid value
Definition: SkAlphaType.h:31

Function Documentation

◆ SkAlphaTypeIsOpaque()

static bool SkAlphaTypeIsOpaque ( SkAlphaType  at)
inlinestatic

Returns true if SkAlphaType equals kOpaque_SkAlphaType.

kOpaque_SkAlphaType is a hint that the SkColorType is opaque, or that all alpha values are set to their 1.0 equivalent. If SkAlphaType is kOpaque_SkAlphaType, and SkColorType is not opaque, then the result of drawing any pixel with a alpha value less than 1.0 is undefined.

Definition at line 41 of file SkAlphaType.h.

41 {
42 return kOpaque_SkAlphaType == at;
43}