Region

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.

Constructors

this
this(cairo_region_t* cairo_region)

Sets our main struct and passes it to the parent class

Members

Functions

containsPoint
cairo_bool_t containsPoint(int x, int y)

Checks whether (x, y) is contained in region. Since 1.10

containsRectangle
cairo_region_overlap_t containsRectangle(cairo_rectangle_int_t rectangle)

Checks whether rectangle is inside, outside or partially contained in region Since 1.10

copy
Region copy()

Allocates a new region object copying the area from original. Since 1.10

destroy
void destroy()

Destroys a cairo_region_t object created with cairo_region_create(), cairo_region_copy(), or or cairo_region_create_rectangle(). Since 1.10

equal
cairo_bool_t equal(Region b)

Compares whether region_a is equivalent to region_b. NULL as an argument is equal to itself, but not to any non-NULL region. Since 1.10

getExtents
void getExtents(cairo_rectangle_int_t extents)

Gets the bounding rectangle of region as a cairo_rectangle_int_t Since 1.10

getRectangle
void getRectangle(int nth, cairo_rectangle_int_t rectangle)

Stores the nth rectangle from the region in rectangle. Since 1.10

getRegionStruct
cairo_region_t* getRegionStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

intersect
cairo_status_t intersect(Region other)

Computes the intersection of dst with other and places the result in dst Since 1.10

intersectRectangle
cairo_status_t intersectRectangle(cairo_rectangle_int_t rectangle)

Computes the intersection of dst with rectangle and places the result in dst Since 1.10

isEmpty
cairo_bool_t isEmpty()

Checks whether region is empty. Since 1.10

numRectangles
int numRectangles()

Returns the number of rectangles contained in region. Since 1.10

reference
Region reference()

Increases the reference count on region by one. This prevents region from being destroyed until a matching call to cairo_region_destroy() is made. Since 1.10

status
cairo_status_t status()

Checks whether an error has previous occurred for this region object. Since 1.10

subtract
cairo_status_t subtract(Region other)

Subtracts other from dst and places the result in dst Since 1.10

subtractRectangle
cairo_status_t subtractRectangle(cairo_rectangle_int_t rectangle)

Subtracts rectangle from dst and places the result in dst Since 1.10

translate
void translate(int dx, int dy)

Translates region by (dx, dy). Since 1.10

unio
cairo_status_t unio(Region other)

Computes the union of dst with other and places the result in dst Since 1.10

unionRectangle
cairo_status_t unionRectangle(cairo_rectangle_int_t rectangle)

Computes the union of dst with rectangle and places the result in dst. Since 1.10

xor
cairo_status_t xor(Region other)

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. Since 1.10

xorRectangle
cairo_status_t xorRectangle(cairo_rectangle_int_t rectangle)

Computes the exclusive difference of dst with rectangle and places the result in dst. That is, dst will be set to contain all areas that are either in dst or in rectangle, but not in both. Since 1.10

Static functions

create
Region create()

Allocates a new empty region object. Since 1.10

createRectangle
Region createRectangle(cairo_rectangle_int_t rectangle)

Allocates a new region object containing rectangle. Since 1.10

createRectangles
Region createRectangles(cairo_rectangle_int_t[] rects)

Allocates a new region object containing the union of all given rects. Since 1.10

Variables

cairo_region
cairo_region_t* cairo_region;

the main Gtk struct

Meta