~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to plug-ins/pygimp/doc/gimp-module-procedures.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Gimp Module Procedures</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet"><LINK
 
9
REL="HOME"
 
10
TITLE="Gimp Python Documentation"
 
11
HREF="pygimp.html"><LINK
 
12
REL="PREVIOUS"
 
13
TITLE="The Procedural Database"
 
14
HREF="procedural-database.html"><LINK
 
15
REL="NEXT"
 
16
TITLE="Gimp Objects"
 
17
HREF="gimp-objects.html"></HEAD
 
18
><BODY
 
19
><DIV
 
20
CLASS="NAVHEADER"
 
21
><TABLE
 
22
WIDTH="100%"
 
23
BORDER="0"
 
24
CELLPADDING="0"
 
25
CELLSPACING="0"
 
26
><TR
 
27
><TH
 
28
COLSPAN="3"
 
29
ALIGN="center"
 
30
>Gimp Python Documentation</TH
 
31
></TR
 
32
><TR
 
33
><TD
 
34
WIDTH="10%"
 
35
ALIGN="left"
 
36
VALIGN="bottom"
 
37
><A
 
38
HREF="procedural-database.html"
 
39
>Prev</A
 
40
></TD
 
41
><TD
 
42
WIDTH="80%"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
></TD
 
46
><TD
 
47
WIDTH="10%"
 
48
ALIGN="right"
 
49
VALIGN="bottom"
 
50
><A
 
51
HREF="gimp-objects.html"
 
52
>Next</A
 
53
></TD
 
54
></TR
 
55
></TABLE
 
56
><HR
 
57
ALIGN="LEFT"
 
58
WIDTH="100%"></DIV
 
59
><DIV
 
60
CLASS="SECT1"
 
61
><H1
 
62
CLASS="SECT1"
 
63
><A
 
64
NAME="GIMP-MODULE-PROCEDURES"
 
65
>Gimp Module Procedures</A
 
66
></H1
 
67
><P
 
68
>The <TT
 
69
CLASS="FILENAME"
 
70
>gimp</TT
 
71
> module contains a number of
 
72
    procedures and functions, as well as the definitions of many gimp
 
73
    types such as images, and the procedural database.  This section
 
74
    explains the base level procedures.</P
 
75
><DIV
 
76
CLASS="SECT2"
 
77
><H2
 
78
CLASS="SECT2"
 
79
><A
 
80
NAME="CONSTRUCTORS-AND-DESTRUCTORS"
 
81
>Constructors and Object Deletion</A
 
82
></H2
 
83
><P
 
84
>There are a number of functions in the
 
85
      <TT
 
86
CLASS="FILENAME"
 
87
>gimp</TT
 
88
> module that are used to create the objects
 
89
      used to make up an image in Gimp.  Here is a set of descriptions
 
90
      of these constructors:</P
 
91
><P
 
92
></P
 
93
><DL
 
94
><DT
 
95
><TT
 
96
CLASS="FUNCTION"
 
97
><B
 
98
>gimp.image</B
 
99
></TT
 
100
>(<TT
 
101
CLASS="PARAMETER"
 
102
><I
 
103
>width</I
 
104
></TT
 
105
>,
 
106
          <TT
 
107
CLASS="PARAMETER"
 
108
><I
 
109
>height</I
 
110
></TT
 
111
>,
 
112
          <TT
 
113
CLASS="PARAMETER"
 
114
><I
 
115
>type</I
 
116
></TT
 
117
>)</DT
 
118
><DD
 
119
><P
 
120
>This procedure creates an image with the given
 
121
            dimensions and type (type is one of
 
122
            <TT
 
123
CLASS="LITERAL"
 
124
>RGB</TT
 
125
>, <TT
 
126
CLASS="LITERAL"
 
127
>GRAY</TT
 
128
> or
 
129
            <TT
 
130
CLASS="LITERAL"
 
131
>INDEXED</TT
 
132
>).</P
 
133
></DD
 
134
><DT
 
135
><TT
 
136
CLASS="FUNCTION"
 
137
><B
 
138
>gimp.layer</B
 
139
></TT
 
140
>(<TT
 
141
CLASS="PARAMETER"
 
142
><I
 
143
>img</I
 
144
></TT
 
145
>,
 
146
          <TT
 
147
CLASS="PARAMETER"
 
148
><I
 
149
>name</I
 
150
></TT
 
151
>, <TT
 
152
CLASS="PARAMETER"
 
153
><I
 
154
>width</I
 
155
></TT
 
156
>,
 
157
          <TT
 
158
CLASS="PARAMETER"
 
159
><I
 
160
>height</I
 
161
></TT
 
162
>, <TT
 
163
CLASS="PARAMETER"
 
164
><I
 
165
>type</I
 
166
></TT
 
167
>,
 
168
          <TT
 
169
CLASS="PARAMETER"
 
170
><I
 
171
>opacity</I
 
172
></TT
 
173
>,
 
174
          <TT
 
175
CLASS="PARAMETER"
 
176
><I
 
177
>mode</I
 
178
></TT
 
179
>)</DT
 
180
><DD
 
181
><P
 
182
>Create a new layer called
 
183
            <TT
 
184
CLASS="PARAMETER"
 
185
><I
 
186
>name</I
 
187
></TT
 
188
>, with the given dimensions and
 
189
            <TT
 
