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 #ifndef GFX_GP_CIRCLE_H
27 #define GFX_GP_CIRCLE_H
29 #include "core/GP_Pixmap.h"
32 * Quadrants in cartesian space the center is set in the middle of the circle.
34 * First segment is where both x and y are possitive, second is where only y is
35 * possitive, third is for both x and y negative and the last one for only y
38 * Note that on computer screen (and in in-memory bitmaps) cordinates for y
39 * grows in the opposite direction to the standard cartesian plane.
41 * So first segment is actually down right, second is down left, third is up
42 * left, and fourth is up right.
44 enum GP_CircleSegments
{
45 GP_CIRCLE_SEG1
= 0x01, /* First Quadrant */
46 GP_CIRCLE_SEG2
= 0x02, /* Second Quadrant */
47 GP_CIRCLE_SEG3
= 0x04, /* Third Quadrant */
48 GP_CIRCLE_SEG4
= 0x08, /* Fourth Quadrant */
53 void GP_CircleSeg(GP_Pixmap
*pixmap
, GP_Coord xcenter
, GP_Coord ycenter
,
54 GP_Size r
, uint8_t seg_flag
, GP_Pixel pixel
);
56 void GP_CircleSeg_Raw(GP_Pixmap
*pixmap
, GP_Coord xcenter
, GP_Coord ycenter
,
57 GP_Size r
, uint8_t seg_flag
, GP_Pixel pixel
);
59 /* Filled Circle Segment */
61 void GP_FillCircleSeg(GP_Pixmap
*pixmap
, GP_Coord xcenter
, GP_Coord ycenter
,
62 GP_Size r
, uint8_t seg_flag
, GP_Pixel pixel
);
64 void GP_FillCircleSeg_Raw(GP_Pixmap
*pixmap
, GP_Coord xcenter
, GP_Coord ycenter
,
65 GP_Size r
, uint8_t seg_flag
, GP_Pixel pixel
);
67 #endif /* GFX_GP_CIRCLE_H */