cairo::region+x86_64 +linux

Regions - 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.

Index

Functions

fn contains_point(region: const *cairo::region_t, x: int, y: int) bool;
fn contains_rectangle(region: const *cairo::region_t, rectangle: *const cairo::rectangle_int_t) cairo::region_overlap_t;
fn copy(original: const *cairo::region_t) (*cairo::region_t | cairo::error);
fn create() (*cairo::region_t | cairo::error);
fn create_rectangle(rectangle: *const cairo::rectangle_int_t) (*cairo::region_t | cairo::error);
fn create_rectangles(rects: *const cairo::rectangle_int_t, count: int) (*cairo::region_t | cairo::error);
fn destroy(region: *cairo::region_t) void;
fn equal(a: const *cairo::region_t, b: const *cairo::region_t) bool;
fn get_extents(region: const *cairo::region_t) cairo::rectangle_int_t;
fn get_rectangle(region: const *cairo::region_t, nth: int, rectangle: *cairo::rectangle_int_t) void;
fn intersect(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);
fn intersect_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);
fn is_empty(region: const *cairo::region_t) bool;
fn num_rectangles(region: const *cairo::region_t) int;
fn reference(region: *cairo::region_t) *cairo::region_t;
fn status(region: const *cairo::region_t) cairo::status_t;
fn subtract(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);
fn subtract_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);
fn translate(region: *cairo::region_t, dx: int, dy: int) void;
fn union_(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);
fn union_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);
fn xor(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);
fn xor_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);

Functions

fn contains_point[link]

fn contains_point(region: const *cairo::region_t, x: int, y: int) bool;

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

Parameters

Returns true if (x, y) is contained in region, false if it is not.

fn contains_rectangle[link]

fn contains_rectangle(region: const *cairo::region_t, rectangle: *const cairo::rectangle_int_t) cairo::region_overlap_t;

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

Returns cairo::region_overlap_t::IN if rectangle is entirely inside region, cairo::region_overlap_t::OUT if rectangle is entirely outside region, or cairo::region_overlap_t::PART if rectangle is partially inside and partially outside region.

fn copy[link]

fn copy(original: const *cairo::region_t) (*cairo::region_t | cairo::error);

Allocates a new region object copying the area from original.

Returns a newly allocated cairo::region_t. Free with destroy. If an error occurs, cairo::error is returned instead.

fn create[link]

fn create() (*cairo::region_t | cairo::error);

Allocates a new empty region object. Returns a newly allocated cairo::region_t. Free with destroy. If an error occurs, cairo::error is returned instead.

fn create_rectangle[link]

fn create_rectangle(rectangle: *const cairo::rectangle_int_t) (*cairo::region_t | cairo::error);

XXX: Allocates a new region object containing rectangle. Returns a newly allocated cairo::region_t. Free with destroy. If an error occurs, cairo::error is returned instead.

fn create_rectangles[link]

fn create_rectangles(rects: *const cairo::rectangle_int_t, count: int) (*cairo::region_t | cairo::error);

XXX: Allocates a new region object containing the union of all given rects.

Parameters

Returns a newly allocated cairo::region_t. Free with destroy. If an error occurs, cairo::error is returned instead.

fn destroy[link]

fn destroy(region: *cairo::region_t) void;

Destroys a cairo::region_t object created with create, copy, or create_rectangle.

fn equal[link]

fn equal(a: const *cairo::region_t, b: const *cairo::region_t) bool;

Compares whether region_a is equivalent to region_b.

Returns true if both regions contained the same coverage, false if it is not or any region is in an error status.

fn get_extents[link]

fn get_extents(region: const *cairo::region_t) cairo::rectangle_int_t;

Gets the bounding rectangle of region as a cairo::rectangle_int_t.

fn get_rectangle[link]

fn get_rectangle(region: const *cairo::region_t, nth: int, rectangle: *cairo::rectangle_int_t) void;

XXX:. Stores the nth rectangle from the region in rectangle.

Parameters

fn intersect[link]

fn intersect(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);

Computes the intersection of dst with other and places the result in dst.

fn intersect_rectangle[link]

fn intersect_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);

Computes the intersection of dst with rectangle and places the result in dst.

fn is_empty[link]

fn is_empty(region: const *cairo::region_t) bool;

Checks whether region is empty. Returns true if region is empty, false if it isn't.

fn num_rectangles[link]

fn num_rectangles(region: const *cairo::region_t) int;

Returns the number of rectangles contained in region.

fn reference[link]

fn reference(region: *cairo::region_t) *cairo::region_t;

Increases the reference count on region by one. This prevents region from being destroyed until a matching call to destroy is made.

Returns the referenced cairo::region_t.

fn status[link]

fn status(region: const *cairo::region_t) cairo::status_t;

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

fn subtract[link]

fn subtract(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);

Subtracts other from dst and places the result in dst.

fn subtract_rectangle[link]

fn subtract_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);

Subtracts rectangle from dst and places the result in dst.

fn translate[link]

fn translate(region: *cairo::region_t, dx: int, dy: int) void;

Translates region by (dx, dy).

Parameters

fn union_[link]

fn union_(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);

Computes the union of dst with other and places the result in dst.

fn union_rectangle[link]

fn union_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);

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

fn xor[link]

fn xor(dst: *cairo::region_t, other: const *cairo::region_t) (void | cairo::error);

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.

fn xor_rectangle[link]

fn xor_rectangle(dst: *cairo::region_t, rectangle: *const cairo::rectangle_int_t) (void | cairo::error);

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.