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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/3d-outline.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:
1
1
; 3d-outlined-patterned-shadowed-and-bump-mapped-logo :)
2
2
; creates outlined border of a text with patterns
3
3
;
4
 
; The GIMP -- an image manipulation program
 
4
; GIMP - The GNU Image Manipulation Program
5
5
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
6
6
;
7
7
; 3d-outline creates outlined border of a text with patterns
22
22
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
23
 
24
24
(define (apply-3d-outline-logo-effect img
25
 
                                      logo-layer
26
 
                                      text-pattern
27
 
                                      outline-blur-radius
28
 
                                      shadow-blur-radius
29
 
                                      bump-map-blur-radius
30
 
                                      noninteractive
31
 
                                      s-offset-x
32
 
                                      s-offset-y)
33
 
  (let* ((width (car (gimp-drawable-width logo-layer)))
34
 
         (height (car (gimp-drawable-height logo-layer)))
35
 
         (bg-layer (car (gimp-layer-new img width height
36
 
                                        RGB-IMAGE "Background" 100 NORMAL-MODE)))
37
 
         (pattern (car (gimp-layer-new img width height
38
 
                                       RGBA-IMAGE "Pattern" 100 NORMAL-MODE)))
39
 
         (layer2)
40
 
         (layer3)
41
 
         (pattern-mask)
42
 
         (floating-sel))
 
25
                                      logo-layer
 
26
                                      text-pattern
 
27
                                      outline-blur-radius
 
28
                                      shadow-blur-radius
 
29
                                      bump-map-blur-radius
 
30
                                      noninteractive
 
31
                                      s-offset-x
 
32
                                      s-offset-y)
 
33
  (let* (
 
34
        (width (car (gimp-drawable-width logo-layer)))
 
35
        (height (car (gimp-drawable-height logo-layer)))
 
36
        (bg-layer (car (gimp-layer-new img width height
 
37
                                       RGB-IMAGE "Background" 100 NORMAL-MODE)))
 
38
        (pattern (car (gimp-layer-new img width height
 
39
                                      RGBA-IMAGE "Pattern" 100 NORMAL-MODE)))
 
40
        (layer2)
 
41
        (layer3)
 
42
        (pattern-mask)
 
43
        (floating-sel)
 
44
        )
43
45
 
44
46
    (gimp-context-push)
45
47
 
50
52
    (gimp-context-set-background '(255 255 255))
51
53
    (gimp-edit-fill bg-layer BACKGROUND-FILL)
52
54
    (gimp-edit-clear pattern)
53
 
    (gimp-layer-set-preserve-trans logo-layer TRUE)
 
55
    (gimp-layer-set-lock-alpha logo-layer TRUE)
54
56
    (gimp-context-set-foreground '(0 0 0))
55
57
    (gimp-edit-fill logo-layer FOREGROUND-FILL)
56
 
    (gimp-layer-set-preserve-trans logo-layer FALSE)
 
58
    (gimp-layer-set-lock-alpha logo-layer FALSE)
57
59
    (plug-in-gauss-iir 1 img logo-layer outline-blur-radius TRUE TRUE)
58
60
 
59
61
    (gimp-drawable-set-visible pattern FALSE)
66
68
    (gimp-selection-all img)
67
69
    (gimp-context-set-pattern text-pattern)
68
70
    (gimp-edit-bucket-fill pattern
69
 
                           PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
 
71
                           PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
70
72
    (plug-in-bump-map noninteractive img pattern layer2
71
 
                      110.0 45.0 4 0 0 0 0 TRUE FALSE 0)
 
73
                      110.0 45.0 4 0 0 0 0 TRUE FALSE 0)
72
74
 
73
75
    (set! pattern-mask (car (gimp-layer-create-mask pattern ADD-ALPHA-MASK)))
74
76
    (gimp-layer-add-mask pattern pattern-mask)
88
90
    (gimp-drawable-set-visible pattern TRUE)
89
91
    ;;(set! final (car (gimp-image-flatten img)))
90
92
 
91
 
    (gimp-context-pop)))
 
93
    (gimp-context-pop)
 
94
  )
 
95
)
92
96
 
