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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/alien-glow-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:
2
2
;  Create a text effect that simulates an eerie alien glow around text
3
3
 
4
4
(define (apply-alien-glow-logo-effect img
5
 
                                      logo-layer
6
 
                                      size
7
 
                                      glow-color)
8
 
  (let* ((border (/ size 4))
9
 
         (grow (/ size 30))
10
 
         (feather (/ size 4))
11
 
         (width (car (gimp-drawable-width logo-layer)))
12
 
         (height (car (gimp-drawable-height logo-layer)))
13
 
         (bg-layer (car (gimp-layer-new img
14
 
                                        width height RGB-IMAGE
15
 
                                        "Background" 100 NORMAL-MODE)))
16
 
         (glow-layer (car (gimp-layer-new img
17
 
                                          width height RGBA-IMAGE
18
 
                                          "Alien Glow" 100 NORMAL-MODE))))
 
5
                                      logo-layer
 
6
                                      size
 
7
                                      glow-color)
 
8
  (let* (
 
9
        (border (/ size 4))
 
10
        (grow (/ size 30))
 
11
        (feather (/ size 4))
 
12
        (width (car (gimp-drawable-width logo-layer)))
 
13
        (height (car (gimp-drawable-height logo-layer)))
 
14
        (bg-layer (car (gimp-layer-new img
 
15
                                       width height RGB-IMAGE
 
16
                                       "Background" 100 NORMAL-MODE)))
 
17
        (glow-layer (car (gimp-layer-new img
 
18
                                         width height RGBA-IMAGE
 
19
                                         "Alien Glow" 100 NORMAL-MODE)))
 
20
        )
19
21
 
20
22
    (gimp-context-push)
21
23
 
23
25
    (script-fu-util-image-resize-from-layer img logo-layer)
24
26
    (gimp-image-add-layer img bg-layer 1)
25
27
    (gimp-image-add-layer img glow-layer 1)
26
 
    (gimp-layer-set-preserve-trans logo-layer TRUE)
 
28
    (gimp-layer-set-lock-alpha logo-layer TRUE)
27
29
    (gimp-context-set-background '(0 0 0))
28
30
    (gimp-edit-fill bg-layer BACKGROUND-FILL)
29
31
    (gimp-edit-clear glow-layer)
38
40
    (gimp-context-set-foreground '(79 79 79))
39
41
 
40
42
    (gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
41
 
                     GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
42
 
                     FALSE 0 0 TRUE
43
 
                     0 0 1 1)
44
 
 
45
 
    (gimp-context-pop)))
 
43
                     GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
 
44
                     FALSE 0 0 TRUE
 
45
                     0 0 1 1)
 
46
 
 
47
    (gimp-context-pop)
 
48
  )
 
49
)
 
50
 
46
51
 
47
52
(define (script-fu-alien-glow-logo-alpha img
48
 
                                         logo-layer
49
 
                                         size
50
 
                                         glow-color)
 
53
                                         logo-layer
 
54
                                         size
 
55
                                         glow-color)
51
56
  (begin
52
57
    (gimp-image-undo-group-start img)
53
58
    (apply-alien-glow-logo-effect img logo-layer size glow-color)
54
59
    (gimp-image-undo-group-end img)
55
 
    (gimp-displays-flush)))
 
60
    (gimp-displays-flush)
 
61
  )
 
62
)
56
63
 
