gimppainttools_pdb.c 33.7 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3
 *
Michael Natterer's avatar
Michael Natterer committed
4
 * gimppainttools_pdb.c
5
 *
6
 * This library is free software: you can redistribute it and/or
7 8
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
9
 * version 3 of the License, or (at your option) any later version.
10 11 12 13 14 15 16
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * 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/>.
19 20
 */

21
/* NOTE: This file is auto-generated by pdbgen.pl */
22

Sven Neumann's avatar
Sven Neumann committed
23 24
#include "config.h"

25 26
#include "gimp.h"

27 28

/**
29
 * SECTION: gimppainttools
30 31 32 33 34 35 36
 * @title: gimppainttools
 * @short_description: Access to toolbox paint tools.
 *
 * Functions giving access to toolbox paint tools.
 **/


37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
/**
 * gimp_airbrush:
 * @drawable_ID: The affected drawable.
 * @pressure: The pressure of the airbrush strokes.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Paint in the current brush with varying pressure. Paint application
 * is time-dependent.
 *
 * This tool simulates the use of an airbrush. Paint pressure
 * represents the relative intensity of the paint application. High
 * pressure results in a thicker layer of paint while low pressure
 * results in a thinner layer.
 *
 * Returns: TRUE on success.
53
 **/
54
gboolean
55
gimp_airbrush (gint32         drawable_ID,
56 57 58
               gdouble        pressure,
               gint           num_strokes,
               const gdouble *strokes)
59
{
60 61
  GimpValueArray *args;
  GimpValueArray *return_vals;
62
  gboolean success = TRUE;
63

64 65 66 67 68 69 70 71 72
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 1), pressure);
  g_value_set_int (gimp_value_array_index (args, 2), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
73

74 75 76
  return_vals = gimp_run_procedure_with_array ("gimp-airbrush",
                                               args);
  gimp_value_array_unref (args);
77

78 79 80
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
81 82

  return success;
83 84
}

85 86 87 88 89 90 91 92 93 94
/**
 * gimp_airbrush_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Paint in the current brush with varying pressure. Paint application
 * is time-dependent.
 *
 * This tool simulates the use of an airbrush. It is similar to
95 96 97
 * gimp_airbrush() except that the pressure is derived from the
 * airbrush tools options box. It the option has not been set the
 * default for the option will be used.
98 99
 *
 * Returns: TRUE on success.
100
 **/
101
gboolean
102
gimp_airbrush_default (gint32         drawable_ID,
103 104
                       gint           num_strokes,
                       const gdouble *strokes)
105
{
106 107
  GimpValueArray *args;
  GimpValueArray *return_vals;
108
  gboolean success = TRUE;
109

110 111 112 113 114 115 116 117 118 119 120
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-airbrush-default",
                                               args);
  gimp_value_array_unref (args);
121

122
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
123

124
  gimp_value_array_unref (return_vals);
125 126

  return success;
127 128
}

129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
/**
 * gimp_clone:
 * @drawable_ID: The affected drawable.
 * @src_drawable_ID: The source drawable.
 * @clone_type: The type of clone.
 * @src_x: The x coordinate in the source image.
 * @src_y: The y coordinate in the source image.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Clone from the source to the dest drawable using the current brush
 *
 * This tool clones (copies) from the source drawable starting at the
 * specified source coordinates to the dest drawable. If the
 * \"clone_type\" argument is set to PATTERN-CLONE, then the current
 * pattern is used as the source and the \"src_drawable\" argument is
 * ignored. Pattern cloning assumes a tileable pattern and mods the sum
 * of the src coordinates and subsequent stroke offsets with the width
 * and height of the pattern. For image cloning, if the sum of the src
 * coordinates and subsequent stroke offsets exceeds the extents of the
 * src drawable, then no paint is transferred. The clone tool is
 * capable of transforming between any image types including
151
 * RGB-&gt;Indexed--although converting from any type to indexed is
152 153 154
 * significantly slower.
 *
 * Returns: TRUE on success.
155
 **/
