Rename GP_Context -> GP_Pixmap
[gfxprim.git] / doc / get_put_pixel.txt
blobdb9893f04e9689cbf7b9c24a7dd910925efb268b
1 GetPixel and PutPixel
2 ---------------------
4 [source,c]
5 --------------------------------------------------------------------------------
6 #include <GP.h>
7 /* or */
8 #include <core/GP_GetPutPixel.h>
10 GP_Pixel GP_GetPixel(const GP_Pixmap *pixmap, GP_Coord x, GP_Coord y);
12 void GP_PutPixel(GP_Pixmap *pixmap, GP_Coord x, GP_Coord y, GP_Pixel p);
13 --------------------------------------------------------------------------------
15 Gets, puts a pixel value. GP_Pixel is a number which holds a pixel value.
17 This functions are clipped, GetPixel outside of the pixmap returns zero,
18 PutPixel outside the pixmap is no-op.
20 This functions honour link:pixmap.html[pixmap rotation flags].
22 Generally these function are safe to use but rather slow in innner cycles.
24 [source,c]
25 --------------------------------------------------------------------------------
26 #include <GP.h>
27 /* or */
28 #include <core/GP_GetPutPixel.h>
30 GP_Pixel GP_GetPixel_Raw(const GP_Pixmap *pixmap, GP_Coord x, GP_Coord y);
32 void GP_PutPixel_Raw(GP_Pixmap *pixmap, GP_Coord x, GP_Coord y, GP_Pixel p);
35  * Substitute {{ bpp }} for specific bits per pixel (1BPP_LE, 24BPP, ...)
36  *
37  * These macros are generated to core/GP_GetPutPixel.gen.h
38  */
39 GP_Pixel GP_GetPixel_Raw_{{ bpp }}(const GP_Pixmap *c, int x, int y);
41 void GP_PutPixel_Raw_{{ bpp }}(GP_Pixmap *c, GP_Coord x, GP_Coord y,
42                                GP_Pixel p);
43 --------------------------------------------------------------------------------
45 These functions are generally fast, but does not honour pixmap rotation flags
46 and do not check that coordinates are inside of the pixmap.
48 They are intended as basic building blocks for other GFX primitives, filters,
49 etc.