-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadjoinLayersIntoSteropair.scm
46 lines (44 loc) · 2.31 KB
/
adjoinLayersIntoSteropair.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; ------------------------------------------------------------------------------
; Adjoin 2 separate layers into stereo pair
;
; (c) 2008 Kay Stenschke <[email protected]>
; All rights reserved
;
; This script is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
;
; The GNU General Public License can be found at
; http://www.gnu.org/copyleft/gpl.html.
;
;
; Changelog: (add new entries on top)
; V1.0 (2008-10-07) Tested and working with Gimp 2.4.5, Gimp 2.6
; -------------------------------------------------------------------------------------
(define (script-fu-adjoinLayersIntoSteropair img drawable layer)
(let* ; @note: Scope of the following variables ends with mathching brace to the one before "let*"
( (width (car (gimp-drawable-width drawable))) ;image width
(height (car (gimp-drawable-height drawable))) ;image height
(curLayer)
) ; --------------------------------------------------------------------
(gimp-layer-set-offsets layer width 0) ;move layer to right of lower layer
(gimp-image-resize-to-layers img) ;resize canvas fitting to layers
(gimp-image-set-active-layer img layer) ;activate layer with right image
(gimp-image-merge-visible-layers img 0) ;merge visible layers
; ---------------------------------------------------------------------- done. cleanup:
(gimp-selection-clear img) ;clear selection
)
(gimp-displays-flush) ;flush output
) ; ------------------------------------------------------------------------------ register (into image/Script-Fu menu):
(script-fu-register "script-fu-adjoinLayersIntoSteropair"
_"<Image>/Script-Fu/Stereo imaging/Adjoin 2 separate layers into stereo pair"
"Adjoin 2 separate layers into stereo pair"
"Kay Stenschke <[email protected]>"
"Kay Stenschke"
"2008-26-08"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-LAYER "Select right image layer" 0 ;show dialog to select right layer on start
) ; ------------------------------------------------------------------------------