3 Coordinates and Size and Length
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 Most of the drawing functions use typedefed 'GP_Coord' and 'GP_Size' integer
9 The 'GP_Coord' is signed integer which is used for coordinates and the
10 'GP_Size' is unsigned integer type used for object size, length and so.
15 Pixel value in 'GFXprim' is an integer big enough to hold the actual pixel
16 values. The default typedef for 'GP_Pixel' is set to 32 bit integer, which may
17 be changed at compile time to support colors with more than 10 bits per
18 channel. The 'GP_Pixel' is thus used as opaque value big enough to hold any
19 supported pixel value.
25 The 'GP_Color' enumeration holds symbolic constants for basic colors.
27 A 'GP_Color' can be converted into a 'GP_Pixel' for a given 'GP_PixelType'.
28 Symbolic values can also be converted to/from strings (color name in English).
30 The 'GP_Color' enum is defined as follows:
33 --------------------------------------------------------------------------------
34 typedef enum GP_Color {
37 /* full-intensity RGB and CMYK */
46 /* various common mixes */
49 GP_COL_GRAY_DARK, /* exactly half RGB values of white */
53 GP_COL_WHITE, /* full-intensity white */
56 --------------------------------------------------------------------------------
59 --------------------------------------------------------------------------------
60 #include <core/GP_Color.h>
64 GP_Pixel GP_ColorToPixel(GP_Color color, GP_PixelType pixel_type);
65 GP_Pixel GP_ColorToContextPixel(GP_Color color, GP_Context *context);
67 GP_Color GP_ColorNameToColor(const char *color_name);
68 const char *GP_ColorToColorName(GP_Color color);
70 bool GP_ColorNameToPixel(const char *color_name, GP_PixelType pixel_type,
72 bool GP_ColorNameToContextPixel(const char *color_name, GP_Context *context,
74 --------------------------------------------------------------------------------
76 Functions for conversion between colors, pixels and color names. The last two
77 returns true if color with such name was found.
80 --------------------------------------------------------------------------------
81 #include <core/GP_Color.h>
85 void GP_ColorLoadPixels(GP_Pixel pixels[], GP_PixelType pixel_type);
86 void GP_ColorLoadContextPixels(GP_Pixel pixels[], GP_Context *context);
87 --------------------------------------------------------------------------------
89 Loads array of 'GP_Pixel' of size 'GP_COL_MAX', the array is then used with
90 the GP_Color enum as 'pixels[GP_COL_BLACK]'.