Gimp.Item.transform_perspective

### Method

# Gimp Itemtransform_perspective

since: 2.8

#### Declaration [src]

    GimpItem*
    gimp_item_transform_perspective (
      GimpItem* item,
      gdouble x0,
      gdouble y0,
      gdouble x1,
      gdouble y1,
      gdouble x2,
      gdouble y2,
      gdouble x3,
      gdouble y3
    )

#### Description [src]

Perform a possibly non-affine transformation on the specified item.

This procedure performs a possibly non-affine transformation on the specified item by allowing the corners of the original bounding box to be arbitrarily remapped to any values.

The 4 coordinates specify the new locations of each corner of the original bounding box. By specifying these values, any affine transformation (rotation, scaling, translation) can be affected. Additionally, these values can be specified such that the resulting transformed item will appear to have been projected via a perspective transform.

If a selection exists and the item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then transformed as specified. The return value is the ID of the transformed floating selection.

If there is no selection or the item is not a drawable, the entire item will be transformed according to the specified mapping. The return value will be equal to the item ID supplied as input.

This procedure is affected by the following context setters: gimp_context_set_interpolation(), gimp_context_set_transform_direction(), gimp_context_set_transform_resize().

Available since: 2.8

#### Parameters

`x0`

  Type: `gdouble`

  The new x coordinate of upper-left corner of original bounding box.

`y0`

  Type: `gdouble`

  The new y coordinate of upper-left corner of original bounding box.

`x1`

  Type: `gdouble`

  The new x coordinate of upper-right corner of original bounding box.

`y1`

  Type: `gdouble`

  The new y coordinate of upper-right corner of original bounding box.

`x2`

  Type: `gdouble`

  The new x coordinate of lower-left corner of original bounding box.

`y2`

  Type: `gdouble`

  The new y coordinate of lower-left corner of original bounding box.

`x3`

  Type: `gdouble`

  The new x coordinate of lower-right corner of original bounding box.

`y3`

  Type: `gdouble`

  The new y coordinate of lower-right corner of original bounding box.

#### Return value

Type: `GimpItem`

The transformed item.

The data is owned by the instance.