58
(bevelling-whole-image FALSE)
60
(thickness (abs thickness))
61
(type (car (gimp-drawable-type-with-alpha drawable)))
62
(image (if (= work-on-copy TRUE) (car (gimp-image-duplicate img)) img))
63
(pic-layer (car (gimp-image-get-active-drawable image)))
64
(offsets (gimp-drawable-offsets pic-layer))
65
(width (car (gimp-drawable-width pic-layer)))
66
(height (car (gimp-drawable-height pic-layer)))
59
(bevelling-whole-image FALSE)
61
(thickness (abs thickness))
62
(type (car (gimp-drawable-type-with-alpha drawable)))
63
(image (if (= work-on-copy TRUE) (car (gimp-image-duplicate img)) img))
64
(pic-layer (car (gimp-image-get-active-drawable image)))
65
(offsets (gimp-drawable-offsets pic-layer))
66
(width (car (gimp-drawable-width pic-layer)))
67
(height (car (gimp-drawable-height pic-layer)))
68
; Bumpmap has a one pixel border on each side
69
(bump-layer (car (gimp-layer-new image
76
(bevelling-whole-image TRUE)
69
; Bumpmap has a one pixel border on each side
70
(bump-layer (car (gimp-layer-new image
79
80
(gimp-context-push)
117
118
(gimp-context-set-background '(0 0 0))
118
119
(gimp-drawable-fill bump-layer BACKGROUND-FILL)
121
121
(while (< index thickness)
122
122
(set! greyness (/ (* index 255) thickness))
123
123
(gimp-context-set-background (list greyness greyness greyness))
162
162
(gimp-image-remove-channel image select)
163
163
(if (= keep-bump-layer TRUE)
164
(gimp-drawable-set-visible bump-layer 0)
165
(gimp-image-remove-layer image bump-layer))
164
(gimp-drawable-set-visible bump-layer 0)
165
(gimp-image-remove-layer image bump-layer)
167
168
(gimp-image-set-active-layer image pic-layer)
169
170
; enable undo / end undo group
170
(if (= work-on-copy TRUE)
172
(gimp-display-new image)
173
(gimp-image-undo-enable image))
174
(gimp-image-undo-group-end image))
171
(if (= work-on-copy TRUE)
173
(gimp-display-new image)
174
(gimp-image-undo-enable image)
176
(gimp-image-undo-group-end image)
176
179
(gimp-displays-flush)
180
185
(script-fu-register "script-fu-add-bevel"
182
"Add a bevel to an image"
183
"Andrew Donkin <ard@cs.waikato.ac.nz>"
188
SF-DRAWABLE "Drawable" 0
189
SF-ADJUSTMENT _"Thickness" '(5 0 30 1 2 0 0)
190
SF-TOGGLE _"Work on copy" TRUE
191
SF-TOGGLE _"Keep bump layer" FALSE)
187
_"Add a beveled border to an image"
188
"Andrew Donkin <ard@cs.waikato.ac.nz>"
193
SF-DRAWABLE "Drawable" 0
194
SF-ADJUSTMENT _"Thickness" '(5 0 30 1 2 0 0)
195
SF-TOGGLE _"Work on copy" TRUE
196
SF-TOGGLE _"Keep bump layer" FALSE
193
199
(script-fu-menu-register "script-fu-add-bevel"
194
_"<Image>/Script-Fu/Decor")
200
"<Image>/Filters/Decor")