%ffp //------------------------------------- // FM_TEMPLATE_1 //------------------------------------- Category: "AstroPlugins" Title: "Sigmoid Stretch" Copyright: "Copyright ©2005 Author: "James Ryan" Organization: "Astroplugins" Filename: "Sigmoid Stretch" Description: "Sigmoid Stretch" Version: "v1.0" URL: "www.grekalova.com" About: "AstroPlugins !V\n" "!c\n!A\n!U" Dialog: Text = "Astroplugins Sigmoid Stretch !V !c !A" ctl(1):"Linear Addition(0)",range=(-49,50), val=0 ctl(2):"Low Boost Sigmoid(10)",range=(1,100), val=10 ctl(3):"Scale(50)",range=(0,255), val=50 ctl(4):"S Boost(50)",range=(0,255), val=50 ctl(5):"Sigmoid End(0)",range=(0,100), val=0 ctl(6):"S Inflection(50)",range=(0,100), val=50 ctl(8):checkbox, "Plot Graph",pos=(250,100),val=1 ctl(9):checkbox, "Reverse Plot",pos=(250,120),val=0 //------------------------------------- ForEveryTile: { int r,g,b,max,k,i,cv,c; float f,scalem,inv,cpower,mag,inf,ratio,num,den; float xint,yint,e,fx,fX,a,m,n,tau,hmax,fc,fmax,linear,right,sinf; bool plotgraph,reverse; e=2.71828; fX=(float)X; k=0; cpower = (float)ctl(1)/100; inf = ctl(2); tau = (float)ctl(4)/10; m = (float)ctl(2)/10; sinf = (float)ctl(6)/50; m=m*m; a = (float)ctl(1)/50; linear = (float)ctl(3)/50; right = (float)ctl(5)/100; c = src(x,y,z); scalem = 1; if (imageMode == 11) scalem=128; max = 255*scalem; fmax = (float)max; hmax = fmax/2.0; plotgraph=ctl(8); reverse = ctl(9); for (z=0;z0.0) { cv = c + c*fx; } else cv=c; } else { cpower = (sinf*hmax-fc)/fmax*tau; num = 1.0/(1+m*pow(e,cpower))-fc*right/fmax; fx =linear*(a+(1.0-num)); if (fx>0.0) { cv = c + c*fx; } else cv=c; } pset(x,y,z, cv); } } } if (plotgraph ==1) { for (x=0;x<25;x++) { } for (z=0;z