156
gboolean
157
gimp_clone (gint32         drawable_ID,
158 159 160 161 162 163
            gint32         src_drawable_ID,
            GimpCloneType  clone_type,
            gdouble        src_x,
            gdouble        src_y,
            gint           num_strokes,
            const gdouble *strokes)
164
{
165 166
  GimpValueArray *args;
  GimpValueArray *return_vals;
167
  gboolean success = TRUE;
168

169 170
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_DRAWABLE_ID,
171
                                          GIMP_TYPE_CLONE_TYPE,
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
                                          G_TYPE_DOUBLE,
                                          G_TYPE_DOUBLE,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 1), src_drawable_ID);
  g_value_set_enum (gimp_value_array_index (args, 2), clone_type);
  g_value_set_double (gimp_value_array_index (args, 3), src_x);
  g_value_set_double (gimp_value_array_index (args, 4), src_y);
  g_value_set_int (gimp_value_array_index (args, 5), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 6), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-clone",
                                               args);
  gimp_value_array_unref (args);

  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
192 193

  return success;
194 195
}

196 197 198 199 200 201 202 203 204 205
/**
 * gimp_clone_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Clone from the source to the dest drawable using the current brush
 *
 * This tool clones (copies) from the source drawable starting at the
 * specified source coordinates to the dest drawable. This function
206 207 208 209
 * performs exactly the same as the gimp_clone() function except that
 * the tools arguments are obtained from the clones option dialog. It
 * this dialog has not been activated then the dialogs default values
 * will be used.
210 211
 *
 * Returns: TRUE on success.
212
 **/
213
gboolean
214
gimp_clone_default (gint32         drawable_ID,
215 216
                    gint           num_strokes,
                    const gdouble *strokes)
217
{
218 219
  GimpValueArray *args;
  GimpValueArray *return_vals;
220
  gboolean success = TRUE;
221

222 223 224 225 226 227 228 229 230 231 232
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-clone-default",
                                               args);
  gimp_value_array_unref (args);
233

234
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
235

236
  gimp_value_array_unref (return_vals);
237 238

  return success;
239 240
}

241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
/**
 * gimp_convolve:
 * @drawable_ID: The affected drawable.
 * @pressure: The pressure.
 * @convolve_type: Convolve type.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Convolve (Blur, Sharpen) using the current brush.
 *
 * This tool convolves the specified drawable with either a sharpening
 * or blurring kernel. The pressure parameter controls the magnitude of
 * the operation. Like the paintbrush, this tool linearly interpolates
 * between the specified stroke coordinates.
 *
 * Returns: TRUE on success.
257
 **/
258
gboolean
259
gimp_convolve (gint32            drawable_ID,
260 261 262 263
               gdouble           pressure,
               GimpConvolveType  convolve_type,
               gint              num_strokes,
               const gdouble    *strokes)
264
{
265 266
  GimpValueArray *args;
  GimpValueArray *return_vals;
267
  gboolean success = TRUE;
268

269 270
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
271
                                          GIMP_TYPE_CONVOLVE_TYPE,
272 273 274 275 276 277 278 279
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 1), pressure);
  g_value_set_enum (gimp_value_array_index (args, 2), convolve_type);
  g_value_set_int (gimp_value_array_index (args, 3), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 4), strokes, num_strokes);
280

281 282 283
  return_vals = gimp_run_procedure_with_array ("gimp-convolve",
                                               args);
  gimp_value_array_unref (args);
284

285 286 287
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
288 289

  return success;
290 291
}

292 293 294 295 296 297 298 299 300 301
/**
 * gimp_convolve_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Convolve (Blur, Sharpen) using the current brush.
 *
 * This tool convolves the specified drawable with either a sharpening
 * or blurring kernel. This function performs exactly the same as the
302 303 304
 * gimp_convolve() function except that the tools arguments are
 * obtained from the convolve option dialog. It this dialog has not
 * been activated then the dialogs default values will be used.
305 306
 *
 * Returns: TRUE on success.
307
 **/
