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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/gradient-bevel-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:
1
 
; The GIMP -- an image manipulation program
 
1
; GIMP - The GNU Image Manipulation Program
2
2
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
 
 
3
;
4
4
; This program is free software; you can redistribute it and/or modify
5
5
; it under the terms of the GNU General Public License as published by
6
6
; the Free Software Foundation; either version 2 of the License, or
7
7
; (at your option) any later version.
8
 
 
8
;
9
9
; This program is distributed in the hope that it will be useful,
10
10
; but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
; GNU General Public License for more details.
13
 
 
13
;
14
14
; You should have received a copy of the GNU General Public License
15
15
; along with this program; if not, write to the Free Software
16
16
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
20
;  Create cool glossy bevelly text
21
21
 
22
22
(define (apply-gradient-bevel-logo-effect img
23
 
                                          logo-layer
24
 
                                          b-size
25
 
                                          bevel-height
26
 
                                          bevel-width
27
 
                                          bg-color)
28
 
  (let* ((width (car (gimp-drawable-width logo-layer)))
29
 
         (height (car (gimp-drawable-height logo-layer)))
30
 
         (indentX (+ b-size 12))
31
 
         (indentY (+ b-size (/ height 8)))
32
 
         (bg-layer (car (gimp-layer-new img width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
33
 
         (blur-layer (car (gimp-layer-new img width height RGBA-IMAGE "Blur" 100 NORMAL-MODE))))
 
23
                                          logo-layer
 
24
                                          b-size
 
25
                                          bevel-height
 
26
                                          bevel-width
 
27
                                          bg-color)
 
28
  (let* (
 
29
        (width (car (gimp-drawable-width logo-layer)))
 
30
        (height (car (gimp-drawable-height logo-layer)))
 
31
        (indentX (+ b-size 12))
 
32
        (indentY (+ b-size (/ height 8)))
 
33
        (bg-layer (car (gimp-layer-new img width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
 
34
        (blur-layer (car (gimp-layer-new img width height RGBA-IMAGE "Blur" 100 NORMAL-MODE)))
 
35
        )
34
36
 
35
37
    (gimp-context-push)
36
38
 
43
45
    (gimp-edit-fill bg-layer BACKGROUND-FILL)
44
46
    (gimp-selection-none img)
45
47
 
46
 
    (gimp-layer-set-preserve-trans blur-layer TRUE)
 
48
    (gimp-layer-set-lock-alpha blur-layer TRUE)
47
49
    (gimp-context-set-background '(255 255 255))
48
50
    (gimp-selection-all img)
49
51
    (gimp-edit-fill blur-layer BACKGROUND-FILL)
50
52
    (gimp-edit-clear blur-layer)
51
53
    (gimp-selection-none img)
52
 
    (gimp-layer-set-preserve-trans blur-layer FALSE)
 
54
    (gimp-layer-set-lock-alpha blur-layer FALSE)
53
55
    (gimp-selection-layer-alpha logo-layer)
54
56
    (gimp-edit-fill blur-layer BACKGROUND-FILL)
55
57
    (plug-in-gauss-rle 1 img blur-layer bevel-width 1 1)
56
58
    (gimp-selection-none img)
57
59
    (gimp-context-set-background '(127 127 127))
58
60
    (gimp-context-set-foreground '(255 255 255))
59
 
    (gimp-layer-set-preserve-trans logo-layer TRUE)
 
61
    (gimp-layer-set-lock-alpha logo-layer TRUE)
60
62
    (gimp-selection-all img)
61
63
 
62
64
    (gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
63
 
                     GRADIENT-RADIAL 95 0 REPEAT-NONE FALSE
64
 
                     FALSE 0 0 TRUE
65
 
                     indentX indentY indentX (- height indentY))
 
65
                     GRADIENT-RADIAL 95 0 REPEAT-NONE FALSE
 
66
                     FALSE 0 0 TRUE
 
67
                     indentX indentY indentX (- height indentY))
66
68
 
67
69
    (gimp-selection-none img)
68
 
    (gimp-layer-set-preserve-trans logo-layer FALSE)
 
70
    (gimp-layer-set-lock-alpha logo-layer FALSE)
69
71
    (plug-in-bump-map 1 img logo-layer blur-layer 115 bevel-height 5 0 0 0 15 TRUE FALSE 0)
70
72
    (gimp-layer-set-offsets blur-layer 5 5)
71
73
    (gimp-invert blur-layer)
72
74
    (gimp-layer-set-opacity blur-layer 50.0)
73
75
    (gimp-image-set-active-layer img logo-layer)
74
76
 
75
 
    (gimp-context-pop)))
 
77
    (gimp-context-pop)
 
78
  )
 
79
)
76
80
 
77
81
(define (script-fu-gradient-bevel-logo-alpha img
78
 
                                             logo-layer
79
 
                                             b-size
80
 
                                             bevel-height
81
 
                                             bevel-width
82
 
                                             bg-color)
83
 
  (begin
84
 
    (gimp-image-undo-group-start img)
85
 
    (apply-gradient-bevel-logo-effect img logo-layer b-size
86
 
                                      bevel-height bevel-width bg-color)
87
 
    (gimp-image-undo-group-end img)
88
 
    (gimp-displays-flush)))
 
82
                                             logo-layer
 
83
                                             b-size
 
84
                                             bevel-height
 
85
                                             bevel-width
 
86
                                             bg-color)
 
87
  (gimp-image-undo-group-start img)
 
88
  (apply-gradient-bevel-logo-effect img logo-layer b-size
 
89
                                    bevel-height bevel-width bg-color)
 
90
  (gimp-image-undo-group-end img)
 
91
  (gimp-displays-flush)
 
92
)
89
93
 
90
94
(script-fu-register "script-fu-gradient-bevel-logo-alpha"
91
 
                    _"Gradient Beve_l..."
92
 
                    "Makes Shiny Bevelly text"
93
 
                    "Brian McFee <keebler@wco.com>"
94
 
                    "Brian McFee"
95
 
                    "April 1998"
96
 
                    "RGBA"
97
 
                    SF-IMAGE      "Image"                     0
98
 
                    SF-DRAWABLE   "Drawable"                  0
99
 
                    SF-ADJUSTMENT _"Border size (pixels)"     '(22 1 300 1 10 0 1)
100
 
                    SF-ADJUSTMENT _"Bevel height (Sharpness)" '(40 1 250 1 10 0 1)
101
 
                    SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
102
 
                    SF-COLOR      _"Background color"         '(255 255 255))
 
95
  _"Gradient Beve_l..."
 
96
  _"Add a shiny look and bevel effect to the selected region (or alpha)"
 
97
  "Brian McFee <keebler@wco.com>"
 
98
  "Brian McFee"
 
99
  "April 1998"
 
100
  "RGBA"
 
101
  SF-IMAGE      "Image"                     0
 
102
  SF-DRAWABLE   "Drawable"                  0
 
103
  SF-ADJUSTMENT _"Border size (pixels)"     '(22 1 300 1 10 0 1)
 
104
  SF-ADJUSTMENT _"Bevel height (sharpness)" '(40 1 250 1 10 0 1)
 
105
  SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
 
106
  SF-COLOR      _"Background color"         "white"
 
107
)
103
108
 
104
109
(script-fu-menu-register "script-fu-gradient-bevel-logo-alpha"
105
 
                         _"<Image>/Script-Fu/Alpha to Logo")
 
110
                         "<Image>/Filters/Alpha to Logo")
106
111
 
107
112
 
108
113
(define (script-fu-gradient-bevel-logo text
109
 
                                       size
110
 
                                       font
111
 
                                       bevel-height
112
 
                                       bevel-width
113
 
                                       bg-color)
114
 
  (let* ((img (car (gimp-image-new 256 256 RGB)))
115
 
         (border (/ size 4))
116
 
         (text-layer (car (gimp-text-fontname img -1 0 0 text
117
 
                                              border TRUE size PIXELS font))))
 
114
                                       size
 
115
                                       font
 
116
                                       bevel-height
 
117
                                       bevel-width
 
118
                                       bg-color)
 
119
  (let* (
 
120
        (img (car (gimp-image-new 256 256 RGB)))
 
121
        (border (/ size 4))
 
122
        (text-layer (car (gimp-text-fontname img -1 0 0 text
 
123
                                             border TRUE size PIXELS font)))
 
124
        )
118
125
    (gimp-image-undo-disable img)
119
 
    (gimp-drawable-set-name text-layer text)
120
126
    (apply-gradient-bevel-logo-effect img text-layer border
121
 
                                      bevel-height bevel-width bg-color)
 
127
                                      bevel-height bevel-width bg-color)
122
128
    (gimp-image-undo-enable img)
123
 
    (gimp-display-new img)))
 
129
    (gimp-display-new img)
 
130
  )
 
131
)
124
132
 
125
133
(script-fu-register "script-fu-gradient-bevel-logo"
126
 
                    _"Gradient Beve_l..."
127
 
                    "Makes Shiny Bevelly text"
128
 
                    "Brian McFee <keebler@wco.com>"
129
 
                    "Brian McFee"
130
 
                    "April 1998"
131
 
                    ""
132
 
                    SF-STRING     _"Text"                     "Moo"
133
 
                    SF-ADJUSTMENT _"Font size (pixels)"       '(90 2 1000 1 10 0 1)
134
 
                    SF-FONT       _"Font"                     "Sans Bold"
135
 
                    SF-ADJUSTMENT _"Bevel height (sharpness)" '(40 1 250 1 10 0 1)
136
 
                    SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
137
 
                    SF-COLOR      _"Background color"         '(255 255 255))
 
134
  _"Gradient Beve_l..."
 
135
  _"Create a logo with a shiny look and beveled edges"
 
136
  "Brian McFee <keebler@wco.com>"
 
137
  "Brian McFee"
 
138
  "April 1998"
 
139
  ""
 
140
  SF-STRING     _"Text"                     "Moo"
 
141
  SF-ADJUSTMENT _"Font size (pixels)"       '(90 2 1000 1 10 0 1)
 
142
  SF-FONT       _"Font"                     "Sans Bold"
 
143
  SF-ADJUSTMENT _"Bevel height (sharpness)" '(40 1 250 1 10 0 1)
 
144
  SF-ADJUSTMENT _"Bevel width"              '(2.5 1 200 1 10 1 1)
 
145
  SF-COLOR      _"Background color"         "white"
 
146
)
138
147
 
139
148
(script-fu-menu-register "script-fu-gradient-bevel-logo"
140
 
                         _"<Toolbox>/Xtns/Script-Fu/Logos")
 
149
                         "<Toolbox>/Xtns/Logos")