93
97
(define (script-fu-3d-outline-logo-alpha img
94
 
                                         logo-layer
95
 
                                         text-pattern
96
 
                                         outline-blur-radius
97
 
                                         shadow-blur-radius
98
 
                                         bump-map-blur-radius
99
 
                                         noninteractive
100
 
                                         s-offset-x
101
 
                                         s-offset-y)
 
98
                                         logo-layer
 
99
                                         text-pattern
 
100
                                         outline-blur-radius
 
101
                                         shadow-blur-radius
 
102
                                         bump-map-blur-radius
 
103
                                         noninteractive
 
104
                                         s-offset-x
 
105
                                         s-offset-y)
102
106
  (begin
103
107
    (gimp-image-undo-group-start img)
104
108
    (apply-3d-outline-logo-effect img logo-layer text-pattern
105
 
                                  outline-blur-radius shadow-blur-radius
106
 
                                  bump-map-blur-radius noninteractive
107
 
                                  s-offset-x s-offset-y)
 
109
                                  outline-blur-radius shadow-blur-radius
 
110
                                  bump-map-blur-radius noninteractive
 
111
                                  s-offset-x s-offset-y)
108
112
    (gimp-image-undo-group-end img)
109
 
    (gimp-displays-flush)))
 
113
    (gimp-displays-flush)
 
114
  )
 
115
)
110
116
 
111
117
(script-fu-register "script-fu-3d-outline-logo-alpha"
112
 
                    _"3D _Outline..."
113
 
                    "Creates outlined texts with drop shadow"
114
 
                    "Hrvoje Horvat (hhorvat@open.hr)"
115
 
                    "Hrvoje Horvat"
116
 
                    "07 April, 1998"
117
 
                    "RGBA"
118
 
                    SF-IMAGE       "Image"               0
119
 
                    SF-DRAWABLE    "Drawable"            0
120
 
                    SF-PATTERN    _"Pattern"             "Parque #1"
121
 
                    SF-ADJUSTMENT _"Outline blur radius" '(5 1 200 1 10 0 1)
122
 
                    SF-ADJUSTMENT _"Shadow blur radius"  '(10 1 200 1 10 0 1)
123
 
                    SF-ADJUSTMENT _"Bumpmap (alpha layer) blur radius" '(5 1 200 1 10 0 1)
124
 
                    SF-TOGGLE     _"Default bumpmap settings" TRUE
125
 
                    SF-ADJUSTMENT _"Shadow X offset"     '(0 0 200 1 5 0 1)
126
 
                    SF-ADJUSTMENT _"Shadow Y offset"     '(0 0 200 1 5 0 1))
 
118
  _"3D _Outline..."
 
119
  _"Outline the selected region (or alpha) with a pattern and add a drop shadow"
 
120
  "Hrvoje Horvat (hhorvat@open.hr)"
 
121
  "Hrvoje Horvat"
 
122
  "07 April, 1998"
 
123
  "RGBA"
 
124
  SF-IMAGE       "Image"               0
 
125
  SF-DRAWABLE    "Drawable"            0
 
126
  SF-PATTERN    _"Pattern"             "Parque #1"
 
127
  SF-ADJUSTMENT _"Outline blur radius" '(5 1 200 1 10 0 1)
 
128
  SF-ADJUSTMENT _"Shadow blur radius"  '(10 1 200 1 10 0 1)
 
129
  SF-ADJUSTMENT _"Bumpmap (alpha layer) blur radius" '(5 1 200 1 10 0 1)
 
130
  SF-TOGGLE     _"Default bumpmap settings" TRUE
 
131
  SF-ADJUSTMENT _"Shadow X offset"     '(0 0 200 1 5 0 1)
 
132
  SF-ADJUSTMENT _"Shadow Y offset"     '(0 0 200 1 5 0 1)
 
133
)
127
134
 
128
135
(script-fu-menu-register "script-fu-3d-outline-logo-alpha"
129
 
                         _"<Image>/Script-Fu/Alpha to Logo")
 
136
                         "<Image>/Filters/Alpha to Logo")
130
137
 
131
138
 
132
139
(define (script-fu-3d-outline-logo text-pattern
133
 
                                   text
134
 
                                   size
135
 
                                   font
136
 
                                   outline-blur-radius
137
 
                                   shadow-blur-radius
138
 
                                   bump-map-blur-radius
139
 
                                   noninteractive
140
 
                                   s-offset-x
141
 
                                   s-offset-y)
142
 
  (let* ((img (car (gimp-image-new 256 256 RGB)))
143
 
         (text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font))))
 
