jpayne@68: jpayne@68: jpayne@68:
jpayne@68: jpayne@68:jpayne@68: Top jpayne@68: | jpayne@68:![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68:
jpayne@68: Regionsjpayne@68:Regions — Representing a pixel-aligned area jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: cairo_region_t * jpayne@68: | jpayne@68:jpayne@68: cairo_region_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_region_t * jpayne@68: | jpayne@68:jpayne@68: cairo_region_create_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_region_t * jpayne@68: | jpayne@68:jpayne@68: cairo_region_create_rectangles () jpayne@68: | jpayne@68:
jpayne@68: cairo_region_t * jpayne@68: | jpayne@68:jpayne@68: cairo_region_copy () jpayne@68: | jpayne@68:
jpayne@68: cairo_region_t * jpayne@68: | jpayne@68:jpayne@68: cairo_region_reference () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_region_destroy () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_status () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_region_get_extents () jpayne@68: | jpayne@68:
jpayne@68: int jpayne@68: | jpayne@68:jpayne@68: cairo_region_num_rectangles () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_region_get_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_bool_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_is_empty () jpayne@68: | jpayne@68:
jpayne@68: cairo_bool_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_contains_point () jpayne@68: | jpayne@68:
jpayne@68: cairo_region_overlap_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_contains_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_bool_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_equal () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_region_translate () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_intersect () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_intersect_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_subtract () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_subtract_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_union () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_union_rectangle () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_xor () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_region_xor_rectangle () jpayne@68: | jpayne@68:
typedef | jpayne@68:cairo_region_t | jpayne@68:
enum | jpayne@68:cairo_region_overlap_t | jpayne@68:
Regions are a simple graphical data type representing an area of jpayne@68: integer-aligned rectangles. They are often used on raster surfaces jpayne@68: to track areas of interest, such as change or clip areas.
jpayne@68:cairo_region_t *
jpayne@68: cairo_region_create (void
);
jpayne@68: Allocates a new empty region object.
jpayne@68: A newly allocated cairo_region_t. Free with
jpayne@68: cairo_region_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_region_status()
.
Since: 1.10
jpayne@68:cairo_region_t *
jpayne@68: cairo_region_create_rectangle (const cairo_rectangle_int_t *rectangle
);
jpayne@68: Allocates a new region object containing rectangle
jpayne@68: .
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
A newly allocated cairo_region_t. Free with
jpayne@68: cairo_region_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_region_status()
.
Since: 1.10
jpayne@68:cairo_region_t * jpayne@68: cairo_region_create_rectangles (jpayne@68:const cairo_rectangle_int_t *rects
, jpayne@68:int count
);
Allocates a new region object containing the union of all given rects
jpayne@68: .
rects |
jpayne@68: an array of |
jpayne@68: jpayne@68: |
count |
jpayne@68: number of rectangles |
jpayne@68: jpayne@68: |
A newly allocated cairo_region_t. Free with
jpayne@68: cairo_region_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_region_status()
.
Since: 1.10
jpayne@68:cairo_region_t *
jpayne@68: cairo_region_copy (const cairo_region_t *original
);
jpayne@68: Allocates a new region object copying the area from original
jpayne@68: .
original |
jpayne@68: jpayne@68: | jpayne@68: |
A newly allocated cairo_region_t. Free with
jpayne@68: cairo_region_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_region_status()
.
Since: 1.10
jpayne@68:cairo_region_t *
jpayne@68: cairo_region_reference (cairo_region_t *region
);
jpayne@68: Increases the reference count on region
jpayne@68: by one. This prevents
jpayne@68: region
jpayne@68: from being destroyed until a matching call to
jpayne@68: cairo_region_destroy()
is made.
region |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:void
jpayne@68: cairo_region_destroy (cairo_region_t *region
);
jpayne@68: Destroys a cairo_region_t object created with
jpayne@68: cairo_region_create()
, cairo_region_copy()
, or
jpayne@68: or cairo_region_create_rectangle()
.
region |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t
jpayne@68: cairo_region_status (const cairo_region_t *region
);
jpayne@68: Checks whether an error has previous occurred for this jpayne@68: region object.
jpayne@68:region |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:void jpayne@68: cairo_region_get_extents (jpayne@68:const cairo_region_t *region
, jpayne@68:cairo_rectangle_int_t *extents
);
Gets the bounding rectangle of region
jpayne@68: as a cairo_rectangle_int_t
region |
jpayne@68: jpayne@68: | jpayne@68: |
extents |
jpayne@68: rectangle into which to store the extents |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:int
jpayne@68: cairo_region_num_rectangles (const cairo_region_t *region
);
jpayne@68: Returns the number of rectangles contained in region
jpayne@68: .
region |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:void jpayne@68: cairo_region_get_rectangle (jpayne@68:const cairo_region_t *region
, jpayne@68:int nth
, jpayne@68:cairo_rectangle_int_t *rectangle
);
Stores the nth
jpayne@68: rectangle from the region in rectangle
jpayne@68: .
region |
jpayne@68: jpayne@68: | jpayne@68: |
nth |
jpayne@68: a number indicating which rectangle should be returned |
jpayne@68: jpayne@68: |
rectangle |
jpayne@68: return location for a cairo_rectangle_int_t |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_bool_t
jpayne@68: cairo_region_is_empty (const cairo_region_t *region
);
jpayne@68: Checks whether region
jpayne@68: is empty.
region |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:cairo_bool_t jpayne@68: cairo_region_contains_point (jpayne@68:const cairo_region_t *region
, jpayne@68:int x
, jpayne@68:int y
);
Checks whether (x
jpayne@68: , y
jpayne@68: ) is contained in region
jpayne@68: .
region |
jpayne@68: jpayne@68: | jpayne@68: |
x |
jpayne@68: the x coordinate of a point |
jpayne@68: jpayne@68: |
y |
jpayne@68: the y coordinate of a point |
jpayne@68: jpayne@68: |
TRUE
if (x
jpayne@68: , y
jpayne@68: ) is contained in region
jpayne@68: , FALSE
if it is not.
Since: 1.10
jpayne@68:cairo_region_overlap_t jpayne@68: cairo_region_contains_rectangle (jpayne@68:const cairo_region_t *region
, jpayne@68:const cairo_rectangle_int_t *rectangle
);
Checks whether rectangle
jpayne@68: is inside, outside or partially contained
jpayne@68: in region
jpayne@68:
region |
jpayne@68: jpayne@68: | jpayne@68: |
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
CAIRO_REGION_OVERLAP_IN
if rectangle
jpayne@68: is entirely inside region
jpayne@68: ,
jpayne@68: CAIRO_REGION_OVERLAP_OUT
if rectangle
jpayne@68: is entirely outside region
jpayne@68: , or
jpayne@68: CAIRO_REGION_OVERLAP_PART
if rectangle
jpayne@68: is partially inside and partially outside region
jpayne@68: .
Since: 1.10
jpayne@68:cairo_bool_t jpayne@68: cairo_region_equal (jpayne@68:const cairo_region_t *a
, jpayne@68:const cairo_region_t *b
);
Compares whether region_a is equivalent to region_b. NULL
as an argument
jpayne@68: is equal to itself, but not to any non-NULL
region.
a |
jpayne@68: a cairo_region_t or |
jpayne@68: jpayne@68: |
b |
jpayne@68: a cairo_region_t or |
jpayne@68: jpayne@68: |
TRUE
if both regions contained the same coverage,
jpayne@68: FALSE
if it is not or any region is in an error status.
Since: 1.10
jpayne@68:void jpayne@68: cairo_region_translate (jpayne@68:cairo_region_t *region
, jpayne@68:int dx
, jpayne@68:int dy
);
Translates region
jpayne@68: by (dx
jpayne@68: , dy
jpayne@68: ).
region |
jpayne@68: jpayne@68: | jpayne@68: |
dx |
jpayne@68: Amount to translate in the x direction |
jpayne@68: jpayne@68: |
dy |
jpayne@68: Amount to translate in the y direction |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_intersect (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_region_t *other
);
Computes the intersection of dst
jpayne@68: with other
jpayne@68: and places the result in dst
jpayne@68:
dst |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_region_t |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_intersect_rectangle (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_rectangle_int_t *rectangle
);
Computes the intersection of dst
jpayne@68: with rectangle
jpayne@68: and places the
jpayne@68: result in dst
jpayne@68:
dst |
jpayne@68: jpayne@68: | jpayne@68: |
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_subtract (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_region_t *other
);
Subtracts other
jpayne@68: from dst
jpayne@68: and places the result in dst
jpayne@68:
dst |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_region_t |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_subtract_rectangle (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_rectangle_int_t *rectangle
);
Subtracts rectangle
jpayne@68: from dst
jpayne@68: and places the result in dst
jpayne@68:
dst |
jpayne@68: jpayne@68: | jpayne@68: |
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_union (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_region_t *other
);
Computes the union of dst
jpayne@68: with other
jpayne@68: and places the result in dst
jpayne@68:
dst |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_region_t |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_union_rectangle (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_rectangle_int_t *rectangle
);
Computes the union of dst
jpayne@68: with rectangle
jpayne@68: and places the result in dst
jpayne@68: .
dst |
jpayne@68: jpayne@68: | jpayne@68: |
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_xor (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_region_t *other
);
Computes the exclusive difference of dst
jpayne@68: with other
jpayne@68: and places the
jpayne@68: result in dst
jpayne@68: . That is, dst
jpayne@68: will be set to contain all areas that
jpayne@68: are either in dst
jpayne@68: or in other
jpayne@68: , but not in both.
dst |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_region_t |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68:cairo_status_t jpayne@68: cairo_region_xor_rectangle (jpayne@68:cairo_region_t *dst
, jpayne@68:const cairo_rectangle_int_t *rectangle
);
Computes the exclusive difference of dst
jpayne@68: with rectangle
jpayne@68: and places the
jpayne@68: result in dst
jpayne@68: . That is, dst
jpayne@68: will be set to contain all areas that are
jpayne@68: either in dst
jpayne@68: or in rectangle
jpayne@68: , but not in both.
dst |
jpayne@68: jpayne@68: | jpayne@68: |
rectangle |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.10
jpayne@68:typedef struct _cairo_region cairo_region_t; jpayne@68:jpayne@68:
A cairo_region_t represents a set of integer-aligned rectangles.
jpayne@68:It allows set-theoretical operations like cairo_region_union()
and
jpayne@68: cairo_region_intersect()
to be performed on them.
Memory management of cairo_region_t is done with
jpayne@68: cairo_region_reference()
and cairo_region_destroy()
.
Since: 1.10
jpayne@68:Used as the return value for cairo_region_contains_rectangle()
.
jpayne@68: |
jpayne@68: The contents are entirely inside the region. (Since 1.10) jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: The contents are entirely outside the region. (Since 1.10) jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: The contents are partially inside and jpayne@68: partially outside the region. (Since 1.10) jpayne@68: |
jpayne@68: jpayne@68: |
Since: 1.10
jpayne@68: