doc: Add RGB tripplet to pixel conversion docs.
[gfxprim/pasky.git] / doc / convert.txt
blob91918051c33951c5b7da9ea988304da8128c0aaf
1 Pixel Conversions
2 -----------------
4 This page describes RGB tripplet to pixels conversions.
6 See also link:basic_types.html#Color[colors].
8 [source,c]
9 -------------------------------------------------------------------------------
10 #include <GP.h>
11 /* or */
12 #include <core/GP_Convert.h>
14 GP_Pixel GP_RGBToPixel(uint8_t r, uint8_t g, uint8_t b, GP_PixelType type);
16 GP_Pixel GP_RGBAToPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
17                         GP_PixelType type);
19 GP_Pixel GP_RGBToContextPixel(uint8_t r, uint8_t g, uint8_t b,
20                               const GP_Context *context);
22 GP_Pixel GP_RGBAToContextPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
23                                const GP_Context *context);
24 -------------------------------------------------------------------------------
26 Simple functions to convert RGB or RGBA 8 bit values into the specific
27 link:pixels.html[pixel types].
29 [source,c]
30 -------------------------------------------------------------------------------
31 #include <GP.h>
32 /* or */
33 #include <core/GP_Convert.h>
35 GP_Pixel GP_ConvertPixel(GP_Pixel pixel, GP_PixelType from, GP_PixelType to);
36 -------------------------------------------------------------------------------
38 Converts pixel value. The conversion currently converts by converting the
39 value to RGBA8888 and then to the resulting value.