Next: Text, Previous: Transformations, Up: Top [Index]
Representing a pixel-aligned area
Regions are a simple graphical data type representing an area of integer-aligned rectangles. They are often used on raster surfaces to track areas of interest, such as change or clip areas.
<cairo-region-t >
)Allocates a new empty region object.
A newly allocated <cairo-region-t>
. Free with
cairo-region-destroy
. This function always returns a valid
pointer; if memory cannot be allocated, then a special error object is
returned where all operations on the object do nothing. You can check
for this with cairo-region-status
.
Since 1.10
<cairo-region-t>
) ⇒ (ret <cairo-region-t >
)Allocates a new region object copying the area from original.
a <cairo-region-t>
A newly allocated <cairo-region-t>
. Free with
cairo-region-destroy
. This function always returns a valid
pointer; if memory cannot be allocated, then a special error object is
returned where all operations on the object do nothing. You can check
for this with cairo-region-status
.
Since 1.10
<cairo-region-t>
) (extents <cairo-rectangle-int-t>
)Gets the bounding rectangle of region as a
<cairo-rectangle-int-t>
a <cairo-region-t>
rectangle into which to store the extents
Since 1.10
<cairo-region-t>
) ⇒ (ret <cairo-bool-t>
)Checks whether region is empty.
a <cairo-region-t>
‘#t
’ if region is empty, ‘#f
’ if it isn’t.
Since 1.10
<cairo-region-t>
) (x <int>
) (y <int>
) ⇒ (ret <cairo-bool-t>
)Checks whether (x, y) is contained in region.
a <cairo-region-t>
the x coordinate of a point
the y coordinate of a point
‘#t
’ if (x, y) is contained in region,
‘#f
’ if it is not.
Since 1.10
<cairo-region-t>
) (rectangle <cairo-rectangle-int-t>
) ⇒ (ret <cairo-region-overlap-t>
)Checks whether rectangle is inside, outside or partially contained in region
a <cairo-region-t>
a <cairo-rectangle-int-t>
‘CAIRO_REGION_OVERLAP_IN’ if rectangle is entirely inside region, ‘CAIRO_REGION_OVERLAP_OUT’ if rectangle is entirely outside region, or ‘CAIRO_REGION_OVERLAP_PART’ if rectangle is partially inside and partially outside region.
Since 1.10
<cairo-region-t>
) (dx <int>
) (dy <int>
)Translates region by (dx, dy).
a <cairo-region-t>
Amount to translate in the x direction
Amount to translate in the y direction
Since 1.10
<cairo-region-t>
) (other <cairo-region-t>
) ⇒ (ret <cairo-status-t>
)Computes the intersection of dst with other and places the result in dst
a <cairo-region-t>
another <cairo-region-t>
‘CAIRO_STATUS_SUCCESS’ or ‘CAIRO_STATUS_NO_MEMORY’
Since 1.10
<cairo-region-t>
) (other <cairo-region-t>
) ⇒ (ret <cairo-status-t>
)Subtracts other from dst and places the result in dst
a <cairo-region-t>
another <cairo-region-t>
‘CAIRO_STATUS_SUCCESS’ or ‘CAIRO_STATUS_NO_MEMORY’
Since 1.10
<cairo-region-t>
) (other <cairo-region-t>
) ⇒ (ret <cairo-status-t>
)Computes the union of dst with other and places the result in dst
a <cairo-region-t>
another <cairo-region-t>
‘CAIRO_STATUS_SUCCESS’ or ‘CAIRO_STATUS_NO_MEMORY’
Since 1.10
<cairo-region-t>
) (other <cairo-region-t>
) ⇒ (ret <cairo-status-t>
)Computes the exclusive difference of dst with other and places the result in dst. That is, dst will be set to contain all areas that are either in dst or in other, but not in both.
a <cairo-region-t>
another <cairo-region-t>
‘CAIRO_STATUS_SUCCESS’ or ‘CAIRO_STATUS_NO_MEMORY’
Since 1.10
Next: Text, Previous: Transformations, Up: Top [Index]