gimpdrawabletransform_pdb.c 37.8 KB
Newer Older
1 2 3 4 5
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
 *
 * gimpdrawabletransform_pdb.c
 *
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 18
 * License along with this library.  If not, see
 * <http://www.gnu.org/licenses/>.
19 20
 */

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

#include "config.h"

#include "gimp.h"

27 28 29 30 31 32 33 34 35 36

/**
 * SECTION: gimpdrawabletransform
 * @title: gimpdrawabletransform
 * @short_description: Functions to perform transformatrions on drawables.
 *
 * Functions to perform transformatrions on drawables.
 **/


37
/**
38
 * gimp_drawable_transform_flip_simple:
39 40
 * @drawable_ID: The affected drawable.
 * @flip_type: Type of flip.
41
 * @auto_center: Whether to automatically position the axis in the selection center.
42 43 44
 * @axis: coord. of flip axis.
 * @clip_result: Whether to clip results.
 *
45
 * Deprecated: Use gimp_item_transform_flip_simple() instead.
46 47
 *
 * Returns: The flipped drawable.
48 49
 *
 * Since: GIMP 2.2
50
 **/
51
gint32
52
gimp_drawable_transform_flip_simple (gint32              drawable_ID,
53 54 55 56
                                     GimpOrientationType flip_type,
                                     gboolean            auto_center,
                                     gdouble             axis,
                                     gboolean            clip_result)
57 58 59 60 61
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

62
  return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-simple",
63 64 65 66 67 68 69
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_INT32, flip_type,
                                    GIMP_PDB_INT32, auto_center,
                                    GIMP_PDB_FLOAT, axis,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
70 71 72 73 74 75 76 77 78 79

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

/**
80
 * gimp_drawable_transform_flip:
81
 * @drawable_ID: The affected drawable.
82 83 84 85
 * @x0: horz. coord. of one end of axis.
 * @y0: vert. coord. of one end of axis.
 * @x1: horz. coord. of other end of axis.
 * @y1: vert. coord. of other end of axis.
86
 * @transform_direction: Direction of transformation.
87
 * @interpolation: Type of interpolation.
88 89
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
90 91
 * @clip_result: Whether to clip results.
 *
92
 * Deprecated: Use gimp_item_transform_flip() instead.
93 94
 *
 * Returns: The flipped drawable.
95 96
 *
 * Since: GIMP 2.2
97
 **/
98
gint32
99
gimp_drawable_transform_flip (gint32                 drawable_ID,
100 101 102 103 104 105 106 107 108
                              gdouble                x0,
                              gdouble                y0,
                              gdouble                x1,
                              gdouble                y1,
                              GimpTransformDirection transform_direction,
                              GimpInterpolationType  interpolation,
                              gboolean               supersample,
                              gint                   recursion_level,
                              gboolean               clip_result)
109 110 111 112 113
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