190
CLASS="PARAMETER"
 
191
><I
 
192
>type</I
 
193
></TT
 
194
> (one of the
 
195
            <TT
 
196
CLASS="LITERAL"
 
197
>*_IMAGE</TT
 
198
> constants),
 
199
            <TT
 
200
CLASS="LITERAL"
 
201
>opacity</TT
 
202
> (float between 0 and 100) and
 
203
            a <TT
 
204
CLASS="LITERAL"
 
205
>mode</TT
 
206
> (one of the
 
207
            <TT
 
208
CLASS="LITERAL"
 
209
>*_MODE</TT
 
210
> constants).  The layer can
 
211
            then be added to the image with the
 
212
            <TT
 
213
CLASS="FUNCTION"
 
214
><B
 
215
>img.add_layer</B
 
216
></TT
 
217
> method.</P
 
218
></DD
 
219
><DT
 
220
><TT
 
221
CLASS="FUNCTION"
 
222
><B
 
223
>gimp.channel</B
 
224
></TT
 
225
>(<TT
 
226
CLASS="PARAMETER"
 
227
><I
 
228
>img</I
 
229
></TT
 
230
>,
 
231
          <TT
 
232
CLASS="PARAMETER"
 
233
><I
 
234
>name</I
 
235
></TT
 
236
>, <TT
 
237
CLASS="PARAMETER"
 
238
><I
 
239
>width</I
 
240
></TT
 
241
>,
 
242
          <TT
 
243
CLASS="PARAMETER"
 
244
><I
 
245
>height</I
 
246
></TT
 
247
>,
 
248
          <TT
 
249
CLASS="PARAMETER"
 
250
><I
 
251
>opacity</I
 
252
></TT
 
253
>,
 
254
          <TT
 
255
CLASS="PARAMETER"
 
256
><I
 
257
>colour</I
 
258
></TT
 
259
>)</DT
 
260
><DD
 
261
><P
 
262
>Create a new channel object with the given
 
263
            dimensions, <TT
 
264
CLASS="PARAMETER"
 
265
><I
 
266
>opacity</I
 
267
></TT
 
268
> and
 
269
            <TT
 
270
CLASS="PARAMETER"
 
271
><I
 
272
>colour</I
 
273
></TT
 
274
> (one of the
 
275
            <TT
 
276
CLASS="LITERAL"
 
277
>*_CHANNEL</TT
 
278
> constants).  This channel can
 
279
            then be added to an image.</P
 
280
></DD
 
281
><DT
 
282
><TT
 
283
CLASS="FUNCTION"
 
284
><B
 
285
>gimp.display</B
 
286
></TT
 
287
>(<TT
 
288
CLASS="PARAMETER"
 
289
><I
 
290
>img</I
 
291
></TT
 
292
>)</DT
 
293
><DD
 
294
><P
 
295
>Create a new display window for the given image.
 
296
            The window will not be displayed until a call to
 
297
            <TT
 
298
CLASS="FUNCTION"
 
299
><B
 
300
>gimp.displays_flush</B
 
301
></TT
 
302
> is made.</P
 
303
></DD
 
304
><DT
 
305
><TT
 
306
CLASS="FUNCTION"
 
307
><B
 
308
>gimp.parasite(name, flags, data)</B
 
309
></TT
 
310
></DT
 
311
><DD
 
312
><P
 
313
>Create a new parasite.  The parasite can then be
 
314
            attached to gimp, an image or a drawable.  This is only
 
315
            available in gimp &#62;= 1.1</P
 
316
></DD
 
317
></DL
 
318
><P
 
319
>When any of these objects get removed from memory (such as
 
320
      when their name goes out of range), the gimp thing it represents
 
321
      does not get deleted with it (otherwise when your plugin
 
322
      finished running, it would delete all its work).  In order to
 
323
      delete the thing the Python object represents, you should use
 
324
      the <TT
 
325
CLASS="FUNCTION"
 
326
><B
 
327
>gimp.delete</B
 
328
></TT
 
329
> procedure.  It deletes the
 
330
      gimp thing associated with the Python object given as a
 
331
      parameter.  If the object is not an image, layer, channel,
 
332
      drawable or display <TT
 
333
CLASS="FUNCTION"
 
334
><B
 
335
>gimp.delete</B
 
336
></TT
 
337
> does
 
338
      nothing.</P
 
339
></DIV
 
340
><DIV
 
341
CLASS="SECT2"
 
342
><H2
 
343
CLASS="SECT2"
 
344
><A
 
345
NAME="CONFIGURATION-INFORMATION"
 
346
>Configuration Information</A
 
347
></H2
 
348
><P
 
349
>There are a number of functions that can be used to gather
 
350
      information about the environment the plugin is running in:</P
 
351
><P
 
352
></P
 
353
><DL
 
354
><DT
 
355
><TT
 
356
CLASS="FUNCTION"
 
357
><B
 
358
>gimp.color_cube</B
 
359
></TT
 
360
>() or
 
361
          <TT
 
362
CLASS="FUNCTION"
 
363
><B
 
364
>gimp.colour_cube</B
 
365
></TT
 
366
>()</DT
 
367
><DD
 
368
><P
 
369
>Returns the current colour cube.</P
 
370
></DD
 
371
><DT
 
372
><TT
 
373
CLASS="FUNCTION"
 
374
><B
 
375
>gimp.gamma</B
 
