subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublic keycolourtitle key colouruitypetypedefaultÿÿÿÿvalueÿÿÿÿurlwww.fxscript.org stringsoftness thresholdminmaxCCHCH sparkleradiusradiusDzA A rampB¾ edgefeathersoftnessDz@@!B¾useoriginalcoloursUse Original Colours glowcolour1 glow colourÿÿÿÿÿÿÿÿ compositemodeComposite Modeuiinfolabelsmattescreenmultiplyoverlayadd?€@ @ @ amountamountCúB B !B privatestaticsscript ±//--------------------------------// // stib's sparkle // //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 filter "sparkle" group "stib's filters" producesAlpha; input KeyColour, "key colour", Color, 255, 255, 255, 255 input url, "www.fxscript.org", Label, "string" input softness, "threshold", slider, 200, 0, 255; input SparkleRadius, "radius", slider, 20, 0, 1000 ramp 95; input edgefeather, "softness", slider, 2, 0, 1000 ramp 95; input UseOriginalColours, "Use Original Colours", CheckBox, 1 input glowColour1, "glow colour", Color, 255, 255, 255, 255 input CompositeMode, "Composite Mode", Popup, 5, "matte", "screen", "multiply", "overlay", "add" input amount, "amount", slider, 80, 0, 500 ramp 80 Code UseOriginalColours = !UseOriginalColours amount /= 100 softness = 255-softness float w,h; //float CLUT_a[256], CLUT_r[256], CLUT_g[256], CLUT_b[256]; //color KeyColour dimensionsof(dest,w,h); image buf1[w][h], buf2[w][h]; //select the highlight area to become our glow //using a colour key with black //KeyColour = {0,0,0,0} RGBColorKey(src1, buf1, KeyColour.r, softness, KeyColour.g, softness, KeyColour.b, softness, softness, 1) Invert(buf1, buf1) //fill the rgb channels of our key image with either our glow colour or the src image colour if UseOriginalColours ChannelFill(buf1, kNone, glowColour1.r, glowColour1.g, glowColour1.b) else ChannelCopy(src1, buf1, Knone, kRed, kGreen, kBlue) end if; //add pixie dust & feather our glow as user selects Diffuse(buf1, buf1, true, 0, SparkleRadius, 0, SparkleRadius) blur(buf1, buf2, edgefeather, aspectof(dest)) if CompositeMode == 1 //matte Matte(buf2, src1, dest, amount, kAlpha)//matte amount-=1 repeat while (amount > 0) Matte(buf2, dest, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 2 Screen(src1, buf2, dest, amount, kAlpha)//screen amount-=1 repeat while (amount > 0) Screen(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 3 Multiply(src1, buf2, dest, amount, kAlpha)//mult amount-=1 repeat while (amount > 0) Multiply(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 4 Overlay(src1, buf2, dest, amount, kAlpha)//overlay amount-=1 repeat while (amount > 0) Overlay(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 5 Add(src1, buf2, dest, amount, kAlpha) amount-=1 repeat while (amount > 0) Add(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat end ifnamesparklescriptidAgroupstib's filters producesalphaencoded