308
gboolean
309
gimp_convolve_default (gint32         drawable_ID,
310 311
                       gint           num_strokes,
                       const gdouble *strokes)
312
{
313 314
  GimpValueArray *args;
  GimpValueArray *return_vals;
315
  gboolean success = TRUE;
316

317 318 319 320 321 322 323 324 325 326 327
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-convolve-default",
                                               args);
  gimp_value_array_unref (args);
328

329
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
330

331
  gimp_value_array_unref (return_vals);
332 333

  return success;
334 335
}

336 337 338
/**
 * gimp_dodgeburn:
 * @drawable_ID: The affected drawable.
339
 * @exposure: The exposure of the strokes.
340 341 342 343 344 345 346
 * @dodgeburn_type: The type either dodge or burn.
 * @dodgeburn_mode: The mode.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Dodgeburn image with varying exposure.
 *
Manish Singh's avatar
Manish Singh committed
347
 * Dodgeburn. More details here later.
348 349
 *
 * Returns: TRUE on success.
350
 **/
351
gboolean
352
gimp_dodgeburn (gint32             drawable_ID,
353 354 355 356 357
                gdouble            exposure,
                GimpDodgeBurnType  dodgeburn_type,
                GimpTransferMode   dodgeburn_mode,
                gint               num_strokes,
                const gdouble     *strokes)
358
{
359 360
  GimpValueArray *args;
  GimpValueArray *return_vals;
361
  gboolean success = TRUE;
362

363 364
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
365 366
                                          GIMP_TYPE_DODGE_BURN_TYPE,
                                          GIMP_TYPE_TRANSFER_MODE,
367 368 369 370 371 372 373 374 375
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 1), exposure);
  g_value_set_enum (gimp_value_array_index (args, 2), dodgeburn_type);
  g_value_set_enum (gimp_value_array_index (args, 3), dodgeburn_mode);
  g_value_set_int (gimp_value_array_index (args, 4), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
376

377 378 379
  return_vals = gimp_run_procedure_with_array ("gimp-dodgeburn",
                                               args);
  gimp_value_array_unref (args);
380

381 382 383
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
384 385

  return success;
386 387
}

388 389 390 391 392 393 394
/**
 * gimp_dodgeburn_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Dodgeburn image with varying exposure. This is the same as the
395 396
 * gimp_dodgeburn() function except that the exposure, type and mode
 * are taken from the tools option dialog. If the dialog has not been
397 398
 * activated then the defaults as used by the dialog will be used.
 *
399
 * Dodgeburn. More details here later.
400 401
 *
 * Returns: TRUE on success.
402
 **/
403
gboolean
404
gimp_dodgeburn_default (gint32         drawable_ID,
405 406
                        gint           num_strokes,
                        const gdouble *strokes)
407
{
408 409
  GimpValueArray *args;
  GimpValueArray *return_vals;
410
  gboolean success = TRUE;
411

412 413 414 415 416 417 418 419 420 421 422
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-dodgeburn-default",
                                               args);
  gimp_value_array_unref (args);
423

424
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
425

426
  gimp_value_array_unref (return_vals);
427 428

  return success;
429 430
}

431 432 433 434 435
/**
 * gimp_eraser:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
436 437
 * @hardness: How to apply the brush.
 * @method: The paint method to use.
438 439 440 441 442 443 444 445 446 447
 *
 * Erase using the current brush.
 *
 * This tool erases using the current brush mask. If the specified
 * drawable contains an alpha channel, then the erased pixels will
 * become transparent. Otherwise, the eraser tool replaces the contents
 * of the drawable with the background color. Like paintbrush, this
 * tool linearly interpolates between the specified stroke coordinates.
 *
 * Returns: TRUE on success.
448
 **/
