673 lines
44 KiB
HTML
673 lines
44 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>gimpitemtransform</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||
<link rel="home" href="index.html" title="GIMP Library Reference Manual">
|
||
<link rel="up" href="libgimp-image.html" title="Manupulating Images and their Properties">
|
||
<link rel="prev" href="libgimp-gimpitem.html" title="gimpitem">
|
||
<link rel="next" href="libgimp-gimplayer.html" title="gimplayer">
|
||
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||
<tr valign="middle">
|
||
<td><a accesskey="p" href="libgimp-gimpitem.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="u" href="libgimp-image.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
||
<th width="100%" align="center">GIMP Library Reference Manual</th>
|
||
<td><a accesskey="n" href="libgimp-gimplayer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
||
</tr>
|
||
<tr><td colspan="5" class="shortcuts">
|
||
<a href="#libgimp-gimpitemtransform.synopsis" class="shortcut">Top</a>
|
||
|
|
||
<a href="#libgimp-gimpitemtransform.description" class="shortcut">Description</a>
|
||
</td></tr>
|
||
</table>
|
||
<div class="refentry">
|
||
<a name="libgimp-gimpitemtransform"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="libgimp-gimpitemtransform.top_of_page"></a>gimpitemtransform</span></h2>
|
||
<p>gimpitemtransform — Functions to perform transformations on items.</p>
|
||
</td>
|
||
<td valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsynopsisdiv">
|
||
<a name="libgimp-gimpitemtransform.synopsis"></a><h2>Synopsis</h2>
|
||
<pre class="synopsis"><span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-flip-simple" title="gimp_item_transform_flip_simple ()">gimp_item_transform_flip_simple</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpOrientationType" title="enum GimpOrientationType"><span class="type">GimpOrientationType</span></a> flip_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> axis</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-flip" title="gimp_item_transform_flip ()">gimp_item_transform_flip</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-perspective" title="gimp_item_transform_perspective ()">gimp_item_transform_perspective</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x3</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y3</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-rotate-simple" title="gimp_item_transform_rotate_simple ()">gimp_item_transform_rotate_simple</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpRotationType" title="enum GimpRotationType"><span class="type">GimpRotationType</span></a> rotate_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_y</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-rotate" title="gimp_item_transform_rotate ()">gimp_item_transform_rotate</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> angle</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_y</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-scale" title="gimp_item_transform_scale ()">gimp_item_transform_scale</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-shear" title="gimp_item_transform_shear ()">gimp_item_transform_shear</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpOrientationType" title="enum GimpOrientationType"><span class="type">GimpOrientationType</span></a> shear_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> magnitude</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-2d" title="gimp_item_transform_2d ()">gimp_item_transform_2d</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> source_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> source_y</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> scale_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> scale_y</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> angle</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> dest_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> dest_y</code></em>);
|
||
<span class="returnvalue">gint32</span> <a class="link" href="libgimp-gimpitemtransform.html#gimp-item-transform-matrix" title="gimp_item_transform_matrix ()">gimp_item_transform_matrix</a> (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_2</code></em>);
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libgimp-gimpitemtransform.description"></a><h2>Description</h2>
|
||
<p>
|
||
Functions to perform transformations on items.
|
||
</p>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libgimp-gimpitemtransform.details"></a><h2>Details</h2>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-flip-simple"></a><h3>gimp_item_transform_flip_simple ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_flip_simple (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpOrientationType" title="enum GimpOrientationType"><span class="type">GimpOrientationType</span></a> flip_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> axis</code></em>);</pre>
|
||
<p>
|
||
Flip the specified item either vertically or horizontally.
|
||
</p>
|
||
<p>
|
||
This procedure flips the specified item. 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 flipped. If auto_center is set to TRUE, the
|
||
flip is around the selection's center. Otherwise, the coordinate of
|
||
the axis needs to be specified. The return value is the ID of the
|
||
flipped item. If there was no selection or the item is not a
|
||
drawable, this will be equal to the item ID supplied as input.
|
||
Otherwise, this will be the newly created and flipped drawable. This
|
||
procedure is affected by the following context setters:
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>flip_type</code></em> :</span></p></td>
|
||
<td>Type of flip.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>auto_center</code></em> :</span></p></td>
|
||
<td>Whether to automatically position the axis in the selection center.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>axis</code></em> :</span></p></td>
|
||
<td>coord. of flip axis.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The flipped item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.2</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-flip"></a><h3>gimp_item_transform_flip ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_flip (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>);</pre>
|
||
<p>
|
||
Flip the specified item around a given line.
|
||
</p>
|
||
<p>
|
||
This procedure flips the specified item. 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 flipped. The axis to flip around is
|
||
specified by specifying two points from that line. The return value
|
||
is the ID of the flipped item. If there was no selection or the item
|
||
is not a drawable, this will be equal to the item ID supplied as
|
||
input. Otherwise, this will be the newly created and flipped
|
||
drawable. This procedure is affected by the following context
|
||
setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
|
||
<td>horz. coord. of one end of axis.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
|
||
<td>vert. coord. of one end of axis.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
|
||
<td>horz. coord. of other end of axis.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
|
||
<td>vert. coord. of other end of axis.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The flipped item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-perspective"></a><h3>gimp_item_transform_perspective ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_perspective (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x3</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y3</code></em>);</pre>
|
||
<p>
|
||
Perform a possibly non-affine transformation on the specified item.
|
||
</p>
|
||
<p>
|
||
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 specified item is
|
||
remapped if no selection exists or it is not a drawable. However, 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 remapped as specified.
|
||
The return value is the ID of the remapped item. If there was no
|
||
selection or the item is not a drawable, this will be equal to the
|
||
item ID supplied as input. Otherwise, this will be the newly created
|
||
and remapped drawable. 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. This procedure is affected by
|
||
the following context setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
|
||
<td>The new x coordinate of upper-left corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
|
||
<td>The new y coordinate of upper-left corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
|
||
<td>The new x coordinate of upper-right corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
|
||
<td>The new y coordinate of upper-right corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x2</code></em> :</span></p></td>
|
||
<td>The new x coordinate of lower-left corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y2</code></em> :</span></p></td>
|
||
<td>The new y coordinate of lower-left corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x3</code></em> :</span></p></td>
|
||
<td>The new x coordinate of lower-right corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y3</code></em> :</span></p></td>
|
||
<td>The new y coordinate of lower-right corner of original bounding box.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The newly mapped item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-rotate-simple"></a><h3>gimp_item_transform_rotate_simple ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_rotate_simple (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpRotationType" title="enum GimpRotationType"><span class="type">GimpRotationType</span></a> rotate_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_y</code></em>);</pre>
|
||
<p>
|
||
Rotate the specified item about given coordinates through the
|
||
specified angle.
|
||
</p>
|
||
<p>
|
||
This function rotates the specified item. 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 rotated by the specified amount. The return
|
||
value is the ID of the rotated item. If there was no selection or
|
||
the item is not a drawable, this will be equal to the item ID
|
||
supplied as input. Otherwise, this will be the newly created and
|
||
rotated drawable. This procedure is affected by the following
|
||
context setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>rotate_type</code></em> :</span></p></td>
|
||
<td>Type of rotation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>auto_center</code></em> :</span></p></td>
|
||
<td>Whether to automatically rotate around the selection center.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>center_x</code></em> :</span></p></td>
|
||
<td>The hor. coordinate of the center of rotation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>center_y</code></em> :</span></p></td>
|
||
<td>The vert. coordinate of the center of rotation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The rotated item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-rotate"></a><h3>gimp_item_transform_rotate ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_rotate (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> angle</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> auto_center</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> center_y</code></em>);</pre>
|
||
<p>
|
||
Rotate the specified item about given coordinates through the
|
||
specified angle.
|
||
</p>
|
||
<p>
|
||
This function rotates the specified item. 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 rotated by the specified amount. The return
|
||
value is the ID of the rotated item. If there was no selection or
|
||
the item is not a drawable, this will be equal to the item ID
|
||
supplied as input. Otherwise, this will be the newly created and
|
||
rotated drawable. This procedure is affected by the following
|
||
context setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
|
||
<td>The angle of rotation (radians).</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>auto_center</code></em> :</span></p></td>
|
||
<td>Whether to automatically rotate around the selection center.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>center_x</code></em> :</span></p></td>
|
||
<td>The hor. coordinate of the center of rotation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>center_y</code></em> :</span></p></td>
|
||
<td>The vert. coordinate of the center of rotation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The rotated item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-scale"></a><h3>gimp_item_transform_scale ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_scale (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> x1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> y1</code></em>);</pre>
|
||
<p>
|
||
Scale the specified item.
|
||
</p>
|
||
<p>
|
||
This procedure scales the specified item. 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 scaled by the specified amount. The return
|
||
value is the ID of the scaled item. If there was no selection or the
|
||
item is not a drawable, this will be equal to the item ID supplied
|
||
as input. Otherwise, this will be the newly created and scaled
|
||
drawable. This procedure is affected by the following context
|
||
setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
|
||
<td>The new x coordinate of the upper-left corner of the scaled region.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
|
||
<td>The new y coordinate of the upper-left corner of the scaled region.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
|
||
<td>The new x coordinate of the lower-right corner of the scaled region.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
|
||
<td>The new y coordinate of the lower-right corner of the scaled region.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The scaled item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-shear"></a><h3>gimp_item_transform_shear ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_shear (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><a class="link" href="libgimp-gimpenums.html#GimpOrientationType" title="enum GimpOrientationType"><span class="type">GimpOrientationType</span></a> shear_type</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> magnitude</code></em>);</pre>
|
||
<p>
|
||
Shear the specified item about its center by the specified
|
||
magnitude.
|
||
</p>
|
||
<p>
|
||
This procedure shears the specified item. 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 sheard by the specified amount. The return
|
||
value is the ID of the sheard item. If there was no selection or the
|
||
item is not a drawable, this will be equal to the item ID supplied
|
||
as input. Otherwise, this will be the newly created and sheard
|
||
drawable. The shear type parameter indicates whether the shear will
|
||
be applied horizontally or vertically. The magnitude can be either
|
||
positive or negative and indicates the extent (in pixels) to shear
|
||
by. This procedure is affected by the following context setters:
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>shear_type</code></em> :</span></p></td>
|
||
<td>Type of shear.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>magnitude</code></em> :</span></p></td>
|
||
<td>The magnitude of the shear.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The sheared item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-2d"></a><h3>gimp_item_transform_2d ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_2d (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> source_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> source_y</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> scale_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> scale_y</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> angle</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> dest_x</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> dest_y</code></em>);</pre>
|
||
<p>
|
||
Transform the specified item in 2d.
|
||
</p>
|
||
<p>
|
||
This procedure transforms the specified item. 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. The transformation is
|
||
done by scaling the image by the x and y scale factors about the
|
||
point (source_x, source_y), then rotating around the same point,
|
||
then translating that point to the new position (dest_x, dest_y).
|
||
The return value is the ID of the rotated drawable. If there was no
|
||
selection or the item is not a drawable, this will be equal to the
|
||
item ID supplied as input. Otherwise, this will be the newly created
|
||
and transformed drawable. This procedure is affected by the
|
||
following context setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>source_x</code></em> :</span></p></td>
|
||
<td>X coordinate of the transformation center.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>source_y</code></em> :</span></p></td>
|
||
<td>Y coordinate of the transformation center.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>scale_x</code></em> :</span></p></td>
|
||
<td>Amount to scale in x direction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>scale_y</code></em> :</span></p></td>
|
||
<td>Amount to scale in y direction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
|
||
<td>The angle of rotation (radians).</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>dest_x</code></em> :</span></p></td>
|
||
<td>X coordinate of where the center goes.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>dest_y</code></em> :</span></p></td>
|
||
<td>Y coordinate of where the center goes.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The transformed item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gimp-item-transform-matrix"></a><h3>gimp_item_transform_matrix ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gint32</span> gimp_item_transform_matrix (<em class="parameter"><code><span class="type">gint32</span> item_ID</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_0_2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_1_2</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_0</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_1</code></em>,
|
||
<em class="parameter"><code><span class="type">gdouble</span> coeff_2_2</code></em>);</pre>
|
||
<p>
|
||
Transform the specified item in 2d.
|
||
</p>
|
||
<p>
|
||
This procedure transforms the specified item. 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. The transformation is
|
||
done by assembling a 3x3 matrix from the coefficients passed. The
|
||
return value is the ID of the transformed item. If there was no
|
||
selection or the item is not a drawable, this will be equal to the
|
||
item ID supplied as input. Otherwise, this will be the newly created
|
||
and transformed drawable. This procedure is affected by the
|
||
following context setters: <a class="link" href="libgimp-gimpcontext.html#gimp-context-set-interpolation" title="gimp_context_set_interpolation ()"><code class="function">gimp_context_set_interpolation()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-direction" title="gimp_context_set_transform_direction ()"><code class="function">gimp_context_set_transform_direction()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-resize" title="gimp_context_set_transform_resize ()"><code class="function">gimp_context_set_transform_resize()</code></a>,
|
||
<a class="link" href="libgimp-gimpcontext.html#gimp-context-set-transform-recursion" title="gimp_context_set_transform_recursion ()"><code class="function">gimp_context_set_transform_recursion()</code></a>.
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item_ID</code></em> :</span></p></td>
|
||
<td>The affected item.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_0_0</code></em> :</span></p></td>
|
||
<td>coefficient (0,0) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_0_1</code></em> :</span></p></td>
|
||
<td>coefficient (0,1) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_0_2</code></em> :</span></p></td>
|
||
<td>coefficient (0,2) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_1_0</code></em> :</span></p></td>
|
||
<td>coefficient (1,0) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_1_1</code></em> :</span></p></td>
|
||
<td>coefficient (1,1) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_1_2</code></em> :</span></p></td>
|
||
<td>coefficient (1,2) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_2_0</code></em> :</span></p></td>
|
||
<td>coefficient (2,0) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_2_1</code></em> :</span></p></td>
|
||
<td>coefficient (2,1) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>coeff_2_2</code></em> :</span></p></td>
|
||
<td>coefficient (2,2) of the transformation matrix.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td>The transformed item.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
<p class="since">Since GIMP 2.8</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>
|
||
Generated by GTK-Doc V1.18</div>
|
||
</body>
|
||
</html> |