/* SoftBorder v1.00 by Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit pic=arg(1) MARK pic PRIMARY PROJECT_INFO pic WIDTH width=result PROJECT_INFO pic HEIGHT height=result 'REQUEST "What kinda border would you like?" "Foggy|Normal|Borders|Normal shade"' fog=result if fog=0 then do if exists("ie:alpha/purewhite.alpha") == "1" then do OPEN "ie:alpha/purewhite.alpha" COLOUR colortexture=result RESIZE colortexture width+50 height+50 TILE colortexture2=result MARK colortexture2 SECONDARY CLOSE colortexture BRIGHTNESS pic "-255" blackpic=result MARK blackpic PRIMARY MARK colortexture2 SECONDARY COMPOSITE 25 25 MIN blackpic2=result CLOSE colortexture2 CLOSE blackpic end else do 'REQUEST "Please copy purewhite.alpha to dir IE:Alpha/" "Ups, sorry!"' exit end CONVOLVE blackpic2 "IE:Convolves/GaussianBlur5x5" x1=result CONVOLVE x1 "IE:Convolves/GaussianBlur5x5" x2=result CLOSE x1 CONVOLVE x2 "IE:Convolves/GaussianBlur5x5" x3=result CLOSE x2 MARK blackpic2 PRIMARY MARK blackpic2 ALPHA MARK x3 SECONDARY 'GET_NUMBER "Give distance of shadow" 1 15 "Ok|Cancel" 5 SLIDER' IF RC=5 then exit distance=result COMPOSITE "-"distance "-"distance MULTIPLY blackshade=result CLOSE x3 CLOSE blackpic2 MARK pic PRIMARY MARK pic ALPHA MARK blackshade SECONDARY COMPOSITE 25-distance 25-distance MAX CLOSE blackshade exit end if fog == 3 then do if exists("ie:alpha/purewhite.alpha") == "1" then do OPEN "ie:alpha/purewhite.alpha" COLOUR colortexture=result RESIZE colortexture width+50 height+50 TILE colortexture2=result MARK colortexture2 SECONDARY CLOSE colortexture COMPOSITE 25 25 MIN pic2=result BRIGHTNESS pic "-255" blackpic=result MARK blackpic PRIMARY MARK colortexture2 SECONDARY COMPOSITE 25 25 MIN blackpic2=result CLOSE colortexture2 CLOSE blackpic end else do 'REQUEST "Please copy purewhite.alpha to dir IE:Alpha/" "Ups, sorry!"' exit end CONVOLVE blackpic2 "IE:Convolves/Blurr_45degree" blackblur=result CLOSE blackpic2 'NOISE' blackblur '100 INTENSITY RANDOM' tmp1=result MARK tmp1 ALPHA MARK blackblur PRIMARY DISPLACE 5 5 BEST blackdis=result CLOSE tmp1 CLOSE blackblur MARK blackdis PRIMARY CONVOLVE blackdis "IE:Convolves/Blurr_45degree" blackblur=result CLOSE blackdis CONVOLVE blackblur "IE:Convolves/Blurr_45degree" blackblur2=result CLOSE blackblur MARK pic2 PRIMARY MARK blackblur2 SECONDARY COMPOSITE 0 0 ADD final=result CLOSE pic2 CLOSE blackblur2 AUTOCROP final CLOSE final exit end if fog == 1 then OPEN "ie:alpha/highlight.alpha" COLOUR if fog == 2 then OPEN "ie:alpha/highlight2.alpha" COLOUR alphatexture=result SCALE alphatexture width height BEST alphatexture2=result CLOSE alphatexture NEGATIVE alphatexture2 alphatexture3=result CLOSE alphatexture2 MARK pic ALPHA MARK alphatexture3 SECONDARY COMPOSITE 0 0 ADD CLOSE alphatexture3 exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end