1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
22
/* NOTE: This file is auto-generated by pdbgen.pl */
31
* gimp_vectors_is_valid:
32
* @vectors_ID: The vectors object to check.
34
* Returns TRUE if the vectors object is valid.
36
* This procedure checks if the given vectors ID is valid and refers to
37
* an existing vectors object.
39
* Returns: Whether the vectors ID is valid.
44
gimp_vectors_is_valid (gint32 vectors_ID)
46
GimpParam *return_vals;
48
gboolean valid = FALSE;
50
return_vals = gimp_run_procedure ("gimp-vectors-is-valid",
52
GIMP_PDB_VECTORS, vectors_ID,
55
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
56
valid = return_vals[1].data.d_int32;
58
gimp_destroy_params (return_vals, nreturn_vals);
65
* @image_ID: The image.
66
* @name: the name of the new vector object.
68
* Creates a new empty vectors object.
70
* Creates a new empty vectors object. Needs to be added to an image
71
* using gimp_image_add_vectors().
73
* Returns: the current vector object, 0 if no vector exists in the image.
78
gimp_vectors_new (gint32 image_ID,
81
GimpParam *return_vals;
83
gint32 vectors_ID = -1;
85
return_vals = gimp_run_procedure ("gimp-vectors-new",
87
GIMP_PDB_IMAGE, image_ID,
88
GIMP_PDB_STRING, name,
91
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
92
vectors_ID = return_vals[1].data.d_vectors;
94
gimp_destroy_params (return_vals, nreturn_vals);
100
* gimp_vectors_get_image:
101
* @vectors_ID: The vectors object.
103
* Returns the vectors objects image.
105
* Returns the vectors objects image.
107
* Returns: The vectors image.
112
gimp_vectors_get_image (gint32 vectors_ID)
114
GimpParam *return_vals;
116
gint32 image_ID = -1;
118
return_vals = gimp_run_procedure ("gimp-vectors-get-image",
120
GIMP_PDB_VECTORS, vectors_ID,
123
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
124
image_ID = return_vals[1].data.d_image;
126
gimp_destroy_params (return_vals, nreturn_vals);
132
* gimp_vectors_get_name:
133
* @vectors_ID: The vectors object.
135
* Gets the name of the vectors object.
137
* Gets the name of the vectors object.
139
* Returns: The name of the vectors object.
144
gimp_vectors_get_name (gint32 vectors_ID)
146
GimpParam *return_vals;
150
return_vals = gimp_run_procedure ("gimp-vectors-get-name",
152
GIMP_PDB_VECTORS, vectors_ID,
155
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
156
name = g_strdup (return_vals[1].data.d_string);
158
gimp_destroy_params (return_vals, nreturn_vals);
164
* gimp_vectors_set_name:
165
* @vectors_ID: The vectors object.
166
* @name: the new name of the path.
168
* Sets the name of the vectors object.
170
* Sets the name of the vectors object.
172
* Returns: TRUE on success.
177
gimp_vectors_set_name (gint32 vectors_ID,
180
GimpParam *return_vals;
182
gboolean success = TRUE;
184
return_vals = gimp_run_procedure ("gimp-vectors-set-name",
186
GIMP_PDB_VECTORS, vectors_ID,
187
GIMP_PDB_STRING, name,
190
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
192
gimp_destroy_params (return_vals, nreturn_vals);
198
* gimp_vectors_get_visible:
199
* @vectors_ID: The vectors object.
201
* Gets the visibility of the vectors object.
203
* Gets the visibility of the vectors object.
205
* Returns: TRUE if the path is visible, FALSE otherwise.
210
gimp_vectors_get_visible (gint32 vectors_ID)
212
GimpParam *return_vals;
214
gboolean visible = FALSE;
216
return_vals = gimp_run_procedure ("gimp-vectors-get-visible",
218
GIMP_PDB_VECTORS, vectors_ID,
221
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
222
visible = return_vals[1].data.d_int32;
224
gimp_destroy_params (return_vals, nreturn_vals);
230
* gimp_vectors_set_visible:
231
* @vectors_ID: The vectors object.
232
* @visible: Whether the path is visible.
234
* Sets the visibility of the vectors object.
236
* Sets the visibility of the vectors object.
238
* Returns: TRUE on success.
243
gimp_vectors_set_visible (gint32 vectors_ID,
246
GimpParam *return_vals;
248
gboolean success = TRUE;
250
return_vals = gimp_run_procedure ("gimp-vectors-set-visible",
252
GIMP_PDB_VECTORS, vectors_ID,
253
GIMP_PDB_INT32, visible,
256
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
258
gimp_destroy_params (return_vals, nreturn_vals);
264
* gimp_vectors_get_linked:
265
* @vectors_ID: The vectors object.
267
* Gets the linked state of the vectors object.
269
* Gets the linked state of the vectors object.
271
* Returns: TRUE if the path is linked, FALSE otherwise.
276
gimp_vectors_get_linked (gint32 vectors_ID)
278
GimpParam *return_vals;
280
gboolean linked = FALSE;
282
return_vals = gimp_run_procedure ("gimp-vectors-get-linked",
284
GIMP_PDB_VECTORS, vectors_ID,
287
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
288
linked = return_vals[1].data.d_int32;
290
gimp_destroy_params (return_vals, nreturn_vals);
296
* gimp_vectors_set_linked:
297
* @vectors_ID: The vectors object.
298
* @linked: Whether the path is linked.
300
* Sets the linked state of the vectors object.
302
* Sets the linked state of the vectors object.
304
* Returns: TRUE on success.
309
gimp_vectors_set_linked (gint32 vectors_ID,
312
GimpParam *return_vals;
314
gboolean success = TRUE;
316
return_vals = gimp_run_procedure ("gimp-vectors-set-linked",
318
GIMP_PDB_VECTORS, vectors_ID,
319
GIMP_PDB_INT32, linked,
322
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
324
gimp_destroy_params (return_vals, nreturn_vals);
330
* gimp_vectors_get_tattoo:
331
* @vectors_ID: The vectors object.
333
* Get the tattoo of the vectors object.
335
* Get the tattoo state of the vectors object.
337
* Returns: The vectors tattoo.
342
gimp_vectors_get_tattoo (gint32 vectors_ID)
344
GimpParam *return_vals;
348
return_vals = gimp_run_procedure ("gimp-vectors-get-tattoo",
350
GIMP_PDB_VECTORS, vectors_ID,
353
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
354
tattoo = return_vals[1].data.d_int32;
356
gimp_destroy_params (return_vals, nreturn_vals);
362
* gimp_vectors_set_tattoo:
363
* @vectors_ID: The vectors object.
364
* @tattoo: the new tattoo.
366
* Set the tattoo of the vectors object.
368
* Set the tattoo of the vectors object.
370
* Returns: TRUE on success.
375
gimp_vectors_set_tattoo (gint32 vectors_ID,
378
GimpParam *return_vals;
380
gboolean success = TRUE;
382
return_vals = gimp_run_procedure ("gimp-vectors-set-tattoo",
384
GIMP_PDB_VECTORS, vectors_ID,
385
GIMP_PDB_INT32, tattoo,
388
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
390
gimp_destroy_params (return_vals, nreturn_vals);
396
* gimp_vectors_get_strokes:
397
* @vectors_ID: The vectors object.
398
* @num_strokes: The number of strokes returned.
400
* List the strokes associated with the passed path.
402
* Returns an Array with the stroke-IDs associated with the passed
405
* Returns: List of the strokes belonging to the path.
410
gimp_vectors_get_strokes (gint32 vectors_ID,
413
GimpParam *return_vals;
415
gint *stroke_ids = NULL;
417
return_vals = gimp_run_procedure ("gimp-vectors-get-strokes",
419
GIMP_PDB_VECTORS, vectors_ID,
424
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
426
*num_strokes = return_vals[1].data.d_int32;
427
stroke_ids = g_new (gint32, *num_strokes);
429
return_vals[2].data.d_int32array,
430
*num_strokes * sizeof (gint32));
433
gimp_destroy_params (return_vals, nreturn_vals);
439
* gimp_vectors_stroke_get_length:
440
* @vectors_ID: The vectors object.
441
* @stroke_id: The stroke ID.
442
* @precision: The precision used for the approximation.
444
* Measure the length of the given stroke.
446
* Measure the length of the given stroke.
448
* Returns: The length (in pixels) of the given stroke.
453
gimp_vectors_stroke_get_length (gint32 vectors_ID,
457
GimpParam *return_vals;
459
gdouble length = 0.0;
461
return_vals = gimp_run_procedure ("gimp-vectors-stroke-get-length",
463
GIMP_PDB_VECTORS, vectors_ID,
464
GIMP_PDB_INT32, stroke_id,
465
GIMP_PDB_FLOAT, precision,
468
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
469
length = return_vals[1].data.d_float;
471
gimp_destroy_params (return_vals, nreturn_vals);
477
* gimp_vectors_stroke_get_point_at_dist:
478
* @vectors_ID: The vectors object.
479
* @stroke_id: The stroke ID.
480
* @dist: The given distance.
481
* @precision: The precision used for the approximation.
482
* @x_point: The x position of the point.
483
* @y_point: The y position of the point.
484
* @slope: The slope (dy / dx) at the specified point.
485
* @valid: Indicator for the validity of the returned data.
487
* Get point at a specified distance along the stroke.
489
* This will return the x,y position of a point at a given distance
490
* along the stroke. The distance will be obtained by first digitizing
491
* the curve internally and then walking along the curve. For a closed
492
* stroke the start of the path is the first point on the path that was
493
* created. This might not be obvious. If the stroke is not long
494
* enough, a \"valid\" flag will be FALSE.
496
* Returns: TRUE on success.
501
gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
510
GimpParam *return_vals;
512
gboolean success = TRUE;
514
return_vals = gimp_run_procedure ("gimp-vectors-stroke-get-point-at-dist",
516
GIMP_PDB_VECTORS, vectors_ID,
517
GIMP_PDB_INT32, stroke_id,
518
GIMP_PDB_FLOAT, dist,
519
GIMP_PDB_FLOAT, precision,
527
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
531
*x_point = return_vals[1].data.d_float;
532
*y_point = return_vals[2].data.d_float;
533
*slope = return_vals[3].data.d_float;
534
*valid = return_vals[4].data.d_int32;
537
gimp_destroy_params (return_vals, nreturn_vals);
543
* gimp_vectors_remove_stroke:
544
* @vectors_ID: The vectors object.
545
* @stroke_id: The stroke ID.
547
* remove the stroke from a vectors object.
549
* Remove the stroke from a vectors object.
551
* Returns: TRUE on success.
556
gimp_vectors_remove_stroke (gint32 vectors_ID,
559
GimpParam *return_vals;
561
gboolean success = TRUE;
563
return_vals = gimp_run_procedure ("gimp-vectors-remove-stroke",
565
GIMP_PDB_VECTORS, vectors_ID,
566
GIMP_PDB_INT32, stroke_id,
569
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
571
gimp_destroy_params (return_vals, nreturn_vals);
577
* gimp_vectors_stroke_close:
578
* @vectors_ID: The vectors object.
579
* @stroke_id: The stroke ID.
581
* closes the specified stroke.
583
* Closes the specified stroke.
585
* Returns: TRUE on success.
590
gimp_vectors_stroke_close (gint32 vectors_ID,
593
GimpParam *return_vals;
595
gboolean success = TRUE;
597
return_vals = gimp_run_procedure ("gimp-vectors-stroke-close",
599
GIMP_PDB_VECTORS, vectors_ID,
600
GIMP_PDB_INT32, stroke_id,
603
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
605
gimp_destroy_params (return_vals, nreturn_vals);
611
* gimp_vectors_stroke_translate:
612
* @vectors_ID: The vectors object.
613
* @stroke_id: The stroke ID.
614
* @off_x: Offset in x direction.
615
* @off_y: Offset in y direction.
617
* translate the given stroke.
619
* Translate the given stroke.
621
* Returns: TRUE on success.
626
gimp_vectors_stroke_translate (gint32 vectors_ID,
631
GimpParam *return_vals;
633
gboolean success = TRUE;
635
return_vals = gimp_run_procedure ("gimp-vectors-stroke-translate",
637
GIMP_PDB_VECTORS, vectors_ID,
638
GIMP_PDB_INT32, stroke_id,
639
GIMP_PDB_INT32, off_x,
640
GIMP_PDB_INT32, off_y,
643
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
645
gimp_destroy_params (return_vals, nreturn_vals);
651
* gimp_vectors_stroke_scale:
652
* @vectors_ID: The vectors object.
653
* @stroke_id: The stroke ID.
654
* @scale_x: Scale factor in x direction.
655
* @scale_y: Scale factor in y direction.
657
* scales the given stroke.
659
* Scale the given stroke.
661
* Returns: TRUE on success.
666
gimp_vectors_stroke_scale (gint32 vectors_ID,
671
GimpParam *return_vals;
673
gboolean success = TRUE;
675
return_vals = gimp_run_procedure ("gimp-vectors-stroke-scale",
677
GIMP_PDB_VECTORS, vectors_ID,
678
GIMP_PDB_INT32, stroke_id,
679
GIMP_PDB_FLOAT, scale_x,
680
GIMP_PDB_FLOAT, scale_y,
683
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
685
gimp_destroy_params (return_vals, nreturn_vals);
691
* gimp_vectors_stroke_rotate:
692
* @vectors_ID: The vectors object.
693
* @stroke_id: The stroke ID.
694
* @center_x: X coordinate of the rotation center.
695
* @center_y: Y coordinate of the rotation center.
696
* @angle: angle to rotate about.
698
* rotates the given stroke.
700
* Rotates the given stroke around given center by angle (in degrees).
702
* Returns: TRUE on success.
707
gimp_vectors_stroke_rotate (gint32 vectors_ID,
713
GimpParam *return_vals;
715
gboolean success = TRUE;
717
return_vals = gimp_run_procedure ("gimp-vectors-stroke-rotate",
719
GIMP_PDB_VECTORS, vectors_ID,
720
GIMP_PDB_INT32, stroke_id,
721
GIMP_PDB_FLOAT, center_x,
722
GIMP_PDB_FLOAT, center_y,
723
GIMP_PDB_FLOAT, angle,
726
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
728
gimp_destroy_params (return_vals, nreturn_vals);
734
* gimp_vectors_stroke_flip:
735
* @vectors_ID: The vectors object.
736
* @stroke_id: The stroke ID.
737
* @flip_type: Flip orientation, either vertical or horizontal.
738
* @axis: axis coordinate about which to flip, in pixels.
740
* flips the given stroke.
742
* Rotates the given stroke around given center by angle (in degrees).
744
* Returns: TRUE on success.
749
gimp_vectors_stroke_flip (gint32 vectors_ID,
751
GimpOrientationType flip_type,
754
GimpParam *return_vals;
756
gboolean success = TRUE;
758
return_vals = gimp_run_procedure ("gimp-vectors-stroke-flip",
760
GIMP_PDB_VECTORS, vectors_ID,
761
GIMP_PDB_INT32, stroke_id,
762
GIMP_PDB_INT32, flip_type,
763
GIMP_PDB_FLOAT, axis,
766
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
768
gimp_destroy_params (return_vals, nreturn_vals);
774
* gimp_vectors_stroke_flip_free:
775
* @vectors_ID: The vectors object.
776
* @stroke_id: The stroke ID.
777
* @x1: X coordinate of the first point of the flipping axis.
778
* @y1: Y coordinate of the first point of the flipping axis.
779
* @x2: X coordinate of the second point of the flipping axis.
780
* @y2: Y coordinate of the second point of the flipping axis.
782
* flips the given stroke about an arbitrary axis.
784
* Flips the given stroke about an arbitrary axis. Axis is defined by
785
* two coordinates in the image (in pixels), through which the flipping
788
* Returns: TRUE on success.
793
gimp_vectors_stroke_flip_free (gint32 vectors_ID,
800
GimpParam *return_vals;
802
gboolean success = TRUE;
804
return_vals = gimp_run_procedure ("gimp-vectors-stroke-flip-free",
806
GIMP_PDB_VECTORS, vectors_ID,
807
GIMP_PDB_INT32, stroke_id,
814
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
816
gimp_destroy_params (return_vals, nreturn_vals);
822
* gimp_vectors_stroke_get_points:
823
* @vectors_ID: The vectors object.
824
* @stroke_id: The stroke ID.
825
* @num_points: The number of floats returned.
826
* @controlpoints: List of the control points for the stroke (x0, y0, x1, y1, ...).
827
* @closed: Whether the stroke is closed or not.
829
* returns the control points of a stroke.
831
* returns the control points of a stroke. The interpretation of the
832
* coordinates returned depends on the type of the stroke. For Gimp 2.4
833
* this is always a bezier stroke, where the coordinates are the
836
* Returns: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
840
GimpVectorsStrokeType
841
gimp_vectors_stroke_get_points (gint32 vectors_ID,
844
gdouble **controlpoints,
847
GimpParam *return_vals;
849
GimpVectorsStrokeType type = 0;
851
return_vals = gimp_run_procedure ("gimp-vectors-stroke-get-points",
853
GIMP_PDB_VECTORS, vectors_ID,
854
GIMP_PDB_INT32, stroke_id,
859
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
861
type = return_vals[1].data.d_int32;
862
*num_points = return_vals[2].data.d_int32;
863
*controlpoints = g_new (gdouble, *num_points);
864
memcpy (*controlpoints,
865
return_vals[3].data.d_floatarray,
866
*num_points * sizeof (gdouble));
867
*closed = return_vals[4].data.d_int32;
870
gimp_destroy_params (return_vals, nreturn_vals);
876
* gimp_vectors_stroke_new_from_points:
877
* @vectors_ID: The vectors object.
878
* @type: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
879
* @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate).
880
* @controlpoints: List of the x- and y-coordinates of the control points.
881
* @closed: Whether the stroke is to be closed or not.
883
* Adds a stroke of a given type to the vectors object.
885
* Adds a stroke of a given type to the vectors object. The coordinates
886
* of the control points can be specified. For now only strokes of the
887
* type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control
888
* points are specified as a pair of float values for the x- and
889
* y-coordinate. The Bezier stroke type needs a multiple of three
890
* control points. Each Bezier segment endpoint (anchor, A) has two
891
* additional control points (C) associated. They are specified in the
894
* Returns: The stroke ID of the newly created stroke.
899
gimp_vectors_stroke_new_from_points (gint32 vectors_ID,
900
GimpVectorsStrokeType type,
902
const gdouble *controlpoints,
905
GimpParam *return_vals;
909
return_vals = gimp_run_procedure ("gimp-vectors-stroke-new-from-points",
911
GIMP_PDB_VECTORS, vectors_ID,
912
GIMP_PDB_INT32, type,
913
GIMP_PDB_INT32, num_points,
914
GIMP_PDB_FLOATARRAY, controlpoints,
915
GIMP_PDB_INT32, closed,
918
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
919
stroke_id = return_vals[1].data.d_int32;
921
gimp_destroy_params (return_vals, nreturn_vals);
927
* gimp_vectors_stroke_interpolate:
928
* @vectors_ID: The vectors object.
929
* @stroke_id: The stroke ID.
930
* @precision: The precision used for the approximation.
931
* @num_coords: The number of floats returned.
932
* @closed: Whether the stroke is closed or not.
934
* returns polygonal approximation of the stroke.
936
* returns polygonal approximation of the stroke.
938
* Returns: List of the coords along the path (x0, y0, x1, y1, ...).
943
gimp_vectors_stroke_interpolate (gint32 vectors_ID,
949
GimpParam *return_vals;
951
gdouble *coords = NULL;
953
return_vals = gimp_run_procedure ("gimp-vectors-stroke-interpolate",
955
GIMP_PDB_VECTORS, vectors_ID,
956
GIMP_PDB_INT32, stroke_id,
957
GIMP_PDB_FLOAT, precision,
962
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
964
*num_coords = return_vals[1].data.d_int32;
965
coords = g_new (gdouble, *num_coords);
967
return_vals[2].data.d_floatarray,
968
*num_coords * sizeof (gdouble));
969
*closed = return_vals[3].data.d_int32;
972
gimp_destroy_params (return_vals, nreturn_vals);
978
* gimp_vectors_bezier_stroke_new_moveto:
979
* @vectors_ID: The vectors object.
980
* @x0: The x-coordinate of the moveto.
981
* @y0: The y-coordinate of the moveto.
983
* Adds a bezier stroke with a single moveto to the vectors object.
985
* Adds a bezier stroke with a single moveto to the vectors object.
987
* Returns: The resulting stroke.
992
gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID,
996
GimpParam *return_vals;
1000
return_vals = gimp_run_procedure ("gimp-vectors-bezier-stroke-new-moveto",
1002
GIMP_PDB_VECTORS, vectors_ID,
1007
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1008
stroke_id = return_vals[1].data.d_int32;
1010
gimp_destroy_params (return_vals, nreturn_vals);
1016
* gimp_vectors_bezier_stroke_lineto:
1017
* @vectors_ID: The vectors object.
1018
* @stroke_id: The stroke ID.
1019
* @x0: The x-coordinate of the lineto.
1020
* @y0: The y-coordinate of the lineto.
1022
* Extends a bezier stroke with a lineto.
1024
* Extends a bezier stroke with a lineto.
1026
* Returns: TRUE on success.
1031
gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID,
1036
GimpParam *return_vals;
1038
gboolean success = TRUE;
1040
return_vals = gimp_run_procedure ("gimp-vectors-bezier-stroke-lineto",
1042
GIMP_PDB_VECTORS, vectors_ID,
1043
GIMP_PDB_INT32, stroke_id,
1048
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1050
gimp_destroy_params (return_vals, nreturn_vals);
1056
* gimp_vectors_bezier_stroke_conicto:
1057
* @vectors_ID: The vectors object.
1058
* @stroke_id: The stroke ID.
1059
* @x0: The x-coordinate of the control point.
1060
* @y0: The y-coordinate of the control point.
1061
* @x1: The x-coordinate of the end point.
1062
* @y1: The y-coordinate of the end point.
1064
* Extends a bezier stroke with a conic bezier spline.
1066
* Extends a bezier stroke with a conic bezier spline. Actually a cubic
1067
* bezier spline gets added that realizes the shape of a conic bezier
1070
* Returns: TRUE on success.
1075
gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID,
1082
GimpParam *return_vals;
1084
gboolean success = TRUE;
1086
return_vals = gimp_run_procedure ("gimp-vectors-bezier-stroke-conicto",
1088
GIMP_PDB_VECTORS, vectors_ID,
1089
GIMP_PDB_INT32, stroke_id,
1096
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1098
gimp_destroy_params (return_vals, nreturn_vals);
1104
* gimp_vectors_bezier_stroke_cubicto:
1105
* @vectors_ID: The vectors object.
1106
* @stroke_id: The stroke ID.
1107
* @x0: The x-coordinate of the first control point.
1108
* @y0: The y-coordinate of the first control point.
1109
* @x1: The x-coordinate of the second control point.
1110
* @y1: The y-coordinate of the second control point.
1111
* @x2: The x-coordinate of the end point.
1112
* @y2: The y-coordinate of the end point.
1114
* Extends a bezier stroke with a cubic bezier spline.
1116
* Extends a bezier stroke with a cubic bezier spline.
1118
* Returns: TRUE on success.
1123
gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
1132
GimpParam *return_vals;
1134
gboolean success = TRUE;
1136
return_vals = gimp_run_procedure ("gimp-vectors-bezier-stroke-cubicto",
1138
GIMP_PDB_VECTORS, vectors_ID,
1139
GIMP_PDB_INT32, stroke_id,
1148
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1150
gimp_destroy_params (return_vals, nreturn_vals);
1156
* gimp_vectors_bezier_stroke_new_ellipse:
1157
* @vectors_ID: The vectors object.
1158
* @x0: The x-coordinate of the center.
1159
* @y0: The y-coordinate of the center.
1160
* @radius_x: The radius in x direction.
1161
* @radius_y: The radius in y direction.
1162
* @angle: The angle the x-axis of the ellipse (radians, counterclockwise).
1164
* Adds a bezier stroke describing an ellipse the vectors object.
1166
* Adds a bezier stroke describing an ellipse the vectors object.
1168
* Returns: The resulting stroke.
1173
gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
1180
GimpParam *return_vals;
1184
return_vals = gimp_run_procedure ("gimp-vectors-bezier-stroke-new-ellipse",
1186
GIMP_PDB_VECTORS, vectors_ID,
1189
GIMP_PDB_FLOAT, radius_x,
1190
GIMP_PDB_FLOAT, radius_y,
1191
GIMP_PDB_FLOAT, angle,
1194
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1195
stroke_id = return_vals[1].data.d_int32;
1197
gimp_destroy_params (return_vals, nreturn_vals);
1203
* gimp_vectors_to_selection:
1204
* @vectors_ID: The vectors object to render to the selection.
1205
* @operation: The desired operation with current selection.
1206
* @antialias: Antialias selection.
1207
* @feather: Feather selection.
1208
* @feather_radius_x: Feather radius x.
1209
* @feather_radius_y: Feather radius y.
1211
* Transforms the specified vectors object into a selection
1213
* This procedure renders the desired vectors object into the current
1214
* selection of the image the vectors object belongs to.
1216
* Returns: TRUE on success.
1221
gimp_vectors_to_selection (gint32 vectors_ID,
1222
GimpChannelOps operation,
1225
gdouble feather_radius_x,
1226
gdouble feather_radius_y)
1228
GimpParam *return_vals;
1230
gboolean success = TRUE;
1232
return_vals = gimp_run_procedure ("gimp-vectors-to-selection",
1234
GIMP_PDB_VECTORS, vectors_ID,
1235
GIMP_PDB_INT32, operation,
1236
GIMP_PDB_INT32, antialias,
1237
GIMP_PDB_INT32, feather,
1238
GIMP_PDB_FLOAT, feather_radius_x,
1239
GIMP_PDB_FLOAT, feather_radius_y,
1242
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1244
gimp_destroy_params (return_vals, nreturn_vals);
1250
* gimp_vectors_import_from_file:
1251
* @image_ID: The image.
1252
* @filename: The name of the SVG file to import.
1253
* @merge: Merge paths into a single vectors object.
1254
* @scale: Scale the SVG to image dimensions.
1255
* @num_vectors: The number of newly created vectors.
1256
* @vectors_ids: The list of newly created vectors.
1258
* Import paths from an SVG file.
1260
* This procedure imports paths from an SVG file. SVG elements other
1261
* than paths and basic shapes are ignored.
1263
* Returns: TRUE on success.
1268
gimp_vectors_import_from_file (gint32 image_ID,
1269
const gchar *filename,
1273
gint32 **vectors_ids)
1275
GimpParam *return_vals;
1277
gboolean success = TRUE;
1279
return_vals = gimp_run_procedure ("gimp-vectors-import-from-file",
1281
GIMP_PDB_IMAGE, image_ID,
1282
GIMP_PDB_STRING, filename,
1283
GIMP_PDB_INT32, merge,
1284
GIMP_PDB_INT32, scale,
1288
*vectors_ids = NULL;
1290
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1294
*num_vectors = return_vals[1].data.d_int32;
1295
*vectors_ids = g_new (gint32, *num_vectors);
1296
memcpy (*vectors_ids,
1297
return_vals[2].data.d_int32array,
1298
*num_vectors * sizeof (gint32));
1301
gimp_destroy_params (return_vals, nreturn_vals);
1307
* gimp_vectors_import_from_string:
1308
* @image_ID: The image.
1309
* @string: A string that must be a complete and valid SVG document.
1310
* @length: Number of bytes in string or -1 if the string is NULL terminated.
1311
* @merge: Merge paths into a single vectors object.
1312
* @scale: Scale the SVG to image dimensions.
1313
* @num_vectors: The number of newly created vectors.
1314
* @vectors_ids: The list of newly created vectors.
1316
* Import paths from an SVG string.
1318
* This procedure works like gimp_vectors_import_from_file() but takes
1319
* a string rather than reading the SVG from a file. This allows you to
1320
* write scripts that generate SVG and feed it to GIMP.
1322
* Returns: TRUE on success.
1327
gimp_vectors_import_from_string (gint32 image_ID,
1328
const gchar *string,
1333
gint32 **vectors_ids)
1335
GimpParam *return_vals;
1337
gboolean success = TRUE;
1339
return_vals = gimp_run_procedure ("gimp-vectors-import-from-string",
1341
GIMP_PDB_IMAGE, image_ID,
1342
GIMP_PDB_STRING, string,
1343
GIMP_PDB_INT32, length,
1344
GIMP_PDB_INT32, merge,
1345
GIMP_PDB_INT32, scale,
1349
*vectors_ids = NULL;
1351
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1355
*num_vectors = return_vals[1].data.d_int32;
1356
*vectors_ids = g_new (gint32, *num_vectors);
1357
memcpy (*vectors_ids,
1358
return_vals[2].data.d_int32array,
1359
*num_vectors * sizeof (gint32));
1362
gimp_destroy_params (return_vals, nreturn_vals);