comment { See the comments part of mde.ucl file. Also, new great people have participated in the tests. I would like to thank them very much. As they are numerous and I don't want to forget anybody, they are all thanked at once. Helpfiles / Fichiers d'aide: http://www.pruniermei.ca/mde-help.zip Pour me contacter / To contact me: http://www.pruniermei.ca } md-courbeschaos-ed{ ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; ; d'après un souhait par Emily Garlick ; from a wish by Emily Garlick ; global: float a[4] float b[4] a[0] = @a1 a[1] = @a2 a[2] = @a3 a[3] = @a4 b[0] = @b1 b[1] = @b2 b[2] = @b3 b[3] = @b4 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) w =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 float theta = 0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif int courbe = 0 float pr=0 float i1 = 1638.0 float i2 = 6553.0 float i3 = 19660.0 float i4 = 32767.0 loop: if @hasard == 1 pr = real(#random*#z)*32767.0 elseif @hasard == 2 pr = imag(#random*#z)*32767.0 elseif @hasard == 0 ; pas de hasard pr = (real(#z)+imag(#z)) * 32767 elseif @hasard == 3 pr = (real(#random*#z)+imag(#random*#z)) *32767.0 elseif @hasard == 4 pr = (real(#random*#z)-imag(#random*#z)) *32767.0 elseif @hasard == 5 pr = (real(#random*#z)*imag(#random*#z)) *32767.0 elseif @hasard == 6 pr = (real(#random*#z)/imag(#random*#z)) *32767.0 elseif @hasard == 7 pr = (imag(#random*#z)/real(#random*#z)) *32767.0 elseif @hasard == 8 pr = (real(#random*#z)^imag(#random*#z)) *32767.0 elseif @hasard == 9 pr = (imag(#random*#z)^real(#random*#z)) *32767.0 elseif @hasard == 10 pr = (real(#z)*imag(#z)) * 32767 endif ;if pr > 32767 ; pr = pr % 32767 ;endif if @wrp == true && pr > 32767 pr = pr % 32767 endif if pr <= i1 courbe = @c1 i = 0 elseif pr <= i2 courbe = @c2 i = 1 elseif pr <= i3 courbe = @c3 i = 2 elseif pr <= i4 courbe = @c4 i = 3 endif if courbe == 0 ;lissajou x = real(@fn1(a[i]*#z)) y = imag(@fn2(b[i]*#z)) elseif courbe == 1 ;épicycloïde x = real((a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z)) y = imag((a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z)) elseif courbe == 2 ;compagnon du cycloïde x = real(a[i]*#z) y = imag(a[i]*(1-@fn1(#z))) elseif courbe == 3 ;cycloïde x = real(a[i]*#z - b[i]*@fn2(#z)) y = imag(a[i]*-b[i]*@fn1(#z)) elseif courbe == 4 x = real(a[i]*@fn1(#z)) ;ellipse y = imag(b[i]*@fn2(#z)) elseif courbe == 5 x = real(a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y = imag(b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif courbe == 6 x = real(b[i]*a[i]*#z / (1+#z^3)) ;folium de Descartes y = imag(b[i]*a[i]+#z^2 / (1+#z^3)) elseif courbe == 7 ;involute du cercle x = real(a[i]*@fn1(#z) + a[i]*#z*@fn2(#z)) y = imag(a[i]*@fn2(#z) - a[i]*#z*@fn1(#z)) elseif courbe == 8 ;nephroïde x = real(a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z))) y = imag(a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z))) elseif courbe == 9 ;courbe serpentine x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn1(#z)) elseif courbe == 10 ;sorcière d'Agnesi x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn2(#z)) elseif courbe == 11 ;tractrice x = real(#z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i])) y = imag(a[i]/@fn2(#z/a[i])) elseif courbe == 12 ;lissajou 2 x = @fn1(a[i]*#z) y = @fn2(b[i]*#z) elseif courbe == 13 ;épicycloïde 2 x = (a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z) y = (a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z) elseif courbe == 14 ;compagnon du cycloïde 2 x = a[i]*#z y = a[i]*(1-@fn1(#z)) elseif courbe == 15 ;cycloïde 2 x = a[i]*#z - b[i]*@fn2(#z) y = a[i]*-b[i]*@fn1(#z) elseif courbe == 16 x = a[i]*@fn1(#z) ;ellipse 2 y = b[i]*@fn2(#z) elseif courbe == 17 x = a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z) ;évolute de l'ellipse 2 y = b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z) elseif courbe == 18 x = b[i]*a[i]*#z / (1+#z^3) ;folium de Descartes 2 y = b[i]*a[i]+#z^2 / (1+#z^3) elseif courbe == 19 ;involute du cercle 2 x = a[i]*@fn1(#z) + a[i]*#z*@fn2(#z) y = a[i]*@fn2(#z) - a[i]*#z*@fn1(#z) elseif courbe == 20 ;nephroïde 2 x = a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z)) y = a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z)) elseif courbe == 21 ;courbe serpentine 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn1(#z) elseif courbe == 22 ;sorcière d'Agnesi 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn2(#z) elseif courbe == 23 ;tractrice 2 x = #z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i]) y = a[i]/@fn2(#z/a[i]) endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta elseif @coord ==2 rho = sqrt(sqr(x)+sqr(y)) w = x + flip(y) x = rho * cosh(real(w)) y = rho * sinh(imag(w)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes chaotiques" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 != 2 && @c1!= 7 && @c1!= 11 && @c1!= 14 && \ @c1!= 19 && @c1!= 23) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 != 2 && @c2!= 7 && @c2!= 11 && @c2!= 14 && \ @c2!= 19 && @c2!= 23) endparam heading caption = "Third Curve" endheading int param c3 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a3 caption = "a" default = 1.0 endparam float param b3 caption = "b" default = 1.0 visible = (@c3 != 2 && @c3!= 7 && @c3!= 11 && @c3!= 14 && \ @c3!= 19 && @c3!= 23) endparam heading caption = "Fourth Curve" endheading int param c4 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a4 caption = "a" default = 1.0 endparam float param b4 caption = "b" default = 1.0 visible = (@c4 != 2 && @c4!= 7 && @c4!= 11 && @c4!= 14 && \ @c4!= 19 && @c4!= 23) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = !((@c1 == 6 || @c1 == 18) && (@c2 == 6 || @c2 == 18) && \ (@c3 == 6 || @c3 == 18) && (@c4 == 6 || @c4 == 18)) endfunc func fn2 caption = "Second Function" default = sin() visible = !((@c1 == 6 || @c1 == 18 || @c1 == 2 || @c1 == 14) && \ (@c2 == 6 || @c2 == 18 || @c2 == 2 || @c2 == 14) && \ (@c3 == 6 || @c3 == 18 || @c3 == 2 || @c3 == 14) && \ (@c4 == 6 || @c4 == 18 || @c4 == 2 || @c4 == 14)) endfunc heading caption = "Chaos" endheading int param hasard caption ="Chaos" enum="no" "real" "imag" "real+imag" "real-imag" "real*imag" \ "real/imag" "imag/real" "real^imag" "imag^real" "multi" endparam bool param wrp caption = "Apply wrap around?" default = false visible = (@hasard > 0) endparam heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 0 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbespairimp-ed{ ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; global: float a[2] float b[2] a[0] = @a1 a[1] = @a2 b[0] = @b1 b[1] = @b2 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) w =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) int courbe = 0 trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif loop: courbe = @c2 temp1 = trunc(|#z|) i = 1 if temp1 % 2 == 0 courbe = @c1 i = 0 endif if courbe == 0 ;lissajou x = real(@fn1(a[i]*#z)) y = imag(@fn2(b[i]*#z)) elseif courbe == 1 ;épicycloïde x = real((a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z)) y = imag((a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z)) elseif courbe == 2 ;compagnon du cycloïde x = real(a[i]*#z) y = imag(a[i]*(1-@fn1(#z))) elseif courbe == 3 ;cycloïde x = real(a[i]*#z - b[i]*@fn2(#z)) y = imag(a[i]*-b[i]*@fn1(#z)) elseif courbe == 4 x = real(a[i]*@fn1(#z)) ;ellipse y = imag(b[i]*@fn2(#z)) elseif courbe == 5 x = real(a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y = imag(b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif courbe == 6 x = real(b[i]*a[i]*#z / (1+#z^3)) ;folium de Descartes y = imag(b[i]*a[i]+#z^2 / (1+#z^3)) elseif courbe == 7 ;involute du cercle x = real(a[i]*@fn1(#z) + a[i]*#z*@fn2(#z)) y = imag(a[i]*@fn2(#z) - a[i]*#z*@fn1(#z)) elseif courbe == 8 ;nephroïde x = real(a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z))) y = imag(a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z))) elseif courbe == 9 ;courbe serpentine x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn1(#z)) elseif courbe == 10 ;sorcière d'Agnesi x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn2(#z)) elseif courbe == 11 ;tractrice x = real(#z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i])) y = imag(a[i]/@fn2(#z/a[i])) elseif courbe == 12 ;lissajou 2 x = @fn1(a[i]*#z) y = @fn2(b[i]*#z) elseif courbe == 13 ;épicycloïde 2 x = (a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z) y = (a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z) elseif courbe == 14 ;compagnon du cycloïde 2 x = a[i]*#z y = a[i]*(1-@fn1(#z)) elseif courbe == 15 ;cycloïde 2 x = a[i]*#z - b[i]*@fn2(#z) y = a[i]*-b[i]*@fn1(#z) elseif courbe == 16 x = a[i]*@fn1(#z) ;ellipse 2 y = b[i]*@fn2(#z) elseif courbe == 17 x = a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z) ;évolute de l'ellipse 2 y = b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z) elseif courbe == 18 x = b[i]*a[i]*#z / (1+#z^3) ;folium de Descartes 2 y = b[i]*a[i]+#z^2 / (1+#z^3) elseif courbe == 19 ;involute du cercle 2 x = a[i]*@fn1(#z) + a[i]*#z*@fn2(#z) y = a[i]*@fn2(#z) - a[i]*#z*@fn1(#z) elseif courbe == 20 ;nephroïde 2 x = a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z)) y = a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z)) elseif courbe == 21 ;courbe serpentine 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn1(#z) elseif courbe == 22 ;sorcière d'Agnesi 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn2(#z) elseif courbe == 23 ;tractrice 2 x = #z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i]) y = a[i]/@fn2(#z/a[i]) endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta elseif @coord ==2 rho = sqrt(sqr(x)+sqr(y)) w = x + flip(y) x = rho * cosh(real(w)) y = rho * sinh(imag(w)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes pair-impair" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "Even Curve" endheading int param c1 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 != 2 && @c1!= 7 && @c1!= 11 && @c1!= 14 && \ @c1!= 19 && @c1!= 23) endparam heading caption = "Odd Curve" endheading int param c2 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 != 2 && @c2!= 7 && @c2!= 11 && @c2!= 14 && \ @c2!= 19 && @c2!= 23) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = !((@c1 == 6 || @c1 == 18) && (@c2 == 6 || @c2 == 18)) endfunc func fn2 caption = "Second Function" default = sin() visible = !((@c1 == 6 || @c1 == 18 || @c1 == 2 || @c1 == 14) && \ (@c2 == 6 || @c2 == 18 || @c2 == 2 || @c2 == 14)) endfunc heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 0 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbesrot-ec{ ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; global: float a[4] float b[4] a[0] = @a1 a[1] = @a2 a[2] = @a3 a[3] = @a4 b[0] = @b1 b[1] = @b2 b[2] = @b3 b[3] = @b4 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) w =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif int courbe = 0 int mod_iter = 0 loop: mod_iter=iter%@iterfac if mod_iter ==0 courbe = @c1 elseif mod_iter == 1 courbe = @c2 elseif mod_iter == 2 courbe = @c3 elseif mod_iter == 3 courbe = @c4 endif i = mod_iter if courbe == 0 ;lissajou x = real(@fn1(a[i]*#z)) y = imag(@fn2(b[i]*#z)) elseif courbe == 1 ;épicycloïde x = real((a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z)) y = imag((a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z)) elseif courbe == 2 ;compagnon du cycloïde x = real(a[i]*#z) y = imag(a[i]*(1-@fn1(#z))) elseif courbe == 3 ;cycloïde x = real(a[i]*#z - b[i]*@fn2(#z)) y = imag(a[i]*-b[i]*@fn1(#z)) elseif courbe == 4 x = real(a[i]*@fn1(#z)) ;ellipse y = imag(b[i]*@fn2(#z)) elseif courbe == 5 x = real(a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y = imag(b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif courbe == 6 x = real(b[i]*a[i]*#z / (1+#z^3)) ;folium de Descartes y = imag(b[i]*a[i]+#z^2 / (1+#z^3)) elseif courbe == 7 ;involute du cercle x = real(a[i]*@fn1(#z) + a[i]*#z*@fn2(#z)) y = imag(a[i]*@fn2(#z) - a[i]*#z*@fn1(#z)) elseif courbe == 8 ;nephroïde x = real(a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z))) y = imag(a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z))) elseif courbe == 9 ;courbe serpentine x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn1(#z)) elseif courbe == 10 ;sorcière d'Agnesi x = real(a[i]*@fn1(#z)/@fn2(#z)) y = imag(b[i]*@fn2(#z)*@fn2(#z)) elseif courbe == 11 ;tractrice x = real(#z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i])) y = imag(a[i]/@fn2(#z/a[i])) elseif courbe == 12 ;lissajou 2 x = @fn1(a[i]*#z) y = @fn2(b[i]*#z) elseif courbe == 13 ;épicycloïde 2 x = (a[i]+b[i])*@fn1(#z)- b[i]*@fn1(((a[i]+b[i])/b[i])*#z) y = (a[i]+b[i])*@fn2(#z)- b[i]*@fn2(((a[i]+b[i])/b[i])*#z) elseif courbe == 14 ;compagnon du cycloïde 2 x = a[i]*#z y = a[i]*(1-@fn1(#z)) elseif courbe == 15 ;cycloïde 2 x = a[i]*#z - b[i]*@fn2(#z) y = a[i]*-b[i]*@fn1(#z) elseif courbe == 16 x = a[i]*@fn1(#z) ;ellipse 2 y = b[i]*@fn2(#z) elseif courbe == 17 x = a[i]*@fn1(#z)*@fn1(#z)*@fn1(#z) ;évolute de l'ellipse 2 y = b[i]*@fn2(#z)*@fn2(#z)*@fn2(#z) elseif courbe == 18 x = b[i]*a[i]*#z / (1+#z^3) ;folium de Descartes 2 y = b[i]*a[i]+#z^2 / (1+#z^3) elseif courbe == 19 ;involute du cercle 2 x = a[i]*@fn1(#z) + a[i]*#z*@fn2(#z) y = a[i]*@fn2(#z) - a[i]*#z*@fn1(#z) elseif courbe == 20 ;nephroïde 2 x = a[i]*.5*(b[i]*@fn1(#z) - @fn1(b[i]*#z)) y = a[i]*.5*(b[i]*@fn2(#z) - @fn2(b[i]*#z)) elseif courbe == 21 ;courbe serpentine 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn1(#z) elseif courbe == 22 ;sorcière d'Agnesi 2 x = a[i]*@fn1(#z)/@fn2(#z) y = b[i]*@fn2(#z)*@fn2(#z) elseif courbe == 23 ;tractrice 2 x = #z-a[i]*@fn2(#z/a[i])/@fn1(#z/a[i]) y = a[i]/@fn2(#z/a[i]) endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta elseif @coord ==2 rho = sqrt(sqr(x)+sqr(y)) w = x + flip(y) x = rho * cosh(real(w)) y = rho * sinh(imag(w)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes rotation" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam int param iterfac caption = "Iteration Factor" default = 4 min = 2 max = 4 endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 != 2 && @c1!= 7 && @c1!= 11 && @c1!= 14 && \ @c1!= 19 && @c1!= 23) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 != 2 && @c2!= 7 && @c2!= 11 && @c2!= 14 && \ @c2!= 19 && @c2!= 23) endparam heading caption = "Third Curve" visible = (@iterfac > 2) endheading int param c3 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" visible = (@iterfac > 2) endparam float param a3 caption = "a" default = 1.0 visible = (@iterfac > 2) endparam float param b3 caption = "b" default = 1.0 visible = (@iterfac > 2 && @c3 != 2 && @c3!= 7 && @c3!= 11 && @c3!= 14 && \ @c3!= 19 && @c3!= 23) endparam heading caption = "Fourth Curve" visible = (@iterfac > 3 ) endheading int param c4 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" visible = (@iterfac > 3 ) endparam float param a4 caption = "a" default = 1.0 visible = (@iterfac > 3 ) endparam float param b4 caption = "b" default = 1.0 visible = (@iterfac > 3 && @c4 != 2 && @c4!= 7 && @c4!= 11 && @c4!= 14 && \ @c4!= 19 && @c4!= 23) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = !((@c1 == 6 || @c1 == 18) && (@c2 == 6 || @c2 == 18)) endfunc func fn2 caption = "Second Function" default = sin() visible = !((@c1 == 6 || @c1 == 18 || @c1 == 2 || @c1 == 14) && \ (@c2 == 6 || @c2 == 18 || @c2 == 2 || @c2 == 14)) endfunc heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 0 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@txtr_gnarl > 0) default = 1 endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbesvscourbes-c{ ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) w =(0.0,0.0) x1 =(0.0,0.0) y1 =(0.0,0.0) x2 =(0.0,0.0) y2 =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif loop: if @c1 == 0 ;lissajou x1 = real(@fn1(@a1*#z)) y1 = imag(@fn2(@b1*#z)) elseif @c1 == 1 ;épicycloïde x1 = real((@a1+@b1)*@fn1(#z)- @b1*@fn1(((@a1+@b1)/@b1)*#z)) y1 = imag((@a1+@b1)*@fn2(#z)- @b1*@fn2(((@a1+@b1)/@b1)*#z)) elseif @c1 == 2 ;compagnon du cycloïde x1 = real(@a1*#z) y1 = imag(@a1*(1-@fn1(#z))) elseif @c1 == 3 ;cycloïde x1 = real(@a1*#z - @b1*@fn2(#z)) y1 = imag(@a1*-@b1*@fn1(#z)) elseif @c1 == 4 x1 = real(@a1*@fn1(#z)) ;ellipse y1 = imag(@b1*@fn2(#z)) elseif @c1 == 5 x1 = real(@a1*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y1 = imag(@b1*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif @c1 == 6 x1 = real(@b1*@a1*#z / (1+#z^3)) ;folium de Descartes y1 = imag(@b1*@a1+#z^2 / (1+#z^3)) elseif @c1 == 7 ;involute du cercle x1 = real(@a1*@fn1(#z) + @a1*#z*@fn2(#z)) y1 = imag(@a1*@fn2(#z) - @a1*#z*@fn1(#z)) elseif @c1 == 8 ;nephroïde x1 = real(@a1*.5*(@b1*@fn1(#z) - @fn1(@b1*#z))) y1 = imag(@a1*.5*(@b1*@fn2(#z) - @fn2(@b1*#z))) elseif @c1 == 9 ;courbe serpentine x1 = real(@a1*@fn1(#z)/@fn2(#z)) y1= imag(@b1*@fn2(#z)*@fn1(#z)) elseif @c1 == 10 ;sorcière d'Agnesi x1 = real(@a1*@fn1(#z)/@fn2(#z)) y1 = imag(@b1*@fn2(#z)*@fn2(#z)) elseif @c1 == 11 ;tractrice x1 = real(#z-@a1*@fn2(#z/@a1)/@fn1(#z/@a1)) y1 = imag(@a1/@fn2(#z/@a1)) elseif @c1 == 12 ;lissajou 2 x1 = @fn1(@a1*#z) y1 = @fn2(@b1*#z) elseif @c1 == 13 ;épicycloïde 2 x1 = (@a1+@b1)*@fn1(#z)- @b1*@fn1(((@a1+@b1)/@b1)*#z) y1 = (@a1+@b1)*@fn2(#z)- @b1*@fn2(((@a1+@b1)/@b1)*#z) elseif @c1 == 14 ;compagnon du cycloïde 2 x1 = @a1*#z y1 = @a1*(1-@fn1(#z)) elseif @c1 == 15 ;cycloïde 2 x1 = @a1*#z - @b1*@fn2(#z) y1 = @a1*-@b1*@fn1(#z) elseif @c1 == 16 x1 = @a1*@fn1(#z) ;ellipse 2 y1 = @b1*@fn2(#z) elseif @c1 == 17 x1 = @a1*@fn1(#z)*@fn1(#z)*@fn1(#z) ;évolute de l'ellipse 2 y1 = @b1*@fn2(#z)*@fn2(#z)*@fn2(#z) elseif @c1 == 18 x1 = @b1*@a1*#z / (1+#z^3) ;folium de Descartes 2 y1 = @b1*@a1+#z^2 / (1+#z^3) elseif @c1 == 19 ;involute du cercle 2 x1 = @a1*@fn1(#z) + @a1*#z*@fn2(#z) y1 = @a1*@fn2(#z) - @a1*#z*@fn1(#z) elseif @c1 == 20 ;nephroïde 2 x1 = @a1*.5*(@b1*@fn1(#z) - @fn1(@b1*#z)) y1 = @a1*.5*(@b1*@fn2(#z) - @fn2(@b1*#z)) elseif @c1 == 21 ;courbe serpentine 2 x1 = @a1*@fn1(#z)/@fn2(#z) y1 = @b1*@fn2(#z)*@fn1(#z) elseif @c1 == 22 ;sorcière d'Agnesi 2 x1 = @a1*@fn1(#z)/@fn2(#z) y1 = @b1*@fn2(#z)*@fn2(#z) elseif @c1 == 23 ;tractrice 2 x1 = #z-@a1*@fn2(#z/@a1)/@fn1(#z/@a1) y1 = @a1/@fn2(#z/@a1) endif if @c2 == 0 ;lissajou x2 = real(@fn1(@a2*#z)) y2 = imag(@fn2(@b2*#z)) elseif @c2 == 1 ;épicycloïde x2 = real((@a2+@b2)*@fn1(#z)- @b2*@fn1(((@a2+@b2)/@b2)*#z)) y2 = imag((@a2+@b2)*@fn2(#z)- @b2*@fn2(((@a2+@b2)/@b2)*#z)) elseif @c2 == 2 ;compagnon du cycloïde x2 = real(@a2*#z) y2 = imag(@a2*(1-@fn1(#z))) elseif @c2 == 3 ;cycloïde x2 = real(@a2*#z - @b2*@fn2(#z)) y2 = imag(@a2*-@b2*@fn1(#z)) elseif @c2 == 4 x2 = real(@a2*@fn1(#z)) ;ellipse y2 = imag(@b2*@fn2(#z)) elseif @c2 == 5 x2 = real(@a2*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y2 = imag(@b2*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif @c2 == 6 x2 = real(@b2*@a2*#z / (1+#z^3)) ;folium de Descartes y2 = imag(@b2*@a2+#z^2 / (1+#z^3)) elseif @c2 == 7 ;involute du cercle x2 = real(@a2*@fn1(#z) + @a2*#z*@fn2(#z)) y2 = imag(@a2*@fn2(#z) - @a2*#z*@fn1(#z)) elseif @c2 == 8 ;nephroïde x2 = real(@a2*.5*(@b2*@fn1(#z) - @fn1(@b2*#z))) y2 = imag(@a2*.5*(@b2*@fn2(#z) - @fn2(@b2*#z))) elseif @c2 == 9 ;courbe serpentine x2 = real(@a2*@fn1(#z)/@fn2(#z)) y2= imag(@b2*@fn2(#z)*@fn1(#z)) elseif @c2 == 10 ;sorcière d'Agnesi x2 = real(@a2*@fn1(#z)/@fn2(#z)) y2 = imag(@b2*@fn2(#z)*@fn2(#z)) elseif @c2 == 11 ;tractrice x2 = real(#z-@a2*@fn2(#z/@a2)/@fn1(#z/@a2)) y2 = imag(@a2/@fn2(#z/@a2)) elseif @c2 == 12 ;lissajou 2 x2 = @fn1(@a2*#z) y2 = @fn2(@b2*#z) elseif @c2 == 13 ;épicycloïde 2 x2 = (@a2+@b2)*@fn1(#z)- @b2*@fn1(((@a2+@b2)/@b2)*#z) y2 = (@a2+@b2)*@fn2(#z)- @b2*@fn2(((@a2+@b2)/@b2)*#z) elseif @c2 == 14 ;compagnon du cycloïde 2 x2 = @a2*#z y2 = @a2*(1-@fn1(#z)) elseif @c2 == 15 ;cycloïde 2 x2 = @a2*#z - @b2*@fn2(#z) y2 = @a2*-@b2*@fn1(#z) elseif @c2 == 16 x2 = @a2*@fn1(#z) ;ellipse 2 y2 = @b2*@fn2(#z) elseif @c2 == 17 x2 = @a2*@fn1(#z)*@fn1(#z)*@fn1(#z) ;évolute de l'ellipse 2 y2 = @b2*@fn2(#z)*@fn2(#z)*@fn2(#z) elseif @c2 == 18 x2 = @b2*@a2*#z / (1+#z^3) ;folium de Descartes 2 y2 = @b2*@a2+#z^2 / (1+#z^3) elseif @c2 == 19 ;involute du cercle 2 x2 = @a2*@fn1(#z) + @a2*#z*@fn2(#z) y2 = @a2*@fn2(#z) - @a2*#z*@fn1(#z) elseif @c2 == 20 ;nephroïde 2 x2 = @a2*.5*(@b2*@fn1(#z) - @fn1(@b2*#z)) y2 = @a2*.5*(@b2*@fn2(#z) - @fn2(@b2*#z)) elseif @c2 == 21 ;courbe serpentine 2 x2 = @a2*@fn1(#z)/@fn2(#z) y2 = @b2*@fn2(#z)*@fn1(#z) elseif @c2 == 22 ;sorcière d'Agnesi 2 x2 = @a2*@fn1(#z)/@fn2(#z) y2 = @b2*@fn2(#z)*@fn2(#z) elseif @c2 == 23 ;tractrice 2 x2 = #z-@a2*@fn2(#z/@a2)/@fn1(#z/@a2) y2 = @a2/@fn2(#z/@a2) endif if @oper == 0 x = x1+x2 y = y1+y2 elseif @oper == 1 x = x1-x2 y = y1-y2 elseif @oper == 2 x = x1*x2 y = y1*y2 elseif @oper == 3 x = x1/x2 y = y1/y2 elseif @oper == 4 x = x1^x2 y = y1^y2 endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta elseif @coord ==2 rho = sqrt(sqr(x)+sqr(y)) w = x + flip(y) x = rho * cosh(real(w)) y = rho * sinh(imag(w)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = texture_rnd+texture_fbm+texture_dec elseif @gnarl_init == 12 p = #z endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes vs courbes" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 != 2 && @c1!= 7 && @c1!= 11 && @c1!= 14 && \ @c1!= 19 && @c1!= 23) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="lissajou" "epicycloid" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "lissajou 2" "epicycloïde 2" "companion 2" "cycloid 2" \ "ellipse 2" "evolute 2" "folium 2" "involute 2" \ "nephroid 2" "serpentine 2" "agnesi 2" "tractrix 2" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 != 2 && @c2!= 7 && @c2!= 11 && @c2!= 14 && \ @c2!= 19 && @c2!= 23) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = !((@c1 == 6 || @c1 == 18) && (@c2 == 6 || @c2 == 18)) endfunc func fn2 caption = "Second Function" default = sin() visible = !((@c1 == 6 || @c1 == 18 || @c1 == 2 || @c1 == 14) && \ (@c2 == 6 || @c2 == 18 || @c2 == 2 || @c2 == 14)) endfunc heading caption = "Curves Processing" endheading int param oper caption = "Operations" enum = "c1+c2" "c1-c2" "c1*c2" "c1/c2" "c1^c2" endparam heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 0 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" "#Z" \ "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "hand over" "#Z" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbeschaospol-ed { ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; ; d'après un souhait par Emily Garlick ; from a wish by Emily Garlick ; global: float a[4] float b[4] a[0] = @a1 a[1] = @a2 a[2] = @a3 a[3] = @a4 b[0] = @b1 b[1] = @b2 b[2] = @b3 b[3] = @b4 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) rho =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 float theta = 0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif int courbe = 0 float pr=0 float i1 = 1638.0 float i2 = 6553.0 float i3 = 19660.0 float i4 = 32767.0 loop: if @hasard == 1 pr = real(#random*#z)*32767.0 elseif @hasard == 2 pr = imag(#random*#z)*32767.0 elseif @hasard == 0 ; pas de hasard pr = (real(#z)+imag(#z)) * 32767 elseif @hasard == 3 pr = (real(#random*#z)+imag(#random*#z)) *32767.0 elseif @hasard == 4 pr = (real(#random*#z)-imag(#random*#z)) *32767.0 elseif @hasard == 5 pr = (real(#random*#z)*imag(#random*#z)) *32767.0 elseif @hasard == 6 pr = (real(#random*#z)/imag(#random*#z)) *32767.0 elseif @hasard == 7 pr = (imag(#random*#z)/real(#random*#z)) *32767.0 elseif @hasard == 8 pr = (real(#random*#z)^imag(#random*#z)) *32767.0 elseif @hasard == 9 pr = (imag(#random*#z)^real(#random*#z)) *32767.0 elseif @hasard == 10 pr = (real(#z)*imag(#z)) * 32767 endif ;if pr > 32767 ; pr = pr % 32767 ;endif if @wrp == true && pr > 32767 pr = pr % 32767 endif if pr <= i1 courbe = @c1 i = 0 elseif pr <= i2 courbe = @c2 i = 1 elseif pr <= i3 courbe = @c3 i = 2 elseif pr <= i4 courbe = @c4 i = 3 endif if courbe == 0 ;bifolium rho = a[i]*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif courbe == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho = a[i]*@fn1(#z)+b[i] elseif courbe == 2 ;cissoïde de Dioclès rho = a[i]*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif courbe == 3 ;cochléoïde rho = a[i]*@fn2(#z)/#z elseif courbe == 4 ;conchoïde de Nicomède rho = a[i]/@fn2(#z)+b[i] elseif courbe == 5 rho = (a[i]^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif courbe == 6 rho = (a[i]^2/#z)^.5 ;lituus elseif courbe == 7 ;pétales rho = a[i]*@fn1(b[i]*#z) elseif courbe == 8 ;parabole rho = 2*a[i]/(1-@fn1(#z)) elseif courbe == 9 ;spirale d'Archimède rho = a[i]*#z elseif courbe == 10 ;spirale hyperbolique rho = a[i]/#z elseif courbe == 11 ;spirale logarithmique rho = exp(a[i]*#z) elseif courbe == 12 ;strophoïde rho = a[i]*@fn1(2*#z)/@fn1(#z) endif if @coord == 0 x = rho * cos(real(#z)) y = rho * sin(imag(#z)) elseif @coord == 1 x = rho y = theta elseif @coord ==2 x = rho * cosh(real(#z)) y = rho * sinh(imag(#z)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes polaires chaotiques" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 == 1 || @c1 == 4 || @c1 == 7) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 == 1 || @c2 == 4 || @c2 == 7) endparam heading caption = "Third Curve" endheading int param c3 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a3 caption = "a" default = 1.0 endparam float param b3 caption = "b" default = 1.0 visible = (@c3 == 1 || @c3 == 4 || @c3 == 7) endparam heading caption = "Fourth Curve" endheading int param c4 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a4 caption = "a" default = 1.0 endparam float param b4 caption = "b" default = 1.0 visible = (@c4 == 1 || @c4 == 4 || @c4 == 7) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = (@c1 == 0 || @c2 == 0 || @c3 ==0 || @c4 == 0 || \ @c1 == 2 || @c2 == 2 || @c3 ==2 || @c4 == 2 || \ @c1 == 1 || @c2 == 1 || @c3 ==1 || @c4 == 1 || \ @c1 == 5 || @c2 == 5 || @c3 ==5 || @c4 == 5 || \ @c1 == 7 || @c2 == 7 || @c3 ==7 || @c4 == 7 || \ @c1 == 8 || @c2 == 8 || @c3 ==8 || @c4 == 8 || \ @c1 == 12 || @c2 == 12 || @c3 ==12 || @c4 == 12) endfunc func fn2 caption = "Second Function" default = sin() visible = (@c1 == 0 || @c2 == 0 || @c3 ==0 || @c4 == 0 || \ @c1 == 2 || @c2 == 2 || @c3 ==2 || @c4 == 2 || \ @c1 == 3 || @c2 == 3 || @c3 ==3 || @c4 == 3 || \ @c1 == 4 || @c2 == 4 || @c3 ==4 || @c4 == 4) endfunc heading caption = "Chaos" endheading int param hasard caption ="Chaos" enum="no" "real" "imag" "real+imag" "real-imag" "real*imag" \ "real/imag" "imag/real" "real^imag" "imag^real" "multi" endparam bool param wrp caption = "Apply wrap around?" default = false visible = (@hasard > 0) endparam heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 1 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbespairimppol-ed { ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; global: float a[2] float b[2] a[0] = @a1 a[1] = @a2 b[0] = @b1 b[1] = @b2 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) rho = (0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) int courbe = 0 trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif loop: courbe = @c2 temp1 = trunc(|#z|) i = 1 if temp1 % 2 == 0 courbe = @c1 i = 0 endif if courbe == 0 ;bifolium rho = a[i]*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif courbe == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho = a[i]*@fn1(#z)+b[i] elseif courbe == 2 ;cissoïde de Dioclès rho = a[i]*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif courbe == 3 ;cochléoïde rho = a[i]*@fn2(#z)/#z elseif courbe == 4 ;conchoïde de Nicomède rho = a[i]/@fn2(#z)+b[i] elseif courbe == 5 rho = (a[i]^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif courbe == 6 rho = (a[i]^2/#z)^.5 ;lituus elseif courbe == 7 ;pétales rho = a[i]*@fn1(b[i]*#z) elseif courbe == 8 ;parabole rho = 2*a[i]/(1-@fn1(#z)) elseif courbe == 9 ;spirale d'Archimède rho = a[i]*#z elseif courbe == 10 ;spirale hyperbolique rho = a[i]/#z elseif courbe == 11 ;spirale logarithmique rho = exp(a[i]*#z) elseif courbe == 12 ;strophoïde rho = a[i]*@fn1(2*#z)/@fn1(#z) endif if @coord == 0 x = rho * cos(real(#z)) y = rho * sin(imag(#z)) elseif @coord == 1 x = rho y = theta elseif @coord ==2 x = rho * cosh(real(#z)) y = rho * sinh(imag(#z)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes polaires pair-impair" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "Even Curve" endheading int param c1 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 == 1 || @c1 == 4 || @c1 == 7) endparam heading caption = "Odd Curve" endheading int param c2 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 == 1 || @c2 == 4 || @c2 == 7) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = (@c1 == 0 || @c2 == 0 || @c1 == 2 || @c2 == 2 || \ @c1 == 1 || @c2 == 1 || @c1 == 5 || @c2 == 5 || \ @c1 == 7 || @c2 == 7 || @c1 == 8 || @c2 == 8 || \ @c1 == 12 || @c2 == 12) endfunc func fn2 caption = "Second Function" default = sin() visible = (@c1 == 0 || @c2 == 0 || @c1 == 2 || @c2 == 2 || \ @c1 == 3 || @c2 == 3 || @c1 == 4 || @c2 == 4) endfunc heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 1 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbesrotpol-ec { ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; global: float a[4] float b[4] a[0] = @a1 a[1] = @a2 a[2] = @a3 a[3] = @a4 b[0] = @b1 b[1] = @b2 b[2] = @b3 b[3] = @b4 init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int i = 0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) rho =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif int courbe = 0 int mod_iter = 0 loop: mod_iter=iter%@iterfac if mod_iter ==0 courbe = @c1 elseif mod_iter == 1 courbe = @c2 elseif mod_iter == 2 courbe = @c3 elseif mod_iter == 3 courbe = @c4 endif i = mod_iter if courbe == 0 ;bifolium rho = a[i]*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif courbe == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho = a[i]*@fn1(#z)+b[i] elseif courbe == 2 ;cissoïde de Dioclès rho = a[i]*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif courbe == 3 ;cochléoïde rho = a[i]*@fn2(#z)/#z elseif courbe == 4 ;conchoïde de Nicomède rho = a[i]/@fn2(#z)+b[i] elseif courbe == 5 rho = (a[i]^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif courbe == 6 rho = (a[i]^2/#z)^.5 ;lituus elseif courbe == 7 ;pétales rho = a[i]*@fn1(b[i]*#z) elseif courbe == 8 ;parabole rho = 2*a[i]/(1-@fn1(#z)) elseif courbe == 9 ;spirale d'Archimède rho = a[i]*#z elseif courbe == 10 ;spirale hyperbolique rho = a[i]/#z elseif courbe == 11 ;spirale logarithmique rho = exp(a[i]*#z) elseif courbe == 12 ;strophoïde rho = a[i]*@fn1(2*#z)/@fn1(#z) endif if @coord == 0 x = rho * cos(real(#z)) y = rho * sin(imag(#z)) elseif @coord == 1 x = rho y = theta elseif @coord ==2 x = rho * cosh(real(#z)) y = rho * sinh(imag(#z)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float _a = u1 + sx*(v1-u1) float _bb = u2 + sx*(v2-u2) sum = sum + (_a + sy*(_bb-_a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = #z elseif @gnarl_init == 12 p = texture_rnd+texture_fbm+texture_dec endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes polaires rotation" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam int param iterfac caption = "Iteration Factor" default = 4 min = 2 max = 4 endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 == 1 || @c1 == 4 || @c1 == 7) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 == 1 || @c2 == 4 || @c2 == 7) endparam heading caption = "Third Curve" visible = (@iterfac > 2) endheading int param c3 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" visible = (@iterfac > 2) endparam float param a3 caption = "a" default = 1.0 visible = (@iterfac > 2) endparam float param b3 caption = "b" default = 1.0 visible = (@iterfac > 2 && (@c3 == 1 || @c3 == 4 || @c3 == 7)) endparam heading caption = "Fourth Curve" visible = (@iterfac > 3 ) endheading int param c4 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" visible = (@iterfac > 3 ) endparam float param a4 caption = "a" default = 1.0 visible = (@iterfac > 3 ) endparam float param b4 caption = "b" default = 1.0 visible = (@iterfac > 3 && (@c4 == 1 || @c4 == 4 || @c4 == 7)) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = (@c1 == 0 || @c2 == 0 || @c3 ==0 || @c4 == 0 || \ @c1 == 2 || @c2 == 2 || @c3 ==2 || @c4 == 2 || \ @c1 == 1 || @c2 == 1 || @c3 ==1 || @c4 == 1 || \ @c1 == 5 || @c2 == 5 || @c3 ==5 || @c4 == 5 || \ @c1 == 7 || @c2 == 7 || @c3 ==7 || @c4 == 7 || \ @c1 == 8 || @c2 == 8 || @c3 ==8 || @c4 == 8 || \ @c1 == 12 || @c2 == 12 || @c3 ==12 || @c4 == 12) endfunc func fn2 caption = "Second Function" default = sin() visible = (@c1 == 0 || @c2 == 0 || @c3 ==0 || @c4 == 0 || \ @c1 == 2 || @c2 == 2 || @c3 ==2 || @c4 == 2 || \ @c1 == 3 || @c2 == 3 || @c3 ==3 || @c4 == 3 || \ @c1 == 4 || @c2 == 4 || @c3 ==4 || @c4 == 4) endfunc heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 1 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "#Z" "hand over" visible = (@txtr_gnarl > 0) default = 1 endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam } md-courbesvscourbespol-c { ; Michèle Dessureault, 12 décembre 1999 ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x =(0.0,0.0) y =(0.0,0.0) rho =(0.0,0.0) rho1 =(0.0,0.0) rho2 =(0.0,0.0) float xx =0 float yy =0 float path = 0.0 float pathmin = 0.0 float pathmax = 0.0 float trap_path = 0.0 float trap_dist = 0.0 float trap_magn = 0.0 float trap_iter = 0.0 float _index = 0.0 float texture=0.0 float texture_rnd = 0.0 float texture_fbm = 0.0 float texture_dec = 0.0 float texture_gna = 0.0 float phi=0.0 float theta = 0.0 float trap_a=0.0 p=(0.0,0.0) float pd=0.0 trap_p = 0 bool do_trap = true bool est_pair = true int temp1 = 0 temp2 = (0.0,0.0) float signe = 1.0 temp3 = (0.0,0.0) trp_iter = trunc(@trap_min) if real(trp_iter) > #maxiter trp_iter = #maxiter elseif real(trp_iter) < 1 trp_iter = 1 endif loop: if @c1 == 0 ;bifolium rho1 = @a1*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif @c1 == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho1 = @a1*@fn1(#z)+@b1 elseif @c1 == 2 ;cissoïde de Dioclès rho1 = @a1*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif @c1 == 3 ;cochléoïde rho1 = @a1*@fn2(#z)/#z elseif @c1 == 4 ;conchoïde de Nicomède rho1 = @a1/@fn2(#z)+@b1 elseif @c1 == 5 rho1 = (@a1^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif @c1 == 6 rho1 = (@a1^2/#z)^.5 ;lituus elseif @c1 == 7 ;pétales rho1 = @a1*@fn1(@b1*#z) elseif @c1 == 8 ;parabole rho1 = 2*@a1/(1-@fn1(#z)) elseif @c1 == 9 ;spirale d'Archimède rho1 = @a1*#z elseif @c1 == 10 ;spirale hyperbolique rho1 = @a1/#z elseif @c1 == 11 ;spirale logarithmique rho1 = exp(@a1*#z) elseif @c1 == 12 ;strophoïde rho1 = @a1*@fn1(2*#z)/@fn1(#z) endif if @c2 == 0 ;bifolium rho2 = @a2*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif @c2 == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho2 = @a2*@fn1(#z)+@b1 elseif @c2 == 2 ;cissoïde de Dioclès rho2 = @a2*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif @c2 == 3 ;cochléoïde rho2 = @a2*@fn2(#z)/#z elseif @c2 == 4 ;conchoïde de Nicomède rho2 = @a2/@fn2(#z)+@b1 elseif @c2 == 5 rho2 = (@a2^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif @c2 == 6 rho2 = (@a2^2/#z)^.5 ;lituus elseif @c2 == 7 ;pétales rho2 = @a2*@fn1(@b1*#z) elseif @c2 == 8 ;parabole rho2 = 2*@a2/(1-@fn1(#z)) elseif @c2 == 9 ;spirale d'Archimède rho2 = @a2*#z elseif @c2 == 10 ;spirale hyperbolique rho2 = @a2/#z elseif @c2 == 11 ;spirale logarithmique rho2 = exp(@a2*#z) elseif @c2 == 12 ;strophoïde rho2 = @a2*@fn1(2*#z)/@fn1(#z) endif if @oper == 0 rho = rho1 + rho2 elseif @oper == 1 rho = rho1 - rho2 elseif @oper == 2 rho = rho1 * rho2 elseif @oper == 3 rho = rho1 / rho2 elseif @oper == 4 rho = rho1 ^ rho2 endif if @coord == 0 x = rho * cos(real(x)) y = rho * sin(imag(y)) elseif @coord == 1 x = rho y = theta elseif @coord ==2 x = rho * cosh(real(x)) y = rho * sinh(imag(y)) endif z= @fnx(x * (1.0,0.0)) + @fny(y * (0.0,1.0)) iter=iter+1 if @barn > 0 if @barn == 1 && real(z) >= @barn_offset z = @fnb(z) endif if @barn == 2 && imag(z) >= @barn_offset z = @fnb(z) endif if @barn == 3 && (real(z) * imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 4 && (real(z) + imag(z)) >= @barn_offset z = @fnb(z) endif if @barn == 5 && r >= @barn_offset z = @fnb(z) endif if @barn == 6 && phi >= @barn_offset z = @fnb(z) endif if @barn == 7 && cabs(z) >= @barn_offset z = @fnb(z) endif if @barn == 8 && path >= @barn_offset z = @fnb(z) endif if @barn == 9 && real(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 10 && imag(trap_p) >= @barn_offset z = @fnb(z) endif if @barn == 11 && (real(trap_p)*imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 12 && (real(trap_p)+imag(trap_p)) >= @barn_offset z = @fnb(z) endif if @barn == 13 && trap_dist >= @barn_offset z = @fnb(z) endif if @barn == 14 && trap_a >= @barn_offset z = @fnb(z) endif if @barn == 15 && trap_magn >= @barn_offset z = @fnb(z) endif if @barn == 16 && trap_path >= @barn_offset z = @fnb(z) endif if @barn == 17 && iter >= @barn_offset z = @fnb(z) endif if @barn == 18 && trap_iter >= @barn_offset z = @fnb(z) endif endif if @pairimp > 0 if @pairimp == 1 temp2 = real(z) elseif @pairimp == 2 temp2 = imag(z) elseif @pairimp == 3 temp2 = real(z) * imag(z) elseif @pairimp == 4 temp2 = real(z) + imag(z) elseif @pairimp == 5 temp2 = r elseif @pairimp == 6 temp2 = phi elseif @pairimp == 7 temp2 = cabs(z) elseif @pairimp == 8 temp2 = path elseif @pairimp == 9 temp2 = real(trap_p) elseif @pairimp == 10 temp2 = imag(trap_p) elseif @pairimp == 11 temp2 = real(trap_p)*imag(trap_p) elseif @pairimp == 12 temp2 = real(trap_p)+imag(trap_p) elseif @pairimp == 13 temp2 = trap_dist elseif @pairimp == 14 temp2 = trap_a elseif @pairimp == 15 temp2 = trap_magn elseif @pairimp == 16 temp2 = trap_path elseif @pairimp == 17 temp2 = iter elseif @pairimp == 18 temp2 = trap_iter endif if @sgn == true temp3 = real(z) * imag(z) if real(temp3) < 0 signe = -1.0 endif endif if @intf == 0 temp1 = ceil(signe*cabs(temp2)) elseif @intf == 1 temp1 = floor(signe*cabs(temp2)) elseif @intf == 2 temp1 = trunc(signe*cabs(temp2)) elseif @intf == 3 temp1 = round(signe*cabs(temp2)) endif if temp1 % 2 == 0 est_pair = true else est_pair = false endif IF est_pair z = @fnpi(z) endif endif remain=#z-z r=cabs(remain) path = path + r phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter pathmax = path endif ; trappes if do_trap && \ ((@trp==0 && @trapping == 0 && iter<=real(trp_iter)) || \ (@trp==0 && @trapping == 1 && iter>real(trp_iter)) || \ (@trp==1 && @trapping == 0 && |z|<=@trap_min) || \ (@trp==1 && @trapping == 1 && |z|>@trap_min) || \ (@trp==2 && @trapping == 0 && r<=@trap_min) || \ (@trp==2 && @trapping == 1 && r>@trap_min) || \ (@trp==3 && @trapping == 0 && phi<=@trap_min) || \ (@trp==3 && @trapping == 1 && phi>@trap_min) || \ (@trp==4 && @trapping == 0 && real(z)<=@trap_min) || \ (@trp==4 && @trapping == 1 && real(z)>@trap_min) || \ (@trp==5 && @trapping == 0 && imag(z)<=@trap_min) || \ (@trp==5 && @trapping == 1 && imag(z)>@trap_min) || \ (@trp==6 && @trapping == 0 && path<=@trap_min) || \ (@trp==6 && @trapping == 1 && path>@trap_min)) do_trap = false trap_dist = r ; trap distance trap_p = z ;trap trap_a = phi ;trap angle trap_iter = iter trap_magn = cabs(z) trap_path = path endif final: ;Random complex hasard = #random texture_rnd = @rnd * (real(hasard)+ imag(hasard)) ; fBm if (@fbmtxt != 0) r1 = (0,1) ^ (@fbmangle / 90.0) r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset elseif @fbminit == 4 p = cabs(z) * @fbmscale * r1 + @fbmoffset elseif @fbminit == 5 p = path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 6 p = trap_p * @fbmscale * r1 + @fbmoffset elseif @fbminit == 7 p = trap_dist * @fbmscale * r1 + @fbmoffset elseif @fbminit == 8 p = trap_a * @fbmscale * r1 + @fbmoffset elseif @fbminit == 9 p = trap_magn * @fbmscale * r1 + @fbmoffset elseif @fbminit == 10 p = trap_path * @fbmscale * r1 + @fbmoffset elseif @fbminit == 11 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 12 p = texture_rnd * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture_fbm = @fbmtxt * sum endif ;decimal if @dectxt > 0 if @dec_init == 0 pd = real(#z) elseif @dec_init == 1 pd = imag(#z) elseif @dec_init == 2 pd = r elseif @dec_init == 3 pd = phi elseif @dec_init == 4 pd = cabs(z) elseif @dec_init == 5 pd = path elseif @dec_init == 6 pd = real(trap_p) elseif @dec_init == 7 pd = imag(trap_p) elseif @dec_init == 8 pd = trap_dist elseif @dec_init == 9 pd = trap_a elseif @dec_init == 10 pd = trap_magn elseif @dec_init == 11 pd = trap_path elseif @dec_init == 12 pd = texture_rnd+texture_fbm endif if @dec_type == 0 pd = pd-ceil(pd*@dec_scale)/@dec_scale elseif @dec_type == 1 pd = pd-floor(pd*@dec_scale)/@dec_scale elseif @dec_type == 2 pd = pd-trunc(pd*@dec_scale)/@dec_scale elseif @dec_type == 3 pd = pd-round(pd*@dec_scale)/@dec_scale endif if @dec_size != 0 pd = pd/@dec_size endif texture_dec = @dectxt*pd if @dec_limit !=0 texture_dec= texture_dec%@dec_limit endif if @dec_sgn == true texture_dec = abs(texture_dec) endif endif if (@txtr_gnarl != 0) if @gnarl_init == 0 p = #pixel elseif @gnarl_init == 1 p = z elseif @gnarl_init == 2 p = r elseif @gnarl_init == 3 p = phi elseif @gnarl_init == 4 p = cabs(z) elseif @gnarl_init == 5 p = path elseif @gnarl_init == 6 p = trap_p elseif @gnarl_init == 7 p = trap_dist elseif @gnarl_init == 8 p = trap_a elseif @gnarl_init == 9 p = trap_magn elseif @gnarl_init == 10 p = trap_path elseif @gnarl_init == 11 p = texture_rnd+texture_fbm+texture_dec elseif @gnarl_init == 12 p = #z endif ; p = p-trunc(p*@gnarl_scale)/@gnarl_scale if @gnarl_scaling == 0 p = p-ceil(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 1 p = p-floor(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 2 p = p-trunc(p*@gnarl_scale)/@gnarl_scale elseif @gnarl_scaling == 3 p = p-round(p*@gnarl_scale)/@gnarl_scale endif if @gnarl_size != 0 p = p/@gnarl_size endif xx = real(p) yy = imag(p) float xOld = 0 int iter3 = @gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = xx if @gnarl_form == 0 xx = xx - sin(yy + sin(yy)) yy = yy - sin(xOld + sin(xOld)) elseif @gnarl_form == 1 xx = xx - sin(yy + log(yy + cos(yy))) yy = yy - sin(xOld + log(xOld + cos(xOld))) elseif @gnarl_form == 2 xx = xx - sin(yy + cos(yy)) yy = yy - sin(xOld + cos(xOld)) elseif @gnarl_form == 3 xx = xx - sin(yy + log(yy + tan(yy))) yy = yy - sin(xOld + log(xOld + tan(xOld))) elseif @gnarl_form == 4 xx = xx - sin(yy + log(yy + sin(yy))) yy = yy - sin(xOld + log(xOld + sin(xOld))) endif endwhile if (@gnarl_type == 0) texture_gna = abs(xx) elseif (@gnarl_type == 1) texture_gna = abs(yy) elseif (@gnarl_type == 2) texture_gna = abs(xx+yy) elseif (@gnarl_type == 3) texture_gna = abs(xx*yy) elseif (@gnarl_type == 4) texture_gna = abs(xx-yy) elseif (@gnarl_type == 5) texture_gna = abs(xx/yy) elseif (@gnarl_type == 6) texture_gna = abs(yy/xx) elseif (@gnarl_type == 7) texture_gna = abs(xx^yy) elseif (@gnarl_type == 8) texture_gna = abs(yy^xx) elseif (@gnarl_type == 9) texture_gna = abs(1/xx) elseif (@gnarl_type == 10) texture_gna = abs(1/yy) elseif (@gnarl_type == 11) texture_gna = atan2(xx+1i*yy)/(2*#pi) if (texture_gna < 0) texture_gna = texture_gna + 1 endif elseif (@gnarl_type == 12) texture_gna = |xx+1i*yy| elseif (@gnarl_type == 13) texture_gna = (xx+yy+|xx+1i*yy|)/3 elseif (@gnarl_type == 14) texture_gna = (xx*yy*|xx+1i*yy|)^(1/3) endif if @gnarl_limit !=0 texture_gna= texture_gna%@gnarl_limit endif endif texture = texture_rnd + texture_fbm + texture_dec + texture_gna if @colorfix ==0 if(@colorby==0) ; minimum distance _index=rmin elseif @colorby==1 ; iteration @ min _index=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmin) ; magnitude @min elseif(@colorby==4) _index = pathmin ; path @min endif xx = real(zmin) yy = imag(zmin) endif if @colorfix == 1 if(@colorby==0) ; maximum distance _index=rmax elseif(@colorby==1) ; iteration @ max _index=0.01*itermax elseif(@colorby==2) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(zmax) ; magnitude @max elseif(@colorby==4) _index = pathmax ; path @max endif xx = real(zmax) yy = imag(zmax) endif if @colorfix == 2 z = (zmin + zmax)/2 if(@colorby==0) ; average distance _index=path/iter elseif(@colorby==1) ; iteration @ average _index=0.01*iter/2 elseif(@colorby==2) ; angle @ average t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @average elseif(@colorby==4) _index = (pathmin + pathmax)/2 ; path @average endif xx = real(z) yy = imag(z) endif if @colorfix == 3 if(@colorby==0) ; last distance _index=r elseif(@colorby==1) ; iteration @ last _index=0.01*iter elseif(@colorby==2) ; angle @ last t=atan2(z) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = cabs(z) ; magnitude @last elseif(@colorby==4) _index = path ; path @last endif xx = real(z) yy = imag(z) endif if @colorfix == 4 if(@colorby==0) ; distance @trap _index=trap_dist elseif(@colorby==1) ; iteration @ trap _index=0.01*trap_iter elseif(@colorby==2) ; angle @ trap t=atan2(trap_p) t=t/pi if(t<0.0) t=t+2.0 endif _index=0.5*t elseif(@colorby==3) _index = trap_magn ; magnitude @trap elseif(@colorby==4) _index = trap_path ; path @trap endif xx = real(trap_p) yy = imag(trap_p) endif if @colorby == 5 _index = (xx+yy+|xx+1i*yy|)/3 ; arith.mean elseif @colorby == 6 _index = (xx*yy*|xx+1i*yy|)^(1/3) ; geom.mean elseif @colorby == 7 _index = xx ; réel elseif @colorby == 8 _index = yy ; imaginaire elseif @colorby == 9 _index = xx + yy ; real+imag elseif @colorby == 10 _index = xx * yy ; real*imag elseif @colorby == 11 _index = xx - yy ; real-imag elseif @colorby == 12 _index = yy - xx ; imag-real elseif @colorby == 13 _index = xx / yy ; real/imag elseif @colorby ==14 _index = yy / xx ; imag/real elseif @colorby == 15 _index = xx ^ yy ; real^imag elseif @colorby == 16 _index = yy ^ xx ; imag^real elseif @colorby == 17 _index = 1/xx ; 1/real elseif @colorby == 18 _index = 1/yy ; 1/imag endif color _color = gradient(_index + texture) float _alpha = 1 if @corrected _alpha = alpha(_color) endif bool flag_mask = false if @clspace == 0 float _hue = hue(_color) float _hue6 = _hue/6 float _satur = sat(_color) float _lumin = lum(_color) int _h =round(_hue*60) int _s =round(_satur *255) int _l =round(_lumin *255) if @teinte_min != -1 && @teinte_max != -1 && _h >= @teinte_min && _h <= @teinte_max flag_mask = true endif if @satur_min != -1 && @satur_max != -1 && _s >= @satur_min && _s <= @satur_max flag_mask = true endif if @lumin_min != -1 && @lumin_max != -1 && _l >= @lumin_min && _l <= @lumin_max flag_mask = true endif if flag_mask if @pick_hsl == 0 _alpha = _hue6 elseif @pick_hsl == 1 _alpha = _satur elseif @pick_hsl == 2 _alpha = _lumin elseif @pick_hsl == 3 _alpha = (_hue6+_satur)/2 elseif @pick_hsl == 4 _alpha = (_hue6+_lumin)/2 elseif @pick_hsl == 5 _alpha = (_satur+_lumin)/2 elseif @pick_hsl == 6 _alpha = (_hue6+_satur+_lumin)/3 elseif @pick_hsl == 7 if _hue6>_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 8 if _hue6>_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 9 if _satur>_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 10 if _hue6>_satur && _hue6 > _lumin _alpha = _hue6 elseif _satur > _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 11 if _hue6<_satur _alpha = _hue6 else _alpha = _satur endif elseif @pick_hsl == 12 if _hue6<_lumin _alpha = _hue6 else _alpha = _lumin endif elseif @pick_hsl == 13 if _satur<_lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 14 if _hue6<_satur && _hue6 < _lumin _alpha = _hue6 elseif _satur < _lumin _alpha = _satur else _alpha = _lumin endif elseif @pick_hsl == 15 _alpha = @val_hsl/255 endif endif if @inv _alpha = 1-_alpha endif if @gscale if @gapply == 0 flag_mask = true endif if @gapply == 2 flag_mask = !flag_mask endif if flag_mask _satur = @gsatur/255 endif endif #color = hsla(_hue,_satur,_lumin,@autom_amt*_alpha) endif if @clspace == 1 float _rouge = red(_color) float _vert = green(_color) float _bleu = blue(_color) int _r =round(_rouge*255) int _g =round(_vert *255) int _b =round(_bleu *255) if @rouge_min != -1 && @rouge_max != -1 && _r >= @rouge_min && _r <= @rouge_max flag_mask = true endif if @vert_min != -1 && @vert_max != -1 && _g >= @vert_min && _g <= @vert_max flag_mask = true endif if @bleu_min != -1 && @bleu_max != -1 && _b >= @bleu_min && _b <= @bleu_max flag_mask = true endif if flag_mask if @pick_rgb == 0 _alpha = _rouge elseif @pick_rgb == 1 _alpha = _vert elseif @pick_rgb == 2 _alpha = _bleu elseif @pick_rgb == 3 _alpha = (_rouge+_vert)/2 elseif @pick_rgb == 4 _alpha = (_rouge+_bleu)/2 elseif @pick_rgb == 5 _alpha = (_vert+_bleu)/2 elseif @pick_rgb == 6 _alpha = (_rouge+_vert+_bleu)/3 elseif @pick_rgb == 7 if _rouge>_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 8 if _rouge>_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 9 if _vert>_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 10 if _rouge>_vert && _rouge > _bleu _alpha = _rouge elseif _vert > _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 11 if _rouge<_vert _alpha = _rouge else _alpha = _vert endif elseif @pick_rgb == 12 if _rouge<_bleu _alpha = _rouge else _alpha = _bleu endif elseif @pick_rgb == 13 if _vert<_bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 14 if _rouge<_vert && _rouge < _bleu _alpha = _rouge elseif _vert < _bleu _alpha = _vert else _alpha = _bleu endif elseif @pick_rgb == 15 _alpha = @val_rgb/255 endif endif if @inv _alpha = 1-_alpha endif if @negat if @napply == 0 flag_mask = true endif if @napply == 2 flag_mask = !flag_mask endif if flag_mask _rouge = 1- _rouge _vert = 1 - _vert _bleu = 1 - _bleu endif endif #color = rgba(_rouge,_vert,_bleu,@autom_amt*_alpha) endif default: title="Courbes vs courbes polaires" helpfile="mde-help\mde3-courbes.htm" float param version default = 20041223.1 visible = false endparam heading caption = "First Curve" endheading int param c1 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a1 caption = "a" default = 1.0 endparam float param b1 caption = "b" default = 1.0 visible = (@c1 == 1 || @c1 == 4 || @c1 == 7) endparam heading caption = "Second Curve" endheading int param c2 caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" endparam float param a2 caption = "a" default = 1.0 endparam float param b2 caption = "b" default = 1.0 visible = (@c2 == 1 || @c2 == 4 || @c2 == 7) endparam heading caption = "Functions" endheading func fn1 caption = "First Function" default = cos() visible = (@c1 == 0 || @c2 == 0 || @c1 == 2 || @c2 == 2 || \ @c1 == 1 || @c2 == 1 || @c1 == 5 || @c2 == 5 || \ @c1 == 7 || @c2 == 7 || @c1 == 8 || @c2 == 8 || \ @c1 == 12 || @c2 == 12) endfunc func fn2 caption = "Second Function" default = sin() visible = (@c1 == 0 || @c2 == 0 || @c1 == 2 || @c2 == 2 || \ @c1 == 3 || @c2 == 3 || @c1 == 4 || @c2 == 4) endfunc heading caption = "Curves Processing" endheading int param oper caption = "Operations" enum = "c1+c2" "c1-c2" "c1*c2" "c1/c2" "c1^c2" endparam heading caption = "Coordinates" endheading int param coord caption = "Coordinates" enum="cartesian" "polar" "hyperbolic" default = 1 endparam heading caption = "Colouring Mode Toolbox" endheading int param colorby caption="Colouring Mode" default=0 enum="distance" "iteration" "angle" "magnitude" "path" \ "arith. mean" "geom. mean" \ "real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" endparam int param colorfix caption ="Colouring Fix" enum = "@minimum" "@maximum" "average" "@last Z" "@trap" endparam heading caption = "Barnsley Toolbox" endheading int param barn caption = "Barnsley type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam float param barn_offset caption = "Barnsley Offset" default = 0.0 visible = (@barn > 0) endparam func fnb caption = "Barnsley Function" default = flip() visible = (@barn > 0) endfunc heading caption = "Odd-even Toolbox" endheading int param pairimp caption = "Odd-even type" enum = "none" "real" "imag" "real*imag" "real+imag" \ "distance" "angle" "magnitude" "path" "trap real" \ "trap imag" "trap r*i" "trap r+i" "trap distance" \ "trap angle" "trap magnitude" "trap path" "iteration" \ "trap iter" endparam bool param sgn caption = "Apply Odd-even Sign?" default = false visible = (@pairimp > 0) endparam int param intf caption = "Odd-Even factor" enum = "ceil" "floor" "trunc" "round" visible = (@pairimp > 0) endparam func fnpi caption = "Odd-even Function" default = flip() visible = (@pairimp > 0) endfunc heading caption = "Random Texture" endheading float param rnd caption = "Random Texture Amount" default = 0.0 endparam heading caption = "fBm Texture" endheading float param fbmtxt caption = "fBm Texture Amount" default = 0.0 endparam int param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" "#Z" \ "hand over" visible = (@fbmtxt > 0) endparam float param fbmscale caption = "fBm Scale" default = 1.0 visible = (@fbmtxt > 0) endparam param fbmoffset caption = "fBm Offset" default = (0,0) visible = (@fbmtxt > 0) endparam float param fbmangle caption = "fBm Rotation" default = 0.0 visible = (@fbmtxt > 0) endparam float param fbmstep caption = "fBm Scale Step" default = 0.5 visible = (@fbmtxt > 0) endparam float param fbmastep caption = "fBm Rotation Step" default = 37.0 visible = (@fbmtxt > 0) endparam int param fbmoct caption = "fBm Octaves" default = 7 min = 1 visible = (@fbmtxt > 0) endparam float param fbmpower caption = "fBm Exponent" default = 2.0 visible = (@fbmtxt > 0) endparam heading caption = "Decimal Texture" endheading float param dectxt caption = "Decimal Texture Amount" default = 0.0 endparam int param dec_init caption = "Decimal Initialisation" enum = "real z" "imag z" "distance" "angle" "magnitude" "path" \ "real trap" "imag trap" "trap distance" "trap angle" \ "trap magnitude" "trap path" "hand over" visible = (@dectxt > 0) endparam bool param dec_sgn caption = "Apply Decimal Sign?" default = true visible = (@dectxt > 0) endparam int param dec_type caption = "Decimal Type" enum = "Ceil" "Floor" "Trunc" "Round" visible = (@dectxt > 0) endparam float param dec_scale caption = "Decimal Scale" default = 1.0 visible = (@dectxt > 0) endparam float param dec_size caption = "Decimal Size" default = 1.0 visible = (@dectxt > 0) endparam float param dec_limit caption = "Decimal Limit" default = 1.0 min = 0.0 visible = (@dectxt > 0) endparam heading caption = "Popgnarl Texture" endheading float param txtr_gnarl caption = "Popgnarl Texture Amount" default = 0.0 endparam int param gnarl_init caption = "Popgnarl Initialization" enum = "pixel" "z" "distance" "angle" "magnitude" "path" "trap z" \ "trap distance" "trap angle" "trap magnitude" "trap path" \ "hand over" "#Z" default = 1 visible = (@txtr_gnarl > 0) endparam int param gnarl_type caption = "Popgnarl Mode" enum = "real" "imag" "real+imag" "real*imag" "real-imag" \ "real/imag" "imag/real" "real^imag" "imag^real" \ "1/real" "1/imag" "angle" "magnitude" "arith. mean" \ "geom. mean" visible = (@txtr_gnarl > 0) endparam int param gnarl_form caption = "Popgnarl Formula" enum = "gnarl" "popcorn" "popsicle" "tannous" "narlog" visible = (@txtr_gnarl > 0) endparam float param gnarl_scale caption = "Popgnarl Scale" default = 1.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_scaling caption = "Popgnarl Scaling" enum = "Ceil" "Floor" "trunc" "round" visible = (@txtr_gnarl > 0) endparam float param gnarl_size caption = "Popgnarl Size" default = 1.0 visible = (@txtr_gnarl > 0) endparam float param gnarl_limit caption = "Popgnarl Limit" default = 1.0 min = 0.0 visible = (@txtr_gnarl > 0) endparam int param gnarl_octaves caption = "Popgnarl Octaves" default = 5 min = 1 visible = (@txtr_gnarl > 0) endparam heading caption = "Trap Toolbox" endheading int param trapping caption = "Trapping" enum = "lower" "upper" endparam int param trp caption = "Trap Type" enum = "iteration" "magnitude" "distance" "angle" "real" "imag" "path" endparam float param trap_min caption = "Trap Threshold" default = 1.0 min = 0.0 endparam heading caption = "Function Application" endheading func fnx caption = "Apply F(x)" default = ident() endfunc func fny caption = "Apply F(y)" default = ident() endfunc heading caption = "Automask Toolbox" endheading bool param corrected caption = "Corrected?" default = false endparam bool param automask caption = "Show automask?" default = false endparam float param autom_amt caption = "Automask Amount" default = 1.0 min = 0.0 max = 1.0 visible = @automask endparam int param clspace caption = "Colorspace" enum = "HSL" "RGB" visible = @automask endparam Heading caption = "Hue Range" visible = (@clspace == 0 && @automask) endheading int param teinte_min caption="Minimum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param teinte_max caption="Maximum" default = -1 min=-1 max=359 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Saturation Range" visible = (@clspace == 0 && @automask) endheading int param satur_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param satur_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Luminance Range" visible = (@clspace == 0 && @automask) endheading int param lumin_min caption = "Minimum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne inférieure de l'intervalle endparam int param lumin_max caption = "Maximum" default = -1 min=-1 max=255 visible = (@clspace == 0 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 0 && @automask) endheading int param pick_hsl caption= "Use" enum = "H value" "S value" "L value" "Average HS" "Average HL" "Average SL" \ "Average HSL" "Max H/S" "Max H/L" "Max S/L" "Max H/S/L" "Min H/S" "Min H/L" \ "Min S/L" "Min H/S/L" "Custom" default = 2 visible = (@clspace == 0 && @automask) endparam int param val_hsl caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @pick_hsl == 15 && @automask) endparam Heading caption = "Red Range" visible = (@clspace == 1 && @automask) endheading int param rouge_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param rouge_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Green Range" visible = (@clspace == 1 && @automask) endheading int param vert_min caption="Minimum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param vert_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Blue Range" visible = (@clspace == 1 && @automask) endheading int param bleu_min caption="Minimum" default = -1 min= -1 max=255 visible = (@clspace == 1 && @automask) ; borne inférieure de l'intervalle endparam int param bleu_max caption="Maximum" default = -1 min=-1 max=255 visible = (@clspace == 1 && @automask) ; borne supérieure de l'intervalle endparam Heading caption = "Use for Mask" visible = (@clspace == 1 && @automask) endheading int param pick_rgb caption= "Use" enum = "R value" "G value" "B value" "Average RG" "Average RB" "Average GB" \ "Average RGB" "Max R/G" "Max R/B" "Max G/B" "Max R/G/B" "Min R/G" "Min R/B" \ "Min G/B" "Min R/G/B" "Custom" visible = (@clspace == 1 && @automask) endparam int param val_rgb caption = "Value" default = 0 min = 0 max = 255 visible = (@clspace == 1 && @pick_rgb == 15 && @automask) endparam bool param inv caption = "Invert" default = false visible = @automask endparam heading caption = "Color Settings" visible = @automask endheading bool param gscale caption = "Turn Greyscale" default = false visible = (@clspace == 0 && @automask) endparam int param gsatur caption = "Saturation Level" default = 0 min = 0 max = 255 visible = (@clspace == 0 && @gscale == true && @automask) endparam int param gapply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 0 && @gscale && @automask) endparam bool param negat caption = "Turn Negative" default = false visible = (@clspace == 1 && @automask) endparam int param napply caption = "Apply on" enum = "All Image" "Above Range" "Above Range Inverted" visible = (@clspace == 1 && @negat && @automask) endparam }