Rename API to snake_case.
[gfxprim.git] / libs / gfx / GP_HLine.c
blobcfb7f65a9e633c2f4dd7ae01b1a2d479db6da43e
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) 2009-2011 Jiri "BlueBear" Dluhos *
20 * <jiri.bluebear.dluhos@gmail.com> *
21 * *
22 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
23 * *
24 *****************************************************************************/
26 #include "core/GP_Transform.h"
28 #include "gfx/GP_HLine.h"
29 #include "gfx/GP_VLine.h"
31 void gp_hline_xxy_raw(gp_pixmap *pixmap, gp_coord x0, gp_coord x1,
32 gp_coord y, gp_pixel pixel)
34 GP_CHECK_PIXMAP(pixmap);
36 GP_FN_PER_BPP_PIXMAP(gp_hline_raw, pixmap, pixmap, x0, x1, y,
37 pixel);
40 void gp_hline_xyw_raw(gp_pixmap *pixmap, gp_coord x, gp_coord y, gp_size w,
41 gp_pixel pixel)
43 if (w == 0)
44 return;
46 gp_hline_xxy_raw(pixmap, x, x + w - 1, y, pixel);
49 void gp_hline_xxy(gp_pixmap *pixmap, gp_coord x0, gp_coord x1, gp_coord y,
50 gp_pixel pixel)
52 GP_CHECK_PIXMAP(pixmap);
54 if (pixmap->axes_swap) {
55 GP_TRANSFORM_Y(pixmap, x0);
56 GP_TRANSFORM_Y(pixmap, x1);
57 GP_TRANSFORM_X(pixmap, y);
58 gp_vline_raw(pixmap, y, x0, x1, pixel);
59 } else {
60 GP_TRANSFORM_X(pixmap, x0);
61 GP_TRANSFORM_X(pixmap, x1);
62 GP_TRANSFORM_Y(pixmap, y);
63 gp_hline_raw(pixmap, x0, x1, y, pixel);
67 void gp_hline_xyw(gp_pixmap *pixmap, gp_coord x, gp_coord y, gp_size w,
68 gp_pixel pixel)
70 if (w == 0)
71 return;
73 gp_hline_xxy(pixmap, x, x + w - 1, y, pixel);