Cairo::Region
Inherits Reference / Object
A Region represents a set of integer-aligned rectangles.
It allows set-theoretical operations like Region#union and Region#intersect to be performed on them.
Memory management of Region is done with Region#reference and Region#finalize.
Wrapper for LibCairo::PRegionT
Constructors
Allocates a new region object containing the union of all given rects.
###Parameters
- rects an array of count rectangles
Instance methods
Compares whether region is equivalent to other.
###Parameters
- *other a
Regionobject
###Returns
true if both regions contained the same coverage, false if it is not or any region is in an error status.
Checks whether (x, y) is contained in region.
###Parameters
- x the x coordinate of a point
- y the y coordinate of a point
###Returns
true if (x, y) is contained in region, false if it is not.
Checks whether rectangle is inside, outside or partially contained in region.
###Parameters
- rectangle a
RectangleInt
###Returns
RegionOverlap::Inif rectangle is entirely inside regionRegionOverlap::Outif rectangle is entirely outside regionRegionOVerlap::Partif rectangle is partially inside and partially outside region
Gets the bounding rectangle of region as a RectangleInt.
###Parameters
- extents rectangle into which to store the extents
Destroys a Region object created with Region#initialize, Region#dup, or Region#initialize(rectangle).
Computes the intersection of self with other and places the result in self.
###Parameters
- other another
Region
##Raises
StatusException with status of Status::NoMemory.
Computes the intersection of self with rectangle and places the result in self.
###Parameters
- rectangle a
RectangleInt
###Raises
StatusException with status of Status::NoMemory.
Returns the number of rectangles contained in region.
###Returns The number of rectangles contained in region.
Stores the nth rectangle from the region in rectangle.
###Parameters
- nth a number indicating which rectangle should be returned
###Returns
The location for a RectangleInt.
Increases the reference count on region by one. This prevents region from being destroyed until a matching call
to Region#finalize is made.
###Returns
The referenced Region.
Checks whether an error has previous occurred for this region object.
###Returns
Status::Success or Status::NoMemory
Subtracts other from self and places the result in self.
###Parameters
- other another
Region
###Raises
StatusException with status of Status::NoMemory.
Subtracts rectangle from self and places the result in self.
###Parameters
- rectangle a
RectangleInt
###Raises
StatusException with status of Status::NoMemory.
Translates region by (dx, dy).
###Parameters
- dx Amount to translate in the x direction
- dy Amount to translate in the y direction
Computes the union of self with other and places the result in self.
###Parameters
- other another
Region
###Raises
StatusException with status of Status::NoMemory.
Computes the union of self with rectangle and places the result in self.
###Parameters
- rectangle a RectangleInt
###Raises
StatusException with status of Status::NoMemory.
Computes the exclusive difference of self with other and places the result in self.
That is, self will be set to contain all areas that are either in self or in other , but not in both.
###Parameters
- other another
Region
###Raises
StatusException with status of Status::NoMemory.
Computes the exclusive difference of self with rectangle and places the result in self.
That is, self will be set to contain all areas that are either in self or in rectangle, but not in both.
###Parameters
- rectangle a
RectangleInt
###Raises
StatusException with status of Status::NoMemory.