1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 3 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
/* NOTE: This file is auto-generated by pdbgen.pl. */
24
#include "libgimpmath/gimpmath.h"
26
#include "pdb-types.h"
28
#include "core/gimp-transform-utils.h"
29
#include "core/gimpchannel.h"
30
#include "core/gimpdrawable-transform.h"
31
#include "core/gimpdrawable.h"
32
#include "core/gimpimage.h"
33
#include "core/gimpitem.h"
34
#include "core/gimpparamspecs.h"
35
#include "core/gimpprogress.h"
38
#include "gimppdb-utils.h"
39
#include "gimppdbcontext.h"
40
#include "gimpprocedure.h"
41
#include "internal-procs.h"
43
#include "gimp-intl.h"
47
item_transform_flip_simple_invoker (GimpProcedure *procedure,
50
GimpProgress *progress,
51
const GValueArray *args,
54
gboolean success = TRUE;
55
GValueArray *return_vals;
61
item = gimp_value_get_item (&args->values[0], gimp);
62
flip_type = g_value_get_enum (&args->values[1]);
63
auto_center = g_value_get_boolean (&args->values[2]);
64
axis = g_value_get_double (&args->values[3]);
68
gint x, y, width, height;
70
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
73
gimp_item_mask_intersect (item, &x, &y, &width, &height))
75
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
78
gimp_item_get_offset (item, &off_x, &off_y);
82
gimp_transform_get_flip_axis (x, y, width, height,
83
flip_type, auto_center, &axis);
85
if (GIMP_IS_DRAWABLE (item) &&
86
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
87
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
89
GimpDrawable *drawable;
91
drawable = gimp_drawable_transform_flip (GIMP_DRAWABLE (item), context,
93
pdb_context->transform_resize);
96
item = GIMP_ITEM (drawable);
102
gimp_item_flip (item, context,
104
pdb_context->transform_resize);
109
return_vals = gimp_procedure_get_return_values (procedure, success,
110
error ? *error : NULL);
113
gimp_value_set_item (&return_vals->values[1], item);
119
item_transform_flip_invoker (GimpProcedure *procedure,
121
GimpContext *context,
122
GimpProgress *progress,
123
const GValueArray *args,
126
gboolean success = TRUE;
127
GValueArray *return_vals;
134
item = gimp_value_get_item (&args->values[0], gimp);
135
x0 = g_value_get_double (&args->values[1]);
136
y0 = g_value_get_double (&args->values[2]);
137
x1 = g_value_get_double (&args->values[3]);
138
y1 = g_value_get_double (&args->values[4]);
142
gint x, y, width, height;
144
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
147
gimp_item_mask_intersect (item, &x, &y, &width, &height))
149
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
153
gimp_item_get_offset (item, &off_x, &off_y);
157
/* Assemble the transformation matrix */
158
gimp_matrix3_identity (&matrix);
159
gimp_transform_matrix_flip_free (&matrix, x0, y0, x1, y1);
162
gimp_progress_start (progress, _("Flipping"), FALSE);
164
if (GIMP_IS_DRAWABLE (item) &&
165
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
166
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
168
GimpDrawable *drawable;
170
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
172
pdb_context->transform_direction,
173
pdb_context->interpolation,
174
pdb_context->transform_recursion,
175
pdb_context->transform_resize,
179
item = GIMP_ITEM (drawable);
185
gimp_item_transform (item, context, &matrix,
186
pdb_context->transform_direction,
187
pdb_context->interpolation,
188
pdb_context->transform_recursion,
189
pdb_context->transform_resize,
194
gimp_progress_end (progress);
198
return_vals = gimp_procedure_get_return_values (procedure, success,
199
error ? *error : NULL);
202
gimp_value_set_item (&return_vals->values[1], item);
208
item_transform_perspective_invoker (GimpProcedure *procedure,
210
GimpContext *context,
211
GimpProgress *progress,
212
const GValueArray *args,
215
gboolean success = TRUE;
216
GValueArray *return_vals;
227
item = gimp_value_get_item (&args->values[0], gimp);
228
x0 = g_value_get_double (&args->values[1]);
229
y0 = g_value_get_double (&args->values[2]);
230
x1 = g_value_get_double (&args->values[3]);
231
y1 = g_value_get_double (&args->values[4]);
232
x2 = g_value_get_double (&args->values[5]);
233
y2 = g_value_get_double (&args->values[6]);
234
x3 = g_value_get_double (&args->values[7]);
235
y3 = g_value_get_double (&args->values[8]);
239
gint x, y, width, height;
241
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
244
gimp_item_mask_intersect (item, &x, &y, &width, &height))
246
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
250
gimp_item_get_offset (item, &off_x, &off_y);
254
/* Assemble the transformation matrix */
255
gimp_matrix3_identity (&matrix);
256
gimp_transform_matrix_perspective (&matrix,
262
gimp_progress_start (progress, _("Perspective"), FALSE);
264
if (GIMP_IS_DRAWABLE (item) &&
265
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
266
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
268
GimpDrawable *drawable;
270
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
272
pdb_context->transform_direction,
273
pdb_context->interpolation,
274
pdb_context->transform_recursion,
275
pdb_context->transform_resize,
279
item = GIMP_ITEM (drawable);
285
gimp_item_transform (item, context, &matrix,
286
pdb_context->transform_direction,
287
pdb_context->interpolation,
288
pdb_context->transform_recursion,
289
pdb_context->transform_resize,
294
gimp_progress_end (progress);
298
return_vals = gimp_procedure_get_return_values (procedure, success,
299
error ? *error : NULL);
302
gimp_value_set_item (&return_vals->values[1], item);
308
item_transform_rotate_simple_invoker (GimpProcedure *procedure,
310
GimpContext *context,
311
GimpProgress *progress,
312
const GValueArray *args,
315
gboolean success = TRUE;
316
GValueArray *return_vals;
319
gboolean auto_center;
323
item = gimp_value_get_item (&args->values[0], gimp);
324
rotate_type = g_value_get_enum (&args->values[1]);
325
auto_center = g_value_get_boolean (&args->values[2]);
326
center_x = g_value_get_double (&args->values[3]);
327
center_y = g_value_get_double (&args->values[4]);
331
gint x, y, width, height;
333
success = gimp_pdb_item_is_attached (item, NULL, FALSE, error);
336
gimp_item_mask_intersect (item, &x, &y, &width, &height))
338
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
341
gimp_item_get_offset (item, &off_x, &off_y);
345
gimp_transform_get_rotate_center (x, y, width, height,
346
auto_center, ¢er_x, ¢er_y);
348
if (GIMP_IS_DRAWABLE (item) &&
349
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
350
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
352
GimpDrawable *drawable;
354
drawable = gimp_drawable_transform_rotate (GIMP_DRAWABLE (item),
358
pdb_context->transform_resize);
361
item = GIMP_ITEM (drawable);
367
gimp_item_rotate (item, context,
370
pdb_context->transform_resize);
375
return_vals = gimp_procedure_get_return_values (procedure, success,
376
error ? *error : NULL);
379
gimp_value_set_item (&return_vals->values[1], item);
385
item_transform_rotate_invoker (GimpProcedure *procedure,
387
GimpContext *context,
388
GimpProgress *progress,
389
const GValueArray *args,
392
gboolean success = TRUE;
393
GValueArray *return_vals;
396
gboolean auto_center;
400
item = gimp_value_get_item (&args->values[0], gimp);
401
angle = g_value_get_double (&args->values[1]);
402
auto_center = g_value_get_boolean (&args->values[2]);
403
center_x = g_value_get_double (&args->values[3]);
404
center_y = g_value_get_double (&args->values[4]);
408
gint x, y, width, height;
410
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
413
gimp_item_mask_intersect (item, &x, &y, &width, &height))
415
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
419
gimp_item_get_offset (item, &off_x, &off_y);
423
/* Assemble the transformation matrix */
424
gimp_matrix3_identity (&matrix);
426
gimp_transform_matrix_rotate_rect (&matrix,
427
x, y, width, height, angle);
429
gimp_transform_matrix_rotate_center (&matrix,
430
center_x, center_y, angle);
433
gimp_progress_start (progress, _("Rotating"), FALSE);
435
if (GIMP_IS_DRAWABLE (item) &&
436
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
437
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
439
GimpDrawable *drawable;
441
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
443
pdb_context->transform_direction,
444
pdb_context->interpolation,
445
pdb_context->transform_recursion,
446
pdb_context->transform_resize,
450
item = GIMP_ITEM (drawable);
456
gimp_item_transform (item, context, &matrix,
457
pdb_context->transform_direction,
458
pdb_context->interpolation,
459
pdb_context->transform_recursion,
460
pdb_context->transform_resize,
465
gimp_progress_end (progress);
469
return_vals = gimp_procedure_get_return_values (procedure, success,
470
error ? *error : NULL);
473
gimp_value_set_item (&return_vals->values[1], item);
479
item_transform_scale_invoker (GimpProcedure *procedure,
481
GimpContext *context,
482
GimpProgress *progress,
483
const GValueArray *args,
486
gboolean success = TRUE;
487
GValueArray *return_vals;
494
item = gimp_value_get_item (&args->values[0], gimp);
495
x0 = g_value_get_double (&args->values[1]);
496
y0 = g_value_get_double (&args->values[2]);
497
x1 = g_value_get_double (&args->values[3]);
498
y1 = g_value_get_double (&args->values[4]);
502
gint x, y, width, height;
504
success = (gimp_pdb_item_is_attached (item, NULL, TRUE, error) && x0 < x1 && y0 < y1);
507
gimp_item_mask_intersect (item, &x, &y, &width, &height))
509
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
513
gimp_item_get_offset (item, &off_x, &off_y);
517
/* Assemble the transformation matrix */
518
gimp_matrix3_identity (&matrix);
519
gimp_transform_matrix_scale (&matrix,
521
x0, y0, x1 - x0, y1 - y0);
524
gimp_progress_start (progress, _("Scaling"), FALSE);
526
if (GIMP_IS_DRAWABLE (item) &&
527
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
528
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
530
GimpDrawable *drawable;
532
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
534
pdb_context->transform_direction,
535
pdb_context->interpolation,
536
pdb_context->transform_recursion,
537
pdb_context->transform_resize,
541
item = GIMP_ITEM (drawable);
547
gimp_item_transform (item, context, &matrix,
548
pdb_context->transform_direction,
549
pdb_context->interpolation,
550
pdb_context->transform_recursion,
551
pdb_context->transform_resize,
556
gimp_progress_end (progress);
560
return_vals = gimp_procedure_get_return_values (procedure, success,
561
error ? *error : NULL);
564
gimp_value_set_item (&return_vals->values[1], item);
570
item_transform_shear_invoker (GimpProcedure *procedure,
572
GimpContext *context,
573
GimpProgress *progress,
574
const GValueArray *args,
577
gboolean success = TRUE;
578
GValueArray *return_vals;
583
item = gimp_value_get_item (&args->values[0], gimp);
584
shear_type = g_value_get_enum (&args->values[1]);
585
magnitude = g_value_get_double (&args->values[2]);
589
gint x, y, width, height;
591
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
594
gimp_item_mask_intersect (item, &x, &y, &width, &height))
596
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
600
gimp_item_get_offset (item, &off_x, &off_y);
604
/* Assemble the transformation matrix */
605
gimp_matrix3_identity (&matrix);
606
gimp_transform_matrix_shear (&matrix,
608
shear_type, magnitude);
611
gimp_progress_start (progress, _("Shearing"), FALSE);
613
if (GIMP_IS_DRAWABLE (item) &&
614
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
615
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
617
GimpDrawable *drawable;
619
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
621
pdb_context->transform_direction,
622
pdb_context->interpolation,
623
pdb_context->transform_recursion,
624
pdb_context->transform_resize,
628
item = GIMP_ITEM (drawable);
634
gimp_item_transform (item, context, &matrix,
635
pdb_context->transform_direction,
636
pdb_context->interpolation,
637
pdb_context->transform_recursion,
638
pdb_context->transform_resize,
643
gimp_progress_end (progress);
647
return_vals = gimp_procedure_get_return_values (procedure, success,
648
error ? *error : NULL);
651
gimp_value_set_item (&return_vals->values[1], item);
657
item_transform_2d_invoker (GimpProcedure *procedure,
659
GimpContext *context,
660
GimpProgress *progress,
661
const GValueArray *args,
664
gboolean success = TRUE;
665
GValueArray *return_vals;
675
item = gimp_value_get_item (&args->values[0], gimp);
676
source_x = g_value_get_double (&args->values[1]);
677
source_y = g_value_get_double (&args->values[2]);
678
scale_x = g_value_get_double (&args->values[3]);
679
scale_y = g_value_get_double (&args->values[4]);
680
angle = g_value_get_double (&args->values[5]);
681
dest_x = g_value_get_double (&args->values[6]);
682
dest_y = g_value_get_double (&args->values[7]);
686
gint x, y, width, height;
688
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
691
gimp_item_mask_intersect (item, &x, &y, &width, &height))
693
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
697
gimp_item_get_offset (item, &off_x, &off_y);
701
/* Assemble the transformation matrix */
702
gimp_matrix3_identity (&matrix);
703
gimp_matrix3_translate (&matrix, -source_x, -source_y);
704
gimp_matrix3_scale (&matrix, scale_x, scale_y);
705
gimp_matrix3_rotate (&matrix, angle);
706
gimp_matrix3_translate (&matrix, dest_x, dest_y);
709
gimp_progress_start (progress, _("2D Transform"), FALSE);
711
if (GIMP_IS_DRAWABLE (item) &&
712
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
713
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
715
GimpDrawable *drawable;
717
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
719
pdb_context->transform_direction,
720
pdb_context->interpolation,
721
pdb_context->transform_recursion,
722
pdb_context->transform_resize,
726
item = GIMP_ITEM (drawable);
732
gimp_item_transform (item, context, &matrix,
733
pdb_context->transform_direction,
734
pdb_context->interpolation,
735
pdb_context->transform_recursion,
736
pdb_context->transform_resize,
741
gimp_progress_end (progress);
745
return_vals = gimp_procedure_get_return_values (procedure, success,
746
error ? *error : NULL);
749
gimp_value_set_item (&return_vals->values[1], item);
755
item_transform_matrix_invoker (GimpProcedure *procedure,
757
GimpContext *context,
758
GimpProgress *progress,
759
const GValueArray *args,
762
gboolean success = TRUE;
763
GValueArray *return_vals;
775
item = gimp_value_get_item (&args->values[0], gimp);
776
coeff_0_0 = g_value_get_double (&args->values[1]);
777
coeff_0_1 = g_value_get_double (&args->values[2]);
778
coeff_0_2 = g_value_get_double (&args->values[3]);
779
coeff_1_0 = g_value_get_double (&args->values[4]);
780
coeff_1_1 = g_value_get_double (&args->values[5]);
781
coeff_1_2 = g_value_get_double (&args->values[6]);
782
coeff_2_0 = g_value_get_double (&args->values[7]);
783
coeff_2_1 = g_value_get_double (&args->values[8]);
784
coeff_2_2 = g_value_get_double (&args->values[9]);
788
gint x, y, width, height;
790
success = gimp_pdb_item_is_attached (item, NULL, TRUE, error);
793
gimp_item_mask_intersect (item, &x, &y, &width, &height))
795
GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
799
gimp_item_get_offset (item, &off_x, &off_y);
803
/* Assemble the transformation matrix */
804
matrix.coeff[0][0] = coeff_0_0;
805
matrix.coeff[0][1] = coeff_0_1;
806
matrix.coeff[0][2] = coeff_0_2;
807
matrix.coeff[1][0] = coeff_1_0;
808
matrix.coeff[1][1] = coeff_1_1;
809
matrix.coeff[1][2] = coeff_1_2;
810
matrix.coeff[2][0] = coeff_2_0;
811
matrix.coeff[2][1] = coeff_2_1;
812
matrix.coeff[2][2] = coeff_2_2;
815
gimp_progress_start (progress, _("2D Transforming"), FALSE);
817
if (GIMP_IS_DRAWABLE (item) &&
818
! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
819
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
821
GimpDrawable *drawable;
823
drawable = gimp_drawable_transform_affine (GIMP_DRAWABLE (item),
825
pdb_context->transform_direction,
826
pdb_context->interpolation,
827
pdb_context->transform_recursion,
828
pdb_context->transform_resize,
832
item = GIMP_ITEM (drawable);
838
gimp_item_transform (item, context, &matrix,
839
pdb_context->transform_direction,
840
pdb_context->interpolation,
841
pdb_context->transform_recursion,
842
pdb_context->transform_resize,
847
gimp_progress_end (progress);
851
return_vals = gimp_procedure_get_return_values (procedure, success,
852
error ? *error : NULL);
855
gimp_value_set_item (&return_vals->values[1], item);
861
register_item_transform_procs (GimpPDB *pdb)
863
GimpProcedure *procedure;
866
* gimp-item-transform-flip-simple
868
procedure = gimp_procedure_new (item_transform_flip_simple_invoker);
869
gimp_object_set_static_name (GIMP_OBJECT (procedure),
870
"gimp-item-transform-flip-simple");
871
gimp_procedure_set_static_strings (procedure,
872
"gimp-item-transform-flip-simple",
873
"Flip the specified item either vertically or horizontally.",
874
"This procedure flips the specified item. If a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and flipped drawable. This procedure is affected by the following context setters: 'gimp-context-set-transform-resize'.",
875
"Michael Natterer <mitch@gimp.org>",
879
gimp_procedure_add_argument (procedure,
880
gimp_param_spec_item_id ("item",
884
GIMP_PARAM_READWRITE));
885
gimp_procedure_add_argument (procedure,
886
gimp_param_spec_enum ("flip-type",
889
GIMP_TYPE_ORIENTATION_TYPE,
890
GIMP_ORIENTATION_HORIZONTAL,
891
GIMP_PARAM_READWRITE));
892
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
893
GIMP_ORIENTATION_UNKNOWN);
894
gimp_procedure_add_argument (procedure,
895
g_param_spec_boolean ("auto-center",
897
"Whether to automatically position the axis in the selection center",
899
GIMP_PARAM_READWRITE));
900
gimp_procedure_add_argument (procedure,
901
g_param_spec_double ("axis",
903
"coord. of flip axis",
904
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
905
GIMP_PARAM_READWRITE));
906
gimp_procedure_add_return_value (procedure,
907
gimp_param_spec_item_id ("item",
911
GIMP_PARAM_READWRITE));
912
gimp_pdb_register_procedure (pdb, procedure);
913
g_object_unref (procedure);
916
* gimp-item-transform-flip
918
procedure = gimp_procedure_new (item_transform_flip_invoker);
919
gimp_object_set_static_name (GIMP_OBJECT (procedure),
920
"gimp-item-transform-flip");
921
gimp_procedure_set_static_strings (procedure,
922
"gimp-item-transform-flip",
923
"Flip the specified item around a given line.",
924
"This procedure flips the specified item. If a selection exists and the item is a drawable , 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 item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and flipped drawable. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
925
"Michael Natterer <mitch@gimp.org>",
929
gimp_procedure_add_argument (procedure,
930
gimp_param_spec_item_id ("item",
934
GIMP_PARAM_READWRITE));
935
gimp_procedure_add_argument (procedure,
936
g_param_spec_double ("x0",
938
"horz. coord. of one end of axis",
939
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
940
GIMP_PARAM_READWRITE));
941
gimp_procedure_add_argument (procedure,
942
g_param_spec_double ("y0",
944
"vert. coord. of one end of axis",
945
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
946
GIMP_PARAM_READWRITE));
947
gimp_procedure_add_argument (procedure,
948
g_param_spec_double ("x1",
950
"horz. coord. of other end of axis",
951
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
952
GIMP_PARAM_READWRITE));
953
gimp_procedure_add_argument (procedure,
954
g_param_spec_double ("y1",
956
"vert. coord. of other end of axis",
957
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
958
GIMP_PARAM_READWRITE));
959
gimp_procedure_add_return_value (procedure,
960
gimp_param_spec_item_id ("item",
964
GIMP_PARAM_READWRITE));
965
gimp_pdb_register_procedure (pdb, procedure);
966
g_object_unref (procedure);
969
* gimp-item-transform-perspective
971
procedure = gimp_procedure_new (item_transform_perspective_invoker);
972
gimp_object_set_static_name (GIMP_OBJECT (procedure),
973
"gimp-item-transform-perspective");
974
gimp_procedure_set_static_strings (procedure,
975
"gimp-item-transform-perspective",
976
"Perform a possibly non-affine transformation on the specified item.",
977
"This procedure performs a possibly non-affine transformation on the specified item by allowing the corners of the original bounding box to be arbitrarily remapped to any values. The specified item is remapped if no selection exists or it is not a drawable. However, if a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item 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 item will appear to have"
978
"been projected via a perspective transform. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
979
"Michael Natterer <mitch@gimp.org>",
983
gimp_procedure_add_argument (procedure,
984
gimp_param_spec_item_id ("item",
988
GIMP_PARAM_READWRITE));
989
gimp_procedure_add_argument (procedure,
990
g_param_spec_double ("x0",
992
"The new x coordinate of upper-left corner of original bounding box",
993
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
994
GIMP_PARAM_READWRITE));
995
gimp_procedure_add_argument (procedure,
996
g_param_spec_double ("y0",
998
"The new y coordinate of upper-left corner of original bounding box",
999
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1000
GIMP_PARAM_READWRITE));
1001
gimp_procedure_add_argument (procedure,
1002
g_param_spec_double ("x1",
1004
"The new x coordinate of upper-right corner of original bounding box",
1005
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1006
GIMP_PARAM_READWRITE));
1007
gimp_procedure_add_argument (procedure,
1008
g_param_spec_double ("y1",
1010
"The new y coordinate of upper-right corner of original bounding box",
1011
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1012
GIMP_PARAM_READWRITE));
1013
gimp_procedure_add_argument (procedure,
1014
g_param_spec_double ("x2",
1016
"The new x coordinate of lower-left corner of original bounding box",
1017
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1018
GIMP_PARAM_READWRITE));
1019
gimp_procedure_add_argument (procedure,
1020
g_param_spec_double ("y2",
1022
"The new y coordinate of lower-left corner of original bounding box",
1023
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1024
GIMP_PARAM_READWRITE));
1025
gimp_procedure_add_argument (procedure,
1026
g_param_spec_double ("x3",
1028
"The new x coordinate of lower-right corner of original bounding box",
1029
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1030
GIMP_PARAM_READWRITE));
1031
gimp_procedure_add_argument (procedure,
1032
g_param_spec_double ("y3",
1034
"The new y coordinate of lower-right corner of original bounding box",
1035
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1036
GIMP_PARAM_READWRITE));
1037
gimp_procedure_add_return_value (procedure,
1038
gimp_param_spec_item_id ("item",
1040
"The newly mapped item",
1042
GIMP_PARAM_READWRITE));
1043
gimp_pdb_register_procedure (pdb, procedure);
1044
g_object_unref (procedure);
1047
* gimp-item-transform-rotate-simple
1049
procedure = gimp_procedure_new (item_transform_rotate_simple_invoker);
1050
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1051
"gimp-item-transform-rotate-simple");
1052
gimp_procedure_set_static_strings (procedure,
1053
"gimp-item-transform-rotate-simple",
1054
"Rotate the specified item about given coordinates through the specified angle.",
1055
"This function rotates the specified item. If a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and rotated drawable. This procedure is affected by the following context setters: 'gimp-context-set-transform-resize'.",
1056
"Michael Natterer <mitch@gimp.org>",
1060
gimp_procedure_add_argument (procedure,
1061
gimp_param_spec_item_id ("item",
1063
"The affected item",
1065
GIMP_PARAM_READWRITE));
1066
gimp_procedure_add_argument (procedure,
1067
g_param_spec_enum ("rotate-type",
1070
GIMP_TYPE_ROTATION_TYPE,
1072
GIMP_PARAM_READWRITE));
1073
gimp_procedure_add_argument (procedure,
1074
g_param_spec_boolean ("auto-center",
1076
"Whether to automatically rotate around the selection center",
1078
GIMP_PARAM_READWRITE));
1079
gimp_procedure_add_argument (procedure,
1080
g_param_spec_double ("center-x",
1082
"The hor. coordinate of the center of rotation",
1083
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1084
GIMP_PARAM_READWRITE));
1085
gimp_procedure_add_argument (procedure,
1086
g_param_spec_double ("center-y",
1088
"The vert. coordinate of the center of rotation",
1089
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1090
GIMP_PARAM_READWRITE));
1091
gimp_procedure_add_return_value (procedure,
1092
gimp_param_spec_item_id ("item",
1096
GIMP_PARAM_READWRITE));
1097
gimp_pdb_register_procedure (pdb, procedure);
1098
g_object_unref (procedure);
1101
* gimp-item-transform-rotate
1103
procedure = gimp_procedure_new (item_transform_rotate_invoker);
1104
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1105
"gimp-item-transform-rotate");
1106
gimp_procedure_set_static_strings (procedure,
1107
"gimp-item-transform-rotate",
1108
"Rotate the specified item about given coordinates through the specified angle.",
1109
"This function rotates the specified item. If a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and rotated drawable. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
1110
"Michael Natterer <mitch@gimp.org>",
1114
gimp_procedure_add_argument (procedure,
1115
gimp_param_spec_item_id ("item",
1117
"The affected item",
1119
GIMP_PARAM_READWRITE));
1120
gimp_procedure_add_argument (procedure,
1121
g_param_spec_double ("angle",
1123
"The angle of rotation (radians)",
1124
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1125
GIMP_PARAM_READWRITE));
1126
gimp_procedure_add_argument (procedure,
1127
g_param_spec_boolean ("auto-center",
1129
"Whether to automatically rotate around the selection center",
1131
GIMP_PARAM_READWRITE));
1132
gimp_procedure_add_argument (procedure,
1133
g_param_spec_double ("center-x",
1135
"The hor. coordinate of the center of rotation",
1136
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1137
GIMP_PARAM_READWRITE));
1138
gimp_procedure_add_argument (procedure,
1139
g_param_spec_double ("center-y",
1141
"The vert. coordinate of the center of rotation",
1142
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1143
GIMP_PARAM_READWRITE));
1144
gimp_procedure_add_return_value (procedure,
1145
gimp_param_spec_item_id ("item",
1149
GIMP_PARAM_READWRITE));
1150
gimp_pdb_register_procedure (pdb, procedure);
1151
g_object_unref (procedure);
1154
* gimp-item-transform-scale
1156
procedure = gimp_procedure_new (item_transform_scale_invoker);
1157
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1158
"gimp-item-transform-scale");
1159
gimp_procedure_set_static_strings (procedure,
1160
"gimp-item-transform-scale",
1161
"Scale the specified item.",
1162
"This procedure scales the specified item. If a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and scaled drawable. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
1163
"Michael Natterer <mitch@gimp.org>",
1167
gimp_procedure_add_argument (procedure,
1168
gimp_param_spec_item_id ("item",
1170
"The affected item",
1172
GIMP_PARAM_READWRITE));
1173
gimp_procedure_add_argument (procedure,
1174
g_param_spec_double ("x0",
1176
"The new x coordinate of the upper-left corner of the scaled region",
1177
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1178
GIMP_PARAM_READWRITE));
1179
gimp_procedure_add_argument (procedure,
1180
g_param_spec_double ("y0",
1182
"The new y coordinate of the upper-left corner of the scaled region",
1183
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1184
GIMP_PARAM_READWRITE));
1185
gimp_procedure_add_argument (procedure,
1186
g_param_spec_double ("x1",
1188
"The new x coordinate of the lower-right corner of the scaled region",
1189
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1190
GIMP_PARAM_READWRITE));
1191
gimp_procedure_add_argument (procedure,
1192
g_param_spec_double ("y1",
1194
"The new y coordinate of the lower-right corner of the scaled region",
1195
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1196
GIMP_PARAM_READWRITE));
1197
gimp_procedure_add_return_value (procedure,
1198
gimp_param_spec_item_id ("item",
1202
GIMP_PARAM_READWRITE));
1203
gimp_pdb_register_procedure (pdb, procedure);
1204
g_object_unref (procedure);
1207
* gimp-item-transform-shear
1209
procedure = gimp_procedure_new (item_transform_shear_invoker);
1210
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1211
"gimp-item-transform-shear");
1212
gimp_procedure_set_static_strings (procedure,
1213
"gimp-item-transform-shear",
1214
"Shear the specified item about its center by the specified magnitude.",
1215
"This procedure shears the specified item. If a selection exists and the item is a drawable, 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 item. If there was no selection or the item is not a drawable, this will be equal to the item 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. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
1216
"Michael Natterer <mitch@gimp.org>",
1220
gimp_procedure_add_argument (procedure,
1221
gimp_param_spec_item_id ("item",
1223
"The affected item",
1225
GIMP_PARAM_READWRITE));
1226
gimp_procedure_add_argument (procedure,
1227
gimp_param_spec_enum ("shear-type",
1230
GIMP_TYPE_ORIENTATION_TYPE,
1231
GIMP_ORIENTATION_HORIZONTAL,
1232
GIMP_PARAM_READWRITE));
1233
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
1234
GIMP_ORIENTATION_UNKNOWN);
1235
gimp_procedure_add_argument (procedure,
1236
g_param_spec_double ("magnitude",
1238
"The magnitude of the shear",
1239
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1240
GIMP_PARAM_READWRITE));
1241
gimp_procedure_add_return_value (procedure,
1242
gimp_param_spec_item_id ("item",
1246
GIMP_PARAM_READWRITE));
1247
gimp_pdb_register_procedure (pdb, procedure);
1248
g_object_unref (procedure);
1251
* gimp-item-transform-2d
1253
procedure = gimp_procedure_new (item_transform_2d_invoker);
1254
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1255
"gimp-item-transform-2d");
1256
gimp_procedure_set_static_strings (procedure,
1257
"gimp-item-transform-2d",
1258
"Transform the specified item in 2d.",
1259
"This procedure transforms the specified item. If a selection exists and the item is a drawable, 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 or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and transformed drawable. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
1260
"Michael Natterer <mitch@gimp.org>",
1264
gimp_procedure_add_argument (procedure,
1265
gimp_param_spec_item_id ("item",
1267
"The affected item",
1269
GIMP_PARAM_READWRITE));
1270
gimp_procedure_add_argument (procedure,
1271
g_param_spec_double ("source-x",
1273
"X coordinate of the transformation center",
1274
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1275
GIMP_PARAM_READWRITE));
1276
gimp_procedure_add_argument (procedure,
1277
g_param_spec_double ("source-y",
1279
"Y coordinate of the transformation center",
1280
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1281
GIMP_PARAM_READWRITE));
1282
gimp_procedure_add_argument (procedure,
1283
g_param_spec_double ("scale-x",
1285
"Amount to scale in x direction",
1286
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1287
GIMP_PARAM_READWRITE));
1288
gimp_procedure_add_argument (procedure,
1289
g_param_spec_double ("scale-y",
1291
"Amount to scale in y direction",
1292
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1293
GIMP_PARAM_READWRITE));
1294
gimp_procedure_add_argument (procedure,
1295
g_param_spec_double ("angle",
1297
"The angle of rotation (radians)",
1298
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1299
GIMP_PARAM_READWRITE));
1300
gimp_procedure_add_argument (procedure,
1301
g_param_spec_double ("dest-x",
1303
"X coordinate of where the center goes",
1304
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1305
GIMP_PARAM_READWRITE));
1306
gimp_procedure_add_argument (procedure,
1307
g_param_spec_double ("dest-y",
1309
"Y coordinate of where the center goes",
1310
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1311
GIMP_PARAM_READWRITE));
1312
gimp_procedure_add_return_value (procedure,
1313
gimp_param_spec_item_id ("item",
1315
"The transformed item",
1317
GIMP_PARAM_READWRITE));
1318
gimp_pdb_register_procedure (pdb, procedure);
1319
g_object_unref (procedure);
1322
* gimp-item-transform-matrix
1324
procedure = gimp_procedure_new (item_transform_matrix_invoker);
1325
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1326
"gimp-item-transform-matrix");
1327
gimp_procedure_set_static_strings (procedure,
1328
"gimp-item-transform-matrix",
1329
"Transform the specified item in 2d.",
1330
"This procedure transforms the specified item. If a selection exists and the item is a drawable, 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 transformed item. If there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly created and transformed drawable. This procedure is affected by the following context setters: 'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 'gimp-context-set-transform-resize', 'gimp-context-set-transform-recursion'.",
1331
"Michael Natterer <mitch@gimp.org>",
1335
gimp_procedure_add_argument (procedure,
1336
gimp_param_spec_item_id ("item",
1338
"The affected item",
1340
GIMP_PARAM_READWRITE));
1341
gimp_procedure_add_argument (procedure,
1342
g_param_spec_double ("coeff-0-0",
1344
"coefficient (0,0) of the transformation matrix",
1345
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1346
GIMP_PARAM_READWRITE));
1347
gimp_procedure_add_argument (procedure,
1348
g_param_spec_double ("coeff-0-1",
1350
"coefficient (0,1) of the transformation matrix",
1351
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1352
GIMP_PARAM_READWRITE));
1353
gimp_procedure_add_argument (procedure,
1354
g_param_spec_double ("coeff-0-2",
1356
"coefficient (0,2) of the transformation matrix",
1357
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1358
GIMP_PARAM_READWRITE));
1359
gimp_procedure_add_argument (procedure,
1360
g_param_spec_double ("coeff-1-0",
1362
"coefficient (1,0) of the transformation matrix",
1363
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1364
GIMP_PARAM_READWRITE));
1365
gimp_procedure_add_argument (procedure,
1366
g_param_spec_double ("coeff-1-1",
1368
"coefficient (1,1) of the transformation matrix",
1369
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1370
GIMP_PARAM_READWRITE));
1371
gimp_procedure_add_argument (procedure,
1372
g_param_spec_double ("coeff-1-2",
1374
"coefficient (1,2) of the transformation matrix",
1375
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1376
GIMP_PARAM_READWRITE));
1377
gimp_procedure_add_argument (procedure,
1378
g_param_spec_double ("coeff-2-0",
1380
"coefficient (2,0) of the transformation matrix",
1381
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1382
GIMP_PARAM_READWRITE));
1383
gimp_procedure_add_argument (procedure,
1384
g_param_spec_double ("coeff-2-1",
1386
"coefficient (2,1) of the transformation matrix",
1387
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1388
GIMP_PARAM_READWRITE));
1389
gimp_procedure_add_argument (procedure,
1390
g_param_spec_double ("coeff-2-2",
1392
"coefficient (2,2) of the transformation matrix",
1393
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1394
GIMP_PARAM_READWRITE));
1395
gimp_procedure_add_return_value (procedure,
1396
gimp_param_spec_item_id ("item",
1398
"The transformed item",
1400
GIMP_PARAM_READWRITE));
1401
gimp_pdb_register_procedure (pdb, procedure);
1402
g_object_unref (procedure);