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

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/tileblur.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:
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.
18
18
 
19
19
(define (script-fu-tile-blur inImage inLayer inRadius inVert inHoriz inType)
20
20
 
21
 
   (set! theImage inImage)
22
 
   (set! theLayer inLayer)
23
 
   (set! theHeight (car (gimp-drawable-height theLayer)))
24
 
   (set! theWidth (car (gimp-drawable-width theLayer)))
25
 
 
26
 
   (gimp-image-undo-group-start theImage)
27
 
   (gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0)
28
 
 
29
 
   (gimp-rect-select theImage 0 0 theWidth theHeight CHANNEL-OP-REPLACE 0 0)
30
 
   (gimp-edit-cut theLayer)
31
 
 
32
 
   (gimp-selection-none theImage)
33
 
   (gimp-layer-set-offsets theLayer theWidth theHeight)
34
 
 
35
 
   (cjg-pasteat 1 1) (cjg-pasteat 1 2) (cjg-pasteat 1 3)
36
 
   (cjg-pasteat 2 1) (cjg-pasteat 2 2) (cjg-pasteat 2 3)
37
 
   (cjg-pasteat 3 1) (cjg-pasteat 3 2) (cjg-pasteat 3 3)
38
 
 
39
 
   (gimp-selection-none theImage)
40
 
   (if (= inType 0)
41
 
       (plug-in-gauss-iir TRUE theImage theLayer inRadius inHoriz inVert)
42
 
       (plug-in-gauss-rle TRUE theImage theLayer inRadius inHoriz inVert)
43
 
   )
44
 
 
45
 
   (gimp-layer-resize theLayer theWidth theHeight (- 0 theWidth) (- 0 theHeight))
46
 
   (gimp-layer-set-offsets theLayer 0 0)
47
 
   (gimp-image-undo-group-end theImage)
48
 
   (gimp-displays-flush)
49
 
)
50
 
 
51
 
(define (cjg-pasteat xoff yoff)
52
 
   (let         ((theFloat (car(gimp-edit-paste theLayer 0))))
53
 
                (gimp-layer-set-offsets theFloat (* xoff theWidth) (* yoff theHeight) )
54
 
                (gimp-floating-sel-anchor theFloat)
55
 
   )
56
 
)
57
 
 
 
21
  (let* (
 
22
        (theImage inImage)
 
23
        (theLayer inLayer)
 
24
        (theHeight (car (gimp-drawable-height theLayer)))
 
25
        (theWidth (car (gimp-drawable-width theLayer)))
 
26
        )
 
27
 
 
28
    (define (pasteat xoff yoff)
 
29
      (let ((theFloat (car(gimp-edit-paste theLayer 0))))
 
30
        (gimp-layer-set-offsets theFloat (* xoff theWidth) (* yoff theHeight) )
 
31
        (gimp-floating-sel-anchor theFloat)
 
32
       )
 
33
    )
 
34
 
 
35
    (gimp-image-undo-group-start theImage)
 
36
    (gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0)
 
37
 
 
38
    (gimp-rect-select theImage 0 0 theWidth theHeight CHANNEL-OP-REPLACE 0 0)
 
39
    (gimp-edit-cut theLayer)
 
40
 
 
41
    (gimp-selection-none theImage)
 
42
    (gimp-layer-set-offsets theLayer theWidth theHeight)
 
43
 
 
44
    (pasteat 1 1) (pasteat 1 2) (pasteat 1 3)
 
45
    (pasteat 2 1) (pasteat 2 2) (pasteat 2 3)
 
46
    (pasteat 3 1) (pasteat 3 2) (pasteat 3 3)
 
47
 
 
48
    (gimp-selection-none theImage)
 
49
    (if (= inType 0)
 
50
        (plug-in-gauss-iir TRUE theImage theLayer inRadius inHoriz inVert)
 
51
        (plug-in-gauss-rle TRUE theImage theLayer inRadius inHoriz inVert)
 
52
    )
 
53
 
 
54
    (gimp-layer-resize theLayer
 
55
                       theWidth theHeight (- 0 theWidth) (- 0 theHeight))
 
56
    (gimp-layer-set-offsets theLayer 0 0)
 
57
    (gimp-image-undo-group-end theImage)
 
58
    (gimp-displays-flush)
 
59
  )
 
60
)
58
61
 
59
62
(script-fu-register "script-fu-tile-blur"
60
 
                    _"_Tileable Blur..."
61
 
                    "Blurs image edges so that the final result tiles seamlessly"
62
 
                    "Chris Gutteridge"
63
 
                    "1998, Chris Gutteridge / ECS dept, University of Southampton, England."
64
 
                    "25th April 1998"
65
 
                    "RGB*"
66
 
                    SF-IMAGE       "The Image"         0
67
 
                    SF-DRAWABLE    "The Layer"         0
68
 
                    SF-ADJUSTMENT _"Radius"            '(5 0 128 1 1 0 0)
69
 
                    SF-TOGGLE     _"Blur vertically"   TRUE
70
 
                    SF-TOGGLE     _"Blur horizontally" TRUE
71
 
                    SF-OPTION     _"Blur type"         '(_"IIR" _"RLE"))
 
63
  _"_Tileable Blur..."
 
64
  _"Blur the edges of an image so the result tiles seamlessly"
 
65
  "Chris Gutteridge"
 
66
  "1998, Chris Gutteridge / ECS dept, University of Southampton, England."
 
67
  "25th April 1998"
 
68
  "RGB*"
 
69
  SF-IMAGE       "The Image"         0
 
70
  SF-DRAWABLE    "The Layer"         0
 
71
  SF-ADJUSTMENT _"Radius"            '(5 0 128 1 1 0 0)
 
72
  SF-TOGGLE     _"Blur vertically"   TRUE
 
73
  SF-TOGGLE     _"Blur horizontally" TRUE
 
74
  SF-OPTION     _"Blur type"         '(_"IIR" _"RLE")
 
75
)
72
76
 
73
77
(script-fu-menu-register "script-fu-tile-blur"
74
 
                         "<Image>/Filters/Blur")
 
78
                         "<Image>/Filters/Blur")