449
gboolean
450
gimp_eraser (gint32                    drawable_ID,
451 452 453 454
             gint                      num_strokes,
             const gdouble            *strokes,
             GimpBrushApplicationMode  hardness,
             GimpPaintApplicationMode  method)
455
{
456 457
  GimpValueArray *args;
  GimpValueArray *return_vals;
458
  gboolean success = TRUE;
459

460 461 462
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
463 464
                                          GIMP_TYPE_BRUSH_APPLICATION_MODE,
                                          GIMP_TYPE_PAINT_APPLICATION_MODE,
465 466 467 468 469 470
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
  g_value_set_enum (gimp_value_array_index (args, 3), hardness);
  g_value_set_enum (gimp_value_array_index (args, 4), method);
471

472 473 474
  return_vals = gimp_run_procedure_with_array ("gimp-eraser",
                                               args);
  gimp_value_array_unref (args);
475

476 477 478
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
479 480

  return success;
481 482
}

483 484 485 486 487 488 489 490 491
/**
 * gimp_eraser_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Erase using the current brush.
 *
 * This tool erases using the current brush mask. This function
492
 * performs exactly the same as the gimp_eraser() function except that
493 494 495 496 497
 * the tools arguments are obtained from the eraser option dialog. It
 * this dialog has not been activated then the dialogs default values
 * will be used.
 *
 * Returns: TRUE on success.
498
 **/
499
gboolean
500
gimp_eraser_default (gint32         drawable_ID,
501 502
                     gint           num_strokes,
                     const gdouble *strokes)
503
{
504 505
  GimpValueArray *args;
  GimpValueArray *return_vals;
506
  gboolean success = TRUE;
507

508 509 510 511 512 513 514 515 516 517 518
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-eraser-default",
                                               args);
  gimp_value_array_unref (args);
519

520
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
521

522
  gimp_value_array_unref (return_vals);
523 524

  return success;
525 526
}

527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
/**
 * gimp_heal:
 * @drawable_ID: The affected drawable.
 * @src_drawable_ID: The source drawable.
 * @src_x: The x coordinate in the source image.
 * @src_y: The y coordinate in the source image.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Heal from the source to the dest drawable using the current brush
 *
 * This tool heals the source drawable starting at the specified source
 * coordinates to the dest drawable. For image healing, if the sum of
 * the src coordinates and subsequent stroke offsets exceeds the
 * extents of the src drawable, then no paint is transferred. The
 * healing tool is capable of transforming between any image types
 * except RGB-&gt;Indexed.
 *
 * Returns: TRUE on success.
 *
547
 * Since: 2.4
548
 **/
549 550 551 552 553 554 555 556
gboolean
gimp_heal (gint32         drawable_ID,
           gint32         src_drawable_ID,
           gdouble        src_x,
           gdouble        src_y,
           gint           num_strokes,
           const gdouble *strokes)
{
557 558
  GimpValueArray *args;
  GimpValueArray *return_vals;
559 560
  gboolean success = TRUE;

561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
                                          G_TYPE_DOUBLE,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 1), src_drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 2), src_x);
  g_value_set_double (gimp_value_array_index (args, 3), src_y);
  g_value_set_int (gimp_value_array_index (args, 4), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-heal",
                                               args);
  gimp_value_array_unref (args);
578

579
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
580

581
  gimp_value_array_unref (return_vals);
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602

  return success;
}

/**
 * gimp_heal_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Heal from the source to the dest drawable using the current brush
 *
 * This tool heals from the source drawable starting at the specified
 * source coordinates to the dest drawable. This function performs
 * exactly the same as the gimp_heal() function except that the tools
 * arguments are obtained from the healing option dialog. It this
 * dialog has not been activated then the dialogs default values will
 * be used.
 *
 * Returns: TRUE on success.
 *
603
 * Since: 2.4
604
 **/
