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.Rectanglethat 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.Rectangletile (
Gegl.Rectangle) – aGegl.Rectanglealignment (
Gegl.RectangleAlignment) – aGegl.RectangleAlignmentvalue
- 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
Trueif the result is not empty.
- align_to_buffer(rectangle, buffer, alignment)¶
- Parameters:
rectangle (
Gegl.Rectangle) – aGegl.Rectanglebuffer (
Gegl.Buffer) – aGegl.Bufferalignment (
Gegl.RectangleAlignment) – aGegl.RectangleAlignmentvalue
- 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
Trueif the result is not empty.
- bounding_box(source1, source2)¶
- Parameters:
source1 (
Gegl.Rectangle) – aGegl.Rectanglesource2 (
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.Rectanglechild is fully contained within self.Returns
Trueif 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.Rectanglesare equal.Returns
Trueif 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
Trueif self and x,`y` width x height are equal.
- intersect(src1, src2)¶
- Parameters:
src1 (
Gegl.Rectangle) – aGegl.Rectanglesrc2 (
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
Trueif the rectangles intersect.
- is_empty()¶
- Return type:
Check if a rectangle has zero area.
Returns
Trueif the width or height of self is 0.
- is_infinite_plane()¶
- Return type:
Returns
Trueif theGegl.Rectanglerepresents an infininte plane,Falseotherwise.
- set(x, y, width, height)¶
- Parameters:
Sets the x, y, width and height on self.
- subtract(minuend, subtrahend)¶
- Parameters:
minuend (
Gegl.Rectangle) – aGegl.Rectanglesubtrahend (
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.Rectanglesubtrahend (
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
Trueif the result is not empty.
- xor(source1, source2)¶
- Parameters:
source1 (
Gegl.Rectangle) – aGegl.Rectanglesource2 (
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.