include/core/SkColor.h File Reference

#include "SkScalar.h"
Include dependency graph for SkColor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#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)
#define SK_ColorBLACK   0xFF000000
 black SkColor value
#define SK_ColorDKGRAY   0xFF444444
 dark gray SkColor value
#define SK_ColorGRAY   0xFF888888
 gray SkColor value
#define SK_ColorLTGRAY   0xFFCCCCCC
 light gray SkColor value
#define SK_ColorWHITE   0xFFFFFFFF
 white SkColor value
#define SK_ColorRED   0xFFFF0000
 red SkColor value
#define SK_ColorGREEN   0xFF00FF00
 green SkColor value
#define SK_ColorBLUE   0xFF0000FF
 blue SkColor value
#define SK_ColorYELLOW   0xFFFFFF00
 yellow SkColor value
#define SK_ColorCYAN   0xFF00FFFF
 cyan SkColor value
#define SK_ColorMAGENTA   0xFFFF00FF
 magenta SkColor value

Typedefs

typedef uint8_t SkAlpha
typedef uint32_t SkColor
typedef uint32_t SkPMColor
typedef SkPMColor(* SkXfermodeProc )(SkPMColor src, SkPMColor dst)
typedef uint16_t(* SkXfermodeProc16 )(SkPMColor src, uint16_t dst)

Functions

void SkRGBToHSV (U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
SkColor SkHSVToColor (U8CPU alpha, const SkScalar hsv[3])
SkPMColor SkPreMultiplyARGB (U8CPU a, U8CPU r, U8CPU g, U8CPU b)
SkPMColor SkPreMultiplyColor (SkColor c)

Detailed Description

Types and macros for colors

Definition in file SkColor.h.


Define Documentation

#define SK_ColorBLACK   0xFF000000

black SkColor value

Definition at line 66 of file SkColor.h.

#define SK_ColorBLUE   0xFF0000FF

blue SkColor value

Definition at line 74 of file SkColor.h.

#define SK_ColorCYAN   0xFF00FFFF

cyan SkColor value

Definition at line 76 of file SkColor.h.

#define SK_ColorDKGRAY   0xFF444444

dark gray SkColor value

Definition at line 67 of file SkColor.h.

#define SK_ColorGRAY   0xFF888888

gray SkColor value

Definition at line 68 of file SkColor.h.

#define SK_ColorGREEN   0xFF00FF00

green SkColor value

Definition at line 73 of file SkColor.h.

#define SK_ColorLTGRAY   0xFFCCCCCC

light gray SkColor value

Definition at line 69 of file SkColor.h.

#define SK_ColorMAGENTA   0xFFFF00FF

magenta SkColor value

Definition at line 77 of file SkColor.h.

#define SK_ColorRED   0xFFFF0000

red SkColor value

Definition at line 72 of file SkColor.h.

#define SK_ColorWHITE   0xFFFFFFFF

white SkColor value

Definition at line 70 of file SkColor.h.

#define SK_ColorYELLOW   0xFFFFFF00

yellow SkColor value

Definition at line 75 of file SkColor.h.

#define SkColorGetA ( color   )     (((color) >> 24) & 0xFF)

return the alpha byte from a SkColor value

Definition at line 52 of file SkColor.h.

#define SkColorGetB ( color   )     (((color) >> 0) & 0xFF)

return the blue byte from a SkColor value

Definition at line 58 of file SkColor.h.

#define SkColorGetG ( color   )     (((color) >> 8) & 0xFF)

return the green byte from a SkColor value

Definition at line 56 of file SkColor.h.

#define SkColorGetR ( color   )     (((color) >> 16) & 0xFF)

return the red byte from a SkColor value

Definition at line 54 of file SkColor.h.

#define SkColorSetRGB ( r,
g,
 )     SkColorSetARGB(0xFF, r, g, b)

Return a SkColor value from 8 bit component values, with an implied value of 0xFF for alpha (fully opaque)

Definition at line 49 of file SkColor.h.


Typedef Documentation

typedef uint8_t SkAlpha

8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent.

Definition at line 29 of file SkColor.h.

typedef uint32_t SkColor

32 bit ARGB color value, not premultiplied. The 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 kARGB32 bitmaps. SkColor is the type used to specify colors in SkPaint and in gradients.

Definition at line 35 of file SkColor.h.

typedef uint32_t SkPMColor

32 bit ARGB color value, premultiplied. The byte order for this value is configuration dependent, matching the format of kARGB32 bitmaps. This is different from SkColor, which is nonpremultiplied, and is always in the same byte order.

Definition at line 134 of file SkColor.h.

Define a function pointer type for combining two premultiplied colors

Definition at line 147 of file SkColor.h.

typedef uint16_t(* SkXfermodeProc16)(SkPMColor src, uint16_t dst)

Define a function pointer type for combining a premultiplied src color and a 16bit device color.

Definition at line 152 of file SkColor.h.


Function Documentation

SkColor SkHSVToColor ( U8CPU  alpha,
const SkScalar  hsv[3] 
)

Convert HSV components to an ARGB color. The alpha component is passed through unchanged. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Value [0...1] If hsv values are out of range, they are pinned.

Parameters:
alpha the alpha component of the returned argb color.
hsv 3 element array which holds the input HSV components.
Returns:
the resulting argb color
SkPMColor SkPreMultiplyARGB ( U8CPU  a,
U8CPU  r,
U8CPU  g,
U8CPU  b 
)

Return a SkPMColor value from unpremultiplied 8 bit component values

SkPMColor SkPreMultiplyColor ( SkColor  c  ) 

Return a SkPMColor value from a SkColor value. This is done by multiplying the color components by the color's alpha, and by arranging the bytes in a configuration dependent order, to match the format of kARGB32 bitmaps.

void SkRGBToHSV ( U8CPU  red,
U8CPU  green,
U8CPU  blue,
SkScalar  hsv[3] 
)

Convert RGB components to HSV. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Value [0...1]

Parameters:
red red component value [0..255]
green green component value [0..255]
blue blue component value [0..255]
hsv 3 element array which holds the resulting HSV components.

Generated on Tue Oct 20 11:03:40 2009 for Skia by  doxygen 1.6.1