GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_circle_seg.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos
4 * <jiri.bluebear.dluhos@gmail.com>
5 *
6 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz>
7 */
8
9#ifndef GFX_GP_CIRCLE_H
10#define GFX_GP_CIRCLE_H
11
12#include <core/gp_types.h>
13
14/*
15 * Quadrants in cartesian space the center is set in the middle of the circle.
16 *
17 * First segment is where both x and y are possitive, second is where only y is
18 * possitive, third is for both x and y negative and the last one for only y
19 * negative.
20 *
21 * Note that on computer screen (and in in-memory bitmaps) cordinates for y
22 * grows in the opposite direction to the standard cartesian plane.
23 *
24 * So first segment is actually down right, second is down left, third is up
25 * left, and fourth is up right.
26 */
27enum gp_circle_segments {
28 GP_CIRCLE_SEG1 = 0x01, /* First Quadrant */
29 GP_CIRCLE_SEG2 = 0x02, /* Second Quadrant */
30 GP_CIRCLE_SEG3 = 0x04, /* Third Quadrant */
31 GP_CIRCLE_SEG4 = 0x08, /* Fourth Quadrant */
32};
33
34/* Circle Segment */
35
36void gp_circle_seg(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
37 gp_size r, uint8_t seg_flag, gp_pixel pixel);
38
39void gp_circle_seg_raw(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
40 gp_size r, uint8_t seg_flag, gp_pixel pixel);
41
42/* Filled Circle Segment */
43
44void gp_fill_circle_seg(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
45 gp_size r, uint8_t seg_flag, gp_pixel pixel);
46
47void gp_fill_circle_seg_raw(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
48 gp_size r, uint8_t seg_flag, gp_pixel pixel);
49
50/* Filled Ring Segment */
51
52void gp_fill_ring_seg(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
53 gp_size r1, gp_size r2, uint8_t seg_flag, gp_pixel pixel);
54
55void gp_fill_ring_seg_raw(gp_pixmap *pixmap, gp_coord xcenter, gp_coord ycenter,
56 gp_size r1, gp_size r2, uint8_t seg_flag, gp_pixel pixel);
57
58#endif /* GFX_GP_CIRCLE_H */
A common types.
uint32_t gp_pixel
Pixel integer value.
Definition gp_types.h:33
int gp_coord
Integer type for coordinates i.e. x, y, ...
Definition gp_types.h:19
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
Definition gp_types.h:24
A pixmap buffer.
Definition gp_pixmap.h:33