/**$VER: panPost.ifx 1.00 Jan.30.1996 19:03:48 ** **Copyright ©1996 Enosis C. S., All Rights Reserved. ** Written by Ola Eric olsson ** ** **/ /*********************************************************************/ /** The blur factor is a percentage of the frame-step (avg. distance */ /** between frames) to apply to the motion blur operator. Should not */ /** be set higher than 1. */ /*********************************************************************/ $$VERSION = 1.00 /* blur_factor = 1 */ libs.1 = 'rexxsupport.library' libs.2 = 'rexxarplib.library' libs.3 = 'rexxmathlib.library' libs.4 = 'rexxtricks.library' DO i = 1 to 4 library = EXISTS("libs:"||libs.i) IF library = 1 THEN DO IF ~SHOW('L',libs.i) THEN CALL ADDLIB(libs.i,0,-30,0) IF ~SHOW('L',libs.i) THEN DO message = "Can't load "||libs.i CALL exit_msg (message) END END ELSE DO message = "Can't find "||libs.i CALL exit_msg (message) END END OPTIONS RESULTS ADDRESS IMAGEFX.1 /* redraw off */ /* WORKBENCH */ IF ~PUBSCREENTOFRONT(Workbench) THEN DO msg = "Can't bring Workbench to front!" CALL exit_msg(msg) END target = GetFile(100,100,,,"Select Post Config File") IF target ~= '' THEN DO IF UPPER(LEFT(save_path,8)) = 'RAM DISK' THEN, save_path = 'RAM'||RIGHT(save_path,LENGTH(save_path)-8) save_path.bool = 1 END charpos = LASTPOS('/',target) IF charpos = '0' THEN DO charpos = LASTPOS(':',target) END path = LEFT(target,charpos) path1 = path IF LEFT(path,9) = "Ram Disk:" THEN DO path = "ram:"||RIGHT(path,(LENGTH(path)-9)) END IF OPEN('INPUT',target,'R') THEN DO firstline = READLN('INPUT') secondline = READLN('INPUT') thirdline = READLN('INPUT') CALL CLOSE('INPUT') END ELSE DO msg = 'Cannot open config file!' CALL EXIT_MSG(msg) CALL PostMsg(0,0,msg) CALL DELAY(150) CALL PostMsg() END PARSE VAR firstline frame_name '~' frame_tot '~' blur_angle '~' blur_length easetype = secondline IF thirdline > 0 THEN DO easetot = WORDS(thirdline) END ELSE DO easetot = 0 END DO UNTIL changegrid = "OKAY" blur_stat. = '' blur_stat.1 = "1) Blur All Frames" blur_stat.2 = "2) Don't Blur First Frame" blur_stat.3 = "3) Don't Blur First & Last" blur_stat.4 = "4) Don't Blur Last Frame" blurtext = RequestList(1,4,blur_stat,0,0,350,150) IF blurtext = '' THEN CALL exit_msg("Aborted!") blur_stat = LEFT(blurtext,1) msg = "\Following this requester will be\" msg = msg||"five fractional numbers. They determine\" msg = msg||"how much of the original pixel distance\" msg = msg||"between frames to use as the blur distance.\" msg = msg||"Choose one of these numbers.\\" msg = msg||".5 will use half of the original frame-step\" msg = msg||"as the blur distance, and will have the most\" msg = msg||"pronounced effect." pickblur = Request(0,0,msg,,'Continue') blur_factor. = '' blur_factor.1 = ".10" blur_factor.2 = ".20" blur_factor.3 = ".30" blur_factor.4 = ".40" blur_factor.5 = ".50" blur_factor.6 = ".60" blur_factor.7 = ".70" blur_factor.8 = ".80" blur_factor.9 = ".90" blur_factor.10 = "1.00" blurfactor = RequestList(1,10,blur_factor,0,0,250,250) /* WORKBENCH */ IF PUBSCREENTOBACK(Workbench) THEN DO NOP END DO i = 1 to frame_tot IF easetype = LINEAR THEN DO curBlurLength = TRUNC(blur_length * blurfactor) END ELSE DO IF easetype = EASEIN THEN DO IF i <= easetot THEN DO easeFactor = WORD(thirdline,i) curBlurLength = TRUNC(blur_length * blurfactor * easeFactor) IF curBlurLength < 1 THEN curBlurLength = 1 END END IF easetype = EASEBOTH THEN DO IF i <= easetot THEN DO easeFactor = WORD(thirdline,i) curBlurLength = TRUNC(blur_length * blurfactor * easeFactor) IF curBlurLength < 1 THEN curBlurLength = 1 END IF i > (frame_tot - easetot) THEN DO easeFactor = WORD(thirdline,(frame_tot-i)+1) curBlurLength = TRUNC(blur_length * blurfactor * easeFactor) IF curBlurLength < 1 THEN curBlurLength = 1 END END IF easetype = EASEOUT THEN DO IF i > (frame_tot - easetot) THEN DO easeFactor = WORD(thirdline,(frame_tot-i)+1) curBlurLength = TRUNC(blur_length * blurfactor * easeFactor) IF curBlurLength < 1 THEN curBlurLength = 1 END END END msg = "\Processing frame "||i||" of "||frame_tot||" \" msg = msg||"Blur angle is "||blur_angle||"\" msg = msg||"Blur distance is "||curBlurLength||" pixels\" CALL PostMsg(0,0,msg,IMAGEFX_SCREEN) loadbuffer path||frame_name||'.'||RIGHT(i,4,'0') force IF i = 1 THEN DO IF blur_stat = 1 THEN motionblur blur_angle curBlurLength IF blur_stat = 4 THEN motionblur blur_angle curBlurLength END IF i = frame_tot THEN DO IF blur_stat = 1 THEN motionblur blur_angle curBlurLength IF blur_stat = 2 THEN motionblur blur_angle curBlurLength END IF i > 1 & i < frame_tot THEN motionblur blur_angle curBlurLength savebufferas ILBM path||frame_name||'_post.'||RIGHT(i,4,'0') END CALL PostMsg() CALL exit_msg('All Done!') /******************************************************************/ /** Rounds numbers **/ /******************************************************************/ ROUND: PARSE ARG number number = TRUNC(number)+((number//TRUNC(number))>=.5) RETURN(number) /********************************************************************/ /* Leave */ /********************************************************************/ EXIT_MSG: PARSE ARG msg CALL PostMsg(0,0,msg) CALL DELAY(100) CALL PostMsg() /* redraw on */ EXIT