home *** CD-ROM | disk | FTP | other *** search
- /*
- This script will take the current image and puts 'soft shadows'
- onto it - you know, the stuff you see in Web Graphics every day.
-
- This really works well only when the background is white (or close
- to it) and the foreground is a dark object.
-
- by Janne Jalkanen, 1997.
- */
-
- /*-------------------------------------------------------------------*/
- /* I suggest you use this header as-is and add your own code below */
-
- OPTIONS RESULTS
- SIGNAL ON ERROR
- IF ADDRESS() = REXX THEN DO
- startedfromcli = 1
- ADDRESS PPT
- END
- ELSE DO
- startedfromcli = 0
- ADDRESS PPT
- END
- RESULT = 'no result'
-
- /*-------------------------------------------------------------------*/
- /* Add your code here */
-
- PARSE ARG frame
-
- mygad1.label = "X distance"
- mygad1.type = SLIDER
- mygad1.default = 2
- mygad1.min = -20
- mygad1.max = 20
-
- mygad2.label = "Y distance"
- mygad2.type = SLIDER
- mygad2.default = 2
- mygad2.min = -20
- mygad2.max = 20
-
- ASKREQ '"Select the direction of the soft shadow"' mygad1 mygad2
- IF RESULT = 0 THEN DO
- PROCESS frame AutoCrop
- PROCESS frame Transparency T 255 BACKGROUND
-
- COPYFRAME frame
- newframe = RESULT
-
- PROCESS newframe Threshold 128 INTENSITY
- PROCESS newframe Shift X mygad1.value Y mygad2.value
- PROCESS newframe Convolute blur.conv
- PROCESS newframe Contrast '-0.3'
- PROCESS newframe Composite WITH frame METHOD Direct
- PROCESS newframe AutoCrop
- END
-
- EXIT 0
-
- /*-------------------------------------------------------------------*/
- /* Again, keep this part intact. This is the error handler. */
- ERROR :
- returncode = RC
- IF startedfromcli = 1 THEN DO
- SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
- PPT_TO_BACK
- END
- ELSE
- SHOWERROR '"'RC2'"' SIGL
- EXIT returncode
-
-
-