376
></TT
 
377
>()</DT
 
378
><DD
 
379
><P
 
380
>Returns the current gamma correction.</P
 
381
></DD
 
382
><DT
 
383
><TT
 
384
CLASS="FUNCTION"
 
385
><B
 
386
>gimp.install_cmap</B
 
387
></TT
 
388
>()</DT
 
389
><DD
 
390
><P
 
391
>Returns non-zero if a colour map has been
 
392
            installed.</P
 
393
></DD
 
394
><DT
 
395
><TT
 
396
CLASS="FUNCTION"
 
397
><B
 
398
>gimp.use_xshm</B
 
399
></TT
 
400
>()</DT
 
401
><DD
 
402
><P
 
403
>Returns non-zero if Gimp is using X shared
 
404
            memory.</P
 
405
></DD
 
406
><DT
 
407
><TT
 
408
CLASS="FUNCTION"
 
409
><B
 
410
>gimp.gtkrc</B
 
411
></TT
 
412
>()</DT
 
413
><DD
 
414
><P
 
415
>Returns the file name of the GTK configuration
 
416
            file.</P
 
417
></DD
 
418
></DL
 
419
></DIV
 
420
><DIV
 
421
CLASS="SECT2"
 
422
><H2
 
423
CLASS="SECT2"
 
424
><A
 
425
NAME="PALETTE-OPERATIONS"
 
426
>Palette Operations</A
 
427
></H2
 
428
><P
 
429
>These functions alter the currently selected foreground
 
430
      and background.</P
 
431
><P
 
432
></P
 
433
><DL
 
434
><DT
 
435
><TT
 
436
CLASS="FUNCTION"
 
437
><B
 
438
>gimp.get_background</B
 
439
></TT
 
440
>()</DT
 
441
><DD
 
442
><P
 
443
>Returns a 3-tuple containing the current background
 
444
            colour in RGB form.</P
 
445
></DD
 
446
><DT
 
447
><TT
 
448
CLASS="FUNCTION"
 
449
><B
 
450
>gimp.get_foreground</B
 
451
></TT
 
452
>()</DT
 
453
><DD
 
454
><P
 
455
>Returns a 3-tuple containing the current foreground
 
456
            colour in RGB form.</P
 
457
></DD
 
458
><DT
 
459
><TT
 
460
CLASS="FUNCTION"
 
461
><B
 
462
>gimp.set_background</B
 
463
></TT
 
464
>(<TT
 
465
CLASS="PARAMETER"
 
466
><I
 
467
>r</I
 
468
></TT
 
469
>,
 
470
          <TT
 
471
CLASS="PARAMETER"
 
472
><I
 
473
>g</I
 
474
></TT
 
475
>, <TT
 
476
CLASS="PARAMETER"
 
477
><I
 
478
>b</I
 
479
></TT
 
480
>)</DT
 
481
><DD
 
482
><P
 
483
>Sets the current background colour.  The three
 
484
            arguments can be replaced by a single 3-tuple like that
 
485
            returned by <TT
 
486
CLASS="FUNCTION"
 
487
><B
 
488
>gimp.get_background</B
 
489
></TT
 
490
>.</P
 
491
></DD
 
492
><DT
 
493
><TT
 
494
CLASS="FUNCTION"
 
495
><B
 
496
>gimp.set_foreground</B
 
497
></TT
 
498
>(<TT
 
499
CLASS="PARAMETER"
 
500
><I
 
501
>r</I
 
502
></TT
 
503
>,
 
504
          <TT
 
505
CLASS="PARAMETER"
 
506
><I
 
507
>g</I
 
508
></TT
 
509
>, <TT
 
510
CLASS="PARAMETER"
 
511
><I
 
512
>b</I
 
513
></TT
 
514
>)</DT
 
515
><DD
 
516
><P
 
517
>Sets the current foreground colour.  Like
 
518
            <TT
 
519
CLASS="FUNCTION"
 
520
><B
 
521
>gimp.set_background</B
 
522
></TT
 
523
>, the arguments may
 
524
            be replaced by a 3-tuple.</P
 
525
></DD
 
526
></DL
 
527
></DIV
 
528
><DIV
 
529
CLASS="SECT2"
 
530
><H2
 
531
CLASS="SECT2"
 
532
><A
 
533
NAME="GRADIENT-OPERATIONS"
 
534
>Gradient Operations</A
 
535
></H2
 
536
><P
 
537
>These functions perform operations on gradients:</P
 
538
><P
 
539
></P
 
540
><DL
 
541
><DT
 
542
><TT
 
543
CLASS="FUNCTION"
 
544
><B
 
545
>gimp.gradients_get_active</B
 
546
></TT
 
547
>()</DT
 
548
><DD
 
549
><P
 
550
>Returns the name of the active gradient.</P
 
551
></DD
 
552
><DT
 
553
><TT
 
554
CLASS="FUNCTION"
 
555
><B
 
556
>gimp.gradients_set_active</B
 
557
></TT
 
558
>(<TT
 
559
CLASS="PARAMETER"
 
560
><I
 
561
>name</I
 
562
></TT
 
563
>)</DT
 
564
><DD
 
565
><P
 
566
>Sets the active gradient.</P
 
567
></DD
 
568
><DT
 
569
><TT
 
570
CLASS="FUNCTION"
 
571
><B
 
572
>gimp.gradients_get_list</B
 