605 606 607 608 609
gboolean
gimp_heal_default (gint32         drawable_ID,
                   gint           num_strokes,
                   const gdouble *strokes)
{
610 611
  GimpValueArray *args;
  GimpValueArray *return_vals;
612 613
  gboolean success = TRUE;

614 615 616 617 618 619 620
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
621

622 623 624
  return_vals = gimp_run_procedure_with_array ("gimp-heal-default",
                                               args);
  gimp_value_array_unref (args);
625

626 627 628
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
629 630 631 632

  return success;
}

633 634 635 636 637 638
/**
 * gimp_paintbrush:
 * @drawable_ID: The affected drawable.
 * @fade_out: Fade out parameter.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
639
 * @method: The paint method to use.
640 641 642 643 644 645 646 647
 * @gradient_length: Length of gradient to draw.
 *
 * Paint in the current brush with optional fade out parameter and pull
 * colors from a gradient.
 *
 * This tool is the standard paintbrush. It draws linearly interpolated
 * lines through the specified stroke coordinates. It operates on the
 * specified drawable in the foreground color with the active brush.
648 649 650 651 652 653
 * The 'fade-out' parameter is measured in pixels and allows the brush
 * stroke to linearly fall off. The pressure is set to the maximum at
 * the beginning of the stroke. As the distance of the stroke nears the
 * fade-out value, the pressure will approach zero. The gradient-length
 * is the distance to spread the gradient over. It is measured in
 * pixels. If the gradient-length is 0, no gradient is used.
654 655
 *
 * Returns: TRUE on success.
656
 **/
657
gboolean
658
gimp_paintbrush (gint32                    drawable_ID,
659 660 661 662 663
                 gdouble                   fade_out,
                 gint                      num_strokes,
                 const gdouble            *strokes,
                 GimpPaintApplicationMode  method,
                 gdouble                   gradient_length)
664
{
665 666
  GimpValueArray *args;
  GimpValueArray *return_vals;
667
  gboolean success = TRUE;
668

669 670 671 672
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
673
                                          GIMP_TYPE_PAINT_APPLICATION_MODE,
674 675 676 677 678 679 680 681 682 683 684 685
                                          G_TYPE_DOUBLE,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 1), fade_out);
  g_value_set_int (gimp_value_array_index (args, 2), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
  g_value_set_enum (gimp_value_array_index (args, 4), method);
  g_value_set_double (gimp_value_array_index (args, 5), gradient_length);

  return_vals = gimp_run_procedure_with_array ("gimp-paintbrush",
                                               args);
  gimp_value_array_unref (args);
686

687
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
688

689
  gimp_value_array_unref (return_vals);
690 691

  return success;
692 693
}

694 695 696 697 698 699 700 701 702 703 704 705 706 707
/**
 * gimp_paintbrush_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Paint in the current brush. The fade out parameter and pull colors
 * from a gradient parameter are set from the paintbrush options
 * dialog. If this dialog has not been activated then the dialog
 * defaults will be used.
 *
 * This tool is similar to the standard paintbrush. It draws linearly
 * interpolated lines through the specified stroke coordinates. It
 * operates on the specified drawable in the foreground color with the
708
 * active brush. The 'fade-out' parameter is measured in pixels and
709 710 711
 * allows the brush stroke to linearly fall off (value obtained from
 * the option dialog). The pressure is set to the maximum at the
 * beginning of the stroke. As the distance of the stroke nears the
712
 * fade-out value, the pressure will approach zero. The gradient-length
713
 * (value obtained from the option dialog) is the distance to spread
714
 * the gradient over. It is measured in pixels. If the gradient-length
715 716 717
 * is 0, no gradient is used.
 *
 * Returns: TRUE on success.
718
 **/
719
gboolean
720
gimp_paintbrush_default (gint32         drawable_ID,
721 722
                         gint           num_strokes,
                         const gdouble *strokes)
