1
<!-- ##### SECTION Title ##### -->
2
Points, Rectangles and Regions
4
<!-- ##### SECTION Short_Description ##### -->
5
Simple graphical data types
7
<!-- ##### SECTION Long_Description ##### -->
9
GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types
10
for representing pixels and sets of pixels on the screen.
13
#GdkPoint is a simple structure containing an x and y coordinate of a point.
16
#GdkRectangle is a structure holding the position and size of a rectangle.
17
The intersection of two rectangles can be computed with
18
gdk_rectangle_intersect(). To find the union of two rectangles use
19
gdk_rectangle_union().
22
#GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
23
usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
26
#GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
27
is one pixel wide. It is mainly used when rasterizing other graphics primitives.
28
It can be intersected to regions by using gdk_region_spans_intersect_foreach().
31
<!-- ##### SECTION See_Also ##### -->
36
<!-- ##### SECTION Stability_Level ##### -->
39
<!-- ##### STRUCT GdkPoint ##### -->
41
Defines the x and y coordinates of a point.
44
@x: the x coordinate of the point.
45
@y: the y coordinate of the point.
47
<!-- ##### STRUCT GdkRectangle ##### -->
49
Defines the position and size of a rectangle.
52
@x: the x coordinate of the left edge of the rectangle.
53
@y: the y coordinate of the top of the rectangle.
54
@width: the width of the rectangle.
55
@height: the height of the rectangle.
57
<!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
68
<!-- ##### FUNCTION gdk_rectangle_union ##### -->
78
<!-- ##### STRUCT GdkRegion ##### -->
80
A GdkRegion represents a set of pixels on the screen.
84
<!-- ##### FUNCTION gdk_region_new ##### -->
92
<!-- ##### FUNCTION gdk_region_polygon ##### -->
103
<!-- ##### ENUM GdkFillRule ##### -->
105
The method for determining which pixels are included in a region, when
106
creating a #GdkRegion from a polygon.
107
The fill rule is only relevant for polygons which overlap themselves.
110
@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
111
included in the region, while areas overlapped an even number of times are not.
112
@GDK_WINDING_RULE: overlapping areas are always included.
114
<!-- ##### FUNCTION gdk_region_copy ##### -->
123
<!-- ##### FUNCTION gdk_region_rectangle ##### -->
132
<!-- ##### FUNCTION gdk_region_destroy ##### -->
140
<!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
149
<!-- ##### FUNCTION gdk_region_get_rectangles ##### -->
159
<!-- ##### FUNCTION gdk_region_empty ##### -->
168
<!-- ##### FUNCTION gdk_region_equal ##### -->
178
<!-- ##### FUNCTION gdk_region_point_in ##### -->
189
<!-- ##### FUNCTION gdk_region_rect_in ##### -->
199
<!-- ##### ENUM GdkOverlapType ##### -->
201
Specifies the possible values returned by gdk_region_rect_in().
204
@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
205
@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
206
@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
208
<!-- ##### FUNCTION gdk_region_offset ##### -->
218
<!-- ##### FUNCTION gdk_region_shrink ##### -->
228
<!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
237
<!-- ##### FUNCTION gdk_region_intersect ##### -->
245
<!-- ##### FUNCTION gdk_region_union ##### -->
254
<!-- ##### FUNCTION gdk_region_subtract ##### -->
262
<!-- ##### FUNCTION gdk_region_xor ##### -->
270
<!-- ##### STRUCT GdkSpan ##### -->
272
A GdkSpan represents a horizontal line of pixels starting
273
at the pixel with coordinates @x, @y and ending before @x + @width, @y.
276
@x: x coordinate of the first pixel.
277
@y: y coordinate of the first pixel.
278
@width: number of pixels in the span.
280
<!-- ##### USER_FUNCTION GdkSpanFunc ##### -->
282
This defines the type of the function passed to
283
gdk_region_spans_intersect_foreach().
287
@data: the user data passed to gdk_region_spans_intersect_foreach().
290
<!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### -->