3
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
<title>gimppaths</title>
5
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
6
<link rel="start" href="index.html" title="GIMP Library Reference Manual">
7
<link rel="up" href="libgimp-image.html" title="Manupulating Images and all their Properties">
8
<link rel="prev" href="libgimp-gimplayer.html" title="gimplayer">
9
<link rel="next" href="libgimp-gimppixelfetcher.html" title="gimppixelfetcher">
10
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
11
<link rel="stylesheet" href="style.css" type="text/css">
12
<link rel="part" href="gimpdefinitions.html" title="Part I. GIMP Constants">
13
<link rel="part" href="libgimp.html" title="Part II. GIMP Library">
14
<link rel="chapter" href="libgimp-general.html" title="Functions not Related to Specific Images">
15
<link rel="chapter" href="libgimp-image.html" title="Manupulating Images and all their Properties">
16
<link rel="chapter" href="libgimp-data.html" title="Data Objects">
17
<link rel="chapter" href="libgimp-selectors.html" title="Controlling the Core's Selection Dialogs">
18
<link rel="part" href="libgimpui.html" title="Part III. GIMP User Interface Library">
19
<link rel="chapter" href="libgimpui-hierarchy.html" title="Object Hierarchy">
21
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
22
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
23
<td><a accesskey="p" href="libgimp-gimplayer.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
24
<td><a accesskey="u" href="libgimp-image.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
25
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
26
<th width="100%" align="center">GIMP Library Reference Manual</th>
27
<td><a accesskey="n" href="libgimp-gimppixelfetcher.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
29
<div class="refentry" lang="en">
30
<a name="libgimp-gimppaths"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle">gimppaths</span></h2>
34
<p>gimppaths — Operations related to paths.</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
40
<pre class="synopsis">
44
gchar** <a href="libgimp-gimppaths.html#gimp-path-list">gimp_path_list</a> (gint32 image_ID,
46
gint <a href="libgimp-gimppaths.html#gimp-path-get-points">gimp_path_get_points</a> (gint32 image_ID,
49
gint *num_path_point_details,
50
gdouble **points_pairs);
51
gchar* <a href="libgimp-gimppaths.html#gimp-path-get-current">gimp_path_get_current</a> (gint32 image_ID);
52
gboolean <a href="libgimp-gimppaths.html#gimp-path-set-current">gimp_path_set_current</a> (gint32 image_ID,
54
gboolean <a href="libgimp-gimppaths.html#gimp-path-set-points">gimp_path_set_points</a> (gint32 image_ID,
58
const gdouble *points_pairs);
59
gboolean <a href="libgimp-gimppaths.html#gimp-path-stroke-current">gimp_path_stroke_current</a> (gint32 image_ID);
60
gint <a href="libgimp-gimppaths.html#gimp-path-get-point-at-dist">gimp_path_get_point_at_dist</a> (gint32 image_ID,
64
gint <a href="libgimp-gimppaths.html#gimp-path-get-tattoo">gimp_path_get_tattoo</a> (gint32 image_ID,
66
gchar* <a href="libgimp-gimppaths.html#gimp-get-path-by-tattoo">gimp_get_path_by_tattoo</a> (gint32 image_ID,
68
gboolean <a href="libgimp-gimppaths.html#gimp-path-delete">gimp_path_delete</a> (gint32 image_ID,
70
gint <a href="libgimp-gimppaths.html#gimp-path-get-locked">gimp_path_get_locked</a> (gint32 image_ID,
72
gboolean <a href="libgimp-gimppaths.html#gimp-path-set-locked">gimp_path_set_locked</a> (gint32 image_ID,
75
gboolean <a href="libgimp-gimppaths.html#gimp-path-set-tattoo">gimp_path_set_tattoo</a> (gint32 image_ID,
78
gboolean <a href="libgimp-gimppaths.html#gimp-path-to-selection">gimp_path_to_selection</a> (gint32 image_ID,
80
<a href="libgimp-gimpenums.html#GimpChannelOps">GimpChannelOps</a> op,
83
gdouble feather_radius_x,
84
gdouble feather_radius_y);
85
gboolean <a href="libgimp-gimppaths.html#gimp-path-import">gimp_path_import</a> (gint32 image_ID,
86
const gchar *filename,
91
<div class="refsect1" lang="en">
92
<a name="id2592082"></a><h2>Description</h2>
94
Operations related to paths.
97
<div class="refsect1" lang="en">
98
<a name="id2592092"></a><h2>Details</h2>
99
<div class="refsect2" lang="en">
100
<a name="id2592099"></a><h3>
101
<a name="gimp-path-list"></a>gimp_path_list ()</h3>
102
<a class="indexterm" name="id2592109"></a><pre class="programlisting">gchar** gimp_path_list (gint32 image_ID,
103
gint *num_paths);</pre>
105
List the paths associated with the passed image.
108
List the paths associated with the passed image.</p>
112
<div class="variablelist"><table border="0">
113
<col align="left" valign="top">
117
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
118
<td> The ID of the image to list the paths from.
123
<span class="term"><em class="parameter"><code>num_paths</code></em> :</span></td>
124
<td> The number of paths returned.
129
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
130
<td> List of the paths belonging to this image.
137
<div class="refsect2" lang="en">
138
<a name="id2592196"></a><h3>
139
<a name="gimp-path-get-points"></a>gimp_path_get_points ()</h3>
140
<a class="indexterm" name="id2592204"></a><pre class="programlisting">gint gimp_path_get_points (gint32 image_ID,
143
gint *num_path_point_details,
144
gdouble **points_pairs);</pre>
146
List the points associated with the named path.
149
List the points associated with the named path.</p>
153
<div class="variablelist"><table border="0">
154
<col align="left" valign="top">
158
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
159
<td> The ID of the image to list the paths from.
164
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
165
<td> The name of the path whose points should be listed.
170
<span class="term"><em class="parameter"><code>path_closed</code></em> :</span></td>
171
<td> Return if the path is closed. (0 = path open, 1 = path closed).
176
<span class="term"><em class="parameter"><code>num_path_point_details</code></em> :</span></td>
177
<td> The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
182
<span class="term"><em class="parameter"><code>points_pairs</code></em> :</span></td>
183
<td> The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution.
188
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
189
<td> The type of the path. Currently only one type (1 = Bezier) is supported.
196
<div class="refsect2" lang="en">
197
<a name="id2592364"></a><h3>
198
<a name="gimp-path-get-current"></a>gimp_path_get_current ()</h3>
199
<a class="indexterm" name="id2592372"></a><pre class="programlisting">gchar* gimp_path_get_current (gint32 image_ID);</pre>
201
The name of the current path. Error if no paths.
204
The name of the current path. Error if no paths.</p>
208
<div class="variablelist"><table border="0">
209
<col align="left" valign="top">
213
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
214
<td> The ID of the image to get the current path from.
219
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
220
<td> The name of the current path.
227
<div class="refsect2" lang="en">
228
<a name="id2592437"></a><h3>
229
<a name="gimp-path-set-current"></a>gimp_path_set_current ()</h3>
230
<a class="indexterm" name="id2592446"></a><pre class="programlisting">gboolean gimp_path_set_current (gint32 image_ID,
231
const gchar *name);</pre>
233
Sets the current path associated with the passed image.
236
Sets a named path as the current path.</p>
240
<div class="variablelist"><table border="0">
241
<col align="left" valign="top">
245
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
246
<td> The ID of the image in which a path will become current.
251
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
252
<td> The name of the path to make current.
257
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
258
<td> TRUE on success.
265
<div class="refsect2" lang="en">
266
<a name="id2599469"></a><h3>
267
<a name="gimp-path-set-points"></a>gimp_path_set_points ()</h3>
268
<a class="indexterm" name="id2599478"></a><pre class="programlisting">gboolean gimp_path_set_points (gint32 image_ID,
271
gint num_path_points,
272
const gdouble *points_pairs);</pre>
274
Set the points associated with the named path.
277
Set the points associated with the named path.</p>
281
<div class="variablelist"><table border="0">
282
<col align="left" valign="top">
286
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
287
<td> The ID of the image to set the paths in.
292
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
293
<td> The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path.
298
<span class="term"><em class="parameter"><code>ptype</code></em> :</span></td>
299
<td> The type of the path. Currently only one type (1 = Bezier) is supported.
304
<span class="term"><em class="parameter"><code>num_path_points</code></em> :</span></td>
305
<td> The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC.
310
<span class="term"><em class="parameter"><code>points_pairs</code></em> :</span></td>
311
<td> The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution.
316
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
317
<td> TRUE on success.
324
<div class="refsect2" lang="en">
325
<a name="id2599625"></a><h3>
326
<a name="gimp-path-stroke-current"></a>gimp_path_stroke_current ()</h3>
327
<a class="indexterm" name="id2599634"></a><pre class="programlisting">gboolean gimp_path_stroke_current (gint32 image_ID);</pre>
329
Stroke the current path in the passed image.
332
Stroke the current path in the passed image.</p>
336
<div class="variablelist"><table border="0">
337
<col align="left" valign="top">
341
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
342
<td> The ID of the image which contains the path to stroke.
347
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
348
<td> TRUE on success.
355
<div class="refsect2" lang="en">
356
<a name="id2599700"></a><h3>
357
<a name="gimp-path-get-point-at-dist"></a>gimp_path_get_point_at_dist ()</h3>
358
<a class="indexterm" name="id2599708"></a><pre class="programlisting">gint gimp_path_get_point_at_dist (gint32 image_ID,
361
gdouble *slope);</pre>
363
Get point on a path at a specified distance along the path.
366
This will return the x,y position of a point at a given distance
367
along the bezier curve. The distance will be obtained by first
368
digitizing the curve internally and then walking along the curve.
369
For a closed curve the start of the path is the first point on the
370
path that was created. This might not be obvious. Note the current
375
<div class="variablelist"><table border="0">
376
<col align="left" valign="top">
380
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
381
<td> The ID of the image the paths belongs to.
386
<span class="term"><em class="parameter"><code>distance</code></em> :</span></td>
387
<td> The distance along the path.
392
<span class="term"><em class="parameter"><code>y_point</code></em> :</span></td>
393
<td> The y position of the point.
398
<span class="term"><em class="parameter"><code>slope</code></em> :</span></td>
399
<td> The slope (dy / dx) at the specified point.
404
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
405
<td> The x position of the point.
412
<div class="refsect2" lang="en">
413
<a name="id2599841"></a><h3>
414
<a name="gimp-path-get-tattoo"></a>gimp_path_get_tattoo ()</h3>
415
<a class="indexterm" name="id2599850"></a><pre class="programlisting">gint gimp_path_get_tattoo (gint32 image_ID,
416
const gchar *name);</pre>
418
Returns the tattoo associated with the name path.
421
This procedure returns the tattoo associated with the specified
422
path. A tattoo is a unique and permanent identifier attached to a
423
path that can be used to uniquely identify a path within an image
424
even between sessions.</p>
428
<div class="variablelist"><table border="0">
429
<col align="left" valign="top">
433
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
439
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
440
<td> The name of the path whose tattoo should be obtained.
445
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
446
<td> The tattoo associated with the named path.
453
<div class="refsect2" lang="en">
454
<a name="id2599940"></a><h3>
455
<a name="gimp-get-path-by-tattoo"></a>gimp_get_path_by_tattoo ()</h3>
456
<a class="indexterm" name="id2599949"></a><pre class="programlisting">gchar* gimp_get_path_by_tattoo (gint32 image_ID,
459
Return the name of the path with the given tattoo.
462
The procedure returns the name of the path in the specified image
463
which has the passed tattoo. The tattoos are unique within the image
464
and will be preserved across sessions and through renaming of the
465
path. An error is returned if no path with the specified tattoo can
470
<div class="variablelist"><table border="0">
471
<col align="left" valign="top">
475
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
481
<span class="term"><em class="parameter"><code>tattoo</code></em> :</span></td>
482
<td> The tattoo of the required path.
487
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
488
<td> The name of the path with the specified tattoo.
495
<div class="refsect2" lang="en">
496
<a name="id2600040"></a><h3>
497
<a name="gimp-path-delete"></a>gimp_path_delete ()</h3>
498
<a class="indexterm" name="id2600050"></a><pre class="programlisting">gboolean gimp_path_delete (gint32 image_ID,
499
const gchar *name);</pre>
501
Delete the named path associated with the passed image.
504
Delete the named path.</p>
508
<div class="variablelist"><table border="0">
509
<col align="left" valign="top">
513
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
514
<td> The ID of the image to delete the path from.
519
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
520
<td> The name of the path to delete.
525
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
526
<td> TRUE on success.
533
<div class="refsect2" lang="en">
534
<a name="id2600136"></a><h3>
535
<a name="gimp-path-get-locked"></a>gimp_path_get_locked ()</h3>
536
<a class="indexterm" name="id2600145"></a><pre class="programlisting">gint gimp_path_get_locked (gint32 image_ID,
537
const gchar *name);</pre>
539
Returns the locked status associated with the named path.
542
This procedure returns the lock status associated with the specified
543
path. A path can be \"locked\" which means that the transformation
544
tool operations will also apply to the path.</p>
548
<div class="variablelist"><table border="0">
549
<col align="left" valign="top">
553
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
559
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
560
<td> The name of the path whose locked status should be obtained.
565
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
566
<td> The lock status associated with the name path. 0 is returned if the path is not locked. 1 is returned if the path is locked.
573
<div class="refsect2" lang="en">
574
<a name="id2593162"></a><h3>
575
<a name="gimp-path-set-locked"></a>gimp_path_set_locked ()</h3>
576
<a class="indexterm" name="id2593171"></a><pre class="programlisting">gboolean gimp_path_set_locked (gint32 image_ID,
578
gint lockstatus);</pre>
580
Set the locked status associated with the named path.
583
This procedure sets the lock status associated with the specified
584
path. A path can be \"locked\" which means that the transformation
585
tool operations will also apply to the path.</p>
589
<div class="variablelist"><table border="0">
590
<col align="left" valign="top">
594
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
600
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
601
<td> the name of the path whose locked status should be set.
606
<span class="term"><em class="parameter"><code>lockstatus</code></em> :</span></td>
607
<td> The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked.
612
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
613
<td> TRUE on success.
620
<div class="refsect2" lang="en">
621
<a name="id2593283"></a><h3>
622
<a name="gimp-path-set-tattoo"></a>gimp_path_set_tattoo ()</h3>
623
<a class="indexterm" name="id2593292"></a><pre class="programlisting">gboolean gimp_path_set_tattoo (gint32 image_ID,
625
gint tattovalue);</pre>
627
Sets the tattoo associated with the named path.
630
This procedure sets the tattoo associated with the specified path. A
631
tattoo is a unique and permenant identifier attached to a path that
632
can be used to uniquely identify a path within an image even between
633
sessions. Note that the value passed to this function must have been
634
obtained from a previous call to path_get_tattoo.</p>
638
<div class="variablelist"><table border="0">
639
<col align="left" valign="top">
643
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
649
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
650
<td> the name of the path whose tattoo should be set.
655
<span class="term"><em class="parameter"><code>tattovalue</code></em> :</span></td>
656
<td> The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
661
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
662
<td> TRUE on success.
669
<div class="refsect2" lang="en">
670
<a name="id2593407"></a><h3>
671
<a name="gimp-path-to-selection"></a>gimp_path_to_selection ()</h3>
672
<a class="indexterm" name="id2593416"></a><pre class="programlisting">gboolean gimp_path_to_selection (gint32 image_ID,
674
<a href="libgimp-gimpenums.html#GimpChannelOps">GimpChannelOps</a> op,
677
gdouble feather_radius_x,
678
gdouble feather_radius_y);</pre>
680
Transforms the active path into a selection
683
This procedure renders the desired path into the current selection.</p>
687
<div class="variablelist"><table border="0">
688
<col align="left" valign="top">
692
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
698
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
699
<td> The name of the path which should be made into selection.
704
<span class="term"><em class="parameter"><code>op</code></em> :</span></td>
705
<td> The desired operation with current selection.
710
<span class="term"><em class="parameter"><code>antialias</code></em> :</span></td>
711
<td> Antialias selection.
716
<span class="term"><em class="parameter"><code>feather</code></em> :</span></td>
717
<td> Feather selection.
722
<span class="term"><em class="parameter"><code>feather_radius_x</code></em> :</span></td>
723
<td> Feather radius x.
728
<span class="term"><em class="parameter"><code>feather_radius_y</code></em> :</span></td>
729
<td> Feather radius y.
734
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
735
<td> TRUE on success.
742
<div class="refsect2" lang="en">
743
<a name="id2593610"></a><h3>
744
<a name="gimp-path-import"></a>gimp_path_import ()</h3>
745
<a class="indexterm" name="id2593620"></a><pre class="programlisting">gboolean gimp_path_import (gint32 image_ID,
746
const gchar *filename,
748
gboolean scale);</pre>
750
Import paths from an SVG file.
753
This procedure imports paths from an SVG file. This is a temporary
754
solution until the new vectors PDB API is in place. Don't rely on
755
this function being available in future GIMP releases.</p>
759
<div class="variablelist"><table border="0">
760
<col align="left" valign="top">
764
<span class="term"><em class="parameter"><code>image_ID</code></em> :</span></td>
770
<span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
771
<td> The name of the SVG file to import.
776
<span class="term"><em class="parameter"><code>merge</code></em> :</span></td>
777
<td> Merge paths into a single vectors object.
782
<span class="term"><em class="parameter"><code>scale</code></em> :</span></td>
783
<td> Scale the SVG to image dimensions.
788
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
789
<td> TRUE on success.
797
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
798
<td align="left"><a accesskey="p" href="libgimp-gimplayer.html"><b><< gimplayer</b></a></td>
799
<td align="right"><a accesskey="n" href="libgimp-gimppixelfetcher.html"><b>gimppixelfetcher >></b></a></td>