573
></TT
 
574
>()</DT
 
575
><DD
 
576
><P
 
577
>Returns a list of the names of the available
 
578
            gradients.</P
 
579
></DD
 
580
><DT
 
581
><TT
 
582
CLASS="FUNCTION"
 
583
><B
 
584
>gimp.gradients_sample_uniform</B
 
585
></TT
 
586
>(<TT
 
587
CLASS="PARAMETER"
 
588
><I
 
589
>num</I
 
590
></TT
 
591
>)</DT
 
592
><DD
 
593
><P
 
594
>Returns a list of <TT
 
595
CLASS="PARAMETER"
 
596
><I
 
597
>num</I
 
598
></TT
 
599
>
 
600
            samples, where samples consist of 4-tuples of floats
 
601
            representing the red, green, blue and alpha values for the
 
602
            sample.</P
 
603
></DD
 
604
><DT
 
605
><TT
 
606
CLASS="FUNCTION"
 
607
><B
 
608
>gimp.gradients_sample_custom</B
 
609
></TT
 
610
>(<TT
 
611
CLASS="PARAMETER"
 
612
><I
 
613
>pos</I
 
614
></TT
 
615
>)</DT
 
616
><DD
 
617
><P
 
618
>Similar to
 
619
            <TT
 
620
CLASS="FUNCTION"
 
621
><B
 
622
>gimp.gradients_sample_uniform</B
 
623
></TT
 
624
>, except
 
625
            the samples are taken at the positions given in the list
 
626
            of floats <TT
 
627
CLASS="PARAMETER"
 
628
><I
 
629
>pos</I
 
630
></TT
 
631
> instead of uniformly
 
632
            through the gradient.</P
 
633
></DD
 
634
></DL
 
635
></DIV
 
636
><DIV
 
637
CLASS="SECT2"
 
638
><H2
 
639
CLASS="SECT2"
 
640
><A
 
641
NAME="PDB-REGISTRATION-FUNCTIONS"
 
642
>PDB Registration Functions</A
 
643
></H2
 
644
><P
 
645
>These functions either install procedures into the PDB or
 
646
      alert gimp to their special use (eg as file handlers).</P
 
647
><P
 
648
>For simple plugins, you will usually only need to use
 
649
      <TT
 
650
CLASS="FUNCTION"
 
651
><B
 
652
>register</B
 
653
></TT
 
654
> from gimpfu.</P
 
655
><P
 
656
></P
 
657
><DL
 
658
><DT
 
659
><TT
 
660
CLASS="FUNCTION"
 
661
><B
 
662
>gimp.install_procedure</B
 
663
></TT
 
664
>(<TT
 
665
CLASS="PARAMETER"
 
666
><I
 
667
>name</I
 
668
></TT
 
669
>,
 
670
          <TT
 
671
CLASS="PARAMETER"
 
672
><I
 
673
>blurb</I
 
674
></TT
 
675
>, <TT
 
676
CLASS="PARAMETER"
 
677
><I
 
678
>help</I
 
679
></TT
 
680
>,
 
681
          <TT
 
682
CLASS="PARAMETER"
 
683
><I
 
684
>author</I
 
685
></TT
 
686
>,
 
687
          <TT
 
688
CLASS="PARAMETER"
 
689
><I
 
690
>copyright</I
 
691
></TT
 
692
>,
 
693
          <TT
 
694
CLASS="PARAMETER"
 
695
><I
 
696
>date</I
 
697
></TT
 
698
>,
 
699
          <TT
 
700
CLASS="PARAMETER"
 
701
><I
 
702
>menu_path</I
 
703
></TT
 
704
>,
 
705
          <TT
 
706
CLASS="PARAMETER"
 
707
><I
 
708
>image_types</I
 
709
></TT
 
710
>,
 
711
          <TT
 
712
CLASS="PARAMETER"
 
713
><I
 
714
>type</I
 
715
></TT
 
716
>, <TT
 
717
CLASS="PARAMETER"
 
718
><I
 
719
>params</I
 
720
></TT
 
721
>,
 
722
          <TT
 
723
CLASS="PARAMETER"
 
724
><I
 
725
>ret_vals</I
 
726
></TT
 
727
>)</DT
 
728
><DD
 
729
><P
 
730
>This procedure is used to install a procedure into
 
731
            the PDB.  The first eight parameters are strings,
 
732
            <TT
 
733
CLASS="PARAMETER"
 
734
><I
 
735
>type</I
 
736
></TT
 
737
> is a one of the
 
738
            <TT
 
739
CLASS="LITERAL"
 
740
>PROC_*</TT
 
741
> constants, and the last two
 
742
            parameters are sequences describing the parameters and
 
743
            return values.  Their format is the same as the param and
 
744
            ret_vals methods or PDB procedures.</P
 
745
></DD
 
746
><DT
 
747
><TT
 
748
CLASS="FUNCTION"
 
749
><B
 
750
>gimp.install_temp_proc</B
 
751
></TT
 
