subtype idKGScriptParserduration? framebaseencodingparms inputFormat inputCountpublicspudtitlewww.fxscript.orguitype typedefaultstringvalue rgbmaster rgb effect strengthminmax?rampBuiinfosnapdetentsgamma gamma correction@??B?poo ) rsinusoid  r component?B gsinusoid  g component?B bsinusoid  b component?Bgraphon draw graphprivatestaticsscript filter "film curves 1.0"; group "stib's filters"; // imitates film response curves. sorta. //more filters and guff at //www.fxscript.org //This filter is free as in speech, as in beer. // it may be copied and distributed free of charge to whoever you like, // as long as these comments are included. // However it cannot be sold or included in a commercial release // without written consent from the author, stephen dixon. // see my website for contact details input spud, "www.fxscript.org", Label, "string" input RGBMaster, "rgb effect strength", slider, 0, -1, 1 ramp 80 detent 0; input Gamma, "gamma correction", slider, 1, 0, 4 ramp 78.5 detent 1 ; input poo, "", Label, ""; input rSinusoid, "r component", slider, 0, -1, 1 ramp 80 detent 0; input gSinusoid, "g component", slider, 0, -1, 1 ramp 80 detent 0; input bSinusoid, "b component", slider, 0, -1, 1 ramp 80 detent 0; input GraphOn, "draw graph", CheckBox, false //------------------------------------------------------------------------------------------------- code float i, clut_RGB[3][256], RGBSinusoid[3] float ColourChannel; //load the slider values into some arrays RGBSinusoid = {rSinusoid+RGBMaster, gSinusoid+RGBMaster, bSinusoid+RGBMaster}; // here we plot the graph into CLUTs. for ColourChannel = 0 to 2 if ((RGBMaster != 0) or (RGBSinusoid[ColourChannel]!=0) )//skip all this pallaver if the level sliders are not changed for i = 0 to 255 // the r, g & b and master sliders provide the parameters to an output function of the form y = x^a + b.sin(kx) clut_RGB[ColourChannel][i] = Power(i/255, gamma) + (0-RGBSinusoid[ColourChannel])/2*sin(i/255*360) ; //this is a cut down version from my colouriser filter. // I used to have checks for values > 256 and <0 here but you don't need em -levelmap takes care of this itself next; else clut_RGB[ColourChannel] = LinearRamp end if; next; levelmap(src1, dest, LinearRamp, clut_RGB[0], clut_RGB[1], clut_RGB[2]); //--------------------------------------draw graph function--------------------------------------- if GraphOn { color lineColour[3]; float screenwidth, screenheight point Xleft ,Xright , Ytop, RgraphPoint , GgraphPoint , BgraphPoint DimensionsOf(dest, screenwidth, screenheight); screenheight *= 0.8; screenwidth *= 0.8; Xleft = {0-screenwidth/2, screenheight/2} Xright = {screenwidth/2, screenheight/2} Ytop = {screenwidth/2, 0-screenheight/2} Line(Xleft , Xright , dest, kwhite, 2) Line(Xright , Ytop , dest, kwhite, 2) //x & y axes for ColourChannel = 0 to 2 for i = 0 to 255 if clut_RGB[ColourChannel][i] > 0 and clut_RGB[ColourChannel][i] < 1 RgraphPoint = {i/256*screenwidth - screenwidth/2,(screenheight/2)-clut_RGB[ColourChannel][i]*screenheight}; lineColour[0] = {0,255,0,0} lineColour[1] = {0,0,255,0}; lineColour[2] = {0,0,0,255}; //for some reason I couldn't do all this in one line. It kept chucking errors. DrawSoftDot(Dest, RgraphPoint, kRound, 3, 5, 1, lineColour[ColourChannel], 100, 1) // plot the red graph end if next; next; end if; namefilm curves 1.0scriptidCgroupstib's filtersencoded