140
                                   text
 
141
                                   size
 
142
                                   font
 
143
                                   outline-blur-radius
 
144
                                   shadow-blur-radius
 
145
                                   bump-map-blur-radius
 
146
                                   noninteractive
 
147
                                   s-offset-x
 
148
                                   s-offset-y)
 
149
  (let* (
 
150
        (img (car (gimp-image-new 256 256 RGB)))
 
151
        (text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font)))
 
152
        )
144
153
    (gimp-image-undo-disable img)
145
154
    (apply-3d-outline-logo-effect img text-layer text-pattern
146
 
                                  outline-blur-radius shadow-blur-radius
147
 
                                  bump-map-blur-radius noninteractive
148
 
                                  s-offset-x s-offset-y)
 
155
                                  outline-blur-radius shadow-blur-radius
 
156
                                  bump-map-blur-radius noninteractive
 
157
                                  s-offset-x s-offset-y)
149
158
    (gimp-image-undo-enable img)
150
 
    (gimp-display-new img)))
 
159
    (gimp-display-new img)
 
160
  )
 
161
)
151
162
 
152
163
(script-fu-register "script-fu-3d-outline-logo"
153
 
                    _"3D _Outline..."
154
 
                    "Creates outlined texts with drop shadow"
155
 
                    "Hrvoje Horvat (hhorvat@open.hr)"
156
 
                    "Hrvoje Horvat"
157
 
                    "07 April, 1998"
158
 
                    ""
159
 
                    SF-PATTERN    _"Pattern"             "Parque #1"
160
 
                    SF-STRING     _"Text"                "The Gimp"
161
 
                    SF-ADJUSTMENT _"Font size (pixels)"  '(100 2 1000 1 10 0 1)
162
 
                    SF-FONT       _"Font"                "RoostHeavy"
163
 
                    SF-ADJUSTMENT _"Outline blur radius" '(5 1 200 1 10 0 1)
164
 
                    SF-ADJUSTMENT _"Shadow blur radius"  '(10 1 200 1 10 0 1)
165
 
                    SF-ADJUSTMENT _"Bumpmap (alpha layer) blur radius" '(5 1 200 1 10 0 1)
166
 
                    SF-TOGGLE     _"Default bumpmap settings" TRUE
167
 
                    SF-ADJUSTMENT _"Shadow X offset"     '(0 0 200 1 5 0 1)
168
 
                    SF-ADJUSTMENT _"Shadow Y offset"     '(0 0 200 1 5 0 1))
 
164
  _"3D _Outline..."
 
165
  _"Create a logo with outlined text and a drop shadow"
 
166
  "Hrvoje Horvat (hhorvat@open.hr)"
 
167
  "Hrvoje Horvat"
 
168
  "07 April, 1998"
 
169
  ""
 
170
  SF-PATTERN    _"Pattern"             "Parque #1"
 
171
  SF-STRING     _"Text"                "GIMP"
 
172
  SF-ADJUSTMENT _"Font size (pixels)"  '(100 2 1000 1 10 0 1)
 
173
  SF-FONT       _"Font"                "RoostHeavy"
 
174
  SF-ADJUSTMENT _"Outline blur radius" '(5 1 200 1 10 0 1)
 
175
  SF-ADJUSTMENT _"Shadow blur radius"  '(10 1 200 1 10 0 1)
 
176
  SF-ADJUSTMENT _"Bumpmap (alpha layer) blur radius" '(5 1 200 1 10 0 1)
 
177
  SF-TOGGLE     _"Default bumpmap settings" TRUE
 
178
  SF-ADJUSTMENT _"Shadow X offset"     '(0 0 200 1 5 0 1)
 
179
  SF-ADJUSTMENT _"Shadow Y offset"     '(0 0 200 1 5 0 1)
 
180
)
169
181
 
170
182
(script-fu-menu-register "script-fu-3d-outline-logo"
171
 
                         _"<Toolbox>/Xtns/Script-Fu/Logos")
 
183
                         "<Toolbox>/Xtns/Logos")