752
>(<TT
 
753
CLASS="PARAMETER"
 
754
><I
 
755
>name</I
 
756
></TT
 
757
>,
 
758
          <TT
 
759
CLASS="PARAMETER"
 
760
><I
 
761
>blurb</I
 
762
></TT
 
763
>, <TT
 
764
CLASS="PARAMETER"
 
765
><I
 
766
>help</I
 
767
></TT
 
768
>,
 
769
          <TT
 
770
CLASS="PARAMETER"
 
771
><I
 
772
>author</I
 
773
></TT
 
774
>,
 
775
          <TT
 
776
CLASS="PARAMETER"
 
777
><I
 
778
>copyright</I
 
779
></TT
 
780
>,
 
781
          <TT
 
782
CLASS="PARAMETER"
 
783
><I
 
784
>date</I
 
785
></TT
 
786
>,
 
787
          <TT
 
788
CLASS="PARAMETER"
 
789
><I
 
790
>menu_path</I
 
791
></TT
 
792
>,
 
793
          <TT
 
794
CLASS="PARAMETER"
 
795
><I
 
796
>image_types</I
 
797
></TT
 
798
>, <TT
 
799
CLASS="PARAMETER"
 
800
><I
 
801
>type,
 
802
          params</I
 
803
></TT
 
804
>, <TT
 
805
CLASS="PARAMETER"
 
806
><I
 
807
>ret_vals</I
 
808
></TT
 
809
>)</DT
 
810
><DD
 
811
><P
 
812
>This procedure is used to install a procedure into
 
813
            the PDB temporarily.  That is, it must be added again
 
814
            every time gimp is run.  This procedure will be called the
 
815
            same way as all other procedures for a plugin.</P
 
816
></DD
 
817
><DT
 
818
><TT
 
819
CLASS="FUNCTION"
 
820
><B
 
821
>gimp.uninstall_temp_proc</B
 
822
></TT
 
823
>(<TT
 
824
CLASS="PARAMETER"
 
825
><I
 
826
>name</I
 
827
></TT
 
828
>)</DT
 
829
><DD
 
830
><P
 
831
>This removes a temporary procedure from the
 
832
            PDB.</P
 
833
></DD
 
834
><DT
 
835
><TT
 
836
CLASS="FUNCTION"
 
837
><B
 
838
>gimp.register_magic_load_handle</B
 
839
></TT
 
840
>r(<TT
 
841
CLASS="PARAMETER"
 
842
><I
 
843
>name</I
 
844
></TT
 
845
>,
 
846
          <TT
 
847
CLASS="PARAMETER"
 
848
><I
 
849
>extensions</I
 
850
></TT
 
851
>,
 
852
          <TT
 
853
CLASS="PARAMETER"
 
854
><I
 
855
>prefixes</I
 
856
></TT
 
857
>,
 
858
          <TT
 
859
CLASS="PARAMETER"
 
860
><I
 
861
>magics</I
 
862
></TT
 
863
>)</DT
 
864
><DD
 
865
><P
 
866
>This procedure tells Gimp that the PDB procedure
 
867
            <TT
 
868
CLASS="PARAMETER"
 
869
><I
 
870
>name</I
 
871
></TT
 
872
> can load files with
 
873
            <TT
 
874
CLASS="PARAMETER"
 
875
><I
 
876
>extensions</I
 
877
></TT
 
878
> and
 
879
            <TT
 
880
CLASS="PARAMETER"
 
881
><I
 
882
>prefixes</I
 
883
></TT
 
884
> (eg http:) with magic
 
885
            information <TT
 
886
CLASS="PARAMETER"
 
887
><I
 
888
>magics</I
 
889
></TT
 
890
>.</P
 
891
></DD
 
892
><DT
 
893
><TT
 
894
CLASS="FUNCTION"
 
895
><B
 
896
>gimp.register_load_handler</B
 
897
></TT
 
898
>(<TT
 
899
CLASS="PARAMETER"
 
900
><I
 
901
>name</I
 
902
></TT
 
903
>,
 
904
          <TT
 
905
CLASS="PARAMETER"
 
906
><I
 
907
>extensions</I
 
908
></TT
 
909
>,
 
910
          <TT
 
911
CLASS="PARAMETER"
 
912
><I
 
913
>prefixes</I
 
914
></TT
 
915
>)</DT
 
916
><DD
 
917
><P
 
918
>This procedure tells Gimp that the PDB procedure
 
919
            <TT
 
920
CLASS="PARAMETER"
 
921
><I
 
922
>name</I
 
923
></TT
 
924
> can load files with
 
925
            <TT
 
926
CLASS="PARAMETER"
 
927
><I
 
928
>extensions</I
 
929
></TT
 
930
> and
 
931
            <TT
 
932
CLASS="PARAMETER"
 
933
><I
 
934
>prefixes</I
 
935
></TT
 
936
> (eg http:).</P
 
937
></DD
 
938
><DT
 
939
><TT
 
940
CLASS="FUNCTION"
 
941
><B
 
942
>gimp.register_save_handler</B
 
943
></TT
 
944
>(<TT
 
945
CLASS="PARAMETER"
 
946
><I
 
947
>name</I
 
948
></TT
 
949
>,
 
950
          <TT
 
951
CLASS="PARAMETER"
 
952
><I
 
953
>extensions</I
 
954
></TT
 
955
>,
 
956
          <TT
 
957
CLASS="PARAMETER"
 
958
><I
 
959
>prefixes</I
 
960
></TT
 
961
>)</DT
 
962
><DD
 
963
><P
 
964
>This procedure tells Gimp that the PDB procedure
 
965
            <TT
 
966
CLASS="PARAMETER"
 
967
><I
 
968
>name</I
 
