<?xml version="1.0"?>
<page id="Gimp.Selection.bounds"
      type="topic"
      style="function"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/1.0/ui/">
  <info>
    <link xref="Gimp.Selection" group="function" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>bool</api:type>
      </api:returns>
      <api:name>gimp_selection_bounds</api:name>
      <api:arg>
        <api:type>Gimp.Image</api:type>
        <api:name>image</api:name>
      </api:arg>
      <api:arg>
        <api:type>bool</api:type>
        <api:name>non_empty</api:name>
      </api:arg>
      <api:arg>
        <api:type>int</api:type>
        <api:name>x1</api:name>
      </api:arg>
      <api:arg>
        <api:type>int</api:type>
        <api:name>y1</api:name>
      </api:arg>
      <api:arg>
        <api:type>int</api:type>
        <api:name>x2</api:name>
      </api:arg>
      <api:arg>
        <api:type>int</api:type>
        <api:name>y2</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>Gimp.Selection.bounds</title>
  <synopsis><code mime="text/x-python">
@accepts(Gimp.Image, bool, int, int, int, int)
@returns(bool)
def bounds(image, non_empty, x1, y1, x2, y2):
    # Python wrapper for gimp_selection_bounds()
  </code></synopsis>
  <p>Find the bounding box of the current selection.</p>  <p>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).</p>

<terms>
<item>
<title><code>image</code></title>
  <p>The image.</p>
</item>
<item>
<title><code>non_empty</code></title>
  <p>TRUE if there is a selection.</p>
</item>
<item>
<title><code>x1</code></title>
  <p>x coordinate of upper left corner of selection bounds.</p>
</item>
<item>
<title><code>y1</code></title>
  <p>y coordinate of upper left corner of selection bounds.</p>
</item>
<item>
<title><code>x2</code></title>
  <p>x coordinate of lower right corner of selection bounds.</p>
</item>
<item>
<title><code>y2</code></title>
  <p>y coordinate of lower right corner of selection bounds.</p>
</item>
<item>
<title><code>Returns</code></title>
{formatter.format(node, node.retval.doc)}
</item>
</terms>

</page>
