subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublicurltitlewww.fxscript.orguitype typedefaultstringvalue accelerationease inmin¿€max?€wipeclip wipe imageA‘šFsѨòfcanUseSrcClipAsInputClipuseSrcClipAsInputClip" keycolour key colourÿ€€€ÿ€€€softnesssoftnessBÈ@@@@rampB´ edgefeather edgefeatherDz@@)B¾keysrckey fromuiinfolabels outgoing clip incoming clip image well?€@@?€?€maskonly.use incoming clip as mask only (don't display)privatestaticsscript >//---------------------------------// // colour key cross 1.2 // // for more visit www.fxscript.org // //---------------------------------// //copyright 2005 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. transition "colorKey cross 1.2" group "stib's transitions" wipeCode(0, 100); producesAlpha; input url, "www.fxscript.org", Label, "string" //--------------Ease In control --------------- input Acceleration, "ease in", Slider, 0, -1, 1 input wipeClip, "wipe image", Clip input KeyColour, "key colour", Color, 255, 128, 128, 128 input softness, "softness", slider, 3, 0, 100 ramp 90; input edgefeather, "edgefeather", slider, 2, 0, 1000 ramp 95; input keySrc, "key from", Popup, 1, "outgoing clip", "incoming clip", "image well"; input MaskOnly, "use incoming clip as mask only (don't display)", CheckBox, false; code //-------------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 if srcIsGap1 newRatio =0.5 + newRatio / 2 else if srcIsGap2 newRatio /=2 end if; //----------------------------------------------------- float w,h,BlendAmount, softnessFactor, clipDur, Clipoffset; point centrepoint dimensionsof(dest,w,h); image buf1[w][h], buf2[w][h], buf3[w][h]; centrepoint = {0,0} //scale our inputs softness /= 100; //edgefeather *= w/100; softnessFactor = newRatio * 511 if (keySrc == 1) // use the input or output image for our key depending on user's choice RGBColorKey(src1, buf1, KeyColour.r, softnessFactor, KeyColour.g, softnessFactor, KeyColour.b, softnessFactor, softnessFactor*softness, 1) else if(keySrc == 2) RGBColorKey(src2, buf1, KeyColour.r, softnessFactor, KeyColour.g, softnessFactor, KeyColour.b, softnessFactor, softnessFactor*softness, 1) //note that we still apply the resultant alpha channel to src1 else GetLimits(wipeClip, clipDur, Clipoffset) if clipDur > 0 getVideo(wipeClip, clipDur*Ratio, buf3); else SetTextJustify(kcenterjustify) DrawString("no image", 0, 0, 10, buf3, KeyColour, aspectof(dest)) end if RGBColorKey(buf3, buf1, KeyColour.r, softnessFactor, KeyColour.g, softnessFactor, KeyColour.b, softnessFactor, softnessFactor*softness, 1) end if; //apply blur to the key to give edge feather Blur(buf1, buf2, edgefeather, aspectof(dest)) //apply the result of the key to the outgoing clip (src1) channelcopy(buf2, src1, kAlpha, kNone, kNone, kNone); if !MaskOnly //and then matte the outgoing clip over the incoming with its alpha applied Matte(src1, src2, dest, 1, KAlpha); else //if user has chosen to use incoming clip as a mask only then don't show it. Matte(src1, src1, dest, 1, KAlpha); end if; namecolorKey cross 1.2scriptidAgroupstib's transitionswipecode wipeaccuracyd producesalphaencoded