969
></TT
 
970
> can save files with
 
971
            <TT
 
972
CLASS="PARAMETER"
 
973
><I
 
974
>extensions</I
 
975
></TT
 
976
> and
 
977
            <TT
 
978
CLASS="PARAMETER"
 
979
><I
 
980
>prefixes</I
 
981
></TT
 
982
> (eg http:).</P
 
983
></DD
 
984
></DL
 
985
></DIV
 
986
><DIV
 
987
CLASS="SECT2"
 
988
><H2
 
989
CLASS="SECT2"
 
990
><A
 
991
NAME="OTHER-FUNCTIONS"
 
992
>Other Functions</A
 
993
></H2
 
994
><P
 
995
>These are the other functions in the
 
996
      <TT
 
997
CLASS="FILENAME"
 
998
>gimp</TT
 
999
> module.</P
 
1000
><P
 
1001
></P
 
1002
><DL
 
1003
><DT
 
1004
><TT
 
1005
CLASS="FUNCTION"
 
1006
><B
 
1007
>gimp.main</B
 
1008
></TT
 
1009
>(<TT
 
1010
CLASS="PARAMETER"
 
1011
><I
 
1012
>init_func</I
 
1013
></TT
 
1014
>,
 
1015
          <TT
 
1016
CLASS="PARAMETER"
 
1017
><I
 
1018
>quit_func</I
 
1019
></TT
 
1020
>,
 
1021
          <TT
 
1022
CLASS="PARAMETER"
 
1023
><I
 
1024
>query_func</I
 
1025
></TT
 
1026
>,
 
1027
          <TT
 
1028
CLASS="PARAMETER"
 
1029
><I
 
1030
>run_func</I
 
1031
></TT
 
1032
>)</DT
 
1033
><DD
 
1034
><P
 
1035
>This function is the one that controls the execution
 
1036
            of a Gimp-Python plugin.  It is better to not use this
 
1037
            directly but rather subclass the plugin class, defined in
 
1038
            the <A
 
1039
HREF="support-modules.html#GIMPPLUGIN-MODULE"
 
1040
>the section called <I
 
1041
>The gimpplugin Module</I
 
1042
></A
 
1043
>.</P
 
1044
></DD
 
1045
><DT
 
1046
><TT
 
1047
CLASS="PARAMETER"
 
1048
><I
 
1049
>gimp.pdb</I
 
1050
></TT
 
1051
></DT
 
1052
><DD
 
1053
><P
 
1054
>The procedural database object.</P
 
1055
></DD
 
1056
><DT
 
1057
><TT
 
1058
CLASS="FUNCTION"
 
1059
><B
 
1060
>gimp.progress_init</B
 
1061
></TT
 
1062
>(<TT
 
1063
CLASS="PARAMETER"
 
1064
><I
 
1065
>[label]</I
 
1066
></TT
 
1067
>)</DT
 
1068
><DD
 
1069
><P
 
1070
>(Re)Initialise the progress meter with
 
1071
            <TT
 
1072
CLASS="PARAMETER"
 
1073
><I
 
1074
>label</I
 
1075
></TT
 
1076
> (or the plugin name) as a
 
1077
            label in the window.</P
 
1078
></DD
 
1079
><DT
 
1080
><TT
 
1081
CLASS="FUNCTION"
 
1082
><B
 
1083
>gimp.progress_update</B
 
1084
></TT
 
1085
>(<TT
 
1086
CLASS="PARAMETER"
 
1087
><I
 
1088
>percnt</I
 
1089
></TT
 
1090
>)</DT
 
1091
><DD
 
1092
><P
 
1093
>Set the progress meter to
 
1094
            <TT
 
1095
CLASS="PARAMETER"
 
1096
><I
 
1097
>percnt</I
 
1098
></TT
 
1099
> done.</P
 
1100
></DD
 
1101
><DT
 
1102
><TT
 
1103
CLASS="FUNCTION"
 
1104
><B
 
1105
>gimp.query_images</B
 
1106
></TT
 
1107
>()</DT
 
1108
><DD
 
1109
><P
 
1110
>Returns a list of all the image objects.</P
 
1111
></DD
 
1112
><DT
 
1113
><TT
 
1114
CLASS="FUNCTION"
 
1115
><B
 
1116
>gimp.quit</B
 
1117
></TT
 
1118
>()</DT
 
1119
><DD
 
1120
><P
 
1121
>Stops execution imediately and exits.</P
 
1122
></DD
 
1123
><DT
 
1124
><TT
 
1125
CLASS="FUNCTION"
 
1126
><B
 
1127
>gimp.displays_flush</B
 
1128
></TT
 
1129
>()</DT
 
1130
><DD
 
1131
><P
 
1132
>Update all the display windows.</P
 
1133
></DD
 
1134
><DT
 
1135
><TT
 
1136
CLASS="FUNCTION"
 
1137
><B
 
1138
>gimp.tile_width</B
 
1139
></TT
 
1140
>()</DT
 
1141
><DD
 
1142
><P
 
1143
>The maximum width of a tile.</P
 
1144
></DD
 
1145
><DT
 
1146
><TT
 
1147
CLASS="FUNCTION"
 
1148
><B
 
1149
>gimp.tile_height</B
 
1150
></TT
 
1151
>()</DT
 
1152
><DD
 
1153
><P
 
1154
>The maximum height of a tile.</P
 
