gimprectangle

gimprectangle — Utility functions dealing with rectangle extents.

Functions

Description

Utility functions dealing with rectangle extents.

Functions

gimp_rectangle_intersect ()

gboolean
gimp_rectangle_intersect (gint x1,
                          gint y1,
                          gint width1,
                          gint height1,
                          gint x2,
                          gint y2,
                          gint width2,
                          gint height2,
                          gint *dest_x,
                          gint *dest_y,
                          gint *dest_width,
                          gint *dest_height);

Calculates the intersection of two rectangles.

Parameters

x1

origin of first rectangle

 

y1

origin of first rectangle

 

width1

width of first rectangle

 

height1

height of first rectangle

 

x2

origin of second rectangle

 

y2

origin of second rectangle

 

width2

width of second rectangle

 

height2

height of second rectangle

 

dest_x

return location for origin of intersection (may be NULL)

 

dest_y

return location for origin of intersection (may be NULL)

 

dest_width

return location for width of intersection (may be NULL)

 

dest_height

return location for height of intersection (may be NULL)

 

Returns

TRUE if the intersection is non-empty, FALSE otherwise

Since: 2.4


gimp_rectangle_union ()

void
gimp_rectangle_union (gint x1,
                      gint y1,
                      gint width1,
                      gint height1,
                      gint x2,
                      gint y2,
                      gint width2,
                      gint height2,
                      gint *dest_x,
                      gint *dest_y,
                      gint *dest_width,
                      gint *dest_height);

Calculates the union of two rectangles.

Parameters

x1

origin of first rectangle

 

y1

origin of first rectangle

 

width1

width of first rectangle

 

height1

height of first rectangle

 

x2

origin of second rectangle

 

y2

origin of second rectangle

 

width2

width of second rectangle

 

height2

height of second rectangle

 

dest_x

return location for origin of union (may be NULL)

 

dest_y

return location for origin of union (may be NULL)

 

dest_width

return location for width of union (may be NULL)

 

dest_height

return location for height of union (may be NULL)

 

Since: 2.8