Added basic common pixeltypes to be generated
[gfxprim.git] / include / core / GP_Pixel_Access.h
blob331d7eb2e4f2e9badd2dfc5708893e706413dcea
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2011 Tomas Gavenciak <gavento@ucw.cz> *
20 * *
21 *****************************************************************************/
23 #ifndef GP_PIXEL_ACCESS_H
24 #define GP_PIXEL_ACCESS_H
26 #include "GP_Context.h"
27 #include "GP_FnPerBpp.h"
28 #include "GP_Pixel.h"
30 /*
31 * Generated header
33 #include "GP_Pixel_Access.gen.h"
36 * GetPixel with context transformations and clipping.
37 * Returns 0 for clipped pixels or pixels outside bitmap.
39 GP_Pixel GP_GetPixel(GP_Context *context, int x, int y);
42 * Version of GetPixel without transformations nor border checking.
44 static inline GP_Pixel GP_GetPixel_Raw(GP_Context *context, int x, int y)
46 GP_FN_RET_PER_BPP(GP_GetPixel_Raw, context->bpp, context->bit_endian,
47 context, x, y);
51 * PutPixel with context transformations and clipping.
52 * NOP for clipped pixels or pixels outside bitmap.
54 void GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel p);
57 * Version of PutPixel without transformations nor border checking.
59 static inline void GP_PutPixel_Raw(GP_Context *context, int x, int y, GP_Pixel p)
61 GP_FN_PER_BPP(GP_PutPixel_Raw, context->bpp, context->bit_endian,
62 context, x, y, p);
65 #endif /* GP_PIXEL_ACCESS_H */