1155
></DD
 
1156
><DT
 
1157
><TT
 
1158
CLASS="FUNCTION"
 
1159
><B
 
1160
>gimp.tile_cache_size</B
 
1161
></TT
 
1162
>(<TT
 
1163
CLASS="PARAMETER"
 
1164
><I
 
1165
>kb</I
 
1166
></TT
 
1167
>)</DT
 
1168
><DD
 
1169
><P
 
1170
>Set the size of the tile cache in kilobytes.</P
 
1171
></DD
 
1172
><DT
 
1173
><TT
 
1174
CLASS="FUNCTION"
 
1175
><B
 
1176
>gimp.tile_cache_ntiles</B
 
1177
></TT
 
1178
>(<TT
 
1179
CLASS="PARAMETER"
 
1180
><I
 
1181
>n</I
 
1182
></TT
 
1183
>)</DT
 
1184
><DD
 
1185
><P
 
1186
>Set the size of the tile cache in tiles.</P
 
1187
></DD
 
1188
><DT
 
1189
><TT
 
1190
CLASS="FUNCTION"
 
1191
><B
 
1192
>gimp.get_data</B
 
1193
></TT
 
1194
>(<TT
 
1195
CLASS="PARAMETER"
 
1196
><I
 
1197
>key</I
 
1198
></TT
 
1199
>)</DT
 
1200
><DD
 
1201
><P
 
1202
>Get the information associated with
 
1203
            <TT
 
1204
CLASS="PARAMETER"
 
1205
><I
 
1206
>key</I
 
1207
></TT
 
1208
>.  The data will be a string.
 
1209
            This function should probably be used through the <A
 
1210
HREF="support-modules.html#GIMPSHELF-MODULE"
 
1211
>the section called <I
 
1212
>The gimpshelf Module</I
 
1213
></A
 
1214
>.</P
 
1215
></DD
 
1216
><DT
 
1217
><TT
 
1218
CLASS="FUNCTION"
 
1219
><B
 
1220
>gimp.set_data</B
 
1221
></TT
 
1222
>(<TT
 
1223
CLASS="PARAMETER"
 
1224
><I
 
1225
>key</I
 
1226
></TT
 
1227
>,
 
1228
          <TT
 
1229
CLASS="PARAMETER"
 
1230
><I
 
1231
>data</I
 
1232
></TT
 
1233
>)</DT
 
1234
><DD
 
1235
><P
 
1236
>Set the information in the string
 
1237
            <TT
 
1238
CLASS="PARAMETER"
 
1239
><I
 
1240
>data</I
 
1241
></TT
 
1242
> with
 
1243
            <TT
 
1244
CLASS="PARAMETER"
 
1245
><I
 
1246
>key</I
 
1247
></TT
 
1248
>.  The data will persist for the
 
1249
            whole gimp session.  Rather than directly accessing this
 
1250
            function, it is better to go through the <A
 
1251
HREF="support-modules.html#GIMPSHELF-MODULE"
 
1252
>the section called <I
 
1253
>The gimpshelf Module</I
 
1254
></A
 
1255
>.</P
 
1256
></DD
 
1257
><DT
 
1258
><TT
 
1259
CLASS="FUNCTION"
 
1260
><B
 
1261
>gimp.extension_ack</B
 
1262
></TT
 
1263
>()</DT
 
1264
><DD
 
1265
><P
 
1266
>Tells gimp that the plugin has finished its work,
 
1267
            while keeping the plugin connection open.  This is used by
 
1268
            an extension plugin to tell gimp it can continue, while
 
1269
            leaving the plugin connection open.  This is what the
 
1270
            script-fu plugin does so that only one scheme interpretter
 
1271
            is needed.</P
 
1272
></DD
 
1273
><DT
 
1274
><TT
 
1275
CLASS="FUNCTION"
 
1276
><B
 
1277
>gimp.extension_process</B
 
1278
></TT
 
1279
>(<TT
 
1280
CLASS="PARAMETER"
 
1281
><I
 
1282
>timeout</I
 
1283
></TT
 
1284
>)</DT
 
1285
><DD
 
1286
><P
 
1287
>Makes the plugin check for messages from gimp.
 
1288
            generally this is not needed, as messages are checked
 
1289
            during most calls in the gimp module.</P
 
1290
></DD
 
1291
></DL
 
1292
></DIV
 
1293
><DIV
 
1294
CLASS="SECT2"
 
1295
><H2
 
1296
CLASS="SECT2"
 
1297
><A
 
1298
NAME="PARASITES"
 
1299
>Parasites</A
 
1300
></H2
 
1301
><P
 
1302
>In gimp &#62;= 1.1, it is possible to attach arbitrary data to
 
1303
      an image through the use of parasites.  Parasites are simply
 
1304
      wrappers for the data, containing its name and some flags.
 
1305
      Parasites have the following parameters:</P
 
1306
><P
 
1307
></P
 
1308
><DL
 
1309
><DT
 
1310
>data</DT
 
1311
><DD
 
1312
><P
 
1313
>The data for the parasite -- a string</P
 
1314
></DD
 
1315
><DT
 
1316
>flags</DT
 
1317
><DD
 
1318
><P
 
1319
>The flags for the parasite</P
 
1320
></DD
 
1321
><DT
 
1322
>is_persistent</DT
 
1323
><DD
 
1324
><P
 
