Rename GP_Context -> GP_Pixmap
[gfxprim.git] / doc / convert.txt
bloba534ecb56b5ac9b61870581514c453c9fb72cc8d
1 Pixel Conversions
2 -----------------
4 This page describes RGB tripplet to pixels conversions.
6 [source,c]
7 -------------------------------------------------------------------------------
8 #include <GP.h>
9 /* or */
10 #include <core/GP_Convert.h>
12 GP_Pixel GP_RGBToPixel(uint8_t r, uint8_t g, uint8_t b, GP_PixelType type);
14 GP_Pixel GP_RGBAToPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
15                         GP_PixelType type);
17 GP_Pixel GP_RGBToPixmapPixel(uint8_t r, uint8_t g, uint8_t b,
18                               const GP_Pixmap *pixmap);
20 GP_Pixel GP_RGBAToPixmapPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
21                                const GP_Pixmap *pixmap);
22 -------------------------------------------------------------------------------
24 Simple functions to convert RGB or RGBA 8 bit values into the specific
25 link:pixels.html[pixel types].
27 [source,c]
28 -------------------------------------------------------------------------------
29 #include <GP.h>
30 /* or */
31 #include <core/GP_Convert.h>
33 GP_Pixel GP_ConvertPixel(GP_Pixel pixel, GP_PixelType from, GP_PixelType to);
34 -------------------------------------------------------------------------------
36 Converts pixel value. The conversion currently converts by converting the
37 value to RGBA8888 and then to the resulting value.