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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/addborder.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
; Version 0.2 10.6.97 Changed to new script-fu interface in 0.99.10
21
21
 
22
22
; Delta the colour by the given amount. Check for boundary conditions
23
 
; If < 0 set to zero 
 
23
; If < 0 set to zero
24
24
; If > 255 set to 255
25
25
; Return the new value
26
26
 
28
28
  (let* ((newcol (+ col delta)))
29
29
    (if (< newcol 0) (set! newcol 0))
30
30
    (if (> newcol 255) (set! newcol 255))
31
 
    newcol)
 
31
    newcol
32
32
  )
 
33
)
33
34
 
34
35
(define (adjcolour col delta)
35
36
  (mapcar (lambda (x) (deltacolour x delta)) col)
106
107
                                     (car (gimp-drawable-type-with-alpha adraw))
107
108
                                     "Border-Layer" 100 NORMAL-MODE))))
108
109
 
109
 
;Add this for debugging    (verbose 4)
110
 
 
111
110
    (gimp-context-push)
112
111
 
113
112
    (gimp-image-undo-group-start img)
163
162
    (gimp-image-undo-group-end img)
164
163
    (gimp-displays-flush)
165
164
 
166
 
    (gimp-context-pop)))
 
165
    (gimp-context-pop)
 
166
    )
 
167
)
167
168
 
168
169
(script-fu-register "script-fu-addborder"
169
 
                    _"Add _Border..."
170
 
                    "Add a border around an image"
171
 
                    "Andy Thomas <alt@picnic.demon.co.uk>"
172
 
                    "Andy Thomas"
173
 
                    "6/10/97"
174
 
                    "*"
175
 
                    SF-IMAGE       "Input image"          0
176
 
                    SF-DRAWABLE    "Input drawable"       0
177
 
                    SF-ADJUSTMENT _"Border X size"        '(12 1 250 1 10 0 1)
178
 
                    SF-ADJUSTMENT _"Border Y size"        '(12 1 250 1 10 0 1)
179
 
                    SF-COLOR      _"Border color"         '(38 31 207)
180
 
                    SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1))
 
170
  _"Add _Border..."
 
171
  _"Add a border around an image"
 
172
  "Andy Thomas <alt@picnic.demon.co.uk>"
 
173
  "Andy Thomas"
 
174
  "6/10/97"
 
175
  "*"
 
176
  SF-IMAGE       "Input image" 0
 
177
  SF-DRAWABLE    "Input drawable" 0
 
178
  SF-ADJUSTMENT _"Border X size" '(12 1 250 1 10 0 1)
 
179
  SF-ADJUSTMENT _"Border Y size" '(12 1 250 1 10 0 1)
 
180
  SF-COLOR      _"Border color" '(38 31 207)
 
181
  SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1)
 
182
)
181
183
 
182
184
(script-fu-menu-register "script-fu-addborder"
183
 
                         _"<Image>/Script-Fu/Decor")
 
185
                         "<Image>/Filters/Decor")