114
  return_vals = gimp_run_procedure ("gimp-drawable-transform-flip",
115 116 117 118 119 120 121 122 123 124 125 126
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
127 128 129 130 131 132 133 134 135

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

136
/**
137
 * gimp_drawable_transform_flip_default:
138 139 140 141 142
 * @drawable_ID: The affected drawable.
 * @x0: horz. coord. of one end of axis.
 * @y0: vert. coord. of one end of axis.
 * @x1: horz. coord. of other end of axis.
 * @y1: vert. coord. of other end of axis.
143
 * @interpolate: Whether to use interpolation and supersampling.
144 145
 * @clip_result: Whether to clip results.
 *
146
 * Deprecated: Use gimp_item_transform_flip() instead.
147 148 149 150
 *
 * Returns: The flipped drawable.
 *
 * Since: GIMP 2.2
151
 **/
152
gint32
153
gimp_drawable_transform_flip_default (gint32   drawable_ID,
154 155 156 157 158 159
                                      gdouble  x0,
                                      gdouble  y0,
                                      gdouble  x1,
                                      gdouble  y1,
                                      gboolean interpolate,
                                      gboolean clip_result)
160 161 162 163 164
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

165
  return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-default",
166 167 168 169 170 171 172 173 174
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
175 176 177 178 179 180 181 182 183

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

184 185 186 187 188 189 190 191 192 193 194
/**
 * gimp_drawable_transform_perspective:
 * @drawable_ID: The affected drawable.
 * @x0: The new x coordinate of upper-left corner of original bounding box.
 * @y0: The new y coordinate of upper-left corner of original bounding box.
 * @x1: The new x coordinate of upper-right corner of original bounding box.
 * @y1: The new y coordinate of upper-right corner of original bounding box.
 * @x2: The new x coordinate of lower-left corner of original bounding box.
 * @y2: The new y coordinate of lower-left corner of original bounding box.
 * @x3: The new x coordinate of lower-right corner of original bounding box.
 * @y3: The new y coordinate of lower-right corner of original bounding box.
195
 * @transform_direction: Direction of transformation.
196
 * @interpolation: Type of interpolation.
197 198
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
199
 * @clip_result: How to clip results.
200
 *
201
 * Deprecated: Use gimp_item_transform_perspective() instead.
202 203 204 205
 *
 * Returns: The newly mapped drawable.
 *
 * Since: GIMP 2.2
206
 **/
207 208
gint32
gimp_drawable_transform_perspective (gint32                 drawable_ID,
209 210 211 212 213 214 215 216 217 218 219 220
                                     gdouble                x0,
                                     gdouble                y0,
                                     gdouble                x1,
                                     gdouble                y1,
                                     gdouble                x2,
                                     gdouble                y2,
                                     gdouble                x3,
                                     gdouble                y3,
                                     GimpTransformDirection transform_direction,
                                     GimpInterpolationType  interpolation,
                                     gboolean               supersample,
                                     gint                   recursion_level,
221
                                     GimpTransformResize    clip_result)
222 223 224 225 226
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

227
  return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective",
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_FLOAT, x2,
                                    GIMP_PDB_FLOAT, y2,
                                    GIMP_PDB_FLOAT, x3,
                                    GIMP_PDB_FLOAT, y3,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
244 245 246 247 248 249 250 251 252

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

253
/**
254
 * gimp_drawable_transform_perspective_default:
255 256 257 258 259 260 261 262 263
 * @drawable_ID: The affected drawable.
 * @x0: The new x coordinate of upper-left corner of original bounding box.
 * @y0: The new y coordinate of upper-left corner of original bounding box.
 * @x1: The new x coordinate of upper-right corner of original bounding box.
 * @y1: The new y coordinate of upper-right corner of original bounding box.
 * @x2: The new x coordinate of lower-left corner of original bounding box.
 * @y2: The new y coordinate of lower-left corner of original bounding box.
 * @x3: The new x coordinate of lower-right corner of original bounding box.
 * @y3: The new y coordinate of lower-right corner of original bounding box.
264
 * @interpolate: Whether to use interpolation and supersampling.
265
 * @clip_result: How to clip results.
266
 *
267
 * Deprecated: Use gimp_item_transform_perspective() instead.
268 269 270 271
 *
 * Returns: The newly mapped drawable.
 *
 * Since: GIMP 2.2
272
 **/
273
gint32
274 275 276 277 278 279 280 281 282 283 284
gimp_drawable_transform_perspective_default (gint32              drawable_ID,
                                             gdouble             x0,
                                             gdouble             y0,
                                             gdouble             x1,
                                             gdouble             y1,
                                             gdouble             x2,
                                             gdouble             y2,
                                             gdouble             x3,
                                             gdouble             y3,
                                             gboolean            interpolate,
                                             GimpTransformResize clip_result)
285 286 287 288 289
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

290
  return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective-default",
291 292 293 294 295 296 297 298 299 300 301 302 303
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_FLOAT, x2,
                                    GIMP_PDB_FLOAT, y2,
                                    GIMP_PDB_FLOAT, x3,
                                    GIMP_PDB_FLOAT, y3,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
304 305 306 307 308 309 310 311 312

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

313
/**
314
 * gimp_drawable_transform_rotate_simple:
315
 * @drawable_ID: The affected drawable.
316 317 318 319 320 321
 * @rotate_type: Type of rotation.
 * @auto_center: Whether to automatically rotate around the selection center.
 * @center_x: The hor. coordinate of the center of rotation.
 * @center_y: The vert. coordinate of the center of rotation.
 * @clip_result: Whether to clip results.
 *
322
 * Deprecated: Use gimp_item_transform_rotate_simple() instead.
323 324 325 326
 *
 * Returns: The rotated drawable.
 *
 * Since: GIMP 2.2
327
 **/
328
gint32
329
gimp_drawable_transform_rotate_simple (gint32           drawable_ID,
330 331 332 333 334
                                       GimpRotationType rotate_type,
                                       gboolean         auto_center,
                                       gint             center_x,
                                       gint             center_y,
                                       gboolean         clip_result)
335 336 337 338 339
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

340
  return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-simple",
341 342 343 344 345 346 347 348
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_INT32, rotate_type,
                                    GIMP_PDB_INT32, auto_center,
                                    GIMP_PDB_INT32, center_x,
                                    GIMP_PDB_INT32, center_y,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
349 350 351 352 353 354 355 356 357 358

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

/**
359
 * gimp_drawable_transform_rotate:
360
 * @drawable_ID: The affected drawable.
361
 * @angle: The angle of rotation (radians).
362
 * @auto_center: Whether to automatically rotate around the selection center.
363 364
 * @center_x: The hor. coordinate of the center of rotation.
 * @center_y: The vert. coordinate of the center of rotation.
365
 * @transform_direction: Direction of transformation.
366
 * @interpolation: Type of interpolation.
367 368
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
369
 * @clip_result: How to clip results.
370
 *
371
 * Deprecated: Use gimp_item_transform_rotate() instead.
372 373 374 375
 *
 * Returns: The rotated drawable.
 *
 * Since: GIMP 2.2
376
 **/
377
gint32
378
gimp_drawable_transform_rotate (gint32                 drawable_ID,
379 380 381 382 383 384 385 386
                                gdouble                angle,
                                gboolean               auto_center,
                                gint                   center_x,
                                gint                   center_y,
                                GimpTransformDirection transform_direction,
                                GimpInterpolationType  interpolation,
                                gboolean               supersample,
                                gint                   recursion_level,
387
                                GimpTransformResize    clip_result)
388 389 390 391 392
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

393
  return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate",
394 395 396 397 398 399 400 401 402 403 404 405
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, angle,
                                    GIMP_PDB_INT32, auto_center,
                                    GIMP_PDB_INT32, center_x,
                                    GIMP_PDB_INT32, center_y,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
406 407 408 409 410 411 412 413 414

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

415
/**
416
 * gimp_drawable_transform_rotate_default:
417 418 419 420 421
 * @drawable_ID: The affected drawable.
 * @angle: The angle of rotation (radians).
 * @auto_center: Whether to automatically rotate around the selection center.
 * @center_x: The hor. coordinate of the center of rotation.
 * @center_y: The vert. coordinate of the center of rotation.
422
 * @interpolate: Whether to use interpolation and supersampling.
423
 * @clip_result: How to clip results.
424
 *
425
 * Deprecated: Use gimp_item_transform_rotate() instead.
426 427 428 429
 *
 * Returns: The rotated drawable.
 *
 * Since: GIMP 2.2
430
 **/
431
gint32
432 433 434 435 436 437 438
gimp_drawable_transform_rotate_default (gint32              drawable_ID,
                                        gdouble             angle,
                                        gboolean            auto_center,
                                        gint                center_x,
                                        gint                center_y,
                                        gboolean            interpolate,
                                        GimpTransformResize clip_result)
439 440 441 442 443
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

444
  return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-default",
445 446 447 448 449 450 451 452 453
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, angle,
                                    GIMP_PDB_INT32, auto_center,
                                    GIMP_PDB_INT32, center_x,
                                    GIMP_PDB_INT32, center_y,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
454 455 456 457 458 459 460 461 462

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

463 464 465
/**
 * gimp_drawable_transform_scale:
 * @drawable_ID: The affected drawable.
466 467 468 469
 * @x0: The new x coordinate of the upper-left corner of the scaled region.
 * @y0: The new y coordinate of the upper-left corner of the scaled region.
 * @x1: The new x coordinate of the lower-right corner of the scaled region.
 * @y1: The new y coordinate of the lower-right corner of the scaled region.
470
 * @transform_direction: Direction of transformation.
471
 * @interpolation: Type of interpolation.
472 473
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
474
 * @clip_result: How to clip results.
475
 *
476
 * Deprecated: Use gimp_item_transform_scale() instead.
477 478 479 480
 *
 * Returns: The scaled drawable.
 *
 * Since: GIMP 2.2
481
 **/
482 483
gint32
gimp_drawable_transform_scale (gint32                 drawable_ID,
484 485 486 487 488 489 490 491
                               gdouble                x0,
                               gdouble                y0,
                               gdouble                x1,
                               gdouble                y1,
                               GimpTransformDirection transform_direction,
                               GimpInterpolationType  interpolation,
                               gboolean               supersample,
                               gint                   recursion_level,
492
                               GimpTransformResize    clip_result)
493 494 495 496 497
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

498
  return_vals = gimp_run_procedure ("gimp-drawable-transform-scale",
499 500 501 502 503 504 505 506 507 508 509 510
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
511 512 513 514 515 516 517 518 519

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

520
/**
521
 * gimp_drawable_transform_scale_default:
522
 * @drawable_ID: The affected drawable.
523 524 525 526
 * @x0: The new x coordinate of the upper-left corner of the scaled region.
 * @y0: The new y coordinate of the upper-left corner of the scaled region.
 * @x1: The new x coordinate of the lower-right corner of the scaled region.
 * @y1: The new y coordinate of the lower-right corner of the scaled region.
527
 * @interpolate: Whether to use interpolation and supersampling.
528
 * @clip_result: How to clip results.
529
 *
530
 * Deprecated: Use gimp_item_transform_scale() instead.
531 532 533 534
 *
 * Returns: The scaled drawable.
 *
 * Since: GIMP 2.2
535
 **/
536
gint32
537 538 539 540 541 542 543
gimp_drawable_transform_scale_default (gint32              drawable_ID,
                                       gdouble             x0,
                                       gdouble             y0,
                                       gdouble             x1,
                                       gdouble             y1,
                                       gboolean            interpolate,
                                       GimpTransformResize clip_result)
544 545 546 547 548
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

549
  return_vals = gimp_run_procedure ("gimp-drawable-transform-scale-default",
550 551 552 553 554 555 556 557 558
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, x0,
                                    GIMP_PDB_FLOAT, y0,
                                    GIMP_PDB_FLOAT, x1,
                                    GIMP_PDB_FLOAT, y1,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
559 560 561 562 563 564 565 566 567

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

568 569 570 571 572
/**
 * gimp_drawable_transform_shear:
 * @drawable_ID: The affected drawable.
 * @shear_type: Type of shear.
 * @magnitude: The magnitude of the shear.
573
 * @transform_direction: Direction of transformation.
574
 * @interpolation: Type of interpolation.
575 576
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
577
 * @clip_result: How to clip results.
578
 *
579
 * Deprecated: Use gimp_item_transform_shear() instead.
580 581 582 583
 *
 * Returns: The sheared drawable.
 *
 * Since: GIMP 2.2
584
 **/
585 586
gint32
gimp_drawable_transform_shear (gint32                 drawable_ID,
587 588 589 590 591 592
                               GimpOrientationType    shear_type,
                               gdouble                magnitude,
                               GimpTransformDirection transform_direction,
                               GimpInterpolationType  interpolation,
                               gboolean               supersample,
                               gint                   recursion_level,
593
                               GimpTransformResize    clip_result)
594 595 596 597 598
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

599
  return_vals = gimp_run_procedure ("gimp-drawable-transform-shear",
600 601 602 603 604 605 606 607 608 609
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_INT32, shear_type,
                                    GIMP_PDB_FLOAT, magnitude,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
610 611 612 613 614 615 616 617 618

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

619
/**
620
 * gimp_drawable_transform_shear_default:
621 622 623
 * @drawable_ID: The affected drawable.
 * @shear_type: Type of shear.
 * @magnitude: The magnitude of the shear.
624
 * @interpolate: Whether to use interpolation and supersampling.
625
 * @clip_result: How to clip results.
626
 *
627
 * Deprecated: Use gimp_item_transform_shear() instead.
628 629 630 631
 *
 * Returns: The sheared drawable.
 *
 * Since: GIMP 2.2
632
 **/
633
gint32
634
gimp_drawable_transform_shear_default (gint32              drawable_ID,
635 636 637
                                       GimpOrientationType shear_type,
                                       gdouble             magnitude,
                                       gboolean            interpolate,
638
                                       GimpTransformResize clip_result)
639 640 641 642 643
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

644
  return_vals = gimp_run_procedure ("gimp-drawable-transform-shear-default",
645 646 647 648 649 650 651
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_INT32, shear_type,
                                    GIMP_PDB_FLOAT, magnitude,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
652 653 654 655 656 657 658 659 660

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

661 662 663 664 665 666 667 668 669 670
/**
 * gimp_drawable_transform_2d:
 * @drawable_ID: The affected drawable.
 * @source_x: X coordinate of the transformation center.
 * @source_y: Y coordinate of the transformation center.
 * @scale_x: Amount to scale in x direction.
 * @scale_y: Amount to scale in y direction.
 * @angle: The angle of rotation (radians).
 * @dest_x: X coordinate of where the center goes.
 * @dest_y: Y coordinate of where the center goes.
671
 * @transform_direction: Direction of transformation.
672
 * @interpolation: Type of interpolation.
673 674
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
675
 * @clip_result: How to clip results.
676
 *
677
 * Deprecated: Use gimp_item_transform_2d() instead.
678 679 680 681
 *
 * Returns: The transformed drawable.
 *
 * Since: GIMP 2.2
682
 **/
683 684
gint32
gimp_drawable_transform_2d (gint32                 drawable_ID,
685 686 687 688 689 690 691 692 693 694 695
                            gdouble                source_x,
                            gdouble                source_y,
                            gdouble                scale_x,
                            gdouble                scale_y,
                            gdouble                angle,
                            gdouble                dest_x,
                            gdouble                dest_y,
                            GimpTransformDirection transform_direction,
                            GimpInterpolationType  interpolation,
                            gboolean               supersample,
                            gint                   recursion_level,
696
                            GimpTransformResize    clip_result)
697 698 699 700 701
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

702
  return_vals = gimp_run_procedure ("gimp-drawable-transform-2d",
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, source_x,
                                    GIMP_PDB_FLOAT, source_y,
                                    GIMP_PDB_FLOAT, scale_x,
                                    GIMP_PDB_FLOAT, scale_y,
                                    GIMP_PDB_FLOAT, angle,
                                    GIMP_PDB_FLOAT, dest_x,
                                    GIMP_PDB_FLOAT, dest_y,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
718 719 720 721 722 723 724 725

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}
726

727
/**
728
 * gimp_drawable_transform_2d_default:
729 730 731 732 733 734 735 736
 * @drawable_ID: The affected drawable.
 * @source_x: X coordinate of the transformation center.
 * @source_y: Y coordinate of the transformation center.
 * @scale_x: Amount to scale in x direction.
 * @scale_y: Amount to scale in y direction.
 * @angle: The angle of rotation (radians).
 * @dest_x: X coordinate of where the center goes.
 * @dest_y: Y coordinate of where the center goes.
737
 * @interpolate: Whether to use interpolation and supersampling.
738
 * @clip_result: How to clip results.
739
 *
740
 * Deprecated: Use gimp_item_transform_2d() instead.
741 742 743 744
 *
 * Returns: The transformed drawable.
 *
 * Since: GIMP 2.2
745
 **/
746
gint32
747 748 749 750 751 752 753 754 755 756
gimp_drawable_transform_2d_default (gint32              drawable_ID,
                                    gdouble             source_x,
                                    gdouble             source_y,
                                    gdouble             scale_x,
                                    gdouble             scale_y,
                                    gdouble             angle,
                                    gdouble             dest_x,
                                    gdouble             dest_y,
                                    gboolean            interpolate,
                                    GimpTransformResize clip_result)
757 758 759 760 761
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

762
  return_vals = gimp_run_procedure ("gimp-drawable-transform-2d-default",
763 764 765 766 767 768 769 770 771 772 773 774
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, source_x,
                                    GIMP_PDB_FLOAT, source_y,
                                    GIMP_PDB_FLOAT, scale_x,
                                    GIMP_PDB_FLOAT, scale_y,
                                    GIMP_PDB_FLOAT, angle,
                                    GIMP_PDB_FLOAT, dest_x,
                                    GIMP_PDB_FLOAT, dest_y,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
775 776 777 778 779 780 781 782 783

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}

784 785 786 787 788 789 790 791 792 793 794 795
/**
 * gimp_drawable_transform_matrix:
 * @drawable_ID: The affected drawable.
 * @coeff_0_0: coefficient (0,0) of the transformation matrix.
 * @coeff_0_1: coefficient (0,1) of the transformation matrix.
 * @coeff_0_2: coefficient (0,2) of the transformation matrix.
 * @coeff_1_0: coefficient (1,0) of the transformation matrix.
 * @coeff_1_1: coefficient (1,1) of the transformation matrix.
 * @coeff_1_2: coefficient (1,2) of the transformation matrix.
 * @coeff_2_0: coefficient (2,0) of the transformation matrix.
 * @coeff_2_1: coefficient (2,1) of the transformation matrix.
 * @coeff_2_2: coefficient (2,2) of the transformation matrix.
796
 * @transform_direction: Direction of transformation.
797
 * @interpolation: Type of interpolation.
798 799
 * @supersample: This parameter is ignored.
 * @recursion_level: This parameter is ignored.
800
 * @clip_result: How to clip results.
801
 *
802
 * Deprecated: Use gimp_item_transform_matrix() instead.
803 804 805 806
 *
 * Returns: The transformed drawable.
 *
 * Since: GIMP 2.2
807
 **/
808 809
gint32
gimp_drawable_transform_matrix (gint32                 drawable_ID,
810 811 812 813 814 815 816 817 818 819 820 821 822
                                gdouble                coeff_0_0,
                                gdouble                coeff_0_1,
                                gdouble                coeff_0_2,
                                gdouble                coeff_1_0,
                                gdouble                coeff_1_1,
                                gdouble                coeff_1_2,
                                gdouble                coeff_2_0,
                                gdouble                coeff_2_1,
                                gdouble                coeff_2_2,
                                GimpTransformDirection transform_direction,
                                GimpInterpolationType  interpolation,
                                gboolean               supersample,
                                gint                   recursion_level,
823
                                GimpTransformResize    clip_result)
824 825 826 827 828
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

829
  return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix",
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, coeff_0_0,
                                    GIMP_PDB_FLOAT, coeff_0_1,
                                    GIMP_PDB_FLOAT, coeff_0_2,
                                    GIMP_PDB_FLOAT, coeff_1_0,
                                    GIMP_PDB_FLOAT, coeff_1_1,
                                    GIMP_PDB_FLOAT, coeff_1_2,
                                    GIMP_PDB_FLOAT, coeff_2_0,
                                    GIMP_PDB_FLOAT, coeff_2_1,
                                    GIMP_PDB_FLOAT, coeff_2_2,
                                    GIMP_PDB_INT32, transform_direction,
                                    GIMP_PDB_INT32, interpolation,
                                    GIMP_PDB_INT32, supersample,
                                    GIMP_PDB_INT32, recursion_level,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
847 848 849 850 851 852 853 854

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}
855 856

/**
857
 * gimp_drawable_transform_matrix_default:
858 859 860 861 862 863 864 865 866 867
 * @drawable_ID: The affected drawable.
 * @coeff_0_0: coefficient (0,0) of the transformation matrix.
 * @coeff_0_1: coefficient (0,1) of the transformation matrix.
 * @coeff_0_2: coefficient (0,2) of the transformation matrix.
 * @coeff_1_0: coefficient (1,0) of the transformation matrix.
 * @coeff_1_1: coefficient (1,1) of the transformation matrix.
 * @coeff_1_2: coefficient (1,2) of the transformation matrix.
 * @coeff_2_0: coefficient (2,0) of the transformation matrix.
 * @coeff_2_1: coefficient (2,1) of the transformation matrix.
 * @coeff_2_2: coefficient (2,2) of the transformation matrix.
868
 * @interpolate: Whether to use interpolation and supersampling.
869
 * @clip_result: How to clip results.
870
 *
871
 * Deprecated: Use gimp_item_transform_matrix() instead.
872 873 874 875
 *
 * Returns: The transformed drawable.
 *
 * Since: GIMP 2.2
876
 **/
877
gint32
878 879 880 881 882 883 884 885 886 887 888 889
gimp_drawable_transform_matrix_default (gint32              drawable_ID,
                                        gdouble             coeff_0_0,
                                        gdouble             coeff_0_1,
                                        gdouble             coeff_0_2,
                                        gdouble             coeff_1_0,
                                        gdouble             coeff_1_1,
                                        gdouble             coeff_1_2,
                                        gdouble             coeff_2_0,
                                        gdouble             coeff_2_1,
                                        gdouble             coeff_2_2,
                                        gboolean            interpolate,
                                        GimpTransformResize clip_result)
890 891 892 893 894
{
  GimpParam *return_vals;
  gint nreturn_vals;
  gint32 ret_drawable_ID = -1;

895
  return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix-default",
896 897 898 899 900 901 902 903 904 905 906 907 908 909
                                    &nreturn_vals,
                                    GIMP_PDB_DRAWABLE, drawable_ID,
                                    GIMP_PDB_FLOAT, coeff_0_0,
                                    GIMP_PDB_FLOAT, coeff_0_1,
                                    GIMP_PDB_FLOAT, coeff_0_2,
                                    GIMP_PDB_FLOAT, coeff_1_0,
                                    GIMP_PDB_FLOAT, coeff_1_1,
                                    GIMP_PDB_FLOAT, coeff_1_2,
                                    GIMP_PDB_FLOAT, coeff_2_0,
                                    GIMP_PDB_FLOAT, coeff_2_1,
                                    GIMP_PDB_FLOAT, coeff_2_2,
                                    GIMP_PDB_INT32, interpolate,
                                    GIMP_PDB_INT32, clip_result,
                                    GIMP_PDB_END);
910 911 912 913 914 915 916 917

  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
    ret_drawable_ID = return_vals[1].data.d_drawable;

  gimp_destroy_params (return_vals, nreturn_vals);

  return ret_drawable_ID;
}