Region

Region — Representing a pixel-aligned area

class Region()

Region is 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.

class cairo.Region([rectangle_int|rectangle_ints])
Parameters:rectangle_int (RectangleInt or [RectangleInt]) – a rectangle or a list of rectangle

Allocates a new empty region object or a region object with the containing rectangle(s).

copy()
Returns:A newly allocated Region.
Raises:NoMemory if memory cannot be allocated.

Allocates a new Region object copying the area from original.

class RectangleInt()

RectangleInt is a data structure for holding a rectangle with integer coordinates.

class cairo.RectangleInt(x=0, y=0, width=0, height=0)
Parameters:
  • x (int) – X coordinate of the left side of the rectangle
  • y (int) – Y coordinate of the the top side of the rectangle
  • width (int) – width of the rectangle
  • height (int) – height of the rectangle

Allocates a new RectangleInt object.

Table Of Contents

Previous topic

Patterns

Next topic

Surfaces

This Page