1 /*****************************************************************************
2 * This file is part of gfxprim library. *
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. *
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. *
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 *
19 * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos *
20 * <jiri.bluebear.dluhos@gmail.com> *
22 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
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
,
40 void gp_hline_xyw_raw(gp_pixmap
*pixmap
, gp_coord x
, gp_coord y
, gp_size w
,
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
,
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
);
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
,
73 gp_hline_xxy(pixmap
, x
, x
+ w
- 1, y
, pixel
);