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 3 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, see
18 * <https://www.gnu.org/licenses/>.
21 /* NOTE: This file is auto-generated by pdbgen.pl */
31 * SECTION: gimpgradient
32 * @title: gimpgradient
33 * @short_description: Functions operating on a single gradient.
35 * Functions operating on a single gradient.
41 * @name: The requested name of the new gradient.
43 * Creates a new gradient
45 * This procedure creates a new, uninitialized gradient
47 * Returns: The actual new gradient name.
52 gimp_gradient_new (const gchar
*name
)
54 GimpParam
*return_vals
;
56 gchar
*actual_name
= NULL
;
58 return_vals
= gimp_run_procedure ("gimp-gradient-new",
60 GIMP_PDB_STRING
, name
,
63 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
64 actual_name
= g_strdup (return_vals
[1].data
.d_string
);
66 gimp_destroy_params (return_vals
, nreturn_vals
);
72 * gimp_gradient_duplicate:
73 * @name: The gradient name.
75 * Duplicates a gradient
77 * This procedure creates an identical gradient by a different name
79 * Returns: The name of the gradient's copy.
84 gimp_gradient_duplicate (const gchar
*name
)
86 GimpParam
*return_vals
;
88 gchar
*copy_name
= NULL
;
90 return_vals
= gimp_run_procedure ("gimp-gradient-duplicate",
92 GIMP_PDB_STRING
, name
,
95 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
96 copy_name
= g_strdup (return_vals
[1].data
.d_string
);
98 gimp_destroy_params (return_vals
, nreturn_vals
);
104 * gimp_gradient_is_editable:
105 * @name: The gradient name.
107 * Tests if gradient can be edited
109 * Returns TRUE if you have permission to change the gradient
111 * Returns: TRUE if the gradient can be edited.
116 gimp_gradient_is_editable (const gchar
*name
)
118 GimpParam
*return_vals
;
120 gboolean editable
= FALSE
;
122 return_vals
= gimp_run_procedure ("gimp-gradient-is-editable",
124 GIMP_PDB_STRING
, name
,
127 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
128 editable
= return_vals
[1].data
.d_int32
;
130 gimp_destroy_params (return_vals
, nreturn_vals
);
136 * gimp_gradient_rename:
137 * @name: The gradient name.
138 * @new_name: The new name of the gradient.
142 * This procedure renames a gradient
144 * Returns: The actual new name of the gradient.
149 gimp_gradient_rename (const gchar
*name
,
150 const gchar
*new_name
)
152 GimpParam
*return_vals
;
154 gchar
*actual_name
= NULL
;
156 return_vals
= gimp_run_procedure ("gimp-gradient-rename",
158 GIMP_PDB_STRING
, name
,
159 GIMP_PDB_STRING
, new_name
,
162 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
163 actual_name
= g_strdup (return_vals
[1].data
.d_string
);
165 gimp_destroy_params (return_vals
, nreturn_vals
);
171 * gimp_gradient_delete:
172 * @name: The gradient name.
176 * This procedure deletes a gradient
178 * Returns: TRUE on success.
183 gimp_gradient_delete (const gchar
*name
)
185 GimpParam
*return_vals
;
187 gboolean success
= TRUE
;
189 return_vals
= gimp_run_procedure ("gimp-gradient-delete",
191 GIMP_PDB_STRING
, name
,
194 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
196 gimp_destroy_params (return_vals
, nreturn_vals
);
202 * gimp_gradient_get_number_of_segments:
203 * @name: The gradient name.
205 * Returns the number of segments of the specified gradient
207 * This procedure returns the number of segments of the specified
210 * Returns: Number of segments.
215 gimp_gradient_get_number_of_segments (const gchar
*name
)
217 GimpParam
*return_vals
;
219 gint num_segments
= 0;
221 return_vals
= gimp_run_procedure ("gimp-gradient-get-number-of-segments",
223 GIMP_PDB_STRING
, name
,
226 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
227 num_segments
= return_vals
[1].data
.d_int32
;
229 gimp_destroy_params (return_vals
, nreturn_vals
);
235 * gimp_gradient_get_uniform_samples:
236 * @name: The gradient name.
237 * @num_samples: The number of samples to take.
238 * @reverse: Use the reverse gradient.
239 * @num_color_samples: Length of the color_samples array (4 * num_samples).
240 * @color_samples: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
242 * Sample the specified in uniform parts.
244 * This procedure samples the active gradient in the specified number
245 * of uniform parts. It returns a list of floating-point values which
246 * correspond to the RGBA values for each sample. The minimum number of
247 * samples to take is 2, in which case the returned colors will
248 * correspond to the { 0.0, 1.0 } positions in the gradient. For
249 * example, if the number of samples is 3, the procedure will return
250 * the colors at positions { 0.0, 0.5, 1.0 }.
252 * Returns: TRUE on success.
257 gimp_gradient_get_uniform_samples (const gchar
*name
,
260 gint
*num_color_samples
,
261 gdouble
**color_samples
)
263 GimpParam
*return_vals
;
265 gboolean success
= TRUE
;
267 return_vals
= gimp_run_procedure ("gimp-gradient-get-uniform-samples",
269 GIMP_PDB_STRING
, name
,
270 GIMP_PDB_INT32
, num_samples
,
271 GIMP_PDB_INT32
, reverse
,
274 *num_color_samples
= 0;
275 *color_samples
= NULL
;
277 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
281 *num_color_samples
= return_vals
[1].data
.d_int32
;
282 *color_samples
= g_new (gdouble
, *num_color_samples
);
283 memcpy (*color_samples
,
284 return_vals
[2].data
.d_floatarray
,
285 *num_color_samples
* sizeof (gdouble
));
288 gimp_destroy_params (return_vals
, nreturn_vals
);
294 * gimp_gradient_get_custom_samples:
295 * @name: The gradient name.
296 * @num_samples: The number of samples to take.
297 * @positions: The list of positions to sample along the gradient.
298 * @reverse: Use the reverse gradient.
299 * @num_color_samples: Length of the color_samples array (4 * num_samples).
300 * @color_samples: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
302 * Sample the specified gradient in custom positions.
304 * This procedure samples the active gradient in the specified number
305 * of points. The procedure will sample the gradient in the specified
306 * positions from the list. The left endpoint of the gradient
307 * corresponds to position 0.0, and the right endpoint corresponds to
308 * 1.0. The procedure returns a list of floating-point values which
309 * correspond to the RGBA values for each sample.
311 * Returns: TRUE on success.
316 gimp_gradient_get_custom_samples (const gchar
*name
,
318 const gdouble
*positions
,
320 gint
*num_color_samples
,
321 gdouble
**color_samples
)
323 GimpParam
*return_vals
;
325 gboolean success
= TRUE
;
327 return_vals
= gimp_run_procedure ("gimp-gradient-get-custom-samples",
329 GIMP_PDB_STRING
, name
,
330 GIMP_PDB_INT32
, num_samples
,
331 GIMP_PDB_FLOATARRAY
, positions
,
332 GIMP_PDB_INT32
, reverse
,
335 *num_color_samples
= 0;
336 *color_samples
= NULL
;
338 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
342 *num_color_samples
= return_vals
[1].data
.d_int32
;
343 *color_samples
= g_new (gdouble
, *num_color_samples
);
344 memcpy (*color_samples
,
345 return_vals
[2].data
.d_floatarray
,
346 *num_color_samples
* sizeof (gdouble
));
349 gimp_destroy_params (return_vals
, nreturn_vals
);
355 * gimp_gradient_segment_get_left_color:
356 * @name: The gradient name.
357 * @segment: The index of the segment within the gradient.
358 * @color: The return color.
359 * @opacity: The opacity of the endpoint.
361 * Retrieves the left endpoint color of the specified segment
363 * This procedure retrieves the left endpoint color of the specified
364 * segment of the specified gradient.
366 * Returns: TRUE on success.
371 gimp_gradient_segment_get_left_color (const gchar
*name
,
376 GimpParam
*return_vals
;
378 gboolean success
= TRUE
;
380 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-left-color",
382 GIMP_PDB_STRING
, name
,
383 GIMP_PDB_INT32
, segment
,
388 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
392 *color
= return_vals
[1].data
.d_color
;
393 *opacity
= return_vals
[2].data
.d_float
;
396 gimp_destroy_params (return_vals
, nreturn_vals
);
402 * gimp_gradient_segment_set_left_color:
403 * @name: The gradient name.
404 * @segment: The index of the segment within the gradient.
405 * @color: The color to set.
406 * @opacity: The opacity to set for the endpoint.
408 * Sets the left endpoint color of the specified segment
410 * This procedure sets the left endpoint color of the specified segment
411 * of the specified gradient.
413 * Returns: TRUE on success.
418 gimp_gradient_segment_set_left_color (const gchar
*name
,
420 const GimpRGB
*color
,
423 GimpParam
*return_vals
;
425 gboolean success
= TRUE
;
427 return_vals
= gimp_run_procedure ("gimp-gradient-segment-set-left-color",
429 GIMP_PDB_STRING
, name
,
430 GIMP_PDB_INT32
, segment
,
431 GIMP_PDB_COLOR
, color
,
432 GIMP_PDB_FLOAT
, opacity
,
435 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
437 gimp_destroy_params (return_vals
, nreturn_vals
);
443 * gimp_gradient_segment_get_right_color:
444 * @name: The gradient name.
445 * @segment: The index of the segment within the gradient.
446 * @color: The return color.
447 * @opacity: The opacity of the endpoint.
449 * Retrieves the right endpoint color of the specified segment
451 * This procedure retrieves the right endpoint color of the specified
452 * segment of the specified gradient.
454 * Returns: TRUE on success.
459 gimp_gradient_segment_get_right_color (const gchar
*name
,
464 GimpParam
*return_vals
;
466 gboolean success
= TRUE
;
468 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-right-color",
470 GIMP_PDB_STRING
, name
,
471 GIMP_PDB_INT32
, segment
,
476 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
480 *color
= return_vals
[1].data
.d_color
;
481 *opacity
= return_vals
[2].data
.d_float
;
484 gimp_destroy_params (return_vals
, nreturn_vals
);
490 * gimp_gradient_segment_set_right_color:
491 * @name: The gradient name.
492 * @segment: The index of the segment within the gradient.
493 * @color: The color to set.
494 * @opacity: The opacity to set for the endpoint.
496 * Sets the right endpoint color of the specified segment
498 * This procedure sets the right endpoint color of the specified
499 * segment of the specified gradient.
501 * Returns: TRUE on success.
506 gimp_gradient_segment_set_right_color (const gchar
*name
,
508 const GimpRGB
*color
,
511 GimpParam
*return_vals
;
513 gboolean success
= TRUE
;
515 return_vals
= gimp_run_procedure ("gimp-gradient-segment-set-right-color",
517 GIMP_PDB_STRING
, name
,
518 GIMP_PDB_INT32
, segment
,
519 GIMP_PDB_COLOR
, color
,
520 GIMP_PDB_FLOAT
, opacity
,
523 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
525 gimp_destroy_params (return_vals
, nreturn_vals
);
531 * gimp_gradient_segment_get_left_pos:
532 * @name: The gradient name.
533 * @segment: The index of the segment within the gradient.
534 * @pos: The return position.
536 * Retrieves the left endpoint position of the specified segment
538 * This procedure retrieves the left endpoint position of the specified
539 * segment of the specified gradient.
541 * Returns: TRUE on success.
546 gimp_gradient_segment_get_left_pos (const gchar
*name
,
550 GimpParam
*return_vals
;
552 gboolean success
= TRUE
;
554 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-left-pos",
556 GIMP_PDB_STRING
, name
,
557 GIMP_PDB_INT32
, segment
,
562 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
565 *pos
= return_vals
[1].data
.d_float
;
567 gimp_destroy_params (return_vals
, nreturn_vals
);
573 * gimp_gradient_segment_set_left_pos:
574 * @name: The gradient name.
575 * @segment: The index of the segment within the gradient.
576 * @pos: The position to set the guidepoint to.
577 * @final_pos: The return position.
579 * Sets the left endpoint position of the specified segment
581 * This procedure sets the left endpoint position of the specified
582 * segment of the specified gradient. The final position will be
583 * between the position of the middle point to the left to the middle
584 * point of the current segment.
585 * This procedure returns the final position.
587 * Returns: TRUE on success.
592 gimp_gradient_segment_set_left_pos (const gchar
*name
,
597 GimpParam
*return_vals
;
599 gboolean success
= TRUE
;
601 return_vals
= gimp_run_procedure ("gimp-gradient-segment-set-left-pos",
603 GIMP_PDB_STRING
, name
,
604 GIMP_PDB_INT32
, segment
,
610 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
613 *final_pos
= return_vals
[1].data
.d_float
;
615 gimp_destroy_params (return_vals
, nreturn_vals
);
621 * gimp_gradient_segment_get_middle_pos:
622 * @name: The gradient name.
623 * @segment: The index of the segment within the gradient.
624 * @pos: The return position.
626 * Retrieves the middle point position of the specified segment
628 * This procedure retrieves the middle point position of the specified
629 * segment of the specified gradient.
631 * Returns: TRUE on success.
636 gimp_gradient_segment_get_middle_pos (const gchar
*name
,
640 GimpParam
*return_vals
;
642 gboolean success
= TRUE
;
644 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-middle-pos",
646 GIMP_PDB_STRING
, name
,
647 GIMP_PDB_INT32
, segment
,
652 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
655 *pos
= return_vals
[1].data
.d_float
;
657 gimp_destroy_params (return_vals
, nreturn_vals
);
663 * gimp_gradient_segment_set_middle_pos:
664 * @name: The gradient name.
665 * @segment: The index of the segment within the gradient.
666 * @pos: The position to set the guidepoint to.
667 * @final_pos: The return position.
669 * Sets the middle point position of the specified segment
671 * This procedure sets the middle point position of the specified
672 * segment of the specified gradient. The final position will be
673 * between the two endpoints of the segment.
674 * This procedure returns the final position.
676 * Returns: TRUE on success.
681 gimp_gradient_segment_set_middle_pos (const gchar
*name
,
686 GimpParam
*return_vals
;
688 gboolean success
= TRUE
;
690 return_vals
= gimp_run_procedure ("gimp-gradient-segment-set-middle-pos",
692 GIMP_PDB_STRING
, name
,
693 GIMP_PDB_INT32
, segment
,
699 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
702 *final_pos
= return_vals
[1].data
.d_float
;
704 gimp_destroy_params (return_vals
, nreturn_vals
);
710 * gimp_gradient_segment_get_right_pos:
711 * @name: The gradient name.
712 * @segment: The index of the segment within the gradient.
713 * @pos: The return position.
715 * Retrieves the right endpoint position of the specified segment
717 * This procedure retrieves the right endpoint position of the
718 * specified segment of the specified gradient.
720 * Returns: TRUE on success.
725 gimp_gradient_segment_get_right_pos (const gchar
*name
,
729 GimpParam
*return_vals
;
731 gboolean success
= TRUE
;
733 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-right-pos",
735 GIMP_PDB_STRING
, name
,
736 GIMP_PDB_INT32
, segment
,
741 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
744 *pos
= return_vals
[1].data
.d_float
;
746 gimp_destroy_params (return_vals
, nreturn_vals
);
752 * gimp_gradient_segment_set_right_pos:
753 * @name: The gradient name.
754 * @segment: The index of the segment within the gradient.
755 * @pos: The position to set the guidepoint to.
756 * @final_pos: The return position.
758 * Sets the right endpoint position of the specified segment
760 * This procedure sets the right endpoint position of the specified
761 * segment of the specified gradient. The final position will be
762 * between the position of the middle point of the current segment and
763 * the middle point of the segment to the right.
764 * This procedure returns the final position.
766 * Returns: TRUE on success.
771 gimp_gradient_segment_set_right_pos (const gchar
*name
,
776 GimpParam
*return_vals
;
778 gboolean success
= TRUE
;
780 return_vals
= gimp_run_procedure ("gimp-gradient-segment-set-right-pos",
782 GIMP_PDB_STRING
, name
,
783 GIMP_PDB_INT32
, segment
,
789 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
792 *final_pos
= return_vals
[1].data
.d_float
;
794 gimp_destroy_params (return_vals
, nreturn_vals
);
800 * gimp_gradient_segment_get_blending_function:
801 * @name: The gradient name.
802 * @segment: The index of the segment within the gradient.
803 * @blend_func: The blending function of the segment.
805 * Retrieves the gradient segment's blending function
807 * This procedure retrieves the blending function of the segment at the
808 * specified gradient name and segment index.
810 * Returns: TRUE on success.
815 gimp_gradient_segment_get_blending_function (const gchar
*name
,
817 GimpGradientSegmentType
*blend_func
)
819 GimpParam
*return_vals
;
821 gboolean success
= TRUE
;
823 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-blending-function",
825 GIMP_PDB_STRING
, name
,
826 GIMP_PDB_INT32
, segment
,
831 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
834 *blend_func
= return_vals
[1].data
.d_int32
;
836 gimp_destroy_params (return_vals
, nreturn_vals
);
842 * gimp_gradient_segment_get_coloring_type:
843 * @name: The gradient name.
844 * @segment: The index of the segment within the gradient.
845 * @coloring_type: The coloring type of the segment.
847 * Retrieves the gradient segment's coloring type
849 * This procedure retrieves the coloring type of the segment at the
850 * specified gradient name and segment index.
852 * Returns: TRUE on success.
857 gimp_gradient_segment_get_coloring_type (const gchar
*name
,
859 GimpGradientSegmentColor
*coloring_type
)
861 GimpParam
*return_vals
;
863 gboolean success
= TRUE
;
865 return_vals
= gimp_run_procedure ("gimp-gradient-segment-get-coloring-type",
867 GIMP_PDB_STRING
, name
,
868 GIMP_PDB_INT32
, segment
,
873 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
876 *coloring_type
= return_vals
[1].data
.d_int32
;
878 gimp_destroy_params (return_vals
, nreturn_vals
);
884 * gimp_gradient_segment_range_set_blending_function:
885 * @name: The gradient name.
886 * @start_segment: The index of the first segment to operate on.
887 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
888 * @blending_function: The blending function.
890 * Change the blending function of a segments range
892 * This function changes the blending function of a segment range to
893 * the specified blending function.
895 * Returns: TRUE on success.
900 gimp_gradient_segment_range_set_blending_function (const gchar
*name
,
903 GimpGradientSegmentType blending_function
)
905 GimpParam
*return_vals
;
907 gboolean success
= TRUE
;
909 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-set-blending-function",
911 GIMP_PDB_STRING
, name
,
912 GIMP_PDB_INT32
, start_segment
,
913 GIMP_PDB_INT32
, end_segment
,
914 GIMP_PDB_INT32
, blending_function
,
917 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
919 gimp_destroy_params (return_vals
, nreturn_vals
);
925 * gimp_gradient_segment_range_set_coloring_type:
926 * @name: The gradient name.
927 * @start_segment: The index of the first segment to operate on.
928 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
929 * @coloring_type: The coloring type.
931 * Change the coloring type of a segments range
933 * This function changes the coloring type of a segment range to the
934 * specified coloring type.
936 * Returns: TRUE on success.
941 gimp_gradient_segment_range_set_coloring_type (const gchar
*name
,
944 GimpGradientSegmentColor coloring_type
)
946 GimpParam
*return_vals
;
948 gboolean success
= TRUE
;
950 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-set-coloring-type",
952 GIMP_PDB_STRING
, name
,
953 GIMP_PDB_INT32
, start_segment
,
954 GIMP_PDB_INT32
, end_segment
,
955 GIMP_PDB_INT32
, coloring_type
,
958 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
960 gimp_destroy_params (return_vals
, nreturn_vals
);
966 * gimp_gradient_segment_range_flip:
967 * @name: The gradient name.
968 * @start_segment: The index of the first segment to operate on.
969 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
971 * Flip the segment range
973 * This function flips a segment range.
975 * Returns: TRUE on success.
980 gimp_gradient_segment_range_flip (const gchar
*name
,
984 GimpParam
*return_vals
;
986 gboolean success
= TRUE
;
988 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-flip",
990 GIMP_PDB_STRING
, name
,
991 GIMP_PDB_INT32
, start_segment
,
992 GIMP_PDB_INT32
, end_segment
,
995 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
997 gimp_destroy_params (return_vals
, nreturn_vals
);
1003 * gimp_gradient_segment_range_replicate:
1004 * @name: The gradient name.
1005 * @start_segment: The index of the first segment to operate on.
1006 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1007 * @replicate_times: The number of times to replicate.
1009 * Replicate the segment range
1011 * This function replicates a segment range a given number of times.
1012 * Instead of the original segment range, several smaller scaled copies
1013 * of it will appear in equal widths.
1015 * Returns: TRUE on success.
1020 gimp_gradient_segment_range_replicate (const gchar
*name
,
1023 gint replicate_times
)
1025 GimpParam
*return_vals
;
1027 gboolean success
= TRUE
;
1029 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-replicate",
1031 GIMP_PDB_STRING
, name
,
1032 GIMP_PDB_INT32
, start_segment
,
1033 GIMP_PDB_INT32
, end_segment
,
1034 GIMP_PDB_INT32
, replicate_times
,
1037 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1039 gimp_destroy_params (return_vals
, nreturn_vals
);
1045 * gimp_gradient_segment_range_split_midpoint:
1046 * @name: The gradient name.
1047 * @start_segment: The index of the first segment to operate on.
1048 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1050 * Splits each segment in the segment range at midpoint
1052 * This function splits each segment in the segment range at its
1055 * Returns: TRUE on success.
1060 gimp_gradient_segment_range_split_midpoint (const gchar
*name
,
1064 GimpParam
*return_vals
;
1066 gboolean success
= TRUE
;
1068 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-split-midpoint",
1070 GIMP_PDB_STRING
, name
,
1071 GIMP_PDB_INT32
, start_segment
,
1072 GIMP_PDB_INT32
, end_segment
,
1075 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1077 gimp_destroy_params (return_vals
, nreturn_vals
);
1083 * gimp_gradient_segment_range_split_uniform:
1084 * @name: The gradient name.
1085 * @start_segment: The index of the first segment to operate on.
1086 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1087 * @split_parts: The number of uniform divisions to split each segment to.
1089 * Splits each segment in the segment range uniformly
1091 * This function splits each segment in the segment range uniformly
1092 * according to the number of times specified by the parameter.
1094 * Returns: TRUE on success.
1099 gimp_gradient_segment_range_split_uniform (const gchar
*name
,
1104 GimpParam
*return_vals
;
1106 gboolean success
= TRUE
;
1108 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-split-uniform",
1110 GIMP_PDB_STRING
, name
,
1111 GIMP_PDB_INT32
, start_segment
,
1112 GIMP_PDB_INT32
, end_segment
,
1113 GIMP_PDB_INT32
, split_parts
,
1116 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1118 gimp_destroy_params (return_vals
, nreturn_vals
);
1124 * gimp_gradient_segment_range_delete:
1125 * @name: The gradient name.
1126 * @start_segment: The index of the first segment to operate on.
1127 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1129 * Delete the segment range
1131 * This function deletes a segment range.
1133 * Returns: TRUE on success.
1138 gimp_gradient_segment_range_delete (const gchar
*name
,
1142 GimpParam
*return_vals
;
1144 gboolean success
= TRUE
;
1146 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-delete",
1148 GIMP_PDB_STRING
, name
,
1149 GIMP_PDB_INT32
, start_segment
,
1150 GIMP_PDB_INT32
, end_segment
,
1153 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1155 gimp_destroy_params (return_vals
, nreturn_vals
);
1161 * gimp_gradient_segment_range_redistribute_handles:
1162 * @name: The gradient name.
1163 * @start_segment: The index of the first segment to operate on.
1164 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1166 * Uniformly redistribute the segment range's handles
1168 * This function redistributes the handles of the specified segment
1169 * range of the specified gradient, so they'll be evenly spaced.
1171 * Returns: TRUE on success.
1176 gimp_gradient_segment_range_redistribute_handles (const gchar
*name
,
1180 GimpParam
*return_vals
;
1182 gboolean success
= TRUE
;
1184 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-redistribute-handles",
1186 GIMP_PDB_STRING
, name
,
1187 GIMP_PDB_INT32
, start_segment
,
1188 GIMP_PDB_INT32
, end_segment
,
1191 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1193 gimp_destroy_params (return_vals
, nreturn_vals
);
1199 * gimp_gradient_segment_range_blend_colors:
1200 * @name: The gradient name.
1201 * @start_segment: The index of the first segment to operate on.
1202 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1204 * Blend the colors of the segment range.
1206 * This function blends the colors (but not the opacity) of the
1207 * segments' range of the gradient. Using it, the colors' transition
1208 * will be uniform across the range.
1210 * Returns: TRUE on success.
1215 gimp_gradient_segment_range_blend_colors (const gchar
*name
,
1219 GimpParam
*return_vals
;
1221 gboolean success
= TRUE
;
1223 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-blend-colors",
1225 GIMP_PDB_STRING
, name
,
1226 GIMP_PDB_INT32
, start_segment
,
1227 GIMP_PDB_INT32
, end_segment
,
1230 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1232 gimp_destroy_params (return_vals
, nreturn_vals
);
1238 * gimp_gradient_segment_range_blend_opacity:
1239 * @name: The gradient name.
1240 * @start_segment: The index of the first segment to operate on.
1241 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1243 * Blend the opacity of the segment range.
1245 * This function blends the opacity (but not the colors) of the
1246 * segments' range of the gradient. Using it, the opacity's transition
1247 * will be uniform across the range.
1249 * Returns: TRUE on success.
1254 gimp_gradient_segment_range_blend_opacity (const gchar
*name
,
1258 GimpParam
*return_vals
;
1260 gboolean success
= TRUE
;
1262 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-blend-opacity",
1264 GIMP_PDB_STRING
, name
,
1265 GIMP_PDB_INT32
, start_segment
,
1266 GIMP_PDB_INT32
, end_segment
,
1269 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
1271 gimp_destroy_params (return_vals
, nreturn_vals
);
1277 * gimp_gradient_segment_range_move:
1278 * @name: The gradient name.
1279 * @start_segment: The index of the first segment to operate on.
1280 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
1281 * @delta: The delta to move the segment range.
1282 * @control_compress: Whether or not to compress the neighboring segments.
1284 * Move the position of an entire segment range by a delta.
1286 * This function moves the position of an entire segment range by a
1287 * delta. The actual delta (which is returned) will be limited by the
1288 * control points of the neighboring segments.
1290 * Returns: The final delta by which the range moved.
1295 gimp_gradient_segment_range_move (const gchar
*name
,
1299 gboolean control_compress
)
1301 GimpParam
*return_vals
;
1303 gdouble final_delta
= 0.0;
1305 return_vals
= gimp_run_procedure ("gimp-gradient-segment-range-move",
1307 GIMP_PDB_STRING
, name
,
1308 GIMP_PDB_INT32
, start_segment
,
1309 GIMP_PDB_INT32
, end_segment
,
1310 GIMP_PDB_FLOAT
, delta
,
1311 GIMP_PDB_INT32
, control_compress
,
1314 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
1315 final_delta
= return_vals
[1].data
.d_float
;
1317 gimp_destroy_params (return_vals
, nreturn_vals
);