Rename GP_Context -> GP_Pixmap
[gfxprim.git] / libs / core / GP_GetPutPixel.c
blobfb718b29023163cd5a1f167bf3047b54eced425b
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 * Copyright (C) 2012 Cyril Hrubis <metan@ucw.cz> *
21 * *
22 *****************************************************************************/
24 #include "GP_GetPutPixel.h"
25 #include "GP_Transform.h"
27 GP_Pixel GP_GetPixel(const GP_Pixmap *pixmap, GP_Coord x, GP_Coord y)
29 GP_TRANSFORM_POINT(pixmap, x, y);
30 if (GP_PIXEL_IS_CLIPPED(pixmap, x, y))
31 return 0;
32 return GP_GetPixel_Raw(pixmap, x, y);
35 void GP_PutPixel(GP_Pixmap *pixmap, GP_Coord x, GP_Coord y, GP_Pixel p)
37 GP_TRANSFORM_POINT(pixmap, x, y);
38 if (!GP_PIXEL_IS_CLIPPED(pixmap, x, y))
39 GP_PutPixel_Raw(pixmap, x, y, p);
42 uint8_t GP_PixelAddrOffset(GP_Coord x, GP_PixelType pixel_type)
44 GP_FN_RET_PER_BPP_PIXELTYPE(GP_PIXEL_ADDR_OFFSET, pixel_type, x);
46 return 0;