Points, Rectangles and Regions
Simple graphical data types
GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types
for representing pixels and sets of pixels on the screen.
#GdkPoint is a simple structure containing an x and y coordinate of a point.
#GdkRectangle is a structure holding the position and size of a rectangle.
The intersection of two rectangles can be computed with
gdk_rectangle_intersect(). To find the union of two rectangles use
gdk_rectangle_union().
#GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
#GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
is one pixel wide. It is mainly used when rasterizing other graphics primitives.
It can be intersected to regions by using gdk_region_spans_intersect_foreach().
Defines the x and y coordinates of a point.
@x: the x coordinate of the point.
@y: the y coordinate of the point.
Defines the position and size of a rectangle.
@x: the x coordinate of the left edge of the rectangle.
@y: the y coordinate of the top of the rectangle.
@width: the width of the rectangle.
@height: the height of the rectangle.
@src1:
@src2:
@dest:
@Returns:
@src1:
@src2:
@dest:
A GdkRegion represents a set of pixels on the screen.
@Returns:
@points:
@npoints:
@fill_rule:
@Returns:
The method for determining which pixels are included in a region, when
creating a #GdkRegion from a polygon.
The fill rule is only relevant for polygons which overlap themselves.
@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
included in the region, while areas overlapped an even number of times are not.
@GDK_WINDING_RULE: overlapping areas are always included.
@region:
@Returns:
@rectangle:
@Returns:
@region:
@region:
@rectangle:
@region:
@rectangles:
@n_rectangles:
@region:
@Returns:
@region1:
@region2:
@Returns:
@region:
@x:
@y:
@Returns:
@region:
@rectangle:
@Returns:
Specifies the possible values returned by gdk_region_rect_in().
@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
@region:
@dx:
@dy:
@region:
@dx:
@dy:
@region:
@rect:
@source1:
@source2:
@source1:
@source2:
@source1:
@source2:
@source1:
@source2:
A GdkSpan represents a horizontal line of pixels starting
at the pixel with coordinates @x, @y and ending before @x + @width, @y.
@x: x coordinate of the first pixel.
@y: y coordinate of the first pixel.
@width: number of pixels in the span.
This defines the type of the function passed to
gdk_region_spans_intersect_foreach().
@span: a #GdkSpan.
@data: the user data passed to gdk_region_spans_intersect_foreach().
@region:
@spans:
@n_spans:
@sorted:
@function:
@data: