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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/alien-glow-bullet.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
; Alien Glow themed bullets for web pages
5
5
; Copyright (c) 1997 Adrian Likins
6
 
; aklikins@eos.ncsu.edu 
 
6
; aklikins@eos.ncsu.edu
7
7
;
8
8
; This program is free software; you can redistribute it and/or modify
9
9
; it under the terms of the GNU General Public License as published by
10
10
; the Free Software Foundation; either version 2 of the License, or
11
11
; (at your option) any later version.
12
 
 
12
;
13
13
; This program is distributed in the hope that it will be useful,
14
14
; but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
16
; GNU General Public License for more details.
17
 
 
17
;
18
18
; You should have received a copy of the GNU General Public License
19
19
; along with this program; if not, write to the Free Software
20
20
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
21
 
22
 
(define (center-ellipse img
23
 
                        cx
24
 
                        cy
25
 
                        rx
26
 
                        ry
27
 
                        op
28
 
                        aa
29
 
                        feather
30
 
                        frad)
31
 
  (gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
32
 
                       op aa feather frad))
33
 
 
34
 
 
35
22
(define (script-fu-alien-glow-bullet radius
36
 
                                     glow-color
37
 
                                     bg-color
38
 
                                     flatten)
39
 
  (let* ((img (car (gimp-image-new radius radius RGB)))
40
 
         (border (/ radius 4))
41
 
         (diameter (* radius 2))
42
 
         (half-radius (/ radius 2))
43
 
         (blend-start (+ half-radius (/ half-radius 2)))
44
 
         (bullet-layer (car (gimp-layer-new img
45
 
                                            diameter diameter RGBA-IMAGE
46
 
                                            "Ruler" 100 NORMAL-MODE)))
47
 
         (glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
48
 
                                          "ALien Glow" 100 NORMAL-MODE)))
49
 
         (bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
50
 
                                        "Background" 100 NORMAL-MODE))))
 
23
                                     glow-color
 
24
                                     bg-color
 
25
                                     flatten)
 
26
 
 
27
  (define (center-ellipse img cx cy rx ry op aa feather frad)
 
28
    (gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
 
29
                         op aa feather frad)
 
30
  )
 
31
 
 
32
 
 
33
  (let* (
 
34
        (img (car (gimp-image-new radius radius RGB)))
 
35
        (border (/ radius 4))
 
36
        (diameter (* radius 2))
 
37
        (half-radius (/ radius 2))
 
38
        (blend-start (+ half-radius (/ half-radius 2)))
 
39
        (bullet-layer (car (gimp-layer-new img
 
40
                                           diameter diameter RGBA-IMAGE
 
41
                                           "Ruler" 100 NORMAL-MODE)))
 
42
        (glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
 
43
                                         "ALien Glow" 100 NORMAL-MODE)))
 
44
        (bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
 
45
                                       "Background" 100 NORMAL-MODE)))
 
46
        )
51
47
 
52
48
    (gimp-context-push)
53
49
 
57
53
    (gimp-image-add-layer img glow-layer -1)
58
54
    (gimp-image-add-layer img bullet-layer -1)
59
55
 
60
 
    ; (gimp-layer-set-preserve-trans ruler-layer TRUE)
 
56
    ; (gimp-layer-set-lock-alpha ruler-layer TRUE)
61
57
    (gimp-context-set-background bg-color)
62
58
    (gimp-edit-fill bg-layer BACKGROUND-FILL)
63
59
    (gimp-edit-clear glow-layer)
64
60
    (gimp-edit-clear bullet-layer)
65
61
 
66
62
    (center-ellipse img radius radius half-radius half-radius
67
 
                    CHANNEL-OP-REPLACE TRUE FALSE 0)
68
 
    
 
63
                    CHANNEL-OP-REPLACE TRUE FALSE 0)
 
64
 
69
65
    ; (gimp-rect-select img (/ height 2) (/ height 2) length height CHANNEL-OP-REPLACE FALSE 0)
70
66
    (gimp-context-set-foreground '(90 90 90))
71
67
    (gimp-context-set-background '(0 0 0))
72
68
 
73
69
    (gimp-edit-blend bullet-layer FG-BG-RGB-MODE NORMAL-MODE
74
 
                     GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
75
 
                     FALSE 0 0 TRUE
76
 
                     blend-start blend-start
77
 
                     (+ half-radius radius) (+ half-radius radius))
 
70
                     GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
 
71
                     FALSE 0 0 TRUE
 
72
                     blend-start blend-start
 
73
                     (+ half-radius radius) (+ half-radius radius))
78
74
 
79
75
    (gimp-context-set-foreground glow-color)
80
76
    (gimp-selection-grow img border)
82
78
    (gimp-edit-fill glow-layer FOREGROUND-FILL)
83
79
    (gimp-selection-none img)
84
80
    (if (>= radius 16)
85
 
        (plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
86
 
        (plug-in-gauss-rle 1 img glow-layer 12 TRUE TRUE))
 
81
        (plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
 
82
        (plug-in-gauss-rle 1 img glow-layer 12 TRUE TRUE)
 
83
    )
87
84
 
88
85
    (if (= flatten TRUE)
89
 
        (gimp-image-flatten img))
 
86
        (gimp-image-flatten img)
 
87
    )
90
88
    (gimp-image-undo-enable img)
91
89
    (gimp-display-new img)
92
90
 
93
 
    (gimp-context-pop)))
 
91
    (gimp-context-pop)
 
92
  )
 
93
)
94
94
 
95
95
(script-fu-register "script-fu-alien-glow-bullet"
96
 
                    _"_Bullet..."
97
 
                    "Create a Bullet with an Alien Glow theme for web pages"
98
 
                    "Adrian Likins"
99
 
                    "Adrian Likins"
100
 
                    "1997"
101
 
                    ""
102
 
                    SF-ADJUSTMENT _"Radius"           '(16 1 100 1 10 0 1)
103
 
                    SF-COLOR      _"Glow color"       '(63 252 0)
104
 
                    SF-COLOR      _"Background color" '(0 0 0)
105
 
                    SF-TOGGLE     _"Flatten image"    TRUE)
 
96
  _"_Bullet..."
 
97
  _"Create a bullet graphic with an eerie glow for web pages"
 
98
  "Adrian Likins"
 
99
  "Adrian Likins"
 
100
  "1997"
 
101
  ""
 
102
  SF-ADJUSTMENT _"Radius"           '(16 1 100 1 10 0 1)
 
103
  SF-COLOR      _"Glow color"       '(63 252 0)
 
104
  SF-COLOR      _"Background color" "black"
 
105
  SF-TOGGLE     _"Flatten image"    TRUE
 
106
)
106
107
 
107
108
(script-fu-menu-register "script-fu-alien-glow-bullet"
108
 
                         _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow")
 
109
                         "<Toolbox>/Xtns/Web Page Themes/Alien Glow")