Gegl.Rectangle¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
height |
r/w |
||
width |
r/w |
||
x |
r/w |
||
y |
r/w |
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gegl.Rectangle¶
- classmethod infinite_plane()¶
- Return type:
Returns a
Gegl.Rectangle
that represents an infininte plane.
- classmethod new(x, y, width, height)¶
- Parameters:
- Return type:
Creates a new rectangle set with the values from x, y, width and height.
- align(rectangle, tile, alignment)¶
- Parameters:
rectangle (
Gegl.Rectangle
) – aGegl.Rectangle
tile (
Gegl.Rectangle
) – aGegl.Rectangle
alignment (
Gegl.RectangleAlignment
) – aGegl.RectangleAlignment
value
- Return type:
Aligns rectangle to a regular tile grid, of which tile is a representative tile, and stores the result in self.
alignment can be one of:
Gegl.RectangleAlignment.SUBSET
: Calculate the biggest aligned rectangle contained in rectangle.Gegl.RectangleAlignment.SUPERSET
: Calculate the smallest aligned rectangle containing rectangle.Gegl.RectangleAlignment.NEAREST
: Calculate the nearest aligned rectangle to rectangle.self may point to the same object as rectangle or tile.
Returns
True
if the result is not empty.
- align_to_buffer(rectangle, buffer, alignment)¶
- Parameters:
rectangle (
Gegl.Rectangle
) – aGegl.Rectangle
buffer (
Gegl.Buffer
) – aGegl.Buffer
alignment (
Gegl.RectangleAlignment
) – aGegl.RectangleAlignment
value
- Return type:
Aligns rectangle to the tile grid of buffer, and stores the result in self.
alignment has the same meaning as for
Gegl.Rectangle.align
().self may point to the same object as rectangle.
Returns
True
if the result is not empty.
- bounding_box(source1, source2)¶
- Parameters:
source1 (
Gegl.Rectangle
) – aGegl.Rectangle
source2 (
Gegl.Rectangle
) – aGegl.Rectangle
Computes the bounding box of the rectangles source1 and source2 and stores the resulting bounding box in self.
self may point to the same object as source1 or source2.
- contains(child)¶
- Parameters:
child (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Checks if the
Gegl.Rectangle
child is fully contained within self.Returns
True
if the child is fully contained in self.
- copy(source)¶
- Parameters:
source (
Gegl.Rectangle
) – aGegl.Rectangle
Copies the rectangle information stored in source over the information in self.
self may point to the same object as source.
- dump()¶
For debugging purposes, not stable API.
- dup()¶
- Returns:
- Return type:
Create a new copy of self.
- equal(rectangle2)¶
- Parameters:
rectangle2 (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Check if two
Gegl.Rectangles
are equal.Returns
True
if rectangle and rectangle2 are equal.
- equal_coords(x, y, width, height)¶
- Parameters:
- Return type:
Check if a rectangle is equal to a set of parameters.
Returns
True
if self and x,`y` width x height are equal.
- intersect(src1, src2)¶
- Parameters:
src1 (
Gegl.Rectangle
) – aGegl.Rectangle
src2 (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Calculates the intersection of two rectangles. If the rectangles do not intersect, dest’s width and height are set to 0 and its x and y values are undefined.
self may point to the same object as src1 or src2.
Returns
True
if the rectangles intersect.
- is_empty()¶
- Return type:
Check if a rectangle has zero area.
Returns
True
if the width or height of self is 0.
- is_infinite_plane()¶
- Return type:
Returns
True
if theGegl.Rectangle
represents an infininte plane,False
otherwise.
- set(x, y, width, height)¶
- Parameters:
Sets the x, y, width and height on self.
- subtract(minuend, subtrahend)¶
- Parameters:
minuend (
Gegl.Rectangle
) – aGegl.Rectangle
subtrahend (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Subtracts subtrahend from minuend, and stores the resulting rectangles in self. Between 0 and 4 disjoint rectangles may be produced.
self may contain minuend or subtrahend.
Returns the number of resulting rectangles.
- subtract_bounding_box(minuend, subtrahend)¶
- Parameters:
minuend (
Gegl.Rectangle
) – aGegl.Rectangle
subtrahend (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Computes the bounding box of the area formed by subtracting subtrahend from minuend, and stores the result in self.
self may point to the same object as minuend or subtrahend.
Returns
True
if the result is not empty.
- xor(source1, source2)¶
- Parameters:
source1 (
Gegl.Rectangle
) – aGegl.Rectangle
source2 (
Gegl.Rectangle
) – aGegl.Rectangle
- Return type:
Computes the symmetric difference of the rectangles source1 and source2, and stores the resulting rectangles in self. Between 0 and 4 disjoint rectangles may be produced.
self may contain rectangle1 or rectangle2.
Returns the number of resulting rectangles.