~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/t-o-p-logo.scm

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
;; Version 0.2
5
5
 
6
6
(define (apply-t-o-p-logo-effect img
7
 
                                 logo-layer
8
 
                                 b-size
9
 
                                 hit-rate
10
 
                                 edge-size
11
 
                                 edge-only
12
 
                                 base-color
13
 
                                 bg-color)
14
 
  (let* ((width (car (gimp-drawable-width logo-layer)))
15
 
         (height (car (gimp-drawable-height logo-layer)))
16
 
         (logo-layer-mask (car (gimp-layer-create-mask logo-layer ADD-BLACK-MASK)))
17
 
         (sparkle-layer (car (gimp-layer-new img width height RGBA-IMAGE "Sparkle" 100 NORMAL-MODE)))
18
 
         (shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Shadow" 90 ADDITION-MODE)))
19
 
         (bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
20
 
         (selection 0)
21
 
         (white '(255 255 255)))
 
7
                                 logo-layer
 
8
                                 b-size
 
9
                                 hit-rate
 
10
                                 edge-size
 
11
                                 edge-only
 
12
                                 base-color
 
13
                                 bg-color)
 
14
  (let* (
 
15
        (width (car (gimp-drawable-width logo-layer)))
 
16
        (height (car (gimp-drawable-height logo-layer)))
 
17
        (logo-layer-mask (car (gimp-layer-create-mask logo-layer ADD-BLACK-MASK)))
 
18
        (sparkle-layer (car (gimp-layer-new img width height RGBA-IMAGE "Sparkle" 100 NORMAL-MODE)))
 
19
        (shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Shadow" 90 ADDITION-MODE)))
 
20
        (bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
 
21
        (selection 0)
 
22
        (white '(255 255 255))
 
23
        )
22
24
 
23
25
    (gimp-context-push)
24
26
 
35
37
    (set! selection (car (gimp-selection-save img)))
36
38
    (gimp-selection-grow img edge-size)
37
39
    (plug-in-noisify 1 img sparkle-layer FALSE
38
 
                     (* 0.1 hit-rate) (* 0.1 hit-rate) (* 0.1 hit-rate) 0.0)
 
40
                     (* 0.1 hit-rate) (* 0.1 hit-rate) (* 0.1 hit-rate) 0.0)
39
41
    (gimp-selection-border img edge-size)
40
42
    (plug-in-noisify 1 img sparkle-layer FALSE hit-rate hit-rate hit-rate 0.0)
41
43
    (gimp-selection-none img)
51
53
    (gimp-selection-invert img)
52
54
    (gimp-edit-clear sparkle-layer)
53
55
    (if (= edge-only TRUE)
54
 
        (begin
55
 
          (gimp-selection-load selection)
56
 
          (gimp-selection-shrink img (/ edge-size 2.0))
57
 
          (gimp-edit-clear sparkle-layer)
58
 
          (gimp-selection-load selection)
59
 
          (gimp-selection-grow img (/ edge-size 2.0))
60
 
          (gimp-selection-invert img)))
 
56
        (begin
 
57
          (gimp-selection-load selection)
 
58
          (gimp-selection-shrink img (/ edge-size 2.0))
 
59
          (gimp-edit-clear sparkle-layer)
 
60
          (gimp-selection-load selection)
 
61
          (gimp-selection-grow img (/ edge-size 2.0))
 
62
          (gimp-selection-invert img)))
61
63
    (gimp-context-set-foreground '(0 0 0))
62
64
    (gimp-context-set-background '(255 255 255))
63
65
    (gimp-context-set-brush "Circle Fuzzy (11)")
73
75
    (gimp-drawable-set-visible logo-layer 0)
74
76
    (gimp-image-set-active-layer img sparkle-layer)
75
77
 
76
 
    (gimp-context-pop)))
 
78
    (gimp-context-pop)
 
79
  )
 
80
)
77
81
 
78
82
 
79
83
(define (script-fu-t-o-p-logo-alpha img
80
 
                                    logo-layer
81
 
                                    b-size
82
 
                                    hit-rate
83
 
                                    edge-size
84
 
                                    edge-only
85
 
                                    base-color
86
 
                                    bg-color)
 
84
                                    logo-layer
 
85
                                    b-size
 
86
                                    hit-rate
 
87
                                    edge-size
 
88
                                    edge-only
 
89
                                    base-color
 
90
                                    bg-color)
87
91
  (begin
88
92
    (gimp-image-undo-group-start img)
89
93
    (apply-t-o-p-logo-effect img logo-layer b-size hit-rate
90
 
                             edge-size edge-only base-color bg-color)
 
94
                             edge-size edge-only base-color bg-color)
91
95
    (gimp-image-undo-group-end img)
92
 
    (gimp-displays-flush)))
 
96
    (gimp-displays-flush)
 
97
  )
 
98
)
93
99
 
94
100
(script-fu-register "script-fu-t-o-p-logo-alpha"
95
 
                    _"_Particle Trace..."
96
 
                    "Trace of Particles Effect"
97
 
                    "Shuji Narazaki (narazaki@InetQ.or.jp)"
98
 
                    "Shuji Narazaki"
99
 
                    "1997"
100
 
                    "RGBA"
101
 
                    SF-IMAGE       "Image"                0
102
 
                    SF-DRAWABLE    "Drawable"             0
103
 
                    SF-ADJUSTMENT _"Border size (pixels)" '(20 1 200 1 10 0 1)
104
 
                    SF-ADJUSTMENT _"Hit rate"             '(0.2 0 1 .01 .01 2 0)
105
 
                    SF-ADJUSTMENT _"Edge width"           '(2 0 128 1 1 0 0)
106
 
                    SF-TOGGLE     _"Edge only"            FALSE
107
 
                    SF-COLOR      _"Base color"           '(0 40 0)
108
 
                    SF-COLOR      _"Background color"     '(255 255 255))
 
101
  _"_Particle Trace..."
 
102
  _"Add a Trace of Particles effect to the selected region (or alpha)"
 
103
  "Shuji Narazaki (narazaki@InetQ.or.jp)"
 
104
  "Shuji Narazaki"
 
105
  "1997"
 
106
  "RGBA"
 
107
  SF-IMAGE      "Image"                 0
 
108
  SF-DRAWABLE   "Drawable"              0
 
109
  SF-ADJUSTMENT _"Border size (pixels)" '(20 1 200 1 10 0 1)
 
110
  SF-ADJUSTMENT _"Hit rate"             '(0.2 0 1 .01 .01 2 0)
 
111
  SF-ADJUSTMENT _"Edge width"           '(2 0 128 1 1 0 0)
 
112
  SF-TOGGLE     _"Edge only"            FALSE
 
113
  SF-COLOR      _"Base color"           '(0 40 0)
 
114
  SF-COLOR      _"Background color"     "white"
 
115
)
109
116
 
110
117
(script-fu-menu-register "script-fu-t-o-p-logo-alpha"
111
 
                         _"<Image>/Script-Fu/Alpha to Logo")
 
118
                         "<Image>/Filters/Alpha to Logo")