1325
>True if this parasite is persistent</P
 
1326
></DD
 
1327
><DT
 
1328
>is_undoable</DT
 
1329
><DD
 
1330
><P
 
1331
>True if this parasite is undoable</P
 
1332
></DD
 
1333
><DT
 
1334
>name</DT
 
1335
><DD
 
1336
><P
 
1337
>The name of the parasite</P
 
1338
></DD
 
1339
></DL
 
1340
><P
 
1341
>Parasites also have the methods <TT
 
1342
CLASS="FUNCTION"
 
1343
><B
 
1344
>copy</B
 
1345
></TT
 
1346
>,
 
1347
      <TT
 
1348
CLASS="FUNCTION"
 
1349
><B
 
1350
>is_type</B
 
1351
></TT
 
1352
> and
 
1353
      <TT
 
1354
CLASS="FUNCTION"
 
1355
><B
 
1356
>has_flag</B
 
1357
></TT
 
1358
>.</P
 
1359
><P
 
1360
>There is a set of four functions that are used to
 
1361
      manipulate parasites.  They exist as functions in the
 
1362
      <TT
 
1363
CLASS="FILENAME"
 
1364
>gimp</TT
 
1365
> module, and methods for image and
 
1366
      drawable objects.  They are:</P
 
1367
><P
 
1368
></P
 
1369
><DL
 
1370
><DT
 
1371
><TT
 
1372
CLASS="FUNCTION"
 
1373
><B
 
1374
>parasite_find</B
 
1375
></TT
 
1376
>(<TT
 
1377
CLASS="PARAMETER"
 
1378
><I
 
1379
>name</I
 
1380
></TT
 
1381
>)</DT
 
1382
><DD
 
1383
><P
 
1384
>find a parasite by its name.</P
 
1385
></DD
 
1386
><DT
 
1387
><TT
 
1388
CLASS="FUNCTION"
 
1389
><B
 
1390
>parasite_attach</B
 
1391
></TT
 
1392
>(<TT
 
1393
CLASS="PARAMETER"
 
1394
><I
 
1395
>parasite</I
 
1396
></TT
 
1397
>)</DT
 
1398
><DD
 
1399
><P
 
1400
>Attach a parasite to this object.</P
 
1401
></DD
 
1402
><DT
 
1403
><TT
 
1404
CLASS="FUNCTION"
 
1405
><B
 
1406
>attach_new_parasite</B
 
1407
></TT
 
1408
>(<TT
 
1409
CLASS="PARAMETER"
 
1410
><I
 
1411
>name</I
 
1412
></TT
 
1413
>, <TT
 
1414
CLASS="PARAMETER"
 
1415
><I
 
1416
>flags</I
 
1417
></TT
 
1418
>, <TT
 
1419
CLASS="PARAMETER"
 
1420
><I
 
1421
>data</I
 
1422
></TT
 
1423
>)</DT
 
1424
><DD
 
1425
><P
 
1426
>Create a new parasite and attach it.</P
 
1427
></DD
 
1428
><DT
 
1429
><TT
 
1430
CLASS="FUNCTION"
 
1431
><B
 
1432
>parasite_detach</B
 
1433
></TT
 
1434
>(<TT
 
1435
CLASS="PARAMETER"
 
1436
><I
 
1437
>name</I
 
1438
></TT
 
1439
>)</DT
 
1440
><DD
 
1441
><P
 
1442
>Detach the named parasite</P
 
1443
></DD
 
1444
></DL
 
1445
></DIV
 
1446
></DIV
 
1447
><DIV
 
1448
CLASS="NAVFOOTER"
 
1449
><HR
 
1450
ALIGN="LEFT"
 
1451
WIDTH="100%"><TABLE
 
1452
WIDTH="100%"
 
1453
BORDER="0"
 
1454
CELLPADDING="0"
 
1455
CELLSPACING="0"
 
1456
><TR
 
1457
><TD
 
1458
WIDTH="33%"
 
1459
ALIGN="left"
 
1460
VALIGN="top"
 
1461
><A
 
1462
HREF="procedural-database.html"
 
1463
>Prev</A
 
1464
></TD
 
1465
><TD
 
1466
WIDTH="34%"
 
1467
ALIGN="center"
 
1468
VALIGN="top"
 
1469
><A
 
1470
HREF="pygimp.html"
 
1471
>Home</A
 
1472
></TD
 
1473
><TD
 
1474
WIDTH="33%"
 
1475
ALIGN="right"
 
1476
VALIGN="top"
 
1477
><A
 
1478
HREF="gimp-objects.html"
 
1479
>Next</A
 
1480
></TD
 
1481
></TR
 
1482
><TR
 
1483
><TD
 
1484
WIDTH="33%"
 
1485
ALIGN="left"
 
1486
VALIGN="top"
 
1487
>The Procedural Database</TD
 
1488
><TD
 
1489
WIDTH="34%"
 
1490
ALIGN="center"
 
1491
VALIGN="top"
 
1492
>&nbsp;</TD
 
1493
><TD
 
1494
WIDTH="33%"
 
1495
ALIGN="right"
 
1496
VALIGN="top"
 
1497
>Gimp Objects</TD
 
1498
></TR
 
1499
></TABLE
 
1500
></DIV
 
1501
></BODY
 
1502
></HTML
 
1503
>
 
 
b'\\ No newline at end of file'