122
return_args = procedural_db_return_args (&drawable_transform_flip_simple_proc, success);
125
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
130
static ProcArg drawable_transform_flip_simple_inargs[] =
135
"The affected drawable"
140
"Type of flip: GIMP_ORIENTATION_HORIZONTAL (0) or GIMP_ORIENTATION_VERTICAL (1)"
145
"Whether to automatically position the axis in the selection center"
150
"coord. of flip axis"
155
"Whether to clip results"
159
static ProcArg drawable_transform_flip_simple_outargs[] =
164
"The flipped drawable"
168
static ProcRecord drawable_transform_flip_simple_proc =
170
"gimp_drawable_transform_flip_simple",
171
"Flip the specified drawable either vertically or horizontally.",
172
"This procedure flips the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then flipped. If auto_center is set to true, the flip is around the selection's center. Otherwise, the coordinate of the axis needs to be specified. The return value is the ID of the flipped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and flipped drawable.",
173
"Jo\xc3\xa3o S. O. Bueno Calligaris",
174
"Jo\xc3\xa3o S. O. Bueno Calligaris",
179
drawable_transform_flip_simple_inargs,
181
drawable_transform_flip_simple_outargs,
182
{ { drawable_transform_flip_simple_invoker } }
186
drawable_transform_flip_invoker (Gimp *gimp,
187
GimpContext *context,
188
GimpProgress *progress,
191
gboolean success = TRUE;
192
Argument *return_args;
193
GimpDrawable *drawable;
198
gint32 transform_direction;
199
gint32 interpolation;
200
gboolean supersample;
201
gint32 recursion_level;
202
gboolean clip_result;
204
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
205
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
208
x0 = args[1].value.pdb_float;
210
y0 = args[2].value.pdb_float;
212
x1 = args[3].value.pdb_float;
214
y1 = args[4].value.pdb_float;
216
transform_direction = args[5].value.pdb_int;
217
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
220
interpolation = args[6].value.pdb_int;
221
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
224
supersample = args[7].value.pdb_int ? TRUE : FALSE;
226
recursion_level = args[8].value.pdb_int;
227
if (recursion_level <= 0)
230
clip_result = args[9].value.pdb_int ? TRUE : FALSE;
234
gint x, y, width, height;
236
success = gimp_item_is_attached (GIMP_ITEM (drawable));
239
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
244
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
249
/* Assemble the transformation matrix */
250
gimp_transform_matrix_flip_free (x, y, width, height,
255
gimp_progress_start (progress, _("Flip..."), FALSE);
257
/* Transform the selection */
258
success = gimp_drawable_transform_affine (drawable, context,
259
&matrix, transform_direction,
260
interpolation, supersample,
262
clip_result, progress);
265
gimp_progress_end (progress);
269
return_args = procedural_db_return_args (&drawable_transform_flip_proc, success);
272
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
277
static ProcArg drawable_transform_flip_inargs[] =
282
"The affected drawable"
287
"horz. coord. of one end of axis"
292
"vert. coord. of one end of axis"
297
"horz. coord. of other end of axis"
302
"vert. coord. of other end of axis"
306
"transform_direction",
307
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
312
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
317
"Whether to perform supersample"
322
"Level of recursion (3 is a nice default)"
327
"Whether to clip results"
331
static ProcArg drawable_transform_flip_outargs[] =
336
"The flipped drawable"
340
static ProcRecord drawable_transform_flip_proc =
342
"gimp_drawable_transform_flip",
343
"Flip the specified drawable around a given line.",
344
"This procedure flips the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then flipped. The axis to flip around is specified by specifying two points from that line. The return value is the ID of the flipped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and flipped drawable. The clip results parameter specifies wheter current selection will affect the transform.",
345
"Jo\xc3\xa3o S. O. Bueno Calligaris",
346
"Jo\xc3\xa3o S. O. Bueno Calligaris",
351
drawable_transform_flip_inargs,
353
drawable_transform_flip_outargs,
354
{ { drawable_transform_flip_invoker } }
358
drawable_transform_flip_default_invoker (Gimp *gimp,
359
GimpContext *context,
360
GimpProgress *progress,
363
gboolean success = TRUE;
364
Argument *return_args;
365
GimpDrawable *drawable;
370
gboolean interpolate;
371
gboolean clip_result;
373
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
374
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
377
x0 = args[1].value.pdb_float;
379
y0 = args[2].value.pdb_float;
381
x1 = args[3].value.pdb_float;
383
y1 = args[4].value.pdb_float;
385
interpolate = args[5].value.pdb_int ? TRUE : FALSE;
387
clip_result = args[6].value.pdb_int ? TRUE : FALSE;
391
gint x, y, width, height;
393
success = gimp_item_is_attached (GIMP_ITEM (drawable));
396
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
399
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
402
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
407
/* Assemble the transformation matrix */
408
gimp_transform_matrix_flip_free (x, y, width, height,
413
interpolation_type = gimp->config->interpolation_type;
416
gimp_progress_start (progress, _("Flip..."), FALSE);
418
/* Transform the selection */
419
success = gimp_drawable_transform_affine (drawable, context,
420
&matrix, GIMP_TRANSFORM_FORWARD,
423
clip_result, progress);
426
gimp_progress_end (progress);
430
return_args = procedural_db_return_args (&drawable_transform_flip_default_proc, success);
433
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
438
static ProcArg drawable_transform_flip_default_inargs[] =
443
"The affected drawable"
448
"horz. coord. of one end of axis"
453
"vert. coord. of one end of axis"
458
"horz. coord. of other end of axis"
463
"vert. coord. of other end of axis"
468
"Whether to use interpolation and supersampling"
473
"Whether to clip results"
477
static ProcArg drawable_transform_flip_default_outargs[] =
482
"The flipped drawable"
486
static ProcRecord drawable_transform_flip_default_proc =
488
"gimp_drawable_transform_flip_default",
489
"Flip the specified drawable around a given line.",
490
"This procedure is a variant of gimp_drawable_transform_flip() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
491
"Jo\xc3\xa3o S. O. Bueno Calligaris",
492
"Jo\xc3\xa3o S. O. Bueno Calligaris",
497
drawable_transform_flip_default_inargs,
499
drawable_transform_flip_default_outargs,
500
{ { drawable_transform_flip_default_invoker } }
504
drawable_transform_perspective_invoker (Gimp *gimp,
505
GimpContext *context,
506
GimpProgress *progress,
509
gboolean success = TRUE;
510
Argument *return_args;
511
GimpDrawable *drawable;
512
gint32 transform_direction;
513
gint32 interpolation;
514
gboolean supersample;
515
gint32 recursion_level;
516
gboolean clip_result;
517
gdouble trans_info[8];
519
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
520
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
523
trans_info[X0] = args[1].value.pdb_float;
525
trans_info[Y0] = args[2].value.pdb_float;
527
trans_info[X1] = args[3].value.pdb_float;
529
trans_info[Y1] = args[4].value.pdb_float;
531
trans_info[X2] = args[5].value.pdb_float;
533
trans_info[Y2] = args[6].value.pdb_float;
535
trans_info[X3] = args[7].value.pdb_float;
537
trans_info[Y3] = args[8].value.pdb_float;
539
transform_direction = args[9].value.pdb_int;
540
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
543
interpolation = args[10].value.pdb_int;
544
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
547
supersample = args[11].value.pdb_int ? TRUE : FALSE;
549
recursion_level = args[12].value.pdb_int;
550
if (recursion_level <= 0)
553
clip_result = args[13].value.pdb_int ? TRUE : FALSE;
557
gint x, y, width, height;
559
success = gimp_item_is_attached (GIMP_ITEM (drawable));
562
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
567
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
572
/* Assemble the transformation matrix */
573
gimp_transform_matrix_perspective (x, y, width, height,
574
trans_info[X0], trans_info[Y0],
575
trans_info[X1], trans_info[Y1],
576
trans_info[X2], trans_info[Y2],
577
trans_info[X3], trans_info[Y3],
581
gimp_progress_start (progress, _("Perspective..."), FALSE);
583
/* Transform the selection */
584
success = gimp_drawable_transform_affine (drawable, context,
585
&matrix, transform_direction,
586
interpolation, supersample,
588
clip_result, progress);
591
gimp_progress_end (progress);
595
return_args = procedural_db_return_args (&drawable_transform_perspective_proc, success);
598
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
603
static ProcArg drawable_transform_perspective_inargs[] =
608
"The affected drawable"
613
"The new x coordinate of upper-left corner of original bounding box"
618
"The new y coordinate of upper-left corner of original bounding box"
623
"The new x coordinate of upper-right corner of original bounding box"
628
"The new y coordinate of upper-right corner of original bounding box"
633
"The new x coordinate of lower-left corner of original bounding box"
638
"The new y coordinate of lower-left corner of original bounding box"
643
"The new x coordinate of lower-right corner of original bounding box"
648
"The new y coordinate of lower-right corner of original bounding box"
652
"transform_direction",
653
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
658
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
663
"Whether to perform supersample"
668
"Level of recursion (3 is a nice default)"
673
"Whether to clip results"
677
static ProcArg drawable_transform_perspective_outargs[] =
682
"The newly mapped drawable"
686
static ProcRecord drawable_transform_perspective_proc =
688
"gimp_drawable_transform_perspective",
689
"Perform a possibly non-affine transformation on the specified drawable, with extra parameters.",
690
"This procedure performs a possibly non-affine transformation on the specified drawable by allowing the corners of the original bounding box to be arbitrarily remapped to any values. The specified drawable is remapped if no selection exists. However, if a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then remapped as specified. The return value is the ID of the remapped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and remapped drawable. The 4 coordinates specify the new locations of each corner of the original bounding box. By specifying these values, any affine transformation (rotation, scaling, translation) can be affected. Additionally, these values can be specified such that the resulting transformed drawable will appear to have been projected via a perspective transform.",
691
"Jo\xc3\xa3o S. O. Bueno Calligaris",
692
"Jo\xc3\xa3o S. O. Bueno Calligaris",
697
drawable_transform_perspective_inargs,
699
drawable_transform_perspective_outargs,
700
{ { drawable_transform_perspective_invoker } }
704
drawable_transform_perspective_default_invoker (Gimp *gimp,
705
GimpContext *context,
706
GimpProgress *progress,
709
gboolean success = TRUE;
710
Argument *return_args;
711
GimpDrawable *drawable;
712
gboolean interpolate;
713
gboolean clip_result;
714
gdouble trans_info[8];
716
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
717
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
720
trans_info[X0] = args[1].value.pdb_float;
722
trans_info[Y0] = args[2].value.pdb_float;
724
trans_info[X1] = args[3].value.pdb_float;
726
trans_info[Y1] = args[4].value.pdb_float;
728
trans_info[X2] = args[5].value.pdb_float;
730
trans_info[Y2] = args[6].value.pdb_float;
732
trans_info[X3] = args[7].value.pdb_float;
734
trans_info[Y3] = args[8].value.pdb_float;
736
interpolate = args[9].value.pdb_int ? TRUE : FALSE;
738
clip_result = args[10].value.pdb_int ? TRUE : FALSE;
742
gint x, y, width, height;
744
success = gimp_item_is_attached (GIMP_ITEM (drawable));
747
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
750
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
753
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
758
/* Assemble the transformation matrix */
759
gimp_transform_matrix_perspective (x, y, width, height,
760
trans_info[X0], trans_info[Y0],
761
trans_info[X1], trans_info[Y1],
762
trans_info[X2], trans_info[Y2],
763
trans_info[X3], trans_info[Y3],
767
interpolation_type = gimp->config->interpolation_type;
770
gimp_progress_start (progress, _("Perspective..."), FALSE);
772
/* Transform the selection */
773
success = gimp_drawable_transform_affine (drawable, context,
774
&matrix, GIMP_TRANSFORM_FORWARD,
777
clip_result, progress);
780
gimp_progress_end (progress);
784
return_args = procedural_db_return_args (&drawable_transform_perspective_default_proc, success);
787
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
792
static ProcArg drawable_transform_perspective_default_inargs[] =
797
"The affected drawable"
802
"The new x coordinate of upper-left corner of original bounding box"
807
"The new y coordinate of upper-left corner of original bounding box"
812
"The new x coordinate of upper-right corner of original bounding box"
817
"The new y coordinate of upper-right corner of original bounding box"
822
"The new x coordinate of lower-left corner of original bounding box"
827
"The new y coordinate of lower-left corner of original bounding box"
832
"The new x coordinate of lower-right corner of original bounding box"
837
"The new y coordinate of lower-right corner of original bounding box"
842
"Whether to use interpolation and supersampling"
847
"Whether to clip results"
851
static ProcArg drawable_transform_perspective_default_outargs[] =
856
"The newly mapped drawable"
860
static ProcRecord drawable_transform_perspective_default_proc =
862
"gimp_drawable_transform_perspective_default",
863
"Perform a possibly non-affine transformation on the specified drawable, with extra parameters.",
864
"This procedure is a variant of gimp_drawable_transform_perspective() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
865
"Jo\xc3\xa3o S. O. Bueno Calligaris",
866
"Jo\xc3\xa3o S. O. Bueno Calligaris",
871
drawable_transform_perspective_default_inargs,
873
drawable_transform_perspective_default_outargs,
874
{ { drawable_transform_perspective_default_invoker } }
878
drawable_transform_rotate_simple_invoker (Gimp *gimp,
879
GimpContext *context,
880
GimpProgress *progress,
883
gboolean success = TRUE;
884
Argument *return_args;
82
return_vals = gimp_procedure_get_return_values (procedure, success);
85
gimp_value_set_drawable (&return_vals->values[1], drawable);
91
drawable_transform_flip_invoker (GimpProcedure *procedure,
94
GimpProgress *progress,
95
const GValueArray *args)
97
gboolean success = TRUE;
98
GValueArray *return_vals;
99
GimpDrawable *drawable;
104
gint32 transform_direction;
105
gint32 interpolation;
106
gboolean supersample;
107
gint32 recursion_level;
108
gboolean clip_result;
110
drawable = gimp_value_get_drawable (&args->values[0], gimp);
111
x0 = g_value_get_double (&args->values[1]);
112
y0 = g_value_get_double (&args->values[2]);
113
x1 = g_value_get_double (&args->values[3]);
114
y1 = g_value_get_double (&args->values[4]);
115
transform_direction = g_value_get_enum (&args->values[5]);
116
interpolation = g_value_get_enum (&args->values[6]);
117
supersample = g_value_get_boolean (&args->values[7]);
118
recursion_level = g_value_get_int (&args->values[8]);
119
clip_result = g_value_get_boolean (&args->values[9]);
123
gint x, y, width, height;
125
success = gimp_item_is_attached (GIMP_ITEM (drawable));
128
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
133
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
138
/* Assemble the transformation matrix */
139
gimp_matrix3_identity (&matrix);
140
gimp_transform_matrix_flip_free (&matrix,
144
gimp_progress_start (progress, _("Flipping"), FALSE);
146
/* Transform the selection */
147
success = gimp_drawable_transform_affine (drawable, context,
148
&matrix, transform_direction,
149
interpolation, supersample,
151
clip_result, progress);
154
gimp_progress_end (progress);
158
return_vals = gimp_procedure_get_return_values (procedure, success);
161
gimp_value_set_drawable (&return_vals->values[1], drawable);
167
drawable_transform_flip_default_invoker (GimpProcedure *procedure,
169
GimpContext *context,
170
GimpProgress *progress,
171
const GValueArray *args)
173
gboolean success = TRUE;
174
GValueArray *return_vals;
175
GimpDrawable *drawable;
180
gboolean interpolate;
181
gboolean clip_result;
183
drawable = gimp_value_get_drawable (&args->values[0], gimp);
184
x0 = g_value_get_double (&args->values[1]);
185
y0 = g_value_get_double (&args->values[2]);
186
x1 = g_value_get_double (&args->values[3]);
187
y1 = g_value_get_double (&args->values[4]);
188
interpolate = g_value_get_boolean (&args->values[5]);
189
clip_result = g_value_get_boolean (&args->values[6]);
193
gint x, y, width, height;
195
success = gimp_item_is_attached (GIMP_ITEM (drawable));
198
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
201
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
204
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
209
/* Assemble the transformation matrix */
210
gimp_matrix3_identity (&matrix);
211
gimp_transform_matrix_flip_free (&matrix,
215
interpolation_type = gimp->config->interpolation_type;
218
gimp_progress_start (progress, _("Flipping"), FALSE);
220
/* Transform the selection */
221
success = gimp_drawable_transform_affine (drawable, context,
222
&matrix, GIMP_TRANSFORM_FORWARD,
225
clip_result, progress);
228
gimp_progress_end (progress);
232
return_vals = gimp_procedure_get_return_values (procedure, success);
235
gimp_value_set_drawable (&return_vals->values[1], drawable);
241
drawable_transform_perspective_invoker (GimpProcedure *procedure,
243
GimpContext *context,
244
GimpProgress *progress,
245
const GValueArray *args)
247
gboolean success = TRUE;
248
GValueArray *return_vals;
249
GimpDrawable *drawable;
258
gint32 transform_direction;
259
gint32 interpolation;
260
gboolean supersample;
261
gint32 recursion_level;
264
drawable = gimp_value_get_drawable (&args->values[0], gimp);
265
x0 = g_value_get_double (&args->values[1]);
266
y0 = g_value_get_double (&args->values[2]);
267
x1 = g_value_get_double (&args->values[3]);
268
y1 = g_value_get_double (&args->values[4]);
269
x2 = g_value_get_double (&args->values[5]);
270
y2 = g_value_get_double (&args->values[6]);
271
x3 = g_value_get_double (&args->values[7]);
272
y3 = g_value_get_double (&args->values[8]);
273
transform_direction = g_value_get_enum (&args->values[9]);
274
interpolation = g_value_get_enum (&args->values[10]);
275
supersample = g_value_get_boolean (&args->values[11]);
276
recursion_level = g_value_get_int (&args->values[12]);
277
clip_result = g_value_get_enum (&args->values[13]);
281
gint x, y, width, height;
283
success = gimp_item_is_attached (GIMP_ITEM (drawable));
286
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
291
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
296
/* Assemble the transformation matrix */
297
gimp_matrix3_identity (&matrix);
298
gimp_transform_matrix_perspective (&matrix,
304
gimp_progress_start (progress, _("Perspective"), FALSE);
306
/* Transform the selection */
307
success = gimp_drawable_transform_affine (drawable, context,
308
&matrix, transform_direction,
309
interpolation, supersample,
311
clip_result, progress);
314
gimp_progress_end (progress);
318
return_vals = gimp_procedure_get_return_values (procedure, success);
321
gimp_value_set_drawable (&return_vals->values[1], drawable);
327
drawable_transform_perspective_default_invoker (GimpProcedure *procedure,
329
GimpContext *context,
330
GimpProgress *progress,
331
const GValueArray *args)
333
gboolean success = TRUE;
334
GValueArray *return_vals;
335
GimpDrawable *drawable;
344
gboolean interpolate;
347
drawable = gimp_value_get_drawable (&args->values[0], gimp);
348
x0 = g_value_get_double (&args->values[1]);
349
y0 = g_value_get_double (&args->values[2]);
350
x1 = g_value_get_double (&args->values[3]);
351
y1 = g_value_get_double (&args->values[4]);
352
x2 = g_value_get_double (&args->values[5]);
353
y2 = g_value_get_double (&args->values[6]);
354
x3 = g_value_get_double (&args->values[7]);
355
y3 = g_value_get_double (&args->values[8]);
356
interpolate = g_value_get_boolean (&args->values[9]);
357
clip_result = g_value_get_enum (&args->values[10]);
361
gint x, y, width, height;
363
success = gimp_item_is_attached (GIMP_ITEM (drawable));
366
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
369
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
372
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
377
/* Assemble the transformation matrix */
378
gimp_matrix3_identity (&matrix);
379
gimp_transform_matrix_perspective (&matrix,
385
interpolation_type = gimp->config->interpolation_type;
388
gimp_progress_start (progress, _("Perspective"), FALSE);
390
/* Transform the selection */
391
success = gimp_drawable_transform_affine (drawable, context,
392
&matrix, GIMP_TRANSFORM_FORWARD,
395
clip_result, progress);
398
gimp_progress_end (progress);
402
return_vals = gimp_procedure_get_return_values (procedure, success);
405
gimp_value_set_drawable (&return_vals->values[1], drawable);
411
drawable_transform_rotate_simple_invoker (GimpProcedure *procedure,
413
GimpContext *context,
414
GimpProgress *progress,
415
const GValueArray *args)
417
gboolean success = TRUE;
418
GValueArray *return_vals;
885
419
GimpDrawable *drawable;
886
420
gint32 rotate_type;
887
421
gboolean auto_center;
924
return_args = procedural_db_return_args (&drawable_transform_rotate_simple_proc, success);
927
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
932
static ProcArg drawable_transform_rotate_simple_inargs[] =
937
"The affected drawable"
942
"Type of rotation: GIMP_ROTATE_90 (0), GIMP_ROTATE_180 (1), GIMP_ROTATE_270 (2)"
947
"Whether to automatically rotate around the selection center"
952
"The hor. coordinate of the center of rotation"
957
"The vert. coordinate of the center of rotation"
962
"Whether to clip results"
966
static ProcArg drawable_transform_rotate_simple_outargs[] =
971
"The rotated drawable"
975
static ProcRecord drawable_transform_rotate_simple_proc =
977
"gimp_drawable_transform_rotate_simple",
978
"Rotate the specified drawable about given coordinates through the specified angle.",
979
"This function rotates the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then rotated by the specified amount. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and rotated drawable.",
980
"Jo\xc3\xa3o S. O. Bueno Calligaris",
981
"Jo\xc3\xa3o S. O. Bueno Calligaris",
986
drawable_transform_rotate_simple_inargs,
988
drawable_transform_rotate_simple_outargs,
989
{ { drawable_transform_rotate_simple_invoker } }
993
drawable_transform_rotate_invoker (Gimp *gimp,
994
GimpContext *context,
995
GimpProgress *progress,
998
gboolean success = TRUE;
999
Argument *return_args;
1000
GimpDrawable *drawable;
1002
gboolean auto_center;
1005
gint32 transform_direction;
1006
gint32 interpolation;
1007
gboolean supersample;
1008
gint32 recursion_level;
1009
gboolean clip_result;
1011
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1012
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1015
angle = args[1].value.pdb_float;
1017
auto_center = args[2].value.pdb_int ? TRUE : FALSE;
1019
center_x = args[3].value.pdb_int;
1021
center_y = args[4].value.pdb_int;
1023
transform_direction = args[5].value.pdb_int;
1024
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
1027
interpolation = args[6].value.pdb_int;
1028
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
1031
supersample = args[7].value.pdb_int ? TRUE : FALSE;
1033
recursion_level = args[8].value.pdb_int;
1034
if (recursion_level <= 0)
1037
clip_result = args[9].value.pdb_int ? TRUE : FALSE;
1041
gint x, y, width, height;
1043
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1046
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1051
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1056
/* Assemble the transformation matrix */
1058
gimp_transform_matrix_rotate (x, y, width, height, angle,
1061
gimp_transform_matrix_rotate_center (center_x, center_y, angle,
1065
gimp_progress_start (progress, _("Rotating..."), FALSE);
1067
/* Transform the selection */
1068
success = gimp_drawable_transform_affine (drawable, context,
1069
&matrix, transform_direction,
1070
interpolation, supersample,
1072
clip_result, progress);
1075
gimp_progress_end (progress);
1079
return_args = procedural_db_return_args (&drawable_transform_rotate_proc, success);
1082
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1087
static ProcArg drawable_transform_rotate_inargs[] =
1092
"The affected drawable"
1097
"The angle of rotation (radians)"
1102
"Whether to automatically rotate around the selection center"
1107
"The hor. coordinate of the center of rotation"
1112
"The vert. coordinate of the center of rotation"
1116
"transform_direction",
1117
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
1122
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
1127
"Whether to perform supersample"
1132
"Level of recursion (3 is a nice default)"
1137
"Whether to clip results"
1141
static ProcArg drawable_transform_rotate_outargs[] =
1146
"The rotated drawable"
1150
static ProcRecord drawable_transform_rotate_proc =
1152
"gimp_drawable_transform_rotate",
1153
"Rotate the specified drawable about given coordinates through the specified angle.",
1154
"This function rotates the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then rotated by the specified amount. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and rotated drawable.",
1155
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1156
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1161
drawable_transform_rotate_inargs,
1163
drawable_transform_rotate_outargs,
1164
{ { drawable_transform_rotate_invoker } }
1168
drawable_transform_rotate_default_invoker (Gimp *gimp,
1169
GimpContext *context,
1170
GimpProgress *progress,
1173
gboolean success = TRUE;
1174
Argument *return_args;
1175
GimpDrawable *drawable;
1177
gboolean auto_center;
1180
gboolean interpolate;
1181
gboolean clip_result;
1183
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1184
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1187
angle = args[1].value.pdb_float;
1189
auto_center = args[2].value.pdb_int ? TRUE : FALSE;
1191
center_x = args[3].value.pdb_int;
1193
center_y = args[4].value.pdb_int;
1195
interpolate = args[5].value.pdb_int ? TRUE : FALSE;
1197
clip_result = args[6].value.pdb_int ? TRUE : FALSE;
1201
gint x, y, width, height;
1203
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1206
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1209
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
1212
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1217
/* Assemble the transformation matrix */
1219
gimp_transform_matrix_rotate (x, y, width, height, angle,
1222
gimp_transform_matrix_rotate_center (center_x, center_y, angle,
1226
interpolation_type = gimp->config->interpolation_type;
1229
gimp_progress_start (progress, _("Rotating..."), FALSE);
1231
/* Transform the selection */
1232
success = gimp_drawable_transform_affine (drawable, context,
1233
&matrix, GIMP_TRANSFORM_FORWARD,
1236
clip_result, progress);
1239
gimp_progress_end (progress);
1243
return_args = procedural_db_return_args (&drawable_transform_rotate_default_proc, success);
1246
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1251
static ProcArg drawable_transform_rotate_default_inargs[] =
1256
"The affected drawable"
1261
"The angle of rotation (radians)"
1266
"Whether to automatically rotate around the selection center"
1271
"The hor. coordinate of the center of rotation"
1276
"The vert. coordinate of the center of rotation"
1281
"Whether to use interpolation and supersampling"
1286
"Whether to clip results"
1290
static ProcArg drawable_transform_rotate_default_outargs[] =
1295
"The rotated drawable"
1299
static ProcRecord drawable_transform_rotate_default_proc =
1301
"gimp_drawable_transform_rotate_default",
1302
"Rotate the specified drawable about given coordinates through the specified angle.",
1303
"This procedure is a variant of gimp_drawable_transform_rotate() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1304
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1305
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1310
drawable_transform_rotate_default_inargs,
1312
drawable_transform_rotate_default_outargs,
1313
{ { drawable_transform_rotate_default_invoker } }
1317
drawable_transform_scale_invoker (Gimp *gimp,
1318
GimpContext *context,
1319
GimpProgress *progress,
1322
gboolean success = TRUE;
1323
Argument *return_args;
1324
GimpDrawable *drawable;
1325
gint32 transform_direction;
1326
gint32 interpolation;
1327
gboolean supersample;
1328
gint32 recursion_level;
1329
gboolean clip_result;
1330
gdouble trans_info[4];
1332
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1333
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1336
trans_info[X0] = args[1].value.pdb_float;
1338
trans_info[Y0] = args[2].value.pdb_float;
1340
trans_info[X1] = args[3].value.pdb_float;
1342
trans_info[Y1] = args[4].value.pdb_float;
1344
transform_direction = args[5].value.pdb_int;
1345
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
1348
interpolation = args[6].value.pdb_int;
1349
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
1352
supersample = args[7].value.pdb_int ? TRUE : FALSE;
1354
recursion_level = args[8].value.pdb_int;
1355
if (recursion_level <= 0)
1358
clip_result = args[9].value.pdb_int ? TRUE : FALSE;
1362
gint x, y, width, height;
1364
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) &&
1365
trans_info[X0] < trans_info[X1] &&
1366
trans_info[Y0] < trans_info[Y1]);
1369
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1374
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1379
/* Assemble the transformation matrix */
1380
gimp_transform_matrix_scale (x, y, width, height,
1383
trans_info[X1] - trans_info[X0],
1384
trans_info[Y1] - trans_info[Y0],
1388
gimp_progress_start (progress, _("Scaling..."), FALSE);
1390
/* Transform the selection */
1391
success = gimp_drawable_transform_affine (drawable, context,
1392
&matrix, transform_direction,
1393
interpolation, supersample,
1395
clip_result, progress);
1398
gimp_progress_end (progress);
1402
return_args = procedural_db_return_args (&drawable_transform_scale_proc, success);
1405
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1410
static ProcArg drawable_transform_scale_inargs[] =
1415
"The affected drawable"
1420
"The new x coordinate of upper-left corner of newly scaled region"
1425
"The new y coordinate of upper-left corner of newly scaled region"
1430
"The new x coordinate of lower-right corner of newly scaled region"
1435
"The new y coordinate of lower-right corner of newly scaled region"
1439
"transform_direction",
1440
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
1445
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
1450
"Whether to perform supersample"
1455
"Level of recursion (3 is a nice default)"
1460
"Whether to clip results"
1464
static ProcArg drawable_transform_scale_outargs[] =
1469
"The scaled drawable"
1473
static ProcRecord drawable_transform_scale_proc =
1475
"gimp_drawable_transform_scale",
1476
"Scale the specified drawable with extra parameters",
1477
"This procedure scales the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then scaled by the specified amount. The return value is the ID of the scaled drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and scaled drawable.",
1478
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1479
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1484
drawable_transform_scale_inargs,
1486
drawable_transform_scale_outargs,
1487
{ { drawable_transform_scale_invoker } }
1491
drawable_transform_scale_default_invoker (Gimp *gimp,
1492
GimpContext *context,
1493
GimpProgress *progress,
1496
gboolean success = TRUE;
1497
Argument *return_args;
1498
GimpDrawable *drawable;
1499
gboolean interpolate;
1500
gboolean clip_result;
1501
gdouble trans_info[4];
1503
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1504
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1507
trans_info[X0] = args[1].value.pdb_float;
1509
trans_info[Y0] = args[2].value.pdb_float;
1511
trans_info[X1] = args[3].value.pdb_float;
1513
trans_info[Y1] = args[4].value.pdb_float;
1515
interpolate = args[5].value.pdb_int ? TRUE : FALSE;
1517
clip_result = args[6].value.pdb_int ? TRUE : FALSE;
1521
gint x, y, width, height;
1523
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) &&
1524
trans_info[X0] < trans_info[X1] &&
1525
trans_info[Y0] < trans_info[Y1]);
1528
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1531
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
1534
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1539
/* Assemble the transformation matrix */
1540
gimp_transform_matrix_scale (x, y, width, height,
1543
trans_info[X1] - trans_info[X0],
1544
trans_info[Y1] - trans_info[Y0],
1548
interpolation_type = gimp->config->interpolation_type;
1551
gimp_progress_start (progress, _("Scaling..."), FALSE);
1553
/* Transform the selection */
1554
success = gimp_drawable_transform_affine (drawable, context,
1555
&matrix, GIMP_TRANSFORM_FORWARD,
1558
clip_result, progress);
1561
gimp_progress_end (progress);
1565
return_args = procedural_db_return_args (&drawable_transform_scale_default_proc, success);
1568
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1573
static ProcArg drawable_transform_scale_default_inargs[] =
1578
"The affected drawable"
1583
"The new x coordinate of upper-left corner of newly scaled region"
1588
"The new y coordinate of upper-left corner of newly scaled region"
1593
"The new x coordinate of lower-right corner of newly scaled region"
1598
"The new y coordinate of lower-right corner of newly scaled region"
1603
"Whether to use interpolation and supersampling"
1608
"Whether to clip results"
1612
static ProcArg drawable_transform_scale_default_outargs[] =
1617
"The scaled drawable"
1621
static ProcRecord drawable_transform_scale_default_proc =
1623
"gimp_drawable_transform_scale_default",
1624
"Scale the specified drawable with extra parameters",
1625
"This procedure is a variant of gimp_drawable_transform_scale() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1626
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1627
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1632
drawable_transform_scale_default_inargs,
1634
drawable_transform_scale_default_outargs,
1635
{ { drawable_transform_scale_default_invoker } }
1639
drawable_transform_shear_invoker (Gimp *gimp,
1640
GimpContext *context,
1641
GimpProgress *progress,
1644
gboolean success = TRUE;
1645
Argument *return_args;
1646
GimpDrawable *drawable;
1649
gint32 transform_direction;
1650
gint32 interpolation;
1651
gboolean supersample;
1652
gint32 recursion_level;
1653
gboolean clip_result;
1655
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1656
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1659
shear_type = args[1].value.pdb_int;
1660
if (shear_type < GIMP_ORIENTATION_HORIZONTAL || shear_type > GIMP_ORIENTATION_VERTICAL)
1663
magnitude = args[2].value.pdb_float;
1665
transform_direction = args[3].value.pdb_int;
1666
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
1669
interpolation = args[4].value.pdb_int;
1670
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
1673
supersample = args[5].value.pdb_int ? TRUE : FALSE;
1675
recursion_level = args[6].value.pdb_int;
1676
if (recursion_level <= 0)
1679
clip_result = args[7].value.pdb_int ? TRUE : FALSE;
1683
gint x, y, width, height;
1685
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1688
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1693
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1698
/* Assemble the transformation matrix */
1699
gimp_transform_matrix_shear (x, y, width, height,
1700
shear_type, magnitude,
1704
gimp_progress_start (progress, _("Shearing..."), FALSE);
1706
/* Transform the selection */
1707
success = gimp_drawable_transform_affine (drawable, context,
1708
&matrix, transform_direction,
1709
interpolation, supersample,
1711
clip_result, progress);
1714
gimp_progress_end (progress);
1718
return_args = procedural_db_return_args (&drawable_transform_shear_proc, success);
1721
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1726
static ProcArg drawable_transform_shear_inargs[] =
1731
"The affected drawable"
1736
"Type of shear: GIMP_ORIENTATION_HORIZONTAL (0) or GIMP_ORIENTATION_VERTICAL (1)"
1741
"The magnitude of the shear"
1745
"transform_direction",
1746
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
1751
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
1756
"Whether to perform supersample"
1761
"Level of recursion (3 is a nice default)"
1766
"Whether to clip results"
1770
static ProcArg drawable_transform_shear_outargs[] =
1775
"The sheared drawable"
1779
static ProcRecord drawable_transform_shear_proc =
1781
"gimp_drawable_transform_shear",
1782
"Shear the specified drawable about its center by the specified magnitude, with extra parameters.",
1783
"This procedure shears the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then sheard by the specified amount. The return value is the ID of the sheard drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and sheard drawable. The shear type parameter indicates whether the shear will be applied horizontally or vertically. The magnitude can be either positive or negative and indicates the extent (in pixels) to shear by.",
1784
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1785
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1790
drawable_transform_shear_inargs,
1792
drawable_transform_shear_outargs,
1793
{ { drawable_transform_shear_invoker } }
1797
drawable_transform_shear_default_invoker (Gimp *gimp,
1798
GimpContext *context,
1799
GimpProgress *progress,
1802
gboolean success = TRUE;
1803
Argument *return_args;
1804
GimpDrawable *drawable;
1807
gboolean interpolate;
1808
gboolean clip_result;
1810
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1811
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1814
shear_type = args[1].value.pdb_int;
1815
if (shear_type < GIMP_ORIENTATION_HORIZONTAL || shear_type > GIMP_ORIENTATION_VERTICAL)
1818
magnitude = args[2].value.pdb_float;
1820
interpolate = args[3].value.pdb_int ? TRUE : FALSE;
1822
clip_result = args[4].value.pdb_int ? TRUE : FALSE;
1826
gint x, y, width, height;
1828
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1831
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1834
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
1837
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1842
/* Assemble the transformation matrix */
1843
gimp_transform_matrix_shear (x, y, width, height,
1844
shear_type, magnitude,
1848
interpolation_type = gimp->config->interpolation_type;
1851
gimp_progress_start (progress, _("Shearing..."), FALSE);
1853
/* Transform the selection */
1854
success = gimp_drawable_transform_affine (drawable, context,
1855
&matrix, GIMP_TRANSFORM_FORWARD,
1858
clip_result, progress);
1861
gimp_progress_end (progress);
1865
return_args = procedural_db_return_args (&drawable_transform_shear_default_proc, success);
1868
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
1873
static ProcArg drawable_transform_shear_default_inargs[] =
1878
"The affected drawable"
1883
"Type of shear: GIMP_ORIENTATION_HORIZONTAL (0) or GIMP_ORIENTATION_VERTICAL (1)"
1888
"The magnitude of the shear"
1893
"Whether to use interpolation and supersampling"
1898
"Whether to clip results"
1902
static ProcArg drawable_transform_shear_default_outargs[] =
1907
"The sheared drawable"
1911
static ProcRecord drawable_transform_shear_default_proc =
1913
"gimp_drawable_transform_shear_default",
1914
"Shear the specified drawable about its center by the specified magnitude, with extra parameters.",
1915
"This procedure is a variant of gimp_drawable_transform_shear() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1916
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1917
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1922
drawable_transform_shear_default_inargs,
1924
drawable_transform_shear_default_outargs,
1925
{ { drawable_transform_shear_default_invoker } }
1929
drawable_transform_2d_invoker (Gimp *gimp,
1930
GimpContext *context,
1931
GimpProgress *progress,
1934
gboolean success = TRUE;
1935
Argument *return_args;
1936
GimpDrawable *drawable;
1944
gint32 transform_direction;
1945
gint32 interpolation;
1946
gboolean supersample;
1947
gint32 recursion_level;
1948
gboolean clip_result;
1950
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
1951
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
1954
source_x = args[1].value.pdb_float;
1956
source_y = args[2].value.pdb_float;
1958
scale_x = args[3].value.pdb_float;
1960
scale_y = args[4].value.pdb_float;
1962
angle = args[5].value.pdb_float;
1964
dest_x = args[6].value.pdb_float;
1966
dest_y = args[7].value.pdb_float;
1968
transform_direction = args[8].value.pdb_int;
1969
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
1972
interpolation = args[9].value.pdb_int;
1973
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
1976
supersample = args[10].value.pdb_int ? TRUE : FALSE;
1978
recursion_level = args[11].value.pdb_int;
1979
if (recursion_level <= 0)
1982
clip_result = args[12].value.pdb_int ? TRUE : FALSE;
1986
gint x, y, width, height;
1988
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1991
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1996
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
2001
/* Assemble the transformation matrix */
2002
gimp_matrix3_identity (&matrix);
2003
gimp_matrix3_translate (&matrix, -source_x, -source_y);
2004
gimp_matrix3_scale (&matrix, scale_x, scale_y);
2005
gimp_matrix3_rotate (&matrix, angle);
2006
gimp_matrix3_translate (&matrix, dest_x, dest_y);
2009
gimp_progress_start (progress, _("2D Transform..."), FALSE);
2011
/* Transform the selection */
2012
success = gimp_drawable_transform_affine (drawable, context,
2013
&matrix, transform_direction,
2014
interpolation, supersample,
2016
clip_result, progress);
2019
gimp_progress_end (progress);
2023
return_args = procedural_db_return_args (&drawable_transform_2d_proc, success);
2026
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
2031
static ProcArg drawable_transform_2d_inargs[] =
2036
"The affected drawable"
2041
"X coordinate of the transformation center"
2046
"Y coordinate of the transformation center"
2051
"Amount to scale in x direction"
2056
"Amount to scale in y direction"
2061
"The angle of rotation (radians)"
2066
"X coordinate of where the center goes"
2071
"Y coordinate of where the center goes"
2075
"transform_direction",
2076
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
2081
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
2086
"Whether to perform supersample"
2091
"Level of recursion (3 is a nice default)"
2096
"Whether to clip results"
2100
static ProcArg drawable_transform_2d_outargs[] =
2105
"The transformed drawable"
2109
static ProcRecord drawable_transform_2d_proc =
2111
"gimp_drawable_transform_2d",
2112
"Transform the specified drawable in 2d, with extra parameters.",
2113
"This procedure transforms the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then transformed. The transformation is done by scaling the image by the x and y scale factors about the point (source_x, source_y), then rotating around the same point, then translating that point to the new position (dest_x, dest_y). The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and transformed drawable.",
2114
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2115
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2120
drawable_transform_2d_inargs,
2122
drawable_transform_2d_outargs,
2123
{ { drawable_transform_2d_invoker } }
2127
drawable_transform_2d_default_invoker (Gimp *gimp,
2128
GimpContext *context,
2129
GimpProgress *progress,
2132
gboolean success = TRUE;
2133
Argument *return_args;
2134
GimpDrawable *drawable;
2142
gboolean interpolate;
2143
gboolean clip_result;
2145
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
2146
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
2149
source_x = args[1].value.pdb_float;
2151
source_y = args[2].value.pdb_float;
2153
scale_x = args[3].value.pdb_float;
2155
scale_y = args[4].value.pdb_float;
2157
angle = args[5].value.pdb_float;
2159
dest_x = args[6].value.pdb_float;
2161
dest_y = args[7].value.pdb_float;
2163
interpolate = args[8].value.pdb_int ? TRUE : FALSE;
2165
clip_result = args[9].value.pdb_int ? TRUE : FALSE;
2169
gint x, y, width, height;
2171
success = gimp_item_is_attached (GIMP_ITEM (drawable));
2174
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
2177
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
2180
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
2185
/* Assemble the transformation matrix */
2186
gimp_matrix3_identity (&matrix);
2187
gimp_matrix3_translate (&matrix, -source_x, -source_y);
2188
gimp_matrix3_scale (&matrix, scale_x, scale_y);
2189
gimp_matrix3_rotate (&matrix, angle);
2190
gimp_matrix3_translate (&matrix, dest_x, dest_y);
2193
interpolation_type = gimp->config->interpolation_type;
2196
gimp_progress_start (progress, _("2D Transform..."), FALSE);
2198
/* Transform the selection */
2199
success = gimp_drawable_transform_affine (drawable, context,
2200
&matrix, GIMP_TRANSFORM_FORWARD,
2203
clip_result, progress);
2206
gimp_progress_end (progress);
2210
return_args = procedural_db_return_args (&drawable_transform_2d_default_proc, success);
2213
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
2218
static ProcArg drawable_transform_2d_default_inargs[] =
2223
"The affected drawable"
2228
"X coordinate of the transformation center"
2233
"Y coordinate of the transformation center"
2238
"Amount to scale in x direction"
2243
"Amount to scale in y direction"
2248
"The angle of rotation (radians)"
2253
"X coordinate of where the center goes"
2258
"Y coordinate of where the center goes"
2263
"Whether to use interpolation and supersampling"
2268
"Whether to clip results"
2272
static ProcArg drawable_transform_2d_default_outargs[] =
2277
"The transformed drawable"
2281
static ProcRecord drawable_transform_2d_default_proc =
2283
"gimp_drawable_transform_2d_default",
2284
"Transform the specified drawable in 2d, with extra parameters.",
2285
"This procedure is a variant of gimp_drawable_transform_2d() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
2286
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2287
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2292
drawable_transform_2d_default_inargs,
2294
drawable_transform_2d_default_outargs,
2295
{ { drawable_transform_2d_default_invoker } }
2299
drawable_transform_matrix_invoker (Gimp *gimp,
2300
GimpContext *context,
2301
GimpProgress *progress,
2304
gboolean success = TRUE;
2305
Argument *return_args;
2306
GimpDrawable *drawable;
2316
gint32 transform_direction;
2317
gint32 interpolation;
2318
gboolean supersample;
2319
gint32 recursion_level;
2320
gboolean clip_result;
2322
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
2323
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
2326
coeff_0_0 = args[1].value.pdb_float;
2328
coeff_0_1 = args[2].value.pdb_float;
2330
coeff_0_2 = args[3].value.pdb_float;
2332
coeff_1_0 = args[4].value.pdb_float;
2334
coeff_1_1 = args[5].value.pdb_float;
2336
coeff_1_2 = args[6].value.pdb_float;
2338
coeff_2_0 = args[7].value.pdb_float;
2340
coeff_2_1 = args[8].value.pdb_float;
2342
coeff_2_2 = args[9].value.pdb_float;
2344
transform_direction = args[10].value.pdb_int;
2345
if (transform_direction < GIMP_TRANSFORM_FORWARD || transform_direction > GIMP_TRANSFORM_BACKWARD)
2348
interpolation = args[11].value.pdb_int;
2349
if (interpolation < GIMP_INTERPOLATION_NONE || interpolation > GIMP_INTERPOLATION_CUBIC)
2352
supersample = args[12].value.pdb_int ? TRUE : FALSE;
2354
recursion_level = args[13].value.pdb_int;
2355
if (recursion_level <= 0)
2358
clip_result = args[14].value.pdb_int ? TRUE : FALSE;
2362
gint x, y, width, height;
2364
success = gimp_item_is_attached (GIMP_ITEM (drawable));
2367
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
2372
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
2377
/* Assemble the transformation matrix */
2378
matrix.coeff[0][0] = coeff_0_0;
2379
matrix.coeff[0][1] = coeff_0_1;
2380
matrix.coeff[0][2] = coeff_0_2;
2381
matrix.coeff[1][0] = coeff_1_0;
2382
matrix.coeff[1][1] = coeff_1_1;
2383
matrix.coeff[1][2] = coeff_1_2;
2384
matrix.coeff[2][0] = coeff_2_0;
2385
matrix.coeff[2][1] = coeff_2_1;
2386
matrix.coeff[2][2] = coeff_2_2;
2389
gimp_progress_start (progress, _("2D Transform..."), FALSE);
2391
/* Transform the selection */
2392
success = gimp_drawable_transform_affine (drawable, context,
2393
&matrix, transform_direction,
2394
interpolation, supersample,
2396
clip_result, progress);
2399
gimp_progress_end (progress);
2403
return_args = procedural_db_return_args (&drawable_transform_matrix_proc, success);
2406
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
2411
static ProcArg drawable_transform_matrix_inargs[] =
2416
"The affected drawable"
2421
"coefficient (0,0) of the transformation matrix"
2426
"coefficient (0,1) of the transformation matrix"
2431
"coefficient (0,2) of the transformation matrix"
2436
"coefficient (1,0) of the transformation matrix"
2441
"coefficient (1,1) of the transformation matrix"
2446
"coefficient (1,2) of the transformation matrix"
2451
"coefficient (2,0) of the transformation matrix"
2456
"coefficient (2,1) of the transformation matrix"
2461
"coefficient (2,2) of the transformation matrix"
2465
"transform_direction",
2466
"Direction of Transformation: { GIMP_TRANSFORM_FORWARD (0), GIMP_TRANSFORM_BACKWARD (1) }"
2471
"Type of interpolation: { GIMP_INTERPOLATION_NONE (0), GIMP_INTERPOLATION_LINEAR (1), GIMP_INTERPOLATION_CUBIC (2) }"
2476
"Whether to perform supersample"
2481
"Level of recursion (3 is a nice default)"
2486
"Whether to clip results"
2490
static ProcArg drawable_transform_matrix_outargs[] =
2495
"The transformed drawable"
2499
static ProcRecord drawable_transform_matrix_proc =
2501
"gimp_drawable_transform_matrix",
2502
"Transform the specified drawable in 2d, with extra parameters.",
2503
"This procedure transforms the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then transformed. The transformation is done by assembling a 3x3 matrix from the coefficients passed. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and transformed drawable.",
2504
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2505
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2510
drawable_transform_matrix_inargs,
2512
drawable_transform_matrix_outargs,
2513
{ { drawable_transform_matrix_invoker } }
2517
drawable_transform_matrix_default_invoker (Gimp *gimp,
2518
GimpContext *context,
2519
GimpProgress *progress,
2522
gboolean success = TRUE;
2523
Argument *return_args;
2524
GimpDrawable *drawable;
2534
gboolean interpolate;
2535
gboolean clip_result;
2537
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
2538
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
2541
coeff_0_0 = args[1].value.pdb_float;
2543
coeff_0_1 = args[2].value.pdb_float;
2545
coeff_0_2 = args[3].value.pdb_float;
2547
coeff_1_0 = args[4].value.pdb_float;
2549
coeff_1_1 = args[5].value.pdb_float;
2551
coeff_1_2 = args[6].value.pdb_float;
2553
coeff_2_0 = args[7].value.pdb_float;
2555
coeff_2_1 = args[8].value.pdb_float;
2557
coeff_2_2 = args[9].value.pdb_float;
2559
interpolate = args[10].value.pdb_int ? TRUE : FALSE;
2561
clip_result = args[11].value.pdb_int ? TRUE : FALSE;
2565
gint x, y, width, height;
2567
success = gimp_item_is_attached (GIMP_ITEM (drawable));
2570
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
2573
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
2576
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
2581
/* Assemble the transformation matrix */
2582
matrix.coeff[0][0] = coeff_0_0;
2583
matrix.coeff[0][1] = coeff_0_1;
2584
matrix.coeff[0][2] = coeff_0_2;
2585
matrix.coeff[1][0] = coeff_1_0;
2586
matrix.coeff[1][1] = coeff_1_1;
2587
matrix.coeff[1][2] = coeff_1_2;
2588
matrix.coeff[2][0] = coeff_2_0;
2589
matrix.coeff[2][1] = coeff_2_1;
2590
matrix.coeff[2][2] = coeff_2_2;
2593
interpolation_type = gimp->config->interpolation_type;
2596
gimp_progress_start (progress, _("2D Transform..."), FALSE);
2598
/* Transform the selection */
2599
success = gimp_drawable_transform_affine (drawable, context,
2600
&matrix, GIMP_TRANSFORM_FORWARD,
2603
clip_result, progress);
2606
gimp_progress_end (progress);
2610
return_args = procedural_db_return_args (&drawable_transform_matrix_default_proc, success);
2613
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
2618
static ProcArg drawable_transform_matrix_default_inargs[] =
2623
"The affected drawable"
2628
"coefficient (0,0) of the transformation matrix"
2633
"coefficient (0,1) of the transformation matrix"
2638
"coefficient (0,2) of the transformation matrix"
2643
"coefficient (1,0) of the transformation matrix"
2648
"coefficient (1,1) of the transformation matrix"
2653
"coefficient (1,2) of the transformation matrix"
2658
"coefficient (2,0) of the transformation matrix"
2663
"coefficient (2,1) of the transformation matrix"
2668
"coefficient (2,2) of the transformation matrix"
2673
"Whether to use interpolation and supersampling"
2678
"Whether to clip results"
2682
static ProcArg drawable_transform_matrix_default_outargs[] =
2687
"The transformed drawable"
2691
static ProcRecord drawable_transform_matrix_default_proc =
2693
"gimp_drawable_transform_matrix_default",
2694
"Transform the specified drawable in 2d, with extra parameters.",
2695
"This procedure is a variant of gimp_drawable_transform_matrix() which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
2696
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2697
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2702
drawable_transform_matrix_default_inargs,
2704
drawable_transform_matrix_default_outargs,
2705
{ { drawable_transform_matrix_default_invoker } }
449
return_vals = gimp_procedure_get_return_values (procedure, success);
452
gimp_value_set_drawable (&return_vals->values[1], drawable);
458
drawable_transform_rotate_invoker (GimpProcedure *procedure,
460
GimpContext *context,
461
GimpProgress *progress,
462
const GValueArray *args)
464
gboolean success = TRUE;
465
GValueArray *return_vals;
466
GimpDrawable *drawable;
468
gboolean auto_center;
471
gint32 transform_direction;
472
gint32 interpolation;
473
gboolean supersample;
474
gint32 recursion_level;
477
drawable = gimp_value_get_drawable (&args->values[0], gimp);
478
angle = g_value_get_double (&args->values[1]);
479
auto_center = g_value_get_boolean (&args->values[2]);
480
center_x = g_value_get_int (&args->values[3]);
481
center_y = g_value_get_int (&args->values[4]);
482
transform_direction = g_value_get_enum (&args->values[5]);
483
interpolation = g_value_get_enum (&args->values[6]);
484
supersample = g_value_get_boolean (&args->values[7]);
485
recursion_level = g_value_get_int (&args->values[8]);
486
clip_result = g_value_get_enum (&args->values[9]);
490
gint x, y, width, height;
492
success = gimp_item_is_attached (GIMP_ITEM (drawable));
495
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
500
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
505
/* Assemble the transformation matrix */
506
gimp_matrix3_identity (&matrix);
508
gimp_transform_matrix_rotate_rect (&matrix,
509
x, y, width, height, angle);
511
gimp_transform_matrix_rotate_center (&matrix,
512
center_x, center_y, angle);
515
gimp_progress_start (progress, _("Rotating"), FALSE);
517
/* Transform the selection */
518
success = gimp_drawable_transform_affine (drawable, context,
519
&matrix, transform_direction,
520
interpolation, supersample,
522
clip_result, progress);
525
gimp_progress_end (progress);
529
return_vals = gimp_procedure_get_return_values (procedure, success);
532
gimp_value_set_drawable (&return_vals->values[1], drawable);
538
drawable_transform_rotate_default_invoker (GimpProcedure *procedure,
540
GimpContext *context,
541
GimpProgress *progress,
542
const GValueArray *args)
544
gboolean success = TRUE;
545
GValueArray *return_vals;
546
GimpDrawable *drawable;
548
gboolean auto_center;
551
gboolean interpolate;
554
drawable = gimp_value_get_drawable (&args->values[0], gimp);
555
angle = g_value_get_double (&args->values[1]);
556
auto_center = g_value_get_boolean (&args->values[2]);
557
center_x = g_value_get_int (&args->values[3]);
558
center_y = g_value_get_int (&args->values[4]);
559
interpolate = g_value_get_boolean (&args->values[5]);
560
clip_result = g_value_get_enum (&args->values[6]);
564
gint x, y, width, height;
566
success = gimp_item_is_attached (GIMP_ITEM (drawable));
569
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
572
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
575
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
580
/* Assemble the transformation matrix */
581
gimp_matrix3_identity (&matrix);
583
gimp_transform_matrix_rotate_rect (&matrix,
584
x, y, width, height, angle);
586
gimp_transform_matrix_rotate_center (&matrix,
587
center_x, center_y, angle);
590
interpolation_type = gimp->config->interpolation_type;
593
gimp_progress_start (progress, _("Rotating"), FALSE);
595
/* Transform the selection */
596
success = gimp_drawable_transform_affine (drawable, context,
597
&matrix, GIMP_TRANSFORM_FORWARD,
600
clip_result, progress);
603
gimp_progress_end (progress);
607
return_vals = gimp_procedure_get_return_values (procedure, success);
610
gimp_value_set_drawable (&return_vals->values[1], drawable);
616
drawable_transform_scale_invoker (GimpProcedure *procedure,
618
GimpContext *context,
619
GimpProgress *progress,
620
const GValueArray *args)
622
gboolean success = TRUE;
623
GValueArray *return_vals;
624
GimpDrawable *drawable;
629
gint32 transform_direction;
630
gint32 interpolation;
631
gboolean supersample;
632
gint32 recursion_level;
635
drawable = gimp_value_get_drawable (&args->values[0], gimp);
636
x0 = g_value_get_double (&args->values[1]);
637
y0 = g_value_get_double (&args->values[2]);
638
x1 = g_value_get_double (&args->values[3]);
639
y1 = g_value_get_double (&args->values[4]);
640
transform_direction = g_value_get_enum (&args->values[5]);
641
interpolation = g_value_get_enum (&args->values[6]);
642
supersample = g_value_get_boolean (&args->values[7]);
643
recursion_level = g_value_get_int (&args->values[8]);
644
clip_result = g_value_get_enum (&args->values[9]);
648
gint x, y, width, height;
650
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) && x0 < x1 && y0 < y1);
653
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
658
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
663
/* Assemble the transformation matrix */
664
gimp_matrix3_identity (&matrix);
665
gimp_transform_matrix_scale (&matrix,
667
x0, y0, x1 - x0, y1 - y0);
670
gimp_progress_start (progress, _("Scaling"), FALSE);
672
/* Transform the selection */
673
success = gimp_drawable_transform_affine (drawable, context,
674
&matrix, transform_direction,
675
interpolation, supersample,
677
clip_result, progress);
680
gimp_progress_end (progress);
684
return_vals = gimp_procedure_get_return_values (procedure, success);
687
gimp_value_set_drawable (&return_vals->values[1], drawable);
693
drawable_transform_scale_default_invoker (GimpProcedure *procedure,
695
GimpContext *context,
696
GimpProgress *progress,
697
const GValueArray *args)
699
gboolean success = TRUE;
700
GValueArray *return_vals;
701
GimpDrawable *drawable;
706
gboolean interpolate;
709
drawable = gimp_value_get_drawable (&args->values[0], gimp);
710
x0 = g_value_get_double (&args->values[1]);
711
y0 = g_value_get_double (&args->values[2]);
712
x1 = g_value_get_double (&args->values[3]);
713
y1 = g_value_get_double (&args->values[4]);
714
interpolate = g_value_get_boolean (&args->values[5]);
715
clip_result = g_value_get_enum (&args->values[6]);
719
gint x, y, width, height;
721
success = (gimp_item_is_attached (GIMP_ITEM (drawable)) && x0 < x1 && y0 < y1);
724
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
727
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
730
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
735
/* Assemble the transformation matrix */
736
gimp_matrix3_identity (&matrix);
737
gimp_transform_matrix_scale (&matrix,
739
x0, y0, x1 - x0, y1 - y0);
742
interpolation_type = gimp->config->interpolation_type;
745
gimp_progress_start (progress, _("Scaling"), FALSE);
747
/* Transform the selection */
748
success = gimp_drawable_transform_affine (drawable, context,
749
&matrix, GIMP_TRANSFORM_FORWARD,
752
clip_result, progress);
755
gimp_progress_end (progress);
759
return_vals = gimp_procedure_get_return_values (procedure, success);
762
gimp_value_set_drawable (&return_vals->values[1], drawable);
768
drawable_transform_shear_invoker (GimpProcedure *procedure,
770
GimpContext *context,
771
GimpProgress *progress,
772
const GValueArray *args)
774
gboolean success = TRUE;
775
GValueArray *return_vals;
776
GimpDrawable *drawable;
779
gint32 transform_direction;
780
gint32 interpolation;
781
gboolean supersample;
782
gint32 recursion_level;
785
drawable = gimp_value_get_drawable (&args->values[0], gimp);
786
shear_type = g_value_get_enum (&args->values[1]);
787
magnitude = g_value_get_double (&args->values[2]);
788
transform_direction = g_value_get_enum (&args->values[3]);
789
interpolation = g_value_get_enum (&args->values[4]);
790
supersample = g_value_get_boolean (&args->values[5]);
791
recursion_level = g_value_get_int (&args->values[6]);
792
clip_result = g_value_get_enum (&args->values[7]);
796
gint x, y, width, height;
798
success = gimp_item_is_attached (GIMP_ITEM (drawable));
801
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
806
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
811
/* Assemble the transformation matrix */
812
gimp_matrix3_identity (&matrix);
813
gimp_transform_matrix_shear (&matrix,
815
shear_type, magnitude);
818
gimp_progress_start (progress, _("Shearing"), FALSE);
820
/* Transform the selection */
821
success = gimp_drawable_transform_affine (drawable, context,
822
&matrix, transform_direction,
823
interpolation, supersample,
825
clip_result, progress);
828
gimp_progress_end (progress);
832
return_vals = gimp_procedure_get_return_values (procedure, success);
835
gimp_value_set_drawable (&return_vals->values[1], drawable);
841
drawable_transform_shear_default_invoker (GimpProcedure *procedure,
843
GimpContext *context,
844
GimpProgress *progress,
845
const GValueArray *args)
847
gboolean success = TRUE;
848
GValueArray *return_vals;
849
GimpDrawable *drawable;
852
gboolean interpolate;
855
drawable = gimp_value_get_drawable (&args->values[0], gimp);
856
shear_type = g_value_get_enum (&args->values[1]);
857
magnitude = g_value_get_double (&args->values[2]);
858
interpolate = g_value_get_boolean (&args->values[3]);
859
clip_result = g_value_get_enum (&args->values[4]);
863
gint x, y, width, height;
865
success = gimp_item_is_attached (GIMP_ITEM (drawable));
868
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
871
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
874
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
879
/* Assemble the transformation matrix */
880
gimp_matrix3_identity (&matrix);
881
gimp_transform_matrix_shear (&matrix,
883
shear_type, magnitude);
886
interpolation_type = gimp->config->interpolation_type;
889
gimp_progress_start (progress, _("Shearing"), FALSE);
891
/* Transform the selection */
892
success = gimp_drawable_transform_affine (drawable, context,
893
&matrix, GIMP_TRANSFORM_FORWARD,
896
clip_result, progress);
899
gimp_progress_end (progress);
903
return_vals = gimp_procedure_get_return_values (procedure, success);
906
gimp_value_set_drawable (&return_vals->values[1], drawable);
912
drawable_transform_2d_invoker (GimpProcedure *procedure,
914
GimpContext *context,
915
GimpProgress *progress,
916
const GValueArray *args)
918
gboolean success = TRUE;
919
GValueArray *return_vals;
920
GimpDrawable *drawable;
928
gint32 transform_direction;
929
gint32 interpolation;
930
gboolean supersample;
931
gint32 recursion_level;
934
drawable = gimp_value_get_drawable (&args->values[0], gimp);
935
source_x = g_value_get_double (&args->values[1]);
936
source_y = g_value_get_double (&args->values[2]);
937
scale_x = g_value_get_double (&args->values[3]);
938
scale_y = g_value_get_double (&args->values[4]);
939
angle = g_value_get_double (&args->values[5]);
940
dest_x = g_value_get_double (&args->values[6]);
941
dest_y = g_value_get_double (&args->values[7]);
942
transform_direction = g_value_get_enum (&args->values[8]);
943
interpolation = g_value_get_enum (&args->values[9]);
944
supersample = g_value_get_boolean (&args->values[10]);
945
recursion_level = g_value_get_int (&args->values[11]);
946
clip_result = g_value_get_enum (&args->values[12]);
950
gint x, y, width, height;
952
success = gimp_item_is_attached (GIMP_ITEM (drawable));
955
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
960
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
965
/* Assemble the transformation matrix */
966
gimp_matrix3_identity (&matrix);
967
gimp_matrix3_translate (&matrix, -source_x, -source_y);
968
gimp_matrix3_scale (&matrix, scale_x, scale_y);
969
gimp_matrix3_rotate (&matrix, angle);
970
gimp_matrix3_translate (&matrix, dest_x, dest_y);
973
gimp_progress_start (progress, _("2D Transform"), FALSE);
975
/* Transform the selection */
976
success = gimp_drawable_transform_affine (drawable, context,
977
&matrix, transform_direction,
978
interpolation, supersample,
980
clip_result, progress);
983
gimp_progress_end (progress);
987
return_vals = gimp_procedure_get_return_values (procedure, success);
990
gimp_value_set_drawable (&return_vals->values[1], drawable);
996
drawable_transform_2d_default_invoker (GimpProcedure *procedure,
998
GimpContext *context,
999
GimpProgress *progress,
1000
const GValueArray *args)
1002
gboolean success = TRUE;
1003
GValueArray *return_vals;
1004
GimpDrawable *drawable;
1012
gboolean interpolate;
1015
drawable = gimp_value_get_drawable (&args->values[0], gimp);
1016
source_x = g_value_get_double (&args->values[1]);
1017
source_y = g_value_get_double (&args->values[2]);
1018
scale_x = g_value_get_double (&args->values[3]);
1019
scale_y = g_value_get_double (&args->values[4]);
1020
angle = g_value_get_double (&args->values[5]);
1021
dest_x = g_value_get_double (&args->values[6]);
1022
dest_y = g_value_get_double (&args->values[7]);
1023
interpolate = g_value_get_boolean (&args->values[8]);
1024
clip_result = g_value_get_enum (&args->values[9]);
1028
gint x, y, width, height;
1030
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1033
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1036
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
1039
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1044
/* Assemble the transformation matrix */
1045
gimp_matrix3_identity (&matrix);
1046
gimp_matrix3_translate (&matrix, -source_x, -source_y);
1047
gimp_matrix3_scale (&matrix, scale_x, scale_y);
1048
gimp_matrix3_rotate (&matrix, angle);
1049
gimp_matrix3_translate (&matrix, dest_x, dest_y);
1052
interpolation_type = gimp->config->interpolation_type;
1055
gimp_progress_start (progress, _("2D Transforming"), FALSE);
1057
/* Transform the selection */
1058
success = gimp_drawable_transform_affine (drawable, context,
1059
&matrix, GIMP_TRANSFORM_FORWARD,
1062
clip_result, progress);
1065
gimp_progress_end (progress);
1069
return_vals = gimp_procedure_get_return_values (procedure, success);
1072
gimp_value_set_drawable (&return_vals->values[1], drawable);
1077
static GValueArray *
1078
drawable_transform_matrix_invoker (GimpProcedure *procedure,
1080
GimpContext *context,
1081
GimpProgress *progress,
1082
const GValueArray *args)
1084
gboolean success = TRUE;
1085
GValueArray *return_vals;
1086
GimpDrawable *drawable;
1096
gint32 transform_direction;
1097
gint32 interpolation;
1098
gboolean supersample;
1099
gint32 recursion_level;
1102
drawable = gimp_value_get_drawable (&args->values[0], gimp);
1103
coeff_0_0 = g_value_get_double (&args->values[1]);
1104
coeff_0_1 = g_value_get_double (&args->values[2]);
1105
coeff_0_2 = g_value_get_double (&args->values[3]);
1106
coeff_1_0 = g_value_get_double (&args->values[4]);
1107
coeff_1_1 = g_value_get_double (&args->values[5]);
1108
coeff_1_2 = g_value_get_double (&args->values[6]);
1109
coeff_2_0 = g_value_get_double (&args->values[7]);
1110
coeff_2_1 = g_value_get_double (&args->values[8]);
1111
coeff_2_2 = g_value_get_double (&args->values[9]);
1112
transform_direction = g_value_get_enum (&args->values[10]);
1113
interpolation = g_value_get_enum (&args->values[11]);
1114
supersample = g_value_get_boolean (&args->values[12]);
1115
recursion_level = g_value_get_int (&args->values[13]);
1116
clip_result = g_value_get_enum (&args->values[14]);
1120
gint x, y, width, height;
1122
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1125
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1130
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1135
/* Assemble the transformation matrix */
1136
matrix.coeff[0][0] = coeff_0_0;
1137
matrix.coeff[0][1] = coeff_0_1;
1138
matrix.coeff[0][2] = coeff_0_2;
1139
matrix.coeff[1][0] = coeff_1_0;
1140
matrix.coeff[1][1] = coeff_1_1;
1141
matrix.coeff[1][2] = coeff_1_2;
1142
matrix.coeff[2][0] = coeff_2_0;
1143
matrix.coeff[2][1] = coeff_2_1;
1144
matrix.coeff[2][2] = coeff_2_2;
1147
gimp_progress_start (progress, _("2D Transforming"), FALSE);
1149
/* Transform the selection */
1150
success = gimp_drawable_transform_affine (drawable, context,
1151
&matrix, transform_direction,
1152
interpolation, supersample,
1154
clip_result, progress);
1157
gimp_progress_end (progress);
1161
return_vals = gimp_procedure_get_return_values (procedure, success);
1164
gimp_value_set_drawable (&return_vals->values[1], drawable);
1169
static GValueArray *
1170
drawable_transform_matrix_default_invoker (GimpProcedure *procedure,
1172
GimpContext *context,
1173
GimpProgress *progress,
1174
const GValueArray *args)
1176
gboolean success = TRUE;
1177
GValueArray *return_vals;
1178
GimpDrawable *drawable;
1188
gboolean interpolate;
1191
drawable = gimp_value_get_drawable (&args->values[0], gimp);
1192
coeff_0_0 = g_value_get_double (&args->values[1]);
1193
coeff_0_1 = g_value_get_double (&args->values[2]);
1194
coeff_0_2 = g_value_get_double (&args->values[3]);
1195
coeff_1_0 = g_value_get_double (&args->values[4]);
1196
coeff_1_1 = g_value_get_double (&args->values[5]);
1197
coeff_1_2 = g_value_get_double (&args->values[6]);
1198
coeff_2_0 = g_value_get_double (&args->values[7]);
1199
coeff_2_1 = g_value_get_double (&args->values[8]);
1200
coeff_2_2 = g_value_get_double (&args->values[9]);
1201
interpolate = g_value_get_boolean (&args->values[10]);
1202
clip_result = g_value_get_enum (&args->values[11]);
1206
gint x, y, width, height;
1208
success = gimp_item_is_attached (GIMP_ITEM (drawable));
1211
gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
1214
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
1217
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
1222
/* Assemble the transformation matrix */
1223
matrix.coeff[0][0] = coeff_0_0;
1224
matrix.coeff[0][1] = coeff_0_1;
1225
matrix.coeff[0][2] = coeff_0_2;
1226
matrix.coeff[1][0] = coeff_1_0;
1227
matrix.coeff[1][1] = coeff_1_1;
1228
matrix.coeff[1][2] = coeff_1_2;
1229
matrix.coeff[2][0] = coeff_2_0;
1230
matrix.coeff[2][1] = coeff_2_1;
1231
matrix.coeff[2][2] = coeff_2_2;
1234
interpolation_type = gimp->config->interpolation_type;
1237
gimp_progress_start (progress, _("2D Transforming"), FALSE);
1239
/* Transform the selection */
1240
success = gimp_drawable_transform_affine (drawable, context,
1241
&matrix, GIMP_TRANSFORM_FORWARD,
1244
clip_result, progress);
1247
gimp_progress_end (progress);
1251
return_vals = gimp_procedure_get_return_values (procedure, success);
1254
gimp_value_set_drawable (&return_vals->values[1], drawable);
1260
register_drawable_transform_procs (GimpPDB *pdb)
1262
GimpProcedure *procedure;
1265
* gimp-drawable-transform-flip-simple
1267
procedure = gimp_procedure_new (drawable_transform_flip_simple_invoker);
1268
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-flip-simple");
1269
gimp_procedure_set_static_strings (procedure,
1270
"gimp-drawable-transform-flip-simple",
1271
"Flip the specified drawable either vertically or horizontally.",
1272
"This procedure flips the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then flipped. If auto_center is set to TRUE, the flip is around the selection's center. Otherwise, the coordinate of the axis needs to be specified. The return value is the ID of the flipped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and flipped drawable.",
1273
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1274
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1277
gimp_procedure_add_argument (procedure,
1278
gimp_param_spec_drawable_id ("drawable",
1280
"The affected drawable",
1282
GIMP_PARAM_READWRITE));
1283
gimp_procedure_add_argument (procedure,
1284
gimp_param_spec_enum ("flip-type",
1287
GIMP_TYPE_ORIENTATION_TYPE,
1288
GIMP_ORIENTATION_HORIZONTAL,
1289
GIMP_PARAM_READWRITE));
1290
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
1291
GIMP_ORIENTATION_UNKNOWN);
1292
gimp_procedure_add_argument (procedure,
1293
g_param_spec_boolean ("auto-center",
1295
"Whether to automatically position the axis in the selection center",
1297
GIMP_PARAM_READWRITE));
1298
gimp_procedure_add_argument (procedure,
1299
g_param_spec_double ("axis",
1301
"coord. of flip axis",
1302
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1303
GIMP_PARAM_READWRITE));
1304
gimp_procedure_add_argument (procedure,
1305
g_param_spec_boolean ("clip-result",
1307
"Whether to clip results",
1309
GIMP_PARAM_READWRITE));
1310
gimp_procedure_add_return_value (procedure,
1311
gimp_param_spec_drawable_id ("drawable",
1313
"The flipped drawable",
1315
GIMP_PARAM_READWRITE));
1316
gimp_pdb_register_procedure (pdb, procedure);
1317
g_object_unref (procedure);
1320
* gimp-drawable-transform-flip
1322
procedure = gimp_procedure_new (drawable_transform_flip_invoker);
1323
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-flip");
1324
gimp_procedure_set_static_strings (procedure,
1325
"gimp-drawable-transform-flip",
1326
"Flip the specified drawable around a given line.",
1327
"This procedure flips the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then flipped. The axis to flip around is specified by specifying two points from that line. The return value is the ID of the flipped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and flipped drawable. The clip results parameter specifies wheter current selection will affect the transform.",
1328
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1329
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1332
gimp_procedure_add_argument (procedure,
1333
gimp_param_spec_drawable_id ("drawable",
1335
"The affected drawable",
1337
GIMP_PARAM_READWRITE));
1338
gimp_procedure_add_argument (procedure,
1339
g_param_spec_double ("x0",
1341
"horz. coord. of one end of axis",
1342
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1343
GIMP_PARAM_READWRITE));
1344
gimp_procedure_add_argument (procedure,
1345
g_param_spec_double ("y0",
1347
"vert. coord. of one end of axis",
1348
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1349
GIMP_PARAM_READWRITE));
1350
gimp_procedure_add_argument (procedure,
1351
g_param_spec_double ("x1",
1353
"horz. coord. of other end of axis",
1354
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1355
GIMP_PARAM_READWRITE));
1356
gimp_procedure_add_argument (procedure,
1357
g_param_spec_double ("y1",
1359
"vert. coord. of other end of axis",
1360
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1361
GIMP_PARAM_READWRITE));
1362
gimp_procedure_add_argument (procedure,
1363
g_param_spec_enum ("transform-direction",
1364
"transform direction",
1365
"Direction of transformation",
1366
GIMP_TYPE_TRANSFORM_DIRECTION,
1367
GIMP_TRANSFORM_FORWARD,
1368
GIMP_PARAM_READWRITE));
1369
gimp_procedure_add_argument (procedure,
1370
g_param_spec_enum ("interpolation",
1372
"Type of interpolation",
1373
GIMP_TYPE_INTERPOLATION_TYPE,
1374
GIMP_INTERPOLATION_NONE,
1375
GIMP_PARAM_READWRITE));
1376
gimp_procedure_add_argument (procedure,
1377
g_param_spec_boolean ("supersample",
1379
"Whether to perform supersample",
1381
GIMP_PARAM_READWRITE));
1382
gimp_procedure_add_argument (procedure,
1383
gimp_param_spec_int32 ("recursion-level",
1385
"Level of recursion (3 is a nice default)",
1387
GIMP_PARAM_READWRITE));
1388
gimp_procedure_add_argument (procedure,
1389
g_param_spec_boolean ("clip-result",
1391
"Whether to clip results",
1393
GIMP_PARAM_READWRITE));
1394
gimp_procedure_add_return_value (procedure,
1395
gimp_param_spec_drawable_id ("drawable",
1397
"The flipped drawable",
1399
GIMP_PARAM_READWRITE));
1400
gimp_pdb_register_procedure (pdb, procedure);
1401
g_object_unref (procedure);
1404
* gimp-drawable-transform-flip-default
1406
procedure = gimp_procedure_new (drawable_transform_flip_default_invoker);
1407
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-flip-default");
1408
gimp_procedure_set_static_strings (procedure,
1409
"gimp-drawable-transform-flip-default",
1410
"Flip the specified drawable around a given line.",
1411
"This procedure is a variant of 'gimp-drawable-transform-flip' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1412
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1413
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1416
gimp_procedure_add_argument (procedure,
1417
gimp_param_spec_drawable_id ("drawable",
1419
"The affected drawable",
1421
GIMP_PARAM_READWRITE));
1422
gimp_procedure_add_argument (procedure,
1423
g_param_spec_double ("x0",
1425
"horz. coord. of one end of axis",
1426
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1427
GIMP_PARAM_READWRITE));
1428
gimp_procedure_add_argument (procedure,
1429
g_param_spec_double ("y0",
1431
"vert. coord. of one end of axis",
1432
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1433
GIMP_PARAM_READWRITE));
1434
gimp_procedure_add_argument (procedure,
1435
g_param_spec_double ("x1",
1437
"horz. coord. of other end of axis",
1438
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1439
GIMP_PARAM_READWRITE));
1440
gimp_procedure_add_argument (procedure,
1441
g_param_spec_double ("y1",
1443
"vert. coord. of other end of axis",
1444
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1445
GIMP_PARAM_READWRITE));
1446
gimp_procedure_add_argument (procedure,
1447
g_param_spec_boolean ("interpolate",
1449
"Whether to use interpolation and supersampling",
1451
GIMP_PARAM_READWRITE));
1452
gimp_procedure_add_argument (procedure,
1453
g_param_spec_boolean ("clip-result",
1455
"Whether to clip results",
1457
GIMP_PARAM_READWRITE));
1458
gimp_procedure_add_return_value (procedure,
1459
gimp_param_spec_drawable_id ("drawable",
1461
"The flipped drawable",
1463
GIMP_PARAM_READWRITE));
1464
gimp_pdb_register_procedure (pdb, procedure);
1465
g_object_unref (procedure);
1468
* gimp-drawable-transform-perspective
1470
procedure = gimp_procedure_new (drawable_transform_perspective_invoker);
1471
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-perspective");
1472
gimp_procedure_set_static_strings (procedure,
1473
"gimp-drawable-transform-perspective",
1474
"Perform a possibly non-affine transformation on the specified drawable, with extra parameters.",
1475
"This procedure performs a possibly non-affine transformation on the specified drawable by allowing the corners of the original bounding box to be arbitrarily remapped to any values. The specified drawable is remapped if no selection exists. However, if a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then remapped as specified. The return value is the ID of the remapped drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and remapped drawable. The 4 coordinates specify the new locations of each corner of the original bounding box. By specifying these values, any affine transformation (rotation, scaling, translation) can be affected. Additionally, these values can be specified such that the resulting transformed drawable will appear to have been projected via a perspective transform.",
1476
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1477
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1480
gimp_procedure_add_argument (procedure,
1481
gimp_param_spec_drawable_id ("drawable",
1483
"The affected drawable",
1485
GIMP_PARAM_READWRITE));
1486
gimp_procedure_add_argument (procedure,
1487
g_param_spec_double ("x0",
1489
"The new x coordinate of upper-left corner of original bounding box",
1490
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1491
GIMP_PARAM_READWRITE));
1492
gimp_procedure_add_argument (procedure,
1493
g_param_spec_double ("y0",
1495
"The new y coordinate of upper-left corner of original bounding box",
1496
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1497
GIMP_PARAM_READWRITE));
1498
gimp_procedure_add_argument (procedure,
1499
g_param_spec_double ("x1",
1501
"The new x coordinate of upper-right corner of original bounding box",
1502
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1503
GIMP_PARAM_READWRITE));
1504
gimp_procedure_add_argument (procedure,
1505
g_param_spec_double ("y1",
1507
"The new y coordinate of upper-right corner of original bounding box",
1508
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1509
GIMP_PARAM_READWRITE));
1510
gimp_procedure_add_argument (procedure,
1511
g_param_spec_double ("x2",
1513
"The new x coordinate of lower-left corner of original bounding box",
1514
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1515
GIMP_PARAM_READWRITE));
1516
gimp_procedure_add_argument (procedure,
1517
g_param_spec_double ("y2",
1519
"The new y coordinate of lower-left corner of original bounding box",
1520
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1521
GIMP_PARAM_READWRITE));
1522
gimp_procedure_add_argument (procedure,
1523
g_param_spec_double ("x3",
1525
"The new x coordinate of lower-right corner of original bounding box",
1526
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1527
GIMP_PARAM_READWRITE));
1528
gimp_procedure_add_argument (procedure,
1529
g_param_spec_double ("y3",
1531
"The new y coordinate of lower-right corner of original bounding box",
1532
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1533
GIMP_PARAM_READWRITE));
1534
gimp_procedure_add_argument (procedure,
1535
g_param_spec_enum ("transform-direction",
1536
"transform direction",
1537
"Direction of transformation",
1538
GIMP_TYPE_TRANSFORM_DIRECTION,
1539
GIMP_TRANSFORM_FORWARD,
1540
GIMP_PARAM_READWRITE));
1541
gimp_procedure_add_argument (procedure,
1542
g_param_spec_enum ("interpolation",
1544
"Type of interpolation",
1545
GIMP_TYPE_INTERPOLATION_TYPE,
1546
GIMP_INTERPOLATION_NONE,
1547
GIMP_PARAM_READWRITE));
1548
gimp_procedure_add_argument (procedure,
1549
g_param_spec_boolean ("supersample",
1551
"Whether to perform supersample",
1553
GIMP_PARAM_READWRITE));
1554
gimp_procedure_add_argument (procedure,
1555
gimp_param_spec_int32 ("recursion-level",
1557
"Level of recursion (3 is a nice default)",
1559
GIMP_PARAM_READWRITE));
1560
gimp_procedure_add_argument (procedure,
1561
g_param_spec_enum ("clip-result",
1563
"How to clip results",
1564
GIMP_TYPE_TRANSFORM_RESIZE,
1565
GIMP_TRANSFORM_RESIZE_ADJUST,
1566
GIMP_PARAM_READWRITE));
1567
gimp_procedure_add_return_value (procedure,
1568
gimp_param_spec_drawable_id ("drawable",
1570
"The newly mapped drawable",
1572
GIMP_PARAM_READWRITE));
1573
gimp_pdb_register_procedure (pdb, procedure);
1574
g_object_unref (procedure);
1577
* gimp-drawable-transform-perspective-default
1579
procedure = gimp_procedure_new (drawable_transform_perspective_default_invoker);
1580
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-perspective-default");
1581
gimp_procedure_set_static_strings (procedure,
1582
"gimp-drawable-transform-perspective-default",
1583
"Perform a possibly non-affine transformation on the specified drawable, with extra parameters.",
1584
"This procedure is a variant of 'gimp-drawable-transform-perspective' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1585
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1586
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1589
gimp_procedure_add_argument (procedure,
1590
gimp_param_spec_drawable_id ("drawable",
1592
"The affected drawable",
1594
GIMP_PARAM_READWRITE));
1595
gimp_procedure_add_argument (procedure,
1596
g_param_spec_double ("x0",
1598
"The new x coordinate of upper-left corner of original bounding box",
1599
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1600
GIMP_PARAM_READWRITE));
1601
gimp_procedure_add_argument (procedure,
1602
g_param_spec_double ("y0",
1604
"The new y coordinate of upper-left corner of original bounding box",
1605
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1606
GIMP_PARAM_READWRITE));
1607
gimp_procedure_add_argument (procedure,
1608
g_param_spec_double ("x1",
1610
"The new x coordinate of upper-right corner of original bounding box",
1611
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1612
GIMP_PARAM_READWRITE));
1613
gimp_procedure_add_argument (procedure,
1614
g_param_spec_double ("y1",
1616
"The new y coordinate of upper-right corner of original bounding box",
1617
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1618
GIMP_PARAM_READWRITE));
1619
gimp_procedure_add_argument (procedure,
1620
g_param_spec_double ("x2",
1622
"The new x coordinate of lower-left corner of original bounding box",
1623
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1624
GIMP_PARAM_READWRITE));
1625
gimp_procedure_add_argument (procedure,
1626
g_param_spec_double ("y2",
1628
"The new y coordinate of lower-left corner of original bounding box",
1629
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1630
GIMP_PARAM_READWRITE));
1631
gimp_procedure_add_argument (procedure,
1632
g_param_spec_double ("x3",
1634
"The new x coordinate of lower-right corner of original bounding box",
1635
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1636
GIMP_PARAM_READWRITE));
1637
gimp_procedure_add_argument (procedure,
1638
g_param_spec_double ("y3",
1640
"The new y coordinate of lower-right corner of original bounding box",
1641
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1642
GIMP_PARAM_READWRITE));
1643
gimp_procedure_add_argument (procedure,
1644
g_param_spec_boolean ("interpolate",
1646
"Whether to use interpolation and supersampling",
1648
GIMP_PARAM_READWRITE));
1649
gimp_procedure_add_argument (procedure,
1650
g_param_spec_enum ("clip-result",
1652
"How to clip results",
1653
GIMP_TYPE_TRANSFORM_RESIZE,
1654
GIMP_TRANSFORM_RESIZE_ADJUST,
1655
GIMP_PARAM_READWRITE));
1656
gimp_procedure_add_return_value (procedure,
1657
gimp_param_spec_drawable_id ("drawable",
1659
"The newly mapped drawable",
1661
GIMP_PARAM_READWRITE));
1662
gimp_pdb_register_procedure (pdb, procedure);
1663
g_object_unref (procedure);
1666
* gimp-drawable-transform-rotate-simple
1668
procedure = gimp_procedure_new (drawable_transform_rotate_simple_invoker);
1669
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-rotate-simple");
1670
gimp_procedure_set_static_strings (procedure,
1671
"gimp-drawable-transform-rotate-simple",
1672
"Rotate the specified drawable about given coordinates through the specified angle.",
1673
"This function rotates the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then rotated by the specified amount. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and rotated drawable.",
1674
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1675
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1678
gimp_procedure_add_argument (procedure,
1679
gimp_param_spec_drawable_id ("drawable",
1681
"The affected drawable",
1683
GIMP_PARAM_READWRITE));
1684
gimp_procedure_add_argument (procedure,
1685
g_param_spec_enum ("rotate-type",
1688
GIMP_TYPE_ROTATION_TYPE,
1690
GIMP_PARAM_READWRITE));
1691
gimp_procedure_add_argument (procedure,
1692
g_param_spec_boolean ("auto-center",
1694
"Whether to automatically rotate around the selection center",
1696
GIMP_PARAM_READWRITE));
1697
gimp_procedure_add_argument (procedure,
1698
gimp_param_spec_int32 ("center-x",
1700
"The hor. coordinate of the center of rotation",
1701
G_MININT32, G_MAXINT32, 0,
1702
GIMP_PARAM_READWRITE));
1703
gimp_procedure_add_argument (procedure,
1704
gimp_param_spec_int32 ("center-y",
1706
"The vert. coordinate of the center of rotation",
1707
G_MININT32, G_MAXINT32, 0,
1708
GIMP_PARAM_READWRITE));
1709
gimp_procedure_add_argument (procedure,
1710
g_param_spec_boolean ("clip-result",
1712
"Whether to clip results",
1714
GIMP_PARAM_READWRITE));
1715
gimp_procedure_add_return_value (procedure,
1716
gimp_param_spec_drawable_id ("drawable",
1718
"The rotated drawable",
1720
GIMP_PARAM_READWRITE));
1721
gimp_pdb_register_procedure (pdb, procedure);
1722
g_object_unref (procedure);
1725
* gimp-drawable-transform-rotate
1727
procedure = gimp_procedure_new (drawable_transform_rotate_invoker);
1728
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-rotate");
1729
gimp_procedure_set_static_strings (procedure,
1730
"gimp-drawable-transform-rotate",
1731
"Rotate the specified drawable about given coordinates through the specified angle.",
1732
"This function rotates the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then rotated by the specified amount. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and rotated drawable.",
1733
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1734
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1737
gimp_procedure_add_argument (procedure,
1738
gimp_param_spec_drawable_id ("drawable",
1740
"The affected drawable",
1742
GIMP_PARAM_READWRITE));
1743
gimp_procedure_add_argument (procedure,
1744
g_param_spec_double ("angle",
1746
"The angle of rotation (radians)",
1747
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1748
GIMP_PARAM_READWRITE));
1749
gimp_procedure_add_argument (procedure,
1750
g_param_spec_boolean ("auto-center",
1752
"Whether to automatically rotate around the selection center",
1754
GIMP_PARAM_READWRITE));
1755
gimp_procedure_add_argument (procedure,
1756
gimp_param_spec_int32 ("center-x",
1758
"The hor. coordinate of the center of rotation",
1759
G_MININT32, G_MAXINT32, 0,
1760
GIMP_PARAM_READWRITE));
1761
gimp_procedure_add_argument (procedure,
1762
gimp_param_spec_int32 ("center-y",
1764
"The vert. coordinate of the center of rotation",
1765
G_MININT32, G_MAXINT32, 0,
1766
GIMP_PARAM_READWRITE));
1767
gimp_procedure_add_argument (procedure,
1768
g_param_spec_enum ("transform-direction",
1769
"transform direction",
1770
"Direction of transformation",
1771
GIMP_TYPE_TRANSFORM_DIRECTION,
1772
GIMP_TRANSFORM_FORWARD,
1773
GIMP_PARAM_READWRITE));
1774
gimp_procedure_add_argument (procedure,
1775
g_param_spec_enum ("interpolation",
1777
"Type of interpolation",
1778
GIMP_TYPE_INTERPOLATION_TYPE,
1779
GIMP_INTERPOLATION_NONE,
1780
GIMP_PARAM_READWRITE));
1781
gimp_procedure_add_argument (procedure,
1782
g_param_spec_boolean ("supersample",
1784
"Whether to perform supersample",
1786
GIMP_PARAM_READWRITE));
1787
gimp_procedure_add_argument (procedure,
1788
gimp_param_spec_int32 ("recursion-level",
1790
"Level of recursion (3 is a nice default)",
1792
GIMP_PARAM_READWRITE));
1793
gimp_procedure_add_argument (procedure,
1794
g_param_spec_enum ("clip-result",
1796
"How to clip results",
1797
GIMP_TYPE_TRANSFORM_RESIZE,
1798
GIMP_TRANSFORM_RESIZE_ADJUST,
1799
GIMP_PARAM_READWRITE));
1800
gimp_procedure_add_return_value (procedure,
1801
gimp_param_spec_drawable_id ("drawable",
1803
"The rotated drawable",
1805
GIMP_PARAM_READWRITE));
1806
gimp_pdb_register_procedure (pdb, procedure);
1807
g_object_unref (procedure);
1810
* gimp-drawable-transform-rotate-default
1812
procedure = gimp_procedure_new (drawable_transform_rotate_default_invoker);
1813
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-rotate-default");
1814
gimp_procedure_set_static_strings (procedure,
1815
"gimp-drawable-transform-rotate-default",
1816
"Rotate the specified drawable about given coordinates through the specified angle.",
1817
"This procedure is a variant of 'gimp-drawable-transform-rotate' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1818
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1819
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1822
gimp_procedure_add_argument (procedure,
1823
gimp_param_spec_drawable_id ("drawable",
1825
"The affected drawable",
1827
GIMP_PARAM_READWRITE));
1828
gimp_procedure_add_argument (procedure,
1829
g_param_spec_double ("angle",
1831
"The angle of rotation (radians)",
1832
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1833
GIMP_PARAM_READWRITE));
1834
gimp_procedure_add_argument (procedure,
1835
g_param_spec_boolean ("auto-center",
1837
"Whether to automatically rotate around the selection center",
1839
GIMP_PARAM_READWRITE));
1840
gimp_procedure_add_argument (procedure,
1841
gimp_param_spec_int32 ("center-x",
1843
"The hor. coordinate of the center of rotation",
1844
G_MININT32, G_MAXINT32, 0,
1845
GIMP_PARAM_READWRITE));
1846
gimp_procedure_add_argument (procedure,
1847
gimp_param_spec_int32 ("center-y",
1849
"The vert. coordinate of the center of rotation",
1850
G_MININT32, G_MAXINT32, 0,
1851
GIMP_PARAM_READWRITE));
1852
gimp_procedure_add_argument (procedure,
1853
g_param_spec_boolean ("interpolate",
1855
"Whether to use interpolation and supersampling",
1857
GIMP_PARAM_READWRITE));
1858
gimp_procedure_add_argument (procedure,
1859
g_param_spec_enum ("clip-result",
1861
"How to clip results",
1862
GIMP_TYPE_TRANSFORM_RESIZE,
1863
GIMP_TRANSFORM_RESIZE_ADJUST,
1864
GIMP_PARAM_READWRITE));
1865
gimp_procedure_add_return_value (procedure,
1866
gimp_param_spec_drawable_id ("drawable",
1868
"The rotated drawable",
1870
GIMP_PARAM_READWRITE));
1871
gimp_pdb_register_procedure (pdb, procedure);
1872
g_object_unref (procedure);
1875
* gimp-drawable-transform-scale
1877
procedure = gimp_procedure_new (drawable_transform_scale_invoker);
1878
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-scale");
1879
gimp_procedure_set_static_strings (procedure,
1880
"gimp-drawable-transform-scale",
1881
"Scale the specified drawable with extra parameters",
1882
"This procedure scales the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then scaled by the specified amount. The return value is the ID of the scaled drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and scaled drawable.",
1883
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1884
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1887
gimp_procedure_add_argument (procedure,
1888
gimp_param_spec_drawable_id ("drawable",
1890
"The affected drawable",
1892
GIMP_PARAM_READWRITE));
1893
gimp_procedure_add_argument (procedure,
1894
g_param_spec_double ("x0",
1896
"The new x coordinate of the upper-left corner of the scaled region",
1897
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1898
GIMP_PARAM_READWRITE));
1899
gimp_procedure_add_argument (procedure,
1900
g_param_spec_double ("y0",
1902
"The new y coordinate of the upper-left corner of the scaled region",
1903
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1904
GIMP_PARAM_READWRITE));
1905
gimp_procedure_add_argument (procedure,
1906
g_param_spec_double ("x1",
1908
"The new x coordinate of the lower-right corner of the scaled region",
1909
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1910
GIMP_PARAM_READWRITE));
1911
gimp_procedure_add_argument (procedure,
1912
g_param_spec_double ("y1",
1914
"The new y coordinate of the lower-right corner of the scaled region",
1915
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1916
GIMP_PARAM_READWRITE));
1917
gimp_procedure_add_argument (procedure,
1918
g_param_spec_enum ("transform-direction",
1919
"transform direction",
1920
"Direction of transformation",
1921
GIMP_TYPE_TRANSFORM_DIRECTION,
1922
GIMP_TRANSFORM_FORWARD,
1923
GIMP_PARAM_READWRITE));
1924
gimp_procedure_add_argument (procedure,
1925
g_param_spec_enum ("interpolation",
1927
"Type of interpolation",
1928
GIMP_TYPE_INTERPOLATION_TYPE,
1929
GIMP_INTERPOLATION_NONE,
1930
GIMP_PARAM_READWRITE));
1931
gimp_procedure_add_argument (procedure,
1932
g_param_spec_boolean ("supersample",
1934
"Whether to perform supersample",
1936
GIMP_PARAM_READWRITE));
1937
gimp_procedure_add_argument (procedure,
1938
gimp_param_spec_int32 ("recursion-level",
1940
"Level of recursion (3 is a nice default)",
1942
GIMP_PARAM_READWRITE));
1943
gimp_procedure_add_argument (procedure,
1944
g_param_spec_enum ("clip-result",
1946
"How to clip results",
1947
GIMP_TYPE_TRANSFORM_RESIZE,
1948
GIMP_TRANSFORM_RESIZE_ADJUST,
1949
GIMP_PARAM_READWRITE));
1950
gimp_procedure_add_return_value (procedure,
1951
gimp_param_spec_drawable_id ("drawable",
1953
"The scaled drawable",
1955
GIMP_PARAM_READWRITE));
1956
gimp_pdb_register_procedure (pdb, procedure);
1957
g_object_unref (procedure);
1960
* gimp-drawable-transform-scale-default
1962
procedure = gimp_procedure_new (drawable_transform_scale_default_invoker);
1963
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-scale-default");
1964
gimp_procedure_set_static_strings (procedure,
1965
"gimp-drawable-transform-scale-default",
1966
"Scale the specified drawable with extra parameters",
1967
"This procedure is a variant of 'gimp-drawable-transform-scale' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
1968
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1969
"Jo\xc3\xa3o S. O. Bueno Calligaris",
1972
gimp_procedure_add_argument (procedure,
1973
gimp_param_spec_drawable_id ("drawable",
1975
"The affected drawable",
1977
GIMP_PARAM_READWRITE));
1978
gimp_procedure_add_argument (procedure,
1979
g_param_spec_double ("x0",
1981
"The new x coordinate of the upper-left corner of the scaled region",
1982
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1983
GIMP_PARAM_READWRITE));
1984
gimp_procedure_add_argument (procedure,
1985
g_param_spec_double ("y0",
1987
"The new y coordinate of the upper-left corner of the scaled region",
1988
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1989
GIMP_PARAM_READWRITE));
1990
gimp_procedure_add_argument (procedure,
1991
g_param_spec_double ("x1",
1993
"The new x coordinate of the lower-right corner of the scaled region",
1994
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1995
GIMP_PARAM_READWRITE));
1996
gimp_procedure_add_argument (procedure,
1997
g_param_spec_double ("y1",
1999
"The new y coordinate of the lower-right corner of the scaled region",
2000
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2001
GIMP_PARAM_READWRITE));
2002
gimp_procedure_add_argument (procedure,
2003
g_param_spec_boolean ("interpolate",
2005
"Whether to use interpolation and supersampling",
2007
GIMP_PARAM_READWRITE));
2008
gimp_procedure_add_argument (procedure,
2009
g_param_spec_enum ("clip-result",
2011
"How to clip results",
2012
GIMP_TYPE_TRANSFORM_RESIZE,
2013
GIMP_TRANSFORM_RESIZE_ADJUST,
2014
GIMP_PARAM_READWRITE));
2015
gimp_procedure_add_return_value (procedure,
2016
gimp_param_spec_drawable_id ("drawable",
2018
"The scaled drawable",
2020
GIMP_PARAM_READWRITE));
2021
gimp_pdb_register_procedure (pdb, procedure);
2022
g_object_unref (procedure);
2025
* gimp-drawable-transform-shear
2027
procedure = gimp_procedure_new (drawable_transform_shear_invoker);
2028
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-shear");
2029
gimp_procedure_set_static_strings (procedure,
2030
"gimp-drawable-transform-shear",
2031
"Shear the specified drawable about its center by the specified magnitude, with extra parameters.",
2032
"This procedure shears the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then sheard by the specified amount. The return value is the ID of the sheard drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and sheard drawable. The shear type parameter indicates whether the shear will be applied horizontally or vertically. The magnitude can be either positive or negative and indicates the extent (in pixels) to shear by.",
2033
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2034
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2037
gimp_procedure_add_argument (procedure,
2038
gimp_param_spec_drawable_id ("drawable",
2040
"The affected drawable",
2042
GIMP_PARAM_READWRITE));
2043
gimp_procedure_add_argument (procedure,
2044
gimp_param_spec_enum ("shear-type",
2047
GIMP_TYPE_ORIENTATION_TYPE,
2048
GIMP_ORIENTATION_HORIZONTAL,
2049
GIMP_PARAM_READWRITE));
2050
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
2051
GIMP_ORIENTATION_UNKNOWN);
2052
gimp_procedure_add_argument (procedure,
2053
g_param_spec_double ("magnitude",
2055
"The magnitude of the shear",
2056
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2057
GIMP_PARAM_READWRITE));
2058
gimp_procedure_add_argument (procedure,
2059
g_param_spec_enum ("transform-direction",
2060
"transform direction",
2061
"Direction of transformation",
2062
GIMP_TYPE_TRANSFORM_DIRECTION,
2063
GIMP_TRANSFORM_FORWARD,
2064
GIMP_PARAM_READWRITE));
2065
gimp_procedure_add_argument (procedure,
2066
g_param_spec_enum ("interpolation",
2068
"Type of interpolation",
2069
GIMP_TYPE_INTERPOLATION_TYPE,
2070
GIMP_INTERPOLATION_NONE,
2071
GIMP_PARAM_READWRITE));
2072
gimp_procedure_add_argument (procedure,
2073
g_param_spec_boolean ("supersample",
2075
"Whether to perform supersample",
2077
GIMP_PARAM_READWRITE));
2078
gimp_procedure_add_argument (procedure,
2079
gimp_param_spec_int32 ("recursion-level",
2081
"Level of recursion (3 is a nice default)",
2083
GIMP_PARAM_READWRITE));
2084
gimp_procedure_add_argument (procedure,
2085
g_param_spec_enum ("clip-result",
2087
"How to clip results",
2088
GIMP_TYPE_TRANSFORM_RESIZE,
2089
GIMP_TRANSFORM_RESIZE_ADJUST,
2090
GIMP_PARAM_READWRITE));
2091
gimp_procedure_add_return_value (procedure,
2092
gimp_param_spec_drawable_id ("drawable",
2094
"The sheared drawable",
2096
GIMP_PARAM_READWRITE));
2097
gimp_pdb_register_procedure (pdb, procedure);
2098
g_object_unref (procedure);
2101
* gimp-drawable-transform-shear-default
2103
procedure = gimp_procedure_new (drawable_transform_shear_default_invoker);
2104
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-shear-default");
2105
gimp_procedure_set_static_strings (procedure,
2106
"gimp-drawable-transform-shear-default",
2107
"Shear the specified drawable about its center by the specified magnitude, with extra parameters.",
2108
"This procedure is a variant of 'gimp-drawable-transform-shear' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
2109
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2110
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2113
gimp_procedure_add_argument (procedure,
2114
gimp_param_spec_drawable_id ("drawable",
2116
"The affected drawable",
2118
GIMP_PARAM_READWRITE));
2119
gimp_procedure_add_argument (procedure,
2120
gimp_param_spec_enum ("shear-type",
2123
GIMP_TYPE_ORIENTATION_TYPE,
2124
GIMP_ORIENTATION_HORIZONTAL,
2125
GIMP_PARAM_READWRITE));
2126
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
2127
GIMP_ORIENTATION_UNKNOWN);
2128
gimp_procedure_add_argument (procedure,
2129
g_param_spec_double ("magnitude",
2131
"The magnitude of the shear",
2132
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2133
GIMP_PARAM_READWRITE));
2134
gimp_procedure_add_argument (procedure,
2135
g_param_spec_boolean ("interpolate",
2137
"Whether to use interpolation and supersampling",
2139
GIMP_PARAM_READWRITE));
2140
gimp_procedure_add_argument (procedure,
2141
g_param_spec_enum ("clip-result",
2143
"How to clip results",
2144
GIMP_TYPE_TRANSFORM_RESIZE,
2145
GIMP_TRANSFORM_RESIZE_ADJUST,
2146
GIMP_PARAM_READWRITE));
2147
gimp_procedure_add_return_value (procedure,
2148
gimp_param_spec_drawable_id ("drawable",
2150
"The sheared drawable",
2152
GIMP_PARAM_READWRITE));
2153
gimp_pdb_register_procedure (pdb, procedure);
2154
g_object_unref (procedure);
2157
* gimp-drawable-transform-2d
2159
procedure = gimp_procedure_new (drawable_transform_2d_invoker);
2160
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-2d");
2161
gimp_procedure_set_static_strings (procedure,
2162
"gimp-drawable-transform-2d",
2163
"Transform the specified drawable in 2d, with extra parameters.",
2164
"This procedure transforms the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then transformed. The transformation is done by scaling the image by the x and y scale factors about the point (source_x, source_y), then rotating around the same point, then translating that point to the new position (dest_x, dest_y). The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and transformed drawable.",
2165
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2166
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2169
gimp_procedure_add_argument (procedure,
2170
gimp_param_spec_drawable_id ("drawable",
2172
"The affected drawable",
2174
GIMP_PARAM_READWRITE));
2175
gimp_procedure_add_argument (procedure,
2176
g_param_spec_double ("source-x",
2178
"X coordinate of the transformation center",
2179
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2180
GIMP_PARAM_READWRITE));
2181
gimp_procedure_add_argument (procedure,
2182
g_param_spec_double ("source-y",
2184
"Y coordinate of the transformation center",
2185
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2186
GIMP_PARAM_READWRITE));
2187
gimp_procedure_add_argument (procedure,
2188
g_param_spec_double ("scale-x",
2190
"Amount to scale in x direction",
2191
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2192
GIMP_PARAM_READWRITE));
2193
gimp_procedure_add_argument (procedure,
2194
g_param_spec_double ("scale-y",
2196
"Amount to scale in y direction",
2197
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2198
GIMP_PARAM_READWRITE));
2199
gimp_procedure_add_argument (procedure,
2200
g_param_spec_double ("angle",
2202
"The angle of rotation (radians)",
2203
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2204
GIMP_PARAM_READWRITE));
2205
gimp_procedure_add_argument (procedure,
2206
g_param_spec_double ("dest-x",
2208
"X coordinate of where the center goes",
2209
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2210
GIMP_PARAM_READWRITE));
2211
gimp_procedure_add_argument (procedure,
2212
g_param_spec_double ("dest-y",
2214
"Y coordinate of where the center goes",
2215
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2216
GIMP_PARAM_READWRITE));
2217
gimp_procedure_add_argument (procedure,
2218
g_param_spec_enum ("transform-direction",
2219
"transform direction",
2220
"Direction of transformation",
2221
GIMP_TYPE_TRANSFORM_DIRECTION,
2222
GIMP_TRANSFORM_FORWARD,
2223
GIMP_PARAM_READWRITE));
2224
gimp_procedure_add_argument (procedure,
2225
g_param_spec_enum ("interpolation",
2227
"Type of interpolation",
2228
GIMP_TYPE_INTERPOLATION_TYPE,
2229
GIMP_INTERPOLATION_NONE,
2230
GIMP_PARAM_READWRITE));
2231
gimp_procedure_add_argument (procedure,
2232
g_param_spec_boolean ("supersample",
2234
"Whether to perform supersample",
2236
GIMP_PARAM_READWRITE));
2237
gimp_procedure_add_argument (procedure,
2238
gimp_param_spec_int32 ("recursion-level",
2240
"Level of recursion (3 is a nice default)",
2242
GIMP_PARAM_READWRITE));
2243
gimp_procedure_add_argument (procedure,
2244
g_param_spec_enum ("clip-result",
2246
"How to clip results",
2247
GIMP_TYPE_TRANSFORM_RESIZE,
2248
GIMP_TRANSFORM_RESIZE_ADJUST,
2249
GIMP_PARAM_READWRITE));
2250
gimp_procedure_add_return_value (procedure,
2251
gimp_param_spec_drawable_id ("drawable",
2253
"The transformed drawable",
2255
GIMP_PARAM_READWRITE));
2256
gimp_pdb_register_procedure (pdb, procedure);
2257
g_object_unref (procedure);
2260
* gimp-drawable-transform-2d-default
2262
procedure = gimp_procedure_new (drawable_transform_2d_default_invoker);
2263
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-2d-default");
2264
gimp_procedure_set_static_strings (procedure,
2265
"gimp-drawable-transform-2d-default",
2266
"Transform the specified drawable in 2d, with extra parameters.",
2267
"This procedure is a variant of 'gimp-drawable-transform-2d' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
2268
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2269
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2272
gimp_procedure_add_argument (procedure,
2273
gimp_param_spec_drawable_id ("drawable",
2275
"The affected drawable",
2277
GIMP_PARAM_READWRITE));
2278
gimp_procedure_add_argument (procedure,
2279
g_param_spec_double ("source-x",
2281
"X coordinate of the transformation center",
2282
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2283
GIMP_PARAM_READWRITE));
2284
gimp_procedure_add_argument (procedure,
2285
g_param_spec_double ("source-y",
2287
"Y coordinate of the transformation center",
2288
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2289
GIMP_PARAM_READWRITE));
2290
gimp_procedure_add_argument (procedure,
2291
g_param_spec_double ("scale-x",
2293
"Amount to scale in x direction",
2294
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2295
GIMP_PARAM_READWRITE));
2296
gimp_procedure_add_argument (procedure,
2297
g_param_spec_double ("scale-y",
2299
"Amount to scale in y direction",
2300
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2301
GIMP_PARAM_READWRITE));
2302
gimp_procedure_add_argument (procedure,
2303
g_param_spec_double ("angle",
2305
"The angle of rotation (radians)",
2306
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2307
GIMP_PARAM_READWRITE));
2308
gimp_procedure_add_argument (procedure,
2309
g_param_spec_double ("dest-x",
2311
"X coordinate of where the center goes",
2312
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2313
GIMP_PARAM_READWRITE));
2314
gimp_procedure_add_argument (procedure,
2315
g_param_spec_double ("dest-y",
2317
"Y coordinate of where the center goes",
2318
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2319
GIMP_PARAM_READWRITE));
2320
gimp_procedure_add_argument (procedure,
2321
g_param_spec_boolean ("interpolate",
2323
"Whether to use interpolation and supersampling",
2325
GIMP_PARAM_READWRITE));
2326
gimp_procedure_add_argument (procedure,
2327
g_param_spec_enum ("clip-result",
2329
"How to clip results",
2330
GIMP_TYPE_TRANSFORM_RESIZE,
2331
GIMP_TRANSFORM_RESIZE_ADJUST,
2332
GIMP_PARAM_READWRITE));
2333
gimp_procedure_add_return_value (procedure,
2334
gimp_param_spec_drawable_id ("drawable",
2336
"The transformed drawable",
2338
GIMP_PARAM_READWRITE));
2339
gimp_pdb_register_procedure (pdb, procedure);
2340
g_object_unref (procedure);
2343
* gimp-drawable-transform-matrix
2345
procedure = gimp_procedure_new (drawable_transform_matrix_invoker);
2346
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-matrix");
2347
gimp_procedure_set_static_strings (procedure,
2348
"gimp-drawable-transform-matrix",
2349
"Transform the specified drawable in 2d, with extra parameters.",
2350
"This procedure transforms the specified drawable if no selection exists. If a selection exists, the portion of the drawable which lies under the selection is cut from the drawable and made into a floating selection which is then transformed. The transformation is done by assembling a 3x3 matrix from the coefficients passed. The return value is the ID of the rotated drawable. If there was no selection, this will be equal to the drawable ID supplied as input. Otherwise, this will be the newly created and transformed drawable.",
2351
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2352
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2355
gimp_procedure_add_argument (procedure,
2356
gimp_param_spec_drawable_id ("drawable",
2358
"The affected drawable",
2360
GIMP_PARAM_READWRITE));
2361
gimp_procedure_add_argument (procedure,
2362
g_param_spec_double ("coeff-0-0",
2364
"coefficient (0,0) of the transformation matrix",
2365
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2366
GIMP_PARAM_READWRITE));
2367
gimp_procedure_add_argument (procedure,
2368
g_param_spec_double ("coeff-0-1",
2370
"coefficient (0,1) of the transformation matrix",
2371
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2372
GIMP_PARAM_READWRITE));
2373
gimp_procedure_add_argument (procedure,
2374
g_param_spec_double ("coeff-0-2",
2376
"coefficient (0,2) of the transformation matrix",
2377
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2378
GIMP_PARAM_READWRITE));
2379
gimp_procedure_add_argument (procedure,
2380
g_param_spec_double ("coeff-1-0",
2382
"coefficient (1,0) of the transformation matrix",
2383
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2384
GIMP_PARAM_READWRITE));
2385
gimp_procedure_add_argument (procedure,
2386
g_param_spec_double ("coeff-1-1",
2388
"coefficient (1,1) of the transformation matrix",
2389
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2390
GIMP_PARAM_READWRITE));
2391
gimp_procedure_add_argument (procedure,
2392
g_param_spec_double ("coeff-1-2",
2394
"coefficient (1,2) of the transformation matrix",
2395
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2396
GIMP_PARAM_READWRITE));
2397
gimp_procedure_add_argument (procedure,
2398
g_param_spec_double ("coeff-2-0",
2400
"coefficient (2,0) of the transformation matrix",
2401
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2402
GIMP_PARAM_READWRITE));
2403
gimp_procedure_add_argument (procedure,
2404
g_param_spec_double ("coeff-2-1",
2406
"coefficient (2,1) of the transformation matrix",
2407
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2408
GIMP_PARAM_READWRITE));
2409
gimp_procedure_add_argument (procedure,
2410
g_param_spec_double ("coeff-2-2",
2412
"coefficient (2,2) of the transformation matrix",
2413
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2414
GIMP_PARAM_READWRITE));
2415
gimp_procedure_add_argument (procedure,
2416
g_param_spec_enum ("transform-direction",
2417
"transform direction",
2418
"Direction of transformation",
2419
GIMP_TYPE_TRANSFORM_DIRECTION,
2420
GIMP_TRANSFORM_FORWARD,
2421
GIMP_PARAM_READWRITE));
2422
gimp_procedure_add_argument (procedure,
2423
g_param_spec_enum ("interpolation",
2425
"Type of interpolation",
2426
GIMP_TYPE_INTERPOLATION_TYPE,
2427
GIMP_INTERPOLATION_NONE,
2428
GIMP_PARAM_READWRITE));
2429
gimp_procedure_add_argument (procedure,
2430
g_param_spec_boolean ("supersample",
2432
"Whether to perform supersample",
2434
GIMP_PARAM_READWRITE));
2435
gimp_procedure_add_argument (procedure,
2436
gimp_param_spec_int32 ("recursion-level",
2438
"Level of recursion (3 is a nice default)",
2440
GIMP_PARAM_READWRITE));
2441
gimp_procedure_add_argument (procedure,
2442
g_param_spec_enum ("clip-result",
2444
"How to clip results",
2445
GIMP_TYPE_TRANSFORM_RESIZE,
2446
GIMP_TRANSFORM_RESIZE_ADJUST,
2447
GIMP_PARAM_READWRITE));
2448
gimp_procedure_add_return_value (procedure,
2449
gimp_param_spec_drawable_id ("drawable",
2451
"The transformed drawable",
2453
GIMP_PARAM_READWRITE));
2454
gimp_pdb_register_procedure (pdb, procedure);
2455
g_object_unref (procedure);
2458
* gimp-drawable-transform-matrix-default
2460
procedure = gimp_procedure_new (drawable_transform_matrix_default_invoker);
2461
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-transform-matrix-default");
2462
gimp_procedure_set_static_strings (procedure,
2463
"gimp-drawable-transform-matrix-default",
2464
"Transform the specified drawable in 2d, with extra parameters.",
2465
"This procedure is a variant of 'gimp-drawable-transform-matrix' which uses no interpolation/supersampling at all, or default values (depending on the 'interpolate' parameter).",
2466
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2467
"Jo\xc3\xa3o S. O. Bueno Calligaris",
2470
gimp_procedure_add_argument (procedure,
2471
gimp_param_spec_drawable_id ("drawable",
2473
"The affected drawable",
2475
GIMP_PARAM_READWRITE));
2476
gimp_procedure_add_argument (procedure,
2477
g_param_spec_double ("coeff-0-0",
2479
"coefficient (0,0) of the transformation matrix",
2480
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2481
GIMP_PARAM_READWRITE));
2482
gimp_procedure_add_argument (procedure,
2483
g_param_spec_double ("coeff-0-1",
2485
"coefficient (0,1) of the transformation matrix",
2486
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2487
GIMP_PARAM_READWRITE));
2488
gimp_procedure_add_argument (procedure,
2489
g_param_spec_double ("coeff-0-2",
2491
"coefficient (0,2) of the transformation matrix",
2492
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2493
GIMP_PARAM_READWRITE));
2494
gimp_procedure_add_argument (procedure,
2495
g_param_spec_double ("coeff-1-0",
2497
"coefficient (1,0) of the transformation matrix",
2498
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2499
GIMP_PARAM_READWRITE));
2500
gimp_procedure_add_argument (procedure,
2501
g_param_spec_double ("coeff-1-1",
2503
"coefficient (1,1) of the transformation matrix",
2504
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2505
GIMP_PARAM_READWRITE));
2506
gimp_procedure_add_argument (procedure,
2507
g_param_spec_double ("coeff-1-2",
2509
"coefficient (1,2) of the transformation matrix",
2510
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2511
GIMP_PARAM_READWRITE));
2512
gimp_procedure_add_argument (procedure,
2513
g_param_spec_double ("coeff-2-0",
2515
"coefficient (2,0) of the transformation matrix",
2516
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2517
GIMP_PARAM_READWRITE));
2518
gimp_procedure_add_argument (procedure,
2519
g_param_spec_double ("coeff-2-1",
2521
"coefficient (2,1) of the transformation matrix",
2522
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2523
GIMP_PARAM_READWRITE));
2524
gimp_procedure_add_argument (procedure,
2525
g_param_spec_double ("coeff-2-2",
2527
"coefficient (2,2) of the transformation matrix",
2528
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2529
GIMP_PARAM_READWRITE));
2530
gimp_procedure_add_argument (procedure,
2531
g_param_spec_boolean ("interpolate",
2533
"Whether to use interpolation and supersampling",
2535
GIMP_PARAM_READWRITE));
2536
gimp_procedure_add_argument (procedure,
2537
g_param_spec_enum ("clip-result",
2539
"How to clip results",
2540
GIMP_TYPE_TRANSFORM_RESIZE,
2541
GIMP_TRANSFORM_RESIZE_ADJUST,
2542
GIMP_PARAM_READWRITE));
2543
gimp_procedure_add_return_value (procedure,
2544
gimp_param_spec_drawable_id ("drawable",
2546
"The transformed drawable",
2548
GIMP_PARAM_READWRITE));
2549
gimp_pdb_register_procedure (pdb, procedure);
2550
g_object_unref (procedure);