112
119
 
113
120
 
114
121
(define (script-fu-t-o-p-logo text
115
 
                              size
116
 
                              fontname
117
 
                              hit-rate
118
 
                              edge-size
119
 
                              edge-only
120
 
                              base-color
121
 
                              bg-color)
 
122
                              size
 
123
                              fontname
 
124
                              hit-rate
 
125
                              edge-size
 
126
                              edge-only
 
127
                              base-color
 
128
                              bg-color)
122
129
  (let* ((img (car (gimp-image-new 256 256 RGB)))
123
 
         (border (/ size 5))
124
 
         (text-layer (car (gimp-text-fontname img -1 0 0 text (* border 2) TRUE size PIXELS fontname))))
 
130
         (border (/ size 5))
 
131
         (text-layer (car (gimp-text-fontname img -1 0 0 text (* border 2) TRUE size PIXELS fontname))))
125
132
    (gimp-image-undo-disable img)
126
 
    (gimp-drawable-set-name text-layer text)
127
133
    (apply-t-o-p-logo-effect img text-layer border hit-rate
128
 
                             edge-size edge-only base-color bg-color)
 
134
                             edge-size edge-only base-color bg-color)
129
135
    (gimp-image-undo-enable img)
130
 
    (gimp-display-new img)))
 
136
    (gimp-display-new img)
 
137
  )
 
138
)
131
139
 
132
140
(script-fu-register "script-fu-t-o-p-logo"
133
 
                    _"_Particle Trace..."
134
 
                    "Trace of Particles Effect"
135
 
                    "Shuji Narazaki (narazaki@InetQ.or.jp)"
136
 
                    "Shuji Narazaki"
137
 
                    "1997"
138
 
                    ""
139
 
                    SF-STRING     _"Text"               "The GIMP"
140
 
                    SF-ADJUSTMENT _"Font size (pixels)" '(100 1 1000 1 10 0 1)
141
 
                    SF-FONT       _"Font"               "Becker"
142
 
                    SF-ADJUSTMENT _"Hit rate"           '(0.2 0 1 .01 .01 2 0)
143
 
                    SF-ADJUSTMENT _"Edge width"         '(2 0 128 1 1 0 0)
144
 
                    SF-TOGGLE     _"Edge only"          FALSE
145
 
                    SF-COLOR      _"Base color"         '(0 40 0)
146
 
                    SF-COLOR      _"Background color"   '(255 255 255))
 
141
  _"_Particle Trace..."
 
142
  _"Create a logo using a Trace Of Particles effect"
 
143
  "Shuji Narazaki (narazaki@InetQ.or.jp)"
 
144
  "Shuji Narazaki"
 
145
  "1997"
 
146
  ""
 
147
  SF-STRING     _"Text"               "GIMP"
 
148
  SF-ADJUSTMENT _"Font size (pixels)" '(100 1 1000 1 10 0 1)
 
149
  SF-FONT       _"Font"               "Becker"
 
150
  SF-ADJUSTMENT _"Hit rate"           '(0.2 0 1 .01 .01 2 0)
 
151
  SF-ADJUSTMENT _"Edge width"         '(2 0 128 1 1 0 0)
 
152
  SF-TOGGLE     _"Edge only"          FALSE
 
153
  SF-COLOR      _"Base color"         '(0 40 0)
 
154
  SF-COLOR      _"Background color"   "white"
 
155
)
147
156
 
148
157
(script-fu-menu-register "script-fu-t-o-p-logo"
149
 
                         _"<Toolbox>/Xtns/Script-Fu/Logos")
 
158
                         "<Toolbox>/Xtns/Logos")