summaryrefslogtreecommitdiff
path: root/doc/reference/region.rst
blob: 06124a320a11c58d53f61042e7a60ce056215845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.. _region:

******
Region
******
Region — Representing a pixel-aligned area

.. currentmodule:: cairo


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:: Region([rectangle_int|rectangle_ints])

   :param rectangle_int: a rectangle or a list of rectangle
   :type rectangle_int: :class:`RectangleInt` or [:class:`RectangleInt`]

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


   .. method:: copy()

      :returns: A newly allocated :class:`Region`.
      :raises: :exc:`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:: RectangleInt(x=0, y=0, width=0, height=0)

   :param x: X coordinate of the left side of the rectangle
   :type x: int
   :param y: Y coordinate of the the top side of the rectangle
   :type y: int
   :param width: width of the rectangle
   :type width: int
   :param height: height of the rectangle
   :type height: int

   Allocates a new *RectangleInt* object.