723
{
724 725
  GimpValueArray *args;
  GimpValueArray *return_vals;
726
  gboolean success = TRUE;
727

728 729 730 731 732 733 734
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
735

736 737 738
  return_vals = gimp_run_procedure_with_array ("gimp-paintbrush-default",
                                               args);
  gimp_value_array_unref (args);
739

740 741 742
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
743 744

  return success;
745 746
}

747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762
/**
 * gimp_pencil:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Paint in the current brush without sub-pixel sampling.
 *
 * This tool is the standard pencil. It draws linearly interpolated
 * lines through the specified stroke coordinates. It operates on the
 * specified drawable in the foreground color with the active brush.
 * The brush mask is treated as though it contains only black and white
 * values. Any value below half is treated as black; any above half, as
 * white.
 *
 * Returns: TRUE on success.
763
 **/
764
gboolean
765
gimp_pencil (gint32         drawable_ID,
766 767
             gint           num_strokes,
             const gdouble *strokes)
768
{
769 770
  GimpValueArray *args;
  GimpValueArray *return_vals;
771
  gboolean success = TRUE;
772

773 774 775 776 777 778 779 780 781 782 783
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-pencil",
                                               args);
  gimp_value_array_unref (args);
784

785
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
786

787
  gimp_value_array_unref (return_vals);
788 789

  return success;
790 791
}

792 793 794 795 796 797 798 799 800 801 802 803 804 805
/**
 * gimp_smudge:
 * @drawable_ID: The affected drawable.
 * @pressure: The pressure of the smudge strokes.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Smudge image with varying pressure.
 *
 * This tool simulates a smudge using the current brush. High pressure
 * results in a greater smudge of paint while low pressure results in a
 * lesser smudge.
 *
 * Returns: TRUE on success.
806
 **/
807
gboolean
808
gimp_smudge (gint32         drawable_ID,
809 810 811
             gdouble        pressure,
             gint           num_strokes,
             const gdouble *strokes)
812
{
813 814
  GimpValueArray *args;
  GimpValueArray *return_vals;
815
  gboolean success = TRUE;
816

817 818 819 820 821 822 823 824 825
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          G_TYPE_DOUBLE,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_double (gimp_value_array_index (args, 1), pressure);
  g_value_set_int (gimp_value_array_index (args, 2), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
826

827 828 829
  return_vals = gimp_run_procedure_with_array ("gimp-smudge",
                                               args);
  gimp_value_array_unref (args);
830

831 832 833
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;

  gimp_value_array_unref (return_vals);
834 835

  return success;
836 837
}

838 839 840 841 842 843 844 845 846
/**
 * gimp_smudge_default:
 * @drawable_ID: The affected drawable.
 * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
 * @strokes: Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }.
 *
 * Smudge image with varying pressure.
 *
 * This tool simulates a smudge using the current brush. It behaves
847
 * exactly the same as gimp_smudge() except that the pressure value is
848 849 850 851
 * taken from the smudge tool options or the options default if the
 * tools option dialog has not been activated.
 *
 * Returns: TRUE on success.
852
 **/
853
gboolean
854
gimp_smudge_default (gint32         drawable_ID,
855 856
                     gint           num_strokes,
                     const gdouble *strokes)
857
{
858 859
  GimpValueArray *args;
  GimpValueArray *return_vals;
860
  gboolean success = TRUE;
861

862 863 864 865 866 867 868 869 870 871 872
  args = gimp_value_array_new_from_types (GIMP_TYPE_DRAWABLE_ID,
                                          GIMP_TYPE_INT32,
                                          GIMP_TYPE_FLOAT_ARRAY,
                                          G_TYPE_NONE);
  gimp_value_set_drawable_id (gimp_value_array_index (args, 0), drawable_ID);
  g_value_set_int (gimp_value_array_index (args, 1), num_strokes);
  gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);

  return_vals = gimp_run_procedure_with_array ("gimp-smudge-default",
                                               args);
  gimp_value_array_unref (args);
873

874
  success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
875

876
  gimp_value_array_unref (return_vals);
877 878

  return success;
879
}