Function

GimpSelectionbounds

Declaration [src]

gboolean
gimp_selection_bounds (
  GimpImage* image,
  gboolean* non_empty,
  gint* x1,
  gint* y1,
  gint* x2,
  gint* y2
)

Description [src]

Find the bounding box of the current selection.

This procedure returns whether there is a selection for the specified image. If there is one, the upper left and lower right corners of the bounding box are returned. These coordinates are relative to the image. Please note that the pixel specified by the lower right coordinate of the bounding box is not part of the selection. The selection ends at the upper left corner of this pixel. This means the width of the selection can be calculated as (x2 - x1), its height as (y2 - y1).

Parameters

image

Type: GimpImage

The image.

The data is owned by the caller of the function.
non_empty

Type: gboolean*

TRUE if there is a selection.

The argument will be set by the function.
x1

Type: gint*

X coordinate of upper left corner of selection bounds.

The argument will be set by the function.
y1

Type: gint*

Y coordinate of upper left corner of selection bounds.

The argument will be set by the function.
x2

Type: gint*

X coordinate of lower right corner of selection bounds.

The argument will be set by the function.
y2

Type: gint*

Y coordinate of lower right corner of selection bounds.

The argument will be set by the function.

Return value

Type: gboolean

TRUE on success.