57
64
(script-fu-register "script-fu-alien-glow-logo-alpha"
58
 
                    _"Alien _Glow..."
59
 
                    "Create an X-Files-esque logo with the specified glow color"
60
 
                    "Spencer Kimball"
61
 
                    "Spencer Kimball"
62
 
                    "1997"
63
 
                    "RGBA"
64
 
                    SF-IMAGE      "Image"                   0
65
 
                    SF-DRAWABLE   "Drawable"                0
66
 
                    SF-ADJUSTMENT _"Glow size (pixels * 4)" '(150 2 1000 1 10 0 1)
67
 
                    SF-COLOR      _"Glow color"             '(63 252 0))
 
65
  _"Alien _Glow..."
 
66
  _"Add an eerie glow around the selected region (or alpha)"
 
67
  "Spencer Kimball"
 
68
  "Spencer Kimball"
 
69
  "1997"
 
70
  "RGBA"
 
71
  SF-IMAGE       "Image"                  0
 
72
  SF-DRAWABLE    "Drawable"               0
 
73
  SF-ADJUSTMENT _"Glow size (pixels * 4)" '(150 2 1000 1 10 0 1)
 
74
  SF-COLOR      _"Glow color"             '(63 252 0)
 
75
)
68
76
 
69
77
(script-fu-menu-register "script-fu-alien-glow-logo-alpha"
70
 
                         _"<Image>/Script-Fu/Alpha to Logo")
 
78
                         "<Image>/Filters/Alpha to Logo")
71
79
 
72
80
 
73
81
(define (script-fu-alien-glow-logo text
74
 
                                   size
75
 
                                   font
76
 
                                   glow-color)
77
 
  (let* ((img (car (gimp-image-new 256 256 RGB)))
78
 
         (border (/ size 4))
79
 
         (grow (/ size 30))
80
 
         (feather (/ size 4))
81
 
         (text-layer (car (gimp-text-fontname img
82
 
                                              -1 0 0 text border TRUE
83
 
                                              size PIXELS font)))
84
 
         (width (car (gimp-drawable-width text-layer)))
85
 
         (height (car (gimp-drawable-height text-layer))))
 
82
                                   size
 
83
                                   font
 
84
                                   glow-color)
 
85
  (let* (
 
86
        (img (car (gimp-image-new 256 256 RGB)))
 
87
        (border (/ size 4))
 
88
        (grow (/ size 30))
 
89
        (feather (/ size 4))
 
90
        (text-layer (car (gimp-text-fontname img
 
91
                                             -1 0 0 text border TRUE
 
92
                                             size PIXELS font)))
 
93
        (width (car (gimp-drawable-width text-layer)))
 
94
        (height (car (gimp-drawable-height text-layer)))
 
95
        )
86
96
 
87
97
    (gimp-image-undo-disable img)
88
 
    (gimp-drawable-set-name text-layer text)
89
98
    (apply-alien-glow-logo-effect img text-layer size glow-color)
90
99
    (gimp-image-undo-enable img)
91
 
    (gimp-display-new img)))
 
100
    (gimp-display-new img)
 
101
  )
 
102
)
92
103
 
93
104
(script-fu-register "script-fu-alien-glow-logo"
94
 
                    _"Alien _Glow..."
95
 
                    "Create an X-Files-esque logo with the specified glow color"
96
 
                    "Spencer Kimball"
97
 
                    "Spencer Kimball"
98
 
                    "1997"
99
 
                    ""
100
 
                    SF-STRING     _"Text"               "ALIEN"
101
 
                    SF-ADJUSTMENT _"Font size (pixels)" '(150 2 1000 1 10 0 1)
102
 
                    SF-FONT       _"Font"               "Sans Bold"
103
 
                    SF-COLOR      _"Glow color"         '(63 252 0))
 
105
  _"Alien _Glow..."
 
106
  _"Create a logo with an alien glow around the text"
 
107
  "Spencer Kimball"
 
108
  "Spencer Kimball"
 
109
  "1997"
 
110
  ""
 
111
  SF-STRING     _"Text"               "ALIEN"
 
112
  SF-ADJUSTMENT _"Font size (pixels)" '(150 2 1000 1 10 0 1)
 
113
  SF-FONT       _"Font"               "Sans Bold"
 
114
  SF-COLOR      _"Glow color"         '(63 252 0)
 
115
)
104
116
 
105
117
(script-fu-menu-register "script-fu-alien-glow-logo"
106
 
                         _"<Toolbox>/Xtns/Script-Fu/Logos")
 
118
                         "<Toolbox>/Xtns/Logos")