1 /* LIBGIMP - The GIMP Library
2  * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3  *
4  * gimpdrawabletransform_pdb.c
5  *
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.
10  *
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.
15  *
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/>.
19  */
20 
21 /* NOTE: This file is auto-generated by pdbgen.pl */
22 
23 #include "config.h"
24 
25 #include "gimp.h"
26 
27 
28 /**
29  * SECTION: gimpdrawabletransform
30  * @title: gimpdrawabletransform
31  * @short_description: Functions to perform transformatrions on drawables.
32  *
33  * Functions to perform transformatrions on drawables.
34  **/
35 
36 
37 /**
38  * gimp_drawable_transform_flip_simple:
39  * @drawable_ID: The affected drawable.
40  * @flip_type: Type of flip.
41  * @auto_center: Whether to automatically position the axis in the selection center.
42  * @axis: coord. of flip axis.
43  * @clip_result: Whether to clip results.
44  *
45  * Deprecated: Use gimp_item_transform_flip_simple() instead.
46  *
47  * Returns: The flipped drawable.
48  *
49  * Since: 2.2
50  **/
51 gint32
gimp_drawable_transform_flip_simple(gint32 drawable_ID,GimpOrientationType flip_type,gboolean auto_center,gdouble axis,gboolean clip_result)52 gimp_drawable_transform_flip_simple (gint32              drawable_ID,
53                                      GimpOrientationType flip_type,
54                                      gboolean            auto_center,
55                                      gdouble             axis,
56                                      gboolean            clip_result)
57 {
58   GimpParam *return_vals;
59   gint nreturn_vals;
60   gint32 ret_drawable_ID = -1;
61 
62   return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-simple",
63                                     &nreturn_vals,
64                                     GIMP_PDB_DRAWABLE, drawable_ID,
65                                     GIMP_PDB_INT32, flip_type,
66                                     GIMP_PDB_INT32, auto_center,
67                                     GIMP_PDB_FLOAT, axis,
68                                     GIMP_PDB_INT32, clip_result,
69                                     GIMP_PDB_END);
70 
71   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
72     ret_drawable_ID = return_vals[1].data.d_drawable;
73 
74   gimp_destroy_params (return_vals, nreturn_vals);
75 
76   return ret_drawable_ID;
77 }
78 
79 /**
80  * gimp_drawable_transform_flip:
81  * @drawable_ID: The affected drawable.
82  * @x0: horz. coord. of one end of axis.
83  * @y0: vert. coord. of one end of axis.
84  * @x1: horz. coord. of other end of axis.
85  * @y1: vert. coord. of other end of axis.
86  * @transform_direction: Direction of transformation.
87  * @interpolation: Type of interpolation.
88  * @supersample: This parameter is ignored.
89  * @recursion_level: This parameter is ignored.
90  * @clip_result: Whether to clip results.
91  *
92  * Deprecated: Use gimp_item_transform_flip() instead.
93  *
94  * Returns: The flipped drawable.
95  *
96  * Since: 2.2
97  **/
98 gint32
gimp_drawable_transform_flip(gint32 drawable_ID,gdouble x0,gdouble y0,gdouble x1,gdouble y1,GimpTransformDirection transform_direction,GimpInterpolationType interpolation,gboolean supersample,gint recursion_level,gboolean clip_result)99 gimp_drawable_transform_flip (gint32                 drawable_ID,
100                               gdouble                x0,
101                               gdouble                y0,
102                               gdouble                x1,
103                               gdouble                y1,
104                               GimpTransformDirection transform_direction,
105                               GimpInterpolationType  interpolation,
106                               gboolean               supersample,
107                               gint                   recursion_level,
108                               gboolean               clip_result)
109 {
110   GimpParam *return_vals;
111   gint nreturn_vals;
112   gint32 ret_drawable_ID = -1;
113 
114   return_vals = gimp_run_procedure ("gimp-drawable-transform-flip",
115                                     &nreturn_vals,
116                                     GIMP_PDB_DRAWABLE, drawable_ID,
117                                     GIMP_PDB_FLOAT, x0,
118                                     GIMP_PDB_FLOAT, y0,
119                                     GIMP_PDB_FLOAT, x1,
120                                     GIMP_PDB_FLOAT, y1,
121                                     GIMP_PDB_INT32, transform_direction,
122                                     GIMP_PDB_INT32, interpolation,
123                                     GIMP_PDB_INT32, supersample,
124                                     GIMP_PDB_INT32, recursion_level,
125                                     GIMP_PDB_INT32, clip_result,
126                                     GIMP_PDB_END);
127 
128   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
129     ret_drawable_ID = return_vals[1].data.d_drawable;
130 
131   gimp_destroy_params (return_vals, nreturn_vals);
132 
133   return ret_drawable_ID;
134 }
135 
136 /**
137  * gimp_drawable_transform_flip_default:
138  * @drawable_ID: The affected drawable.
139  * @x0: horz. coord. of one end of axis.
140  * @y0: vert. coord. of one end of axis.
141  * @x1: horz. coord. of other end of axis.
142  * @y1: vert. coord. of other end of axis.
143  * @interpolate: Whether to use interpolation and supersampling.
144  * @clip_result: Whether to clip results.
145  *
146  * Deprecated: Use gimp_item_transform_flip() instead.
147  *
148  * Returns: The flipped drawable.
149  *
150  * Since: 2.2
151  **/
152 gint32
gimp_drawable_transform_flip_default(gint32 drawable_ID,gdouble x0,gdouble y0,gdouble x1,gdouble y1,gboolean interpolate,gboolean clip_result)153 gimp_drawable_transform_flip_default (gint32   drawable_ID,
154                                       gdouble  x0,
155                                       gdouble  y0,
156                                       gdouble  x1,
157                                       gdouble  y1,
158                                       gboolean interpolate,
159                                       gboolean clip_result)
160 {
161   GimpParam *return_vals;
162   gint nreturn_vals;
163   gint32 ret_drawable_ID = -1;
164 
165   return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-default",
166                                     &nreturn_vals,
167                                     GIMP_PDB_DRAWABLE, drawable_ID,
168                                     GIMP_PDB_FLOAT, x0,
169                                     GIMP_PDB_FLOAT, y0,
170                                     GIMP_PDB_FLOAT, x1,
171                                     GIMP_PDB_FLOAT, y1,
172                                     GIMP_PDB_INT32, interpolate,
173                                     GIMP_PDB_INT32, clip_result,
174                                     GIMP_PDB_END);
175 
176   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
177     ret_drawable_ID = return_vals[1].data.d_drawable;
178 
179   gimp_destroy_params (return_vals, nreturn_vals);
180 
181   return ret_drawable_ID;
182 }
183 
184 /**
185  * gimp_drawable_transform_perspective:
186  * @drawable_ID: The affected drawable.
187  * @x0: The new x coordinate of upper-left corner of original bounding box.
188  * @y0: The new y coordinate of upper-left corner of original bounding box.
189  * @x1: The new x coordinate of upper-right corner of original bounding box.
190  * @y1: The new y coordinate of upper-right corner of original bounding box.
191  * @x2: The new x coordinate of lower-left corner of original bounding box.
192  * @y2: The new y coordinate of lower-left corner of original bounding box.
193  * @x3: The new x coordinate of lower-right corner of original bounding box.
194  * @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  * @supersample: This parameter is ignored.
198  * @recursion_level: This parameter is ignored.
199  * @clip_result: How to clip results.
200  *
201  * Deprecated: Use gimp_item_transform_perspective() instead.
202  *
203  * Returns: The newly mapped drawable.
204  *
205  * Since: 2.2
206  **/
207 gint32
gimp_drawable_transform_perspective(gint32 drawable_ID,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,GimpTransformResize clip_result)208 gimp_drawable_transform_perspective (gint32                 drawable_ID,
209                                      gdouble                x0,
210                                      gdouble                y0,
211                                      gdouble                x1,
212                                      gdouble                y1,
213                                      gdouble                x2,
214                                      gdouble                y2,
215                                      gdouble                x3,
216                                      gdouble                y3,
217                                      GimpTransformDirection transform_direction,
218                                      GimpInterpolationType  interpolation,
219                                      gboolean               supersample,
220                                      gint                   recursion_level,
221                                      GimpTransformResize    clip_result)
222 {
223   GimpParam *return_vals;
224   gint nreturn_vals;
225   gint32 ret_drawable_ID = -1;
226 
227   return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective",
228                                     &nreturn_vals,
229                                     GIMP_PDB_DRAWABLE, drawable_ID,
230                                     GIMP_PDB_FLOAT, x0,
231                                     GIMP_PDB_FLOAT, y0,
232                                     GIMP_PDB_FLOAT, x1,
233                                     GIMP_PDB_FLOAT, y1,
234                                     GIMP_PDB_FLOAT, x2,
235                                     GIMP_PDB_FLOAT, y2,
236                                     GIMP_PDB_FLOAT, x3,
237                                     GIMP_PDB_FLOAT, y3,
238                                     GIMP_PDB_INT32, transform_direction,
239                                     GIMP_PDB_INT32, interpolation,
240                                     GIMP_PDB_INT32, supersample,
241                                     GIMP_PDB_INT32, recursion_level,
242                                     GIMP_PDB_INT32, clip_result,
243                                     GIMP_PDB_END);
244 
245   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
246     ret_drawable_ID = return_vals[1].data.d_drawable;
247 
248   gimp_destroy_params (return_vals, nreturn_vals);
249 
250   return ret_drawable_ID;
251 }
252 
253 /**
254  * gimp_drawable_transform_perspective_default:
255  * @drawable_ID: The affected drawable.
256  * @x0: The new x coordinate of upper-left corner of original bounding box.
257  * @y0: The new y coordinate of upper-left corner of original bounding box.
258  * @x1: The new x coordinate of upper-right corner of original bounding box.
259  * @y1: The new y coordinate of upper-right corner of original bounding box.
260  * @x2: The new x coordinate of lower-left corner of original bounding box.
261  * @y2: The new y coordinate of lower-left corner of original bounding box.
262  * @x3: The new x coordinate of lower-right corner of original bounding box.
263  * @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  * Returns: The newly mapped drawable.
270  *
271  * Since: 2.2
272  **/
273 gint32
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)274 gimp_drawable_transform_perspective_default (gint32              drawable_ID,
275                                              gdouble             x0,
276                                              gdouble             y0,
277                                              gdouble             x1,
278                                              gdouble             y1,
279                                              gdouble             x2,
280                                              gdouble             y2,
281                                              gdouble             x3,
282                                              gdouble             y3,
283                                              gboolean            interpolate,
284                                              GimpTransformResize clip_result)
285 {
286   GimpParam *return_vals;
287   gint nreturn_vals;
288   gint32 ret_drawable_ID = -1;
289 
290   return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective-default",
291                                     &nreturn_vals,
292                                     GIMP_PDB_DRAWABLE, drawable_ID,
293                                     GIMP_PDB_FLOAT, x0,
294                                     GIMP_PDB_FLOAT, y0,
295                                     GIMP_PDB_FLOAT, x1,
296                                     GIMP_PDB_FLOAT, y1,
297                                     GIMP_PDB_FLOAT, x2,
298                                     GIMP_PDB_FLOAT, y2,
299                                     GIMP_PDB_FLOAT, x3,
300                                     GIMP_PDB_FLOAT, y3,
301                                     GIMP_PDB_INT32, interpolate,
302                                     GIMP_PDB_INT32, clip_result,
303                                     GIMP_PDB_END);
304 
305   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
306     ret_drawable_ID = return_vals[1].data.d_drawable;
307 
308   gimp_destroy_params (return_vals, nreturn_vals);
309 
310   return ret_drawable_ID;
311 }
312 
313 /**
314  * gimp_drawable_transform_rotate_simple:
315  * @drawable_ID: The affected drawable.
316  * @rotate_type: Type of rotation.
317  * @auto_center: Whether to automatically rotate around the selection center.
318  * @center_x: The hor. coordinate of the center of rotation.
319  * @center_y: The vert. coordinate of the center of rotation.
320  * @clip_result: Whether to clip results.
321  *
322  * Deprecated: Use gimp_item_transform_rotate_simple() instead.
323  *
324  * Returns: The rotated drawable.
325  *
326  * Since: 2.2
327  **/
328 gint32
gimp_drawable_transform_rotate_simple(gint32 drawable_ID,GimpRotationType rotate_type,gboolean auto_center,gint center_x,gint center_y,gboolean clip_result)329 gimp_drawable_transform_rotate_simple (gint32           drawable_ID,
330                                        GimpRotationType rotate_type,
331                                        gboolean         auto_center,
332                                        gint             center_x,
333                                        gint             center_y,
334                                        gboolean         clip_result)
335 {
336   GimpParam *return_vals;
337   gint nreturn_vals;
338   gint32 ret_drawable_ID = -1;
339 
340   return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-simple",
341                                     &nreturn_vals,
342                                     GIMP_PDB_DRAWABLE, drawable_ID,
343                                     GIMP_PDB_INT32, rotate_type,
344                                     GIMP_PDB_INT32, auto_center,
345                                     GIMP_PDB_INT32, center_x,
346                                     GIMP_PDB_INT32, center_y,
347                                     GIMP_PDB_INT32, clip_result,
348                                     GIMP_PDB_END);
349 
350   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
351     ret_drawable_ID = return_vals[1].data.d_drawable;
352 
353   gimp_destroy_params (return_vals, nreturn_vals);
354 
355   return ret_drawable_ID;
356 }
357 
358 /**
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  * @center_x: The hor. coordinate of the center of rotation.
364  * @center_y: The vert. coordinate of the center of rotation.
365  * @transform_direction: Direction of transformation.
366  * @interpolation: Type of interpolation.
367  * @supersample: This parameter is ignored.
368  * @recursion_level: This parameter is ignored.
369  * @clip_result: How to clip results.
370  *
371  * Deprecated: Use gimp_item_transform_rotate() instead.
372  *
373  * Returns: The rotated drawable.
374  *
375  * Since: 2.2
376  **/
377 gint32
gimp_drawable_transform_rotate(gint32 drawable_ID,gdouble angle,gboolean auto_center,gint center_x,gint center_y,GimpTransformDirection transform_direction,GimpInterpolationType interpolation,gboolean supersample,gint recursion_level,GimpTransformResize clip_result)378 gimp_drawable_transform_rotate (gint32                 drawable_ID,
379                                 gdouble                angle,
380                                 gboolean               auto_center,
381                                 gint                   center_x,
382                                 gint                   center_y,
383                                 GimpTransformDirection transform_direction,
384                                 GimpInterpolationType  interpolation,
385                                 gboolean               supersample,
386                                 gint                   recursion_level,
387                                 GimpTransformResize    clip_result)
388 {
389   GimpParam *return_vals;
390   gint nreturn_vals;
391   gint32 ret_drawable_ID = -1;
392 
393   return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate",
394                                     &nreturn_vals,
395                                     GIMP_PDB_DRAWABLE, drawable_ID,
396                                     GIMP_PDB_FLOAT, angle,
397                                     GIMP_PDB_INT32, auto_center,
398                                     GIMP_PDB_INT32, center_x,
399                                     GIMP_PDB_INT32, center_y,
400                                     GIMP_PDB_INT32, transform_direction,
401                                     GIMP_PDB_INT32, interpolation,
402                                     GIMP_PDB_INT32, supersample,
403                                     GIMP_PDB_INT32, recursion_level,
404                                     GIMP_PDB_INT32, clip_result,
405                                     GIMP_PDB_END);
406 
407   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
408     ret_drawable_ID = return_vals[1].data.d_drawable;
409 
410   gimp_destroy_params (return_vals, nreturn_vals);
411 
412   return ret_drawable_ID;
413 }
414 
415 /**
416  * gimp_drawable_transform_rotate_default:
417  * @drawable_ID: The affected drawable.
418  * @angle: The angle of rotation (radians).
419  * @auto_center: Whether to automatically rotate around the selection center.
420  * @center_x: The hor. coordinate of the center of rotation.
421  * @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  * Returns: The rotated drawable.
428  *
429  * Since: 2.2
430  **/
431 gint32
gimp_drawable_transform_rotate_default(gint32 drawable_ID,gdouble angle,gboolean auto_center,gint center_x,gint center_y,gboolean interpolate,GimpTransformResize clip_result)432 gimp_drawable_transform_rotate_default (gint32              drawable_ID,
433                                         gdouble             angle,
434                                         gboolean            auto_center,
435                                         gint                center_x,
436                                         gint                center_y,
437                                         gboolean            interpolate,
438                                         GimpTransformResize clip_result)
439 {
440   GimpParam *return_vals;
441   gint nreturn_vals;
442   gint32 ret_drawable_ID = -1;
443 
444   return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-default",
445                                     &nreturn_vals,
446                                     GIMP_PDB_DRAWABLE, drawable_ID,
447                                     GIMP_PDB_FLOAT, angle,
448                                     GIMP_PDB_INT32, auto_center,
449                                     GIMP_PDB_INT32, center_x,
450                                     GIMP_PDB_INT32, center_y,
451                                     GIMP_PDB_INT32, interpolate,
452                                     GIMP_PDB_INT32, clip_result,
453                                     GIMP_PDB_END);
454 
455   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
456     ret_drawable_ID = return_vals[1].data.d_drawable;
457 
458   gimp_destroy_params (return_vals, nreturn_vals);
459 
460   return ret_drawable_ID;
461 }
462 
463 /**
464  * gimp_drawable_transform_scale:
465  * @drawable_ID: The affected drawable.
466  * @x0: The new x coordinate of the upper-left corner of the scaled region.
467  * @y0: The new y coordinate of the upper-left corner of the scaled region.
468  * @x1: The new x coordinate of the lower-right corner of the scaled region.
469  * @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  * @supersample: This parameter is ignored.
473  * @recursion_level: This parameter is ignored.
474  * @clip_result: How to clip results.
475  *
476  * Deprecated: Use gimp_item_transform_scale() instead.
477  *
478  * Returns: The scaled drawable.
479  *
480  * Since: 2.2
481  **/
482 gint32
gimp_drawable_transform_scale(gint32 drawable_ID,gdouble x0,gdouble y0,gdouble x1,gdouble y1,GimpTransformDirection transform_direction,GimpInterpolationType interpolation,gboolean supersample,gint recursion_level,GimpTransformResize clip_result)483 gimp_drawable_transform_scale (gint32                 drawable_ID,
484                                gdouble                x0,
485                                gdouble                y0,
486                                gdouble                x1,
487                                gdouble                y1,
488                                GimpTransformDirection transform_direction,
489                                GimpInterpolationType  interpolation,
490                                gboolean               supersample,
491                                gint                   recursion_level,
492                                GimpTransformResize    clip_result)
493 {
494   GimpParam *return_vals;
495   gint nreturn_vals;
496   gint32 ret_drawable_ID = -1;
497 
498   return_vals = gimp_run_procedure ("gimp-drawable-transform-scale",
499                                     &nreturn_vals,
500                                     GIMP_PDB_DRAWABLE, drawable_ID,
501                                     GIMP_PDB_FLOAT, x0,
502                                     GIMP_PDB_FLOAT, y0,
503                                     GIMP_PDB_FLOAT, x1,
504                                     GIMP_PDB_FLOAT, y1,
505                                     GIMP_PDB_INT32, transform_direction,
506                                     GIMP_PDB_INT32, interpolation,
507                                     GIMP_PDB_INT32, supersample,
508                                     GIMP_PDB_INT32, recursion_level,
509                                     GIMP_PDB_INT32, clip_result,
510                                     GIMP_PDB_END);
511 
512   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
513     ret_drawable_ID = return_vals[1].data.d_drawable;
514 
515   gimp_destroy_params (return_vals, nreturn_vals);
516 
517   return ret_drawable_ID;
518 }
519 
520 /**
521  * gimp_drawable_transform_scale_default:
522  * @drawable_ID: The affected drawable.
523  * @x0: The new x coordinate of the upper-left corner of the scaled region.
524  * @y0: The new y coordinate of the upper-left corner of the scaled region.
525  * @x1: The new x coordinate of the lower-right corner of the scaled region.
526  * @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  * Returns: The scaled drawable.
533  *
534  * Since: 2.2
535  **/
536 gint32
gimp_drawable_transform_scale_default(gint32 drawable_ID,gdouble x0,gdouble y0,gdouble x1,gdouble y1,gboolean interpolate,GimpTransformResize clip_result)537 gimp_drawable_transform_scale_default (gint32              drawable_ID,
538                                        gdouble             x0,
539                                        gdouble             y0,
540                                        gdouble             x1,
541                                        gdouble             y1,
542                                        gboolean            interpolate,
543                                        GimpTransformResize clip_result)
544 {
545   GimpParam *return_vals;
546   gint nreturn_vals;
547   gint32 ret_drawable_ID = -1;
548 
549   return_vals = gimp_run_procedure ("gimp-drawable-transform-scale-default",
550                                     &nreturn_vals,
551                                     GIMP_PDB_DRAWABLE, drawable_ID,
552                                     GIMP_PDB_FLOAT, x0,
553                                     GIMP_PDB_FLOAT, y0,
554                                     GIMP_PDB_FLOAT, x1,
555                                     GIMP_PDB_FLOAT, y1,
556                                     GIMP_PDB_INT32, interpolate,
557                                     GIMP_PDB_INT32, clip_result,
558                                     GIMP_PDB_END);
559 
560   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
561     ret_drawable_ID = return_vals[1].data.d_drawable;
562 
563   gimp_destroy_params (return_vals, nreturn_vals);
564 
565   return ret_drawable_ID;
566 }
567 
568 /**
569  * gimp_drawable_transform_shear:
570  * @drawable_ID: The affected drawable.
571  * @shear_type: Type of shear.
572  * @magnitude: The magnitude of the shear.
573  * @transform_direction: Direction of transformation.
574  * @interpolation: Type of interpolation.
575  * @supersample: This parameter is ignored.
576  * @recursion_level: This parameter is ignored.
577  * @clip_result: How to clip results.
578  *
579  * Deprecated: Use gimp_item_transform_shear() instead.
580  *
581  * Returns: The sheared drawable.
582  *
583  * Since: 2.2
584  **/
585 gint32
gimp_drawable_transform_shear(gint32 drawable_ID,GimpOrientationType shear_type,gdouble magnitude,GimpTransformDirection transform_direction,GimpInterpolationType interpolation,gboolean supersample,gint recursion_level,GimpTransformResize clip_result)586 gimp_drawable_transform_shear (gint32                 drawable_ID,
587                                GimpOrientationType    shear_type,
588                                gdouble                magnitude,
589                                GimpTransformDirection transform_direction,
590                                GimpInterpolationType  interpolation,
591                                gboolean               supersample,
592                                gint                   recursion_level,
593                                GimpTransformResize    clip_result)
594 {
595   GimpParam *return_vals;
596   gint nreturn_vals;
597   gint32 ret_drawable_ID = -1;
598 
599   return_vals = gimp_run_procedure ("gimp-drawable-transform-shear",
600                                     &nreturn_vals,
601                                     GIMP_PDB_DRAWABLE, drawable_ID,
602                                     GIMP_PDB_INT32, shear_type,
603                                     GIMP_PDB_FLOAT, magnitude,
604                                     GIMP_PDB_INT32, transform_direction,
605                                     GIMP_PDB_INT32, interpolation,
606                                     GIMP_PDB_INT32, supersample,
607                                     GIMP_PDB_INT32, recursion_level,
608                                     GIMP_PDB_INT32, clip_result,
609                                     GIMP_PDB_END);
610 
611   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
612     ret_drawable_ID = return_vals[1].data.d_drawable;
613 
614   gimp_destroy_params (return_vals, nreturn_vals);
615 
616   return ret_drawable_ID;
617 }
618 
619 /**
620  * gimp_drawable_transform_shear_default:
621  * @drawable_ID: The affected drawable.
622  * @shear_type: Type of shear.
623  * @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  * Returns: The sheared drawable.
630  *
631  * Since: 2.2
632  **/
633 gint32
gimp_drawable_transform_shear_default(gint32 drawable_ID,GimpOrientationType shear_type,gdouble magnitude,gboolean interpolate,GimpTransformResize clip_result)634 gimp_drawable_transform_shear_default (gint32              drawable_ID,
635                                        GimpOrientationType shear_type,
636                                        gdouble             magnitude,
637                                        gboolean            interpolate,
638                                        GimpTransformResize clip_result)
639 {
640   GimpParam *return_vals;
641   gint nreturn_vals;
642   gint32 ret_drawable_ID = -1;
643 
644   return_vals = gimp_run_procedure ("gimp-drawable-transform-shear-default",
645                                     &nreturn_vals,
646                                     GIMP_PDB_DRAWABLE, drawable_ID,
647                                     GIMP_PDB_INT32, shear_type,
648                                     GIMP_PDB_FLOAT, magnitude,
649                                     GIMP_PDB_INT32, interpolate,
650                                     GIMP_PDB_INT32, clip_result,
651                                     GIMP_PDB_END);
652 
653   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
654     ret_drawable_ID = return_vals[1].data.d_drawable;
655 
656   gimp_destroy_params (return_vals, nreturn_vals);
657 
658   return ret_drawable_ID;
659 }
660 
661 /**
662  * gimp_drawable_transform_2d:
663  * @drawable_ID: The affected drawable.
664  * @source_x: X coordinate of the transformation center.
665  * @source_y: Y coordinate of the transformation center.
666  * @scale_x: Amount to scale in x direction.
667  * @scale_y: Amount to scale in y direction.
668  * @angle: The angle of rotation (radians).
669  * @dest_x: X coordinate of where the center goes.
670  * @dest_y: Y coordinate of where the center goes.
671  * @transform_direction: Direction of transformation.
672  * @interpolation: Type of interpolation.
673  * @supersample: This parameter is ignored.
674  * @recursion_level: This parameter is ignored.
675  * @clip_result: How to clip results.
676  *
677  * Deprecated: Use gimp_item_transform_2d() instead.
678  *
679  * Returns: The transformed drawable.
680  *
681  * Since: 2.2
682  **/
683 gint32
gimp_drawable_transform_2d(gint32 drawable_ID,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,GimpTransformResize clip_result)684 gimp_drawable_transform_2d (gint32                 drawable_ID,
685                             gdouble                source_x,
686                             gdouble                source_y,
687                             gdouble                scale_x,
688                             gdouble                scale_y,
689                             gdouble                angle,
690                             gdouble                dest_x,
691                             gdouble                dest_y,
692                             GimpTransformDirection transform_direction,
693                             GimpInterpolationType  interpolation,
694                             gboolean               supersample,
695                             gint                   recursion_level,
696                             GimpTransformResize    clip_result)
697 {
698   GimpParam *return_vals;
699   gint nreturn_vals;
700   gint32 ret_drawable_ID = -1;
701 
702   return_vals = gimp_run_procedure ("gimp-drawable-transform-2d",
703                                     &nreturn_vals,
704                                     GIMP_PDB_DRAWABLE, drawable_ID,
705                                     GIMP_PDB_FLOAT, source_x,
706                                     GIMP_PDB_FLOAT, source_y,
707                                     GIMP_PDB_FLOAT, scale_x,
708                                     GIMP_PDB_FLOAT, scale_y,
709                                     GIMP_PDB_FLOAT, angle,
710                                     GIMP_PDB_FLOAT, dest_x,
711                                     GIMP_PDB_FLOAT, dest_y,
712                                     GIMP_PDB_INT32, transform_direction,
713                                     GIMP_PDB_INT32, interpolation,
714                                     GIMP_PDB_INT32, supersample,
715                                     GIMP_PDB_INT32, recursion_level,
716                                     GIMP_PDB_INT32, clip_result,
717                                     GIMP_PDB_END);
718 
719   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
720     ret_drawable_ID = return_vals[1].data.d_drawable;
721 
722   gimp_destroy_params (return_vals, nreturn_vals);
723 
724   return ret_drawable_ID;
725 }
726 
727 /**
728  * gimp_drawable_transform_2d_default:
729  * @drawable_ID: The affected drawable.
730  * @source_x: X coordinate of the transformation center.
731  * @source_y: Y coordinate of the transformation center.
732  * @scale_x: Amount to scale in x direction.
733  * @scale_y: Amount to scale in y direction.
734  * @angle: The angle of rotation (radians).
735  * @dest_x: X coordinate of where the center goes.
736  * @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  * Returns: The transformed drawable.
743  *
744  * Since: 2.2
745  **/
746 gint32
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)747 gimp_drawable_transform_2d_default (gint32              drawable_ID,
748                                     gdouble             source_x,
749                                     gdouble             source_y,
750                                     gdouble             scale_x,
751                                     gdouble             scale_y,
752                                     gdouble             angle,
753                                     gdouble             dest_x,
754                                     gdouble             dest_y,
755                                     gboolean            interpolate,
756                                     GimpTransformResize clip_result)
757 {
758   GimpParam *return_vals;
759   gint nreturn_vals;
760   gint32 ret_drawable_ID = -1;
761 
762   return_vals = gimp_run_procedure ("gimp-drawable-transform-2d-default",
763                                     &nreturn_vals,
764                                     GIMP_PDB_DRAWABLE, drawable_ID,
765                                     GIMP_PDB_FLOAT, source_x,
766                                     GIMP_PDB_FLOAT, source_y,
767                                     GIMP_PDB_FLOAT, scale_x,
768                                     GIMP_PDB_FLOAT, scale_y,
769                                     GIMP_PDB_FLOAT, angle,
770                                     GIMP_PDB_FLOAT, dest_x,
771                                     GIMP_PDB_FLOAT, dest_y,
772                                     GIMP_PDB_INT32, interpolate,
773                                     GIMP_PDB_INT32, clip_result,
774                                     GIMP_PDB_END);
775 
776   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
777     ret_drawable_ID = return_vals[1].data.d_drawable;
778 
779   gimp_destroy_params (return_vals, nreturn_vals);
780 
781   return ret_drawable_ID;
782 }
783 
784 /**
785  * gimp_drawable_transform_matrix:
786  * @drawable_ID: The affected drawable.
787  * @coeff_0_0: coefficient (0,0) of the transformation matrix.
788  * @coeff_0_1: coefficient (0,1) of the transformation matrix.
789  * @coeff_0_2: coefficient (0,2) of the transformation matrix.
790  * @coeff_1_0: coefficient (1,0) of the transformation matrix.
791  * @coeff_1_1: coefficient (1,1) of the transformation matrix.
792  * @coeff_1_2: coefficient (1,2) of the transformation matrix.
793  * @coeff_2_0: coefficient (2,0) of the transformation matrix.
794  * @coeff_2_1: coefficient (2,1) of the transformation matrix.
795  * @coeff_2_2: coefficient (2,2) of the transformation matrix.
796  * @transform_direction: Direction of transformation.
797  * @interpolation: Type of interpolation.
798  * @supersample: This parameter is ignored.
799  * @recursion_level: This parameter is ignored.
800  * @clip_result: How to clip results.
801  *
802  * Deprecated: Use gimp_item_transform_matrix() instead.
803  *
804  * Returns: The transformed drawable.
805  *
806  * Since: 2.2
807  **/
808 gint32
gimp_drawable_transform_matrix(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,GimpTransformDirection transform_direction,GimpInterpolationType interpolation,gboolean supersample,gint recursion_level,GimpTransformResize clip_result)809 gimp_drawable_transform_matrix (gint32                 drawable_ID,
810                                 gdouble                coeff_0_0,
811                                 gdouble                coeff_0_1,
812                                 gdouble                coeff_0_2,
813                                 gdouble                coeff_1_0,
814                                 gdouble                coeff_1_1,
815                                 gdouble                coeff_1_2,
816                                 gdouble                coeff_2_0,
817                                 gdouble                coeff_2_1,
818                                 gdouble                coeff_2_2,
819                                 GimpTransformDirection transform_direction,
820                                 GimpInterpolationType  interpolation,
821                                 gboolean               supersample,
822                                 gint                   recursion_level,
823                                 GimpTransformResize    clip_result)
824 {
825   GimpParam *return_vals;
826   gint nreturn_vals;
827   gint32 ret_drawable_ID = -1;
828 
829   return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix",
830                                     &nreturn_vals,
831                                     GIMP_PDB_DRAWABLE, drawable_ID,
832                                     GIMP_PDB_FLOAT, coeff_0_0,
833                                     GIMP_PDB_FLOAT, coeff_0_1,
834                                     GIMP_PDB_FLOAT, coeff_0_2,
835                                     GIMP_PDB_FLOAT, coeff_1_0,
836                                     GIMP_PDB_FLOAT, coeff_1_1,
837                                     GIMP_PDB_FLOAT, coeff_1_2,
838                                     GIMP_PDB_FLOAT, coeff_2_0,
839                                     GIMP_PDB_FLOAT, coeff_2_1,
840                                     GIMP_PDB_FLOAT, coeff_2_2,
841                                     GIMP_PDB_INT32, transform_direction,
842                                     GIMP_PDB_INT32, interpolation,
843                                     GIMP_PDB_INT32, supersample,
844                                     GIMP_PDB_INT32, recursion_level,
845                                     GIMP_PDB_INT32, clip_result,
846                                     GIMP_PDB_END);
847 
848   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
849     ret_drawable_ID = return_vals[1].data.d_drawable;
850 
851   gimp_destroy_params (return_vals, nreturn_vals);
852 
853   return ret_drawable_ID;
854 }
855 
856 /**
857  * gimp_drawable_transform_matrix_default:
858  * @drawable_ID: The affected drawable.
859  * @coeff_0_0: coefficient (0,0) of the transformation matrix.
860  * @coeff_0_1: coefficient (0,1) of the transformation matrix.
861  * @coeff_0_2: coefficient (0,2) of the transformation matrix.
862  * @coeff_1_0: coefficient (1,0) of the transformation matrix.
863  * @coeff_1_1: coefficient (1,1) of the transformation matrix.
864  * @coeff_1_2: coefficient (1,2) of the transformation matrix.
865  * @coeff_2_0: coefficient (2,0) of the transformation matrix.
866  * @coeff_2_1: coefficient (2,1) of the transformation matrix.
867  * @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  * Returns: The transformed drawable.
874  *
875  * Since: 2.2
876  **/
877 gint32
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)878 gimp_drawable_transform_matrix_default (gint32              drawable_ID,
879                                         gdouble             coeff_0_0,
880                                         gdouble             coeff_0_1,
881                                         gdouble             coeff_0_2,
882                                         gdouble             coeff_1_0,
883                                         gdouble             coeff_1_1,
884                                         gdouble             coeff_1_2,
885                                         gdouble             coeff_2_0,
886                                         gdouble             coeff_2_1,
887                                         gdouble             coeff_2_2,
888                                         gboolean            interpolate,
889                                         GimpTransformResize clip_result)
890 {
891   GimpParam *return_vals;
892   gint nreturn_vals;
893   gint32 ret_drawable_ID = -1;
894 
895   return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix-default",
896                                     &nreturn_vals,
897                                     GIMP_PDB_DRAWABLE, drawable_ID,
898                                     GIMP_PDB_FLOAT, coeff_0_0,
899                                     GIMP_PDB_FLOAT, coeff_0_1,
900                                     GIMP_PDB_FLOAT, coeff_0_2,
901                                     GIMP_PDB_FLOAT, coeff_1_0,
902                                     GIMP_PDB_FLOAT, coeff_1_1,
903                                     GIMP_PDB_FLOAT, coeff_1_2,
904                                     GIMP_PDB_FLOAT, coeff_2_0,
905                                     GIMP_PDB_FLOAT, coeff_2_1,
906                                     GIMP_PDB_FLOAT, coeff_2_2,
907                                     GIMP_PDB_INT32, interpolate,
908                                     GIMP_PDB_INT32, clip_result,
909                                     GIMP_PDB_END);
910 
911   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
912     ret_drawable_ID = return_vals[1].data.d_drawable;
913 
914   gimp_destroy_params (return_vals, nreturn_vals);
915 
916   return ret_drawable_ID;
917 }
918