cairomm 1.18.0
|
A simple graphical data type representing an area of integer-aligned rectangles. More...
#include <cairomm/region.h>
Public Types | |
enum class | Overlap { IN = CAIRO_REGION_OVERLAP_IN , OUT = CAIRO_REGION_OVERLAP_OUT , REGION_OVERLAP_PART = CAIRO_REGION_OVERLAP_PART } |
typedef cairo_region_t | cobject |
Public Member Functions | |
Region (cairo_region_t *cobject, bool has_reference=false) | |
Create a C++ wrapper for the C instance. More... | |
RefPtr< Region > | copy () const |
allocates a new region object copied from the original More... | |
virtual | ~Region () |
RectangleInt | get_extents () const |
Gets the bounding rectangle of the region. More... | |
int | get_num_rectangles () const |
Gets the number of rectangles contained in the region. More... | |
RectangleInt | get_rectangle (int nth_rectangle) const |
Gets the nth rectangle from the region. More... | |
bool | empty () const |
Checks whether the region is empty. More... | |
Overlap | contains_rectangle (const RectangleInt & rectangle) const |
Checks whether rectangle is inside, outside, or partially contained in the region. More... | |
bool | contains_point (int x, int y) const |
Checks whether (x,y) is contained in the region. More... | |
void | translate (int dx, int dy) |
Translates the region by (dx,dy) More... | |
void | subtract (const RefPtr< Region > & other) |
Subtracts other from this region. More... | |
void | subtract (const RectangleInt & rectangle) |
Subtracts rectangle from this region. More... | |
void | intersect (const RefPtr< Region > & other) |
Sets the region to the intersection of this region with other. More... | |
void | intersect (const RectangleInt & rectangle) |
Sets the region to the intersection of this region with rectangle. More... | |
void | do_union (const RefPtr< Region > & other) |
Sets this region to the union of the region with other. More... | |
void | do_union (const RectangleInt & rectangle) |
Sets this region to the union of the region with rectangle. More... | |
void | do_xor (const RefPtr< Region > & other) |
Sets this region to the exclusive difference of the region with other. More... | |
void | do_xor (const RectangleInt & rectangle) |
Sets this region to the exclusive difference of the region with rectangle. More... | |
cobject * | cobj () |
const cobject * | cobj () const |
void | reference () const |
void | unreference () const |
Static Public Member Functions | |
static RefPtr< Region > | create () |
Creates an empty Region object. More... | |
static RefPtr< Region > | create (const RectangleInt & rectangle) |
Creates a Region object containing rectangle. More... | |
static RefPtr< Region > | create (const std::vector< RectangleInt > & rects) |
Creates a Region object containing the union of all given rects. More... | |
static RefPtr< Region > | create (const RectangleInt * rects, int count) |
Creates a Region object containing the union of all given rects. More... | |
Protected Attributes | |
cobject * | m_cobject |
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
It allows set-theoretical operations like union and intersect to be performed on them.
typedef cairo_region_t Cairo::Region::cobject |
|
strong |
|
explicit |
Create a C++ wrapper for the C instance.
This C++ instance should then be given to a RefPtr.
cobject | The C instance. |
has_reference | Whether we already have a reference. Otherwise, the constructor will take an extra reference. |
|
virtual |
|
inline |
|
inline |
bool Cairo::Region::contains_point | ( | int | x, |
int | y | ||
) | const |
Checks whether (x,y) is contained in the region.
Overlap Cairo::Region::contains_rectangle | ( | const RectangleInt & | rectangle | ) | const |
Checks whether rectangle is inside, outside, or partially contained in the region.
allocates a new region object copied from the original
|
static |
Creates a Region object containing rectangle.
|
static |
Creates a Region object containing the union of all given rects.
|
static |
Creates a Region object containing the union of all given rects.
void Cairo::Region::do_union | ( | const RectangleInt & | rectangle | ) |
Sets this region to the union of the region with rectangle.
Sets this region to the union of the region with other.
void Cairo::Region::do_xor | ( | const RectangleInt & | rectangle | ) |
Sets this region to the exclusive difference of the region with rectangle.
That is, the region will contain all areas that are in the original region or in rectangle, but not in both
Sets this region to the exclusive difference of the region with other.
That is, the region will contain all areas that are in the original region or in other, but not in both
bool Cairo::Region::empty | ( | ) | const |
Checks whether the region is empty.
RectangleInt Cairo::Region::get_extents | ( | ) | const |
Gets the bounding rectangle of the region.
int Cairo::Region::get_num_rectangles | ( | ) | const |
Gets the number of rectangles contained in the region.
RectangleInt Cairo::Region::get_rectangle | ( | int | nth_rectangle | ) | const |
Gets the nth rectangle from the region.
void Cairo::Region::intersect | ( | const RectangleInt & | rectangle | ) |
Sets the region to the intersection of this region with rectangle.
Sets the region to the intersection of this region with other.
void Cairo::Region::reference | ( | ) | const |
void Cairo::Region::subtract | ( | const RectangleInt & | rectangle | ) |
Subtracts rectangle from this region.
void Cairo::Region::translate | ( | int | dx, |
int | dy | ||
) |
Translates the region by (dx,dy)
void Cairo::Region::unreference | ( | ) | const |
|
protected |