subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublic urltitlewww.fxscript.orguitype typedefaultstringvalueamount amountminmaxDzBHBHrampB´uiinfosnapdetentsBÈinout zoom modelabelsin - inin - outout - in out - out?€@€@@aspectaspect¿€?€stepssteps?€C–AAB´centercenterpreblurextra blurringBÈ@@B´ accelerationease inÀ@draft quick previewprivatestaticsscriptà//--------------------------------// // Stib's zoom blur cross // //for more visit www.fxscript.org // //--------------------------------// //copyright2005 stephen dixon //This software is free - you may use, modify and distribute it as you wish, with the following provisos: //*it may not be used by any military organisation, or to produce goods or services for any military organisation. //* this source code must remain open //* this message and the accompanying doccumentation files must remain with the source //additionally this software is released under the terms of the GNU general Public license //see http://www.gnu.org/licenses/gpl.html for the full text of this license or look at the readme that came with the plugins //this software comes with no warranty of fitness for any purpose whatsoever, ok. //see www.fxscript.org for more transition "zoom blur cross 1.2" group "stib's transitions" wipeCode(0, 100); ProducesAlpha; input url, "www.fxscript.org", Label, "string" input Amount, "amount", slider, 50, 0, 1000 ramp 90 detent 100; input inOut, "zoom mode", Popup, 2, "in - in", "in - out", "out - in", "out - out"; input Aspect, "aspect", slider, 0, -1, 1; input Steps, "steps", slider, 8, 1, 300 ramp 90; input Center, "center", point, 0, 0; input preblur, "extra blurring", slider, 2, 0, 100 ramp 90 //--------------Ease In control --------------- input Acceleration, "ease in", Slider, 0, -2, 2 input Draft, "quick preview", checkbox, false code if (Draft && Previewing && (steps > 4)) //reduce the number of steps for previews //less than 4 steps is a bit ridiculous, reduce the number proportionally more if the steps are set really high steps = 4 + (steps-4)/(2*Log(steps)) end if //-------------stib's ease in ease out------------------- float e, magicnumber, newRatio; magicnumber = 8; e = 2.71828; //just defining a basic constant newRatio = Acceleration*(1-2/(1+power(e,magicnumber*power(ratio,e))))+(1-Acceleration)*ratio //my superClever easeIn easeOut formula. if srcIsGap1 newRatio = 0.5 + newRatio / 2 else if srcIsGap2 newRatio /=2 end if; //----------------------------------------------------- //string test; //*******for debug****** float HAmount, VAmount, BlendAmount, BlurFactor,MixAmount, counter; point destSize, sourceSize, sourcePoly[4], dest2Poly[4], destPoly[4], sourceSizePoly[4], destSizePoly[4]; Steps = integer(Steps); dimensionsof(dest, destSize.h, destSize.v); image buf1[destSize.h][ destSize.v], buf2[destSize.h][ destSize.v]; //set up our buffers to match our src and dest images BoundsOf(src1, sourceSizePoly); BoundsOf(dest, destSizePoly); sourcePoly = sourceSizePoly destPoly = destSizePoly Center *= destSize; preblur *= (destSize.h + destSize.v)/200 //----------first we do src1--------------- if !srcIsGap1 //adjust the Horizontal and vertical amounts for the chosen aspect ratio HAmount = Amount*newRatio / 100 VAmount = HAmount aspect += 1; if (Aspect<1) HAmount *= 2-power(Aspect,8); else if (Aspect > 1) VAmount *= power(Aspect,2); end if if (preblur > 0) Blur(src1, buf1, preblur*newRatio, aspect) else buf1 = src1 //first load the original image into the buffer end if if (inOut < 3) // zoom the first image in, for in-out or in-in Repeat With counter = 0 to Steps-1 Scale(sourcePoly, Center, 1-HAmount/(Steps), 1-VAmount/Steps) Blit(buf1, sourcePoly, buf1, destPoly, 1-counter/steps) //blitting the output back to itself means that we effectively increase the number of steps to steps^2 End Repeat else //zoom the first image out Repeat With counter = 0 to Steps-1 Scale(destPoly, Center, 1-HAmount/(Steps), 1-VAmount/Steps) Blit(buf1, sourcePoly, buf1, destPoly, 1-counter/steps) End Repeat end if end if //--------- then src2 --------------- if !srcIsGap2 //adjust the Horizontal and vertical amounts for the chosen aspect ratio HAmount = (1-newRatio)*Amount/100 VAmount = HAmount if (Aspect<1) HAmount *= 2-power(Aspect,8); else if (Aspect > 1) VAmount *= power(Aspect,2); end if sourcePoly = sourceSizePoly destPoly = destSizePoly if (preblur > 0) Blur(src2, buf2, preblur*(1-newRatio), aspect) else buf2 = src2 //first load the original image into the buffer end if if (inOut ==2) OR (inOut ==4) //zoom the second image out, for in-out or out-out Repeat With counter = 0 to Steps-1 Scale(sourcePoly, Center, 1-HAmount/Steps, 1-VAmount/Steps) Blit(buf2, sourcePoly, buf2, destPoly, 1-counter/steps) End Repeat else //zoom the second image in, for in-in or out-in Repeat With counter = 0 to Steps-1 Scale(destPoly, Center, 1-HAmount/Steps, 1-VAmount/Steps) Blit(buf2, sourcePoly, buf2, destPoly, 1-counter/steps) End Repeat end if //NumToString(HAmount*1000, test, kPlain)//********for debug******** //DrawString(test, 0, 0, 10, buf2, kWhite, 1) end if //dest = buf2//*********for debug********* Blend(buf1, buf2, dest, newRatio) if (Draft && Previewing) SetTextJustify(krightjustify) DrawString("draft preview", destsize.h*0.35, destsize.v*0.35, 10, dest, kWhite, 1) end ifnamezoom blur cross 1.2scriptidDgroupstib's transitionswipecode wipeaccuracyd producesalphaencoded