Flutter Engine
The Flutter Engine
|
#include "include/core/SkAlphaType.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkCPUTypes.h"
#include <array>
#include <cstdint>
Go to the source code of this file.
Classes | |
struct | SkRGBA4f< kAT > |
Namespaces | |
namespace | SkColors |
Macros | |
#define | SkColorSetRGB(r, g, b) SkColorSetARGB(0xFF, r, g, b) |
#define | SkColorGetA(color) (((color) >> 24) & 0xFF) |
#define | SkColorGetR(color) (((color) >> 16) & 0xFF) |
#define | SkColorGetG(color) (((color) >> 8) & 0xFF) |
#define | SkColorGetB(color) (((color) >> 0) & 0xFF) |
Typedefs | |
typedef uint8_t | SkAlpha |
typedef uint32_t | SkColor |
typedef uint32_t | SkPMColor |
using | SkColor4f = SkRGBA4f< kUnpremul_SkAlphaType > |
Enumerations | |
enum class | SkColorChannel { kR , kG , kB , kA , kLastEnum = kA } |
enum | SkColorChannelFlag : uint32_t { kRed_SkColorChannelFlag = 1 << static_cast<uint32_t>(SkColorChannel::kR) , kGreen_SkColorChannelFlag = 1 << static_cast<uint32_t>(SkColorChannel::kG) , kBlue_SkColorChannelFlag = 1 << static_cast<uint32_t>(SkColorChannel::kB) , kAlpha_SkColorChannelFlag = 1 << static_cast<uint32_t>(SkColorChannel::kA) , kGray_SkColorChannelFlag = 0x10 , kGrayAlpha_SkColorChannelFlags = kGray_SkColorChannelFlag | kAlpha_SkColorChannelFlag , kRG_SkColorChannelFlags = kRed_SkColorChannelFlag | kGreen_SkColorChannelFlag , kRGB_SkColorChannelFlags = kRG_SkColorChannelFlags | kBlue_SkColorChannelFlag , kRGBA_SkColorChannelFlags = kRGB_SkColorChannelFlags | kAlpha_SkColorChannelFlag } |
Functions | |
static constexpr SkColor | SkColorSetARGB (U8CPU a, U8CPU r, U8CPU g, U8CPU b) |
static constexpr SkColor | SkColorSetA (SkColor c, U8CPU a) |
SK_API void | SkRGBToHSV (U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3]) |
static void | SkColorToHSV (SkColor color, SkScalar hsv[3]) |
SK_API SkColor | SkHSVToColor (U8CPU alpha, const SkScalar hsv[3]) |
static SkColor | SkHSVToColor (const SkScalar hsv[3]) |
SK_API SkPMColor | SkPreMultiplyARGB (U8CPU a, U8CPU r, U8CPU g, U8CPU b) |
SK_API SkPMColor | SkPreMultiplyColor (SkColor c) |
Variables | |
constexpr SkAlpha | SK_AlphaTRANSPARENT = 0x00 |
constexpr SkAlpha | SK_AlphaOPAQUE = 0xFF |
constexpr SkColor | SK_ColorTRANSPARENT = SkColorSetARGB(0x00, 0x00, 0x00, 0x00) |
constexpr SkColor | SK_ColorBLACK = SkColorSetARGB(0xFF, 0x00, 0x00, 0x00) |
constexpr SkColor | SK_ColorDKGRAY = SkColorSetARGB(0xFF, 0x44, 0x44, 0x44) |
constexpr SkColor | SK_ColorGRAY = SkColorSetARGB(0xFF, 0x88, 0x88, 0x88) |
constexpr SkColor | SK_ColorLTGRAY = SkColorSetARGB(0xFF, 0xCC, 0xCC, 0xCC) |
constexpr SkColor | SK_ColorWHITE = SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF) |
constexpr SkColor | SK_ColorRED = SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00) |
constexpr SkColor | SK_ColorGREEN = SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00) |
constexpr SkColor | SK_ColorBLUE = SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF) |
constexpr SkColor | SK_ColorYELLOW = SkColorSetARGB(0xFF, 0xFF, 0xFF, 0x00) |
constexpr SkColor | SK_ColorCYAN = SkColorSetARGB(0xFF, 0x00, 0xFF, 0xFF) |
constexpr SkColor | SK_ColorMAGENTA = SkColorSetARGB(0xFF, 0xFF, 0x00, 0xFF) |
constexpr SkColor4f | SkColors::kTransparent = {0, 0, 0, 0} |
constexpr SkColor4f | SkColors::kBlack = {0, 0, 0, 1} |
constexpr SkColor4f | SkColors::kDkGray = {0.25f, 0.25f, 0.25f, 1} |
constexpr SkColor4f | SkColors::kGray = {0.50f, 0.50f, 0.50f, 1} |
constexpr SkColor4f | SkColors::kLtGray = {0.75f, 0.75f, 0.75f, 1} |
constexpr SkColor4f | SkColors::kWhite = {1, 1, 1, 1} |
constexpr SkColor4f | SkColors::kRed = {1, 0, 0, 1} |
constexpr SkColor4f | SkColors::kGreen = {0, 1, 0, 1} |
constexpr SkColor4f | SkColors::kBlue = {0, 0, 1, 1} |
constexpr SkColor4f | SkColors::kYellow = {1, 1, 0, 1} |
constexpr SkColor4f | SkColors::kCyan = {0, 1, 1, 1} |
constexpr SkColor4f | SkColors::kMagenta = {1, 0, 1, 1} |
Types, consts, functions, and macros for colors.
Definition in file SkColor.h.
#define SkColorSetRGB | ( | r, | |
g, | |||
b | |||
) | SkColorSetARGB(0xFF, r, g, b) |
typedef uint8_t SkAlpha |
typedef uint32_t SkColor |
32-bit ARGB color value, unpremultiplied. Color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor is the type used to specify colors in SkPaint and in gradients.
Color that is premultiplied has the same component values as color that is unpremultiplied if alpha is 255, fully opaque, although may have the component values in a different order.
using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType> |
typedef uint32_t SkPMColor |
|
strong |
enum SkColorChannelFlag : uint32_t |
Used to represent the channels available in a color type or texture format as a mask.
Returns unpremultiplied color with red, blue, and green set from c; and alpha set from a. Alpha component of c is ignored and is replaced by a in result.
c | packed RGB, eight bits per component |
a | alpha: transparent at zero, fully opaque at 255 |
|
inlinestaticconstexpr |
Returns color value from 8-bit component values. Asserts if SK_DEBUG is defined if a, r, g, or b exceed 255. Since color is unpremultiplied, a may be smaller than the largest of r, g, and b.
a | amount of alpha, from fully transparent (0) to fully opaque (255) |
r | amount of red, from no red (0) to full red (255) |
g | amount of green, from no green (0) to full green (255) |
b | amount of blue, from no blue (0) to full blue (255) |
Definition at line 49 of file SkColor.h.
Converts ARGB to its HSV components. Alpha in ARGB is ignored. hsv[0] contains hsv hue, and is assigned a value from zero to less than 360. hsv[1] contains hsv saturation, a value from zero to one. hsv[2] contains hsv value, a value from zero to one.
color | ARGB color to convert |
hsv | three element array which holds the resulting HSV components |
Definition at line 169 of file SkColor.h.
Converts HSV components to an ARGB color. Alpha is set to 255. hsv[0] represents hsv hue, an angle from zero to less than 360. hsv[1] represents hsv saturation, and varies from zero to one. hsv[2] represents hsv value, and varies from zero to one.
Out of range hsv values are pinned.
hsv | three element array which holds the input HSV components |
Definition at line 196 of file SkColor.h.
Converts HSV components to an ARGB color. Alpha is passed through unchanged. hsv[0] represents hsv hue, an angle from zero to less than 360. hsv[1] represents hsv saturation, and varies from zero to one. hsv[2] represents hsv value, and varies from zero to one.
Out of range hsv values are pinned.
alpha | alpha component of the returned ARGB color |
hsv | three element array which holds the input HSV components |
Definition at line 78 of file SkColor.cpp.
Returns a SkPMColor value from unpremultiplied 8-bit component values.
a | amount of alpha, from fully transparent (0) to fully opaque (255) |
r | amount of red, from no red (0) to full red (255) |
g | amount of green, from no green (0) to full green (255) |
b | amount of blue, from no blue (0) to full blue (255) |
Definition at line 17 of file SkColor.cpp.
Returns pmcolor closest to color c. Multiplies c RGB components by the c alpha, and arranges the bytes to match the format of kN32_SkColorType.
c | unpremultiplied ARGB color |
Definition at line 21 of file SkColor.cpp.
Converts RGB to its HSV components. hsv[0] contains hsv hue, a value from zero to less than 360. hsv[1] contains hsv saturation, a value from zero to one. hsv[2] contains hsv value, a value from zero to one.
red | red component value from zero to 255 |
green | green component value from zero to 255 |
blue | blue component value from zero to 255 |
hsv | three element array which holds the resulting HSV components |
Definition at line 38 of file SkColor.cpp.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |