comment { Coloring methods by Andreas Lober Last update on August 05, 2000, 21:00 For the latest version of this file go to: http://formulas.ultrafractal.com http://www.aartika.freewire.co.uk/lober/mseries and look for the Download Area under "Various Artists" or just type http://www.aartika.freewire.co.uk/lober/mseries/akl-m.zip or mail to abmlober@t-online.de resp. andreas.lober@sap.com Newest updates: all colourings got new options: * masking in different modes requested by Emily Garlick (Queri) and Angela Wilczynski (Wizzle) - their images are worth every hour spent with work on my formulas - inspired by Mark Townsend's masking with some good ideas from Michèle Dessureault * combinable textures inspired by Mark Townsend's texturing in the fBm Popcorn Trap realized with code containing ideas from Mark Townsend's Gnarl and Popcorn and Samuel Monnier's SFBM and some ideas of my own * cut out feature to determine regions that can be masked and do not have to be calculated * Loop Turnaround Mode for a kind of tiling and a Loop Randomness for scratching the shapes * I tried to give all the formulas the same look and feel so that techniques learned with one formula can be applied to the other ones. } weierstrass_p_func { ; ; It has something to do with funtion theory ; and complex analysis from before the last ; century... ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; complex temp = (-1,0) ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = #z ; init _zz int iter = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode _zz = zStart ; ; transformation ; int lat_real = 0 int lat_imag = 0 complex lat_comp_pp = 0 complex lat_comp_pn = 0 complex lat_comp_np = 0 complex lat_comp_nn = 0 complex W_Fkt_z = 0 if (_zz == 0) W_Fkt_z = 0 else if (@Weierstrass == 0) ; P-Function W_Fkt_z = 1/_zz^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = 1/_zz elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = _zz endif endif ; ; Calculate the P-Function ; while (lat_real <= iter) while (lat_imag <= iter) ; ; Calculate all 4 directions in the lattice ; lat_comp_pp = lat_real*@vector1 + lat_imag*@vector2 lat_comp_pn = lat_real*@vector1 - lat_imag*@vector2 lat_comp_np = -lat_real*@vector1 + lat_imag*@vector2 lat_comp_np = -lat_real*@vector1 - lat_imag*@vector2 if (lat_comp_pp != 0 && (_zz != lat_comp_pp || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pp)^2 - 1/lat_comp_pp^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pp) + 1/lat_comp_pp \ + _zz/lat_comp_pp^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_pp) \ * exp(_zz/lat_comp_pp + 0.5*(_zz/lat_comp_pp)^2) endif endif if (lat_comp_pn != 0 && (_zz != lat_comp_pn || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pn)^2 - 1/lat_comp_pn^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pn) + 1/lat_comp_pn \ + _zz/lat_comp_pn^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_pn) \ * exp(_zz/lat_comp_pn + 0.5*(_zz/lat_comp_pn)^2) endif endif if (lat_comp_np != 0 && (_zz != lat_comp_np || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_np)^2 - 1/lat_comp_np^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_np) + 1/lat_comp_np \ + _zz/lat_comp_np^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_np) \ * exp(_zz/lat_comp_np + 0.5*(_zz/lat_comp_np)^2) endif endif if (lat_comp_nn != 0 && (_zz != lat_comp_nn || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_nn)^2 - 1/lat_comp_nn^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_nn) + 1/lat_comp_nn \ + _zz/lat_comp_nn^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_nn) \ * exp(_zz/lat_comp_nn + 0.5*(_zz/lat_comp_nn)^2) endif endif lat_imag = lat_imag+1 endwhile ; lat_imag <= iter lat_real = lat_real+1 endwhile ; lat_real <= iter if (@pure) _zz = W_Fkt_z^@exponent else _zz = W_Fkt_z^@exponent + #pixel endif ; ; Calculate distances ; _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(_zz - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(_zz-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(_zz-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*_zz)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Three Weierstrass Functions Colouring" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param Weierstrass caption = "Weierstrass Function" enum = "P-Function" "Zeta-Function" "Sigma-Function" endparam param exponent caption= "Exponent for P" default=1.0 endparam param vector1 caption= "Lattice Vector 1" default=(1,0) endparam param vector2 caption= "Lattice Vector 2" default=(0,1) endparam param pure caption= "Pure Weierstrass" default=TRUE endparam func fkt caption = "Additional Function" default = ident() endfunc param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" default = false hint = "Works with the lattices" endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; weierstrass_p_func riemann_zeta_func { ; ; It has something to do with funtion theory ; and complex analysis from before the last ; century... ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; complex temp = (-1,0) ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex zStart = 0 complex _zz = #z ; init _zz int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 ;zStart = #z ; init zStart if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode _zz = zStart ; ; transformation ; int n = 1 complex R_Fkt_z = 0 ; ; Calculate the Riemann Zeta-Function ; while (n <= iter) R_Fkt_z = R_Fkt_z + 1/n^_zz n = n+1 endwhile ; n <= iter if (@pure) _zz = R_Fkt_z^@exponent else _zz = R_Fkt_z^@exponent + #pixel endif ; ; Calculate distances ; _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(_zz - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(_zz-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(_zz-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*_zz)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Riemann Zeta Function Colouring" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param exponent caption= "Exponent for R-Zeta" default=1.0 endparam param pure caption= "With Pixel Addition" default=TRUE endparam func fkt caption = "Additional Function" default = ident() endfunc param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" default = false hint = "Works with the lattices" endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; riemann_zeta_func joukowskij_func { ; ; Do you like aeroplanes from Russia? ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = #z ; init _zz complex zStart = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) ;zStart = #z ; init zStart iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode complex J_Fkt_z = (zStart + @epsilon/zStart)/2 if (@pure) _zz = J_Fkt_z^@exponent else _zz = J_Fkt_z^@exponent + #pixel endif ; ; Calculate distances ; _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(_zz - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(_zz-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(_zz-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*_zz)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Joukowskij Function Colouring" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param exponent caption= "Exponent for J" default=1.0 endparam param epsilon caption= "Epsilon, Coeff. for 1/z" default=1.0 endparam param pure caption= "With Pixel Addition" default=TRUE endparam func fkt caption = "Additional Function" default = ident() endfunc param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" default = false hint = "Works with the lattices" endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; joukowskij_func jouk_dalinsky_func { ; ; Inside the joukowskij UCL combined ; with Peter Kubik's Dalinsky UFM ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = #pixel + @epsilon/#pixel zc = atan(_zz/@sizesq)*@sizesq _zz = 2*(_zz + @epsilon/_zz- zc)/@sizesq complex zStart = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) zStart = _zz ; init zStart iter = iter + 1 int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode _zz = zStart if (@with_z_add) _zz = _zz + #z endif IF (imag(_zz)>0.5) _zz = 2*real(_zz) + 1i*(2*imag(_zz)-1) ELSEIF (real(_zz)>0.5) _zz = 2*real(_zz)-1 + 1i*(2*imag(_zz)) ELSEIF (real(_zz)< 0.1) _zz = 2*@fn1(_zz)-1 + 1i*(2*imag(_zz)) ELSE _zz = 2*@fn2(_zz) + 1i*(2*imag(_zz)) ENDIF if (@pure) _zz = _zz^@exponent + #pixel else _zz = _zz^@exponent endif ; ; Calculate distances ; _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(_zz - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(_zz-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(_zz-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Joukowskij-Dalinsky Colouring" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param exponent caption= "Exponent for JD" default=1.0 endparam param epsilon caption= "Epsilon, Coeff. for 1/z" default=0.0 endparam param sizesq caption = "Magnification" default = 0.5 endparam param pure caption= "With Pixel Addition" default=TRUE endparam param with_z_add caption= "With Z Addition" default=TRUE endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" default = false hint = "Works with the lattices" endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func fn1 caption = "Function 1" default = sin() endfunc func fn2 caption = "Function 2" default = cos() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; jouk_dalinsky_func elliptic_module_transform { ; The elliptic module group GAMMA1 ; ; / a b \ ; is made of all matrixes M = | | ; \ c d / ; ; with det M = 1 and a,b,c,d integer. ; ; It operates on the upper complex plane , i.e. real(z) > 0, ; ; via Mz = (az+b)/(cz+d) ; ; having N(Mz) = (MN)z ; ; / 1 1 \ / 0 -1 \ ; GAMMA1 is generated by | | and | | ; \ 0 1 / \ 1 0 / ; ; A A ; | | ; +- move to the | ; right by 1 | ; z -> z+1 | ; | ; +- Inversion z -> -1/z ; ; ; Freitag,Busam: Funktionentheorie (function theory) Chapter VI, Springer ; ; Last update on April 30, 2000 ; * all colouring methods got masking, ; masking function, transformation of coordinate systems, ; and a loop for this transformation. ; ; Rev.: Feb. 08, 2000: Pre-Lattice was built in ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = 0 ; init _zz float _xx = 0 float _yy = 0 complex zStart = 0 complex a = 0 complex b = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) ;zStart = #z ; init zStart iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif _zz = 0 ; init _zz _xx = 0 _yy = 0 ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode if (@withPreHarlequin) ; ; transformation ; if (@_preHarlPseudo) float _x = real(zStart) float _y = imag(zStart) if (@preHarlTwist != 2) a = 0 b = 0 endif if (@_preHarlPseudoMix) if (@_preHarlMixMode == 0) ; normal mix if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan(_x/_y) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan(_y/_x) endif elseif (@_preHarlMixMode == 1) ; diff mix if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan((_x-_y)/_y) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan((_y-_x)/_x) endif elseif (@_preHarlMixMode == 2) ; sum mix if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan((_x+_y)/_y) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan((_x+_y)/_x) endif elseif (@_preHarlMixMode == 3) ; prod mix if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan(_x^2/_y) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan(_y^2/_x) endif elseif (@_preHarlMixMode == 4) ; expo mix if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan(_x^_y/_y) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan(_y^_x/_x) endif endif else if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan(_y/_x) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan(_x/_y) endif endif else if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * atan(zStart) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * atan(conj(zStart)) endif endif if @variation1 == 0 if (@preHarlTwist == 0 || @preHarlTwist == 2) a = a * a + @c1 a = fn1(1 - a) / a endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = b * b + @c1 b = fn1(1 - b) / b endif elseif @variation1 == 1 if (@preHarlTwist == 0 || @preHarlTwist == 2) a = a * a + @c1 a = fn1(1 - a^2) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = b * b + @c1 b = fn1(1 - b^2) endif elseif @variation1 == 2 if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * fn1(a + @c1)^2 endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * fn1(b + @c1)^2 endif elseif (@variation1 == 3) if (@preHarlTwist == 0 || @preHarlTwist == 2) a = @m1 * fn1(1i*a + @c1)^2 / fn1(a - @c1) endif if (@preHarlTwist == 1 || @preHarlTwist == 2) b = @m1 * fn1(1i*b + @c1)^2 / fn1(a - @c1) endif endif ; ; Transfer from MT->AKL ; zStart = a + 1i*b endif ; withPreHarlequin ; ; transformation ; if (@_pseudo) float _x = real(zStart) float _y = imag(zStart) ; ; calculate the temp real _xx ; if (@_c * _x + @_d == 0) ; don't divide by 0!! _xx = @_a * _x + @_b else if (@_pseudoMix) if (@_mixMode == 0) ; normal mix _xx = (@_a * _y + @_b) / (@_c * _x + @_d) elseif (@_mixMode == 1) ; diff mix _xx = (@_a * (_x-_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 2) ; sum mix _xx = (@_a * (_x+_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 3) ; prod mix _xx = (@_a * (_x*_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 4) ; prod mix _xx = (@_a * (_x^_y)+ @_b) / (@_c * _x + @_d) endif else _xx = (@_a * _x + @_b) / (@_c * _x + @_d) endif endif ; ; calculate the temp imag _yy ; if (@_c * _y + @_d == 0) ; don't divide by 0!! _yy = @_a * _y + @_b else if (@_pseudoMix) if (@_mixMode == 0) ; normal mix _yy = (@_a * _x + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 1) ; diff mix _yy = (@_a * (_y-_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 2) ; sum mix _yy = (@_a * (_y+_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 3) ; prod mix _yy = (@_a * (_y*_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 4) ; prod mix _yy = (@_a * (_y^_x) + @_b) / (@_c * _y + @_d) endif else _yy = (@_a * _y + @_b) / (@_c * _y + @_d) endif endif _zz = real(@mixFkt_x(_xx)) + 1i*real(@mixFkt_y(_yy)) else if (@_c * zStart + @_d == 0) ; don't divide by 0!! _zz = @_a * zStart + @_b else _zz = (@_a * zStart + @_b) / (@_c * zStart + @_d) endif endif if (@withPostHarlequin) ; ; transformation ; if (@_postHarlPseudo) float _x = real(_zz) float _y = imag(_zz) if (@postHarlTwist != 2) a = 0 b = 0 endif if (@_postHarlPseudoMix) if (@_postHarlMixMode == 0) ; normal mix if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan(_x/_y) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan(_y/_x) endif elseif (@_postHarlMixMode == 1) ; diff mix if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan((_x-_y)/_y) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan((_y-_x)/_x) endif elseif (@_postHarlMixMode == 2) ; sum mix if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan((_x+_y)/_y) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan((_x+_y)/_x) endif elseif (@_postHarlMixMode == 3) ; prod mix if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan(_x^2/_y) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan(_y^2/_x) endif elseif (@_postHarlMixMode == 4) ; expo mix if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan(_x^_y/_y) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan(_y^_x/_x) endif endif else if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan(_y/_x) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan(_x/_y) endif endif else if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * atan(zStart) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * atan(conj(zStart)) endif endif if (@variation2 == 0) if (@postHarlTwist == 0 || @postHarlTwist == 2) a = a * a + @c2 a = fn2(1 - a) / a endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = b * b + @c2 b = fn2(1 - b) / b endif elseif (@variation2 == 1) if (@postHarlTwist == 0 || @postHarlTwist == 2) a = a * a + @c2 a = fn2(1 - a^2) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = b * b + @c2 b = fn2(1 - b^2) endif elseif (@variation2 == 2) if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * fn2(a + @c2)^2 endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * fn2(b + @c2)^2 endif elseif (@variation2 == 3) if (@postHarlTwist == 0 || @postHarlTwist == 2) a = @m2 * fn2(1i*a + @c2)^2 / fn2(a - @c2) endif if (@postHarlTwist == 1 || @postHarlTwist == 2) b = @m2 * fn2(1i*b + @c2)^2 / fn2(a - @c2) endif endif ; ; Transfer from MT->AKL ; _zz = a + 1i*b endif ; withPostHarlequin ; ; Calculate distances ; if (@with_zStart) _dist = cabs(_zz - zStart) _rd = real(_zz - zStart) _id = imag(_zz - zStart) else _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) endif _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(_zz - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(_zz-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(_zz-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Elliptic Harlequin Colouring" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _a caption = "a, upper left coefficient" default = -1 endparam param _b caption = "b, upper right coefficient" default = -1 endparam param _c caption = "c, lower left coefficient" default = 1 endparam param _d caption = "d, lower right coefficient" default = 0 endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param _pseudo caption = "Pseudo Elliptic" default = false hint = "separate transforming real and imag" endparam param _pseudoMix caption = "Pseudo Mix Real and Imag" default = false hint = "only in use with Pseudo Elliptic" endparam param _mixMode caption = "Mix Mode for Pseudo Mix" enum = "Normal" "Difference" "Sum" "Product" "Exponent" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" default = false hint = "Works with the lattices" endparam param withPreHarlequin caption = "Harlequin before Elliptic Y/N" default = false endparam param c1 caption = "Pre Harlequin Seed" default = (0,0) endparam param variation1 caption = "Pre Harl Variation" enum = "1" "2" "3" "4" default = 1 endparam param m1 caption = "Pre Harl Angle Multiplier" default = 2.0 endparam param _preHarlPseudo caption = "Pseudo Pre Harlequin" default = false hint = "separate transforming real and imag" endparam param _preHarlPseudoMix caption = "Pre Harl Pseudo Mix Real and Imag" default = false hint = "only in use with Pseudo Harlequin" endparam param _preHarlMixMode caption = "Pre Harl Mix Mode for Pseudo Mix" enum = "Normal" "Difference" "Sum" "Product" "Exponent" endparam param preHarlTwist caption = "Pre Harlequin Twist" enum = "Pure Real" "Pure Imag" "Mixed" default = 0 endparam param withPostHarlequin caption = "Harlequin after Elliptic Y/N" default = false endparam param c2 caption = "Post Harlequin Seed" default = (0,0) endparam param variation2 caption = "Post Harl Variation" enum = "1" "2" "3" "4" default = 1 endparam param m2 caption = "Post Harl Angle Multiplier" default = 2.0 endparam param _postHarlPseudo caption = "Pseudo Post Harlequin" default = false hint = "separate transforming real and imag" endparam param _postHarlPseudoMix caption = "Post Harl Pseudo Mix Real and Imag" default = false hint = "only in use with Pseudo Harlequin" endparam param _postHarlMixMode caption = "Post Harl Mix Mode for Pseudo Mix" enum = "Normal" "Difference" "Sum" "Product" "Exponent" endparam param postHarlTwist caption = "Post Harlequin Twist" enum = "Pure Real" "Pure Imag" "Mixed" default = 0 endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func mixFkt_x caption = "PseudoMix x-Function" default = ident() endfunc func mixFkt_y caption = "PseudoMix y-Function" default = ident() endfunc func fn1 caption = "Pre Harlequin Function" hint = "This function is used in all variations. \ sqr() is best with Real/Imag on\ tan() is best with Real/Imag off" default = sqr() endfunc func fn2 caption = "Post Harlequin Function" hint = "This function is used in all variations. \ sqr() is best with Real/Imag on\ tan() is best with Real/Imag off" default = sqr() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() hint = "Last Transfer to Index" endfunc } ; elliptic_module_transform deriv3 { ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif if (zStart == #pixel) zStart = @derivFkt(#pixel) else zStart = (@derivFkt(zStart) - @derivFkt(#pixel))/(zStart-#pixel) endif ; Here comes the Joukowskij zStart = zStart^@exponent - @jouk/zStart _dist = cabs(zStart - #z) _rd = real(zStart - #z) _id = imag(zStart - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(zStart - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(zStart-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(zStart-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(zStart)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif complex _zz = zStart if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Derivation #3" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 15 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param jouk caption = "Joukowskij Constant" default = (0.01,0.00) endparam param exponent caption = "Transfer Exponent" default = 1.0 endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 1 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func derivFkt caption = "Derivated Function" default = cotanh() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() hint = "Last Transfer to Index" endfunc } ; deriv3 hevia { ; ; Andreas Lober, Feb 20, 2000 ; ; inspired by GFW.Albrecht's Matrix formulas ; and the song "busindre reel" by Hevia ; ; look at z as a real 2-dim vector ; look at the neighborhood of z ; as the 4 entries of a complex 2x2-Matrix ; imagine the FIVE on a dice: z is in the middle ; a,b,c,d are around z ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex a = 0 complex b = 0 complex c = 0 complex d = 0 float x = 0 float y = 0 float xf = 0 float yf = 0 float xc = 0 float yc = 0 complex nenner = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 ; zStart = zStart + #z if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif ; calculate the "vector" x = real(zStart) y = imag(zStart) if (@vectorJouk != 0 && zStart != 0) zStart = zStart + @vectorJouk/zStart endif ; calculate the neighborhood if (@neighbourhood == 0) ; round xf = @neighbour*round(x) yf = @neighbour*round(y) xc = xf+@neighbour yc = yf+@neighbour elseif (@neighbourhood == 1) ; floor/ceil xf = floor(@neighbour*x)/@neighbour yf = floor(@neighbour*y)/@neighbour xc = ceil(@neighbour*x)/@neighbour yc = ceil(@neighbour*y)/@neighbour elseif (@neighbourhood == 2) ; trunc xf = @neighbour*trunc(x) yf = @neighbour*trunc(y) xc = xf+@neighbour yc = yf+@neighbour elseif (@neighbourhood == 3) ; flow xf = @neighbour*x yf = @neighbour*y xc = xf+@neighbour yc = yf+@neighbour elseif (@neighbourhood == 4) ; sfbm complex nSFBM = #z xf=0, xc=0, yf=0, yc=0 complex nrotAngleFBM = exp(1i*#pi/180*28) int nseed = 123094 float nmod = 1 int niter = 0 while (niter < 7) float nscale = @neighbour^niter nSFBM = nSFBM*nrotAngleFBM niter = niter + 1 nmod = sqrt(niter) nzc = round(nscale*nSFBM)/nscale + niter/nscale^2 nzc1 = nzc + (.5,.5)/nscale nzc2 = nzc + (-.5,.5)/nscale nzc3 = nzc + (.5,-.5)/nscale nzc4 = nzc + (-.5,-.5)/nscale complex tmp = 0 tmp = nseed/(nmod*nzc1+124), ncr1 = tmp-floor(tmp) tmp = nseed/(nmod*nzc2+124), ncr2 = tmp-floor(tmp) tmp = nseed/(nmod*nzc3+124), ncr3 = tmp-floor(tmp) tmp = nseed/(nmod*nzc4+124), ncr4 = tmp-floor(tmp) complex ntv1 = (nSFBM - nzc1)*nscale complex ntv2 = (nSFBM - nzc2)*nscale complex ntv3 = (nSFBM - nzc3)*nscale complex ntv4 = (nSFBM - nzc4)*nscale float ncrp1 = real(ncr1)*real(ntv1) + imag(ncr1)*imag(ntv1) float ncrp2 = real(ncr2)*real(ntv2) + imag(ncr2)*imag(ntv2) float ncrp3 = real(ncr3)*real(ntv3) + imag(ncr3)*imag(ntv3) float ncrp4 = real(ncr4)*real(ntv4) + imag(ncr4)*imag(ntv4) float nd1 = ncrp1*real(nSFBM - nzc)*nscale + 0.5 float nd2 = ncrp2*(1 - nd1) float nd3 = ncrp3*imag(nSFBM - nzc)*nscale + 0.5 float nd4 = ncrp4*(1 - nd3) if (|xf| < |nd1|) xf = nd1 endif if (|xc| < |nd2|) xc = nd2 endif if (|yf| < |nd3|) yf = nd3 endif if (|yc| < |nd4|) yc = nd4 endif endwhile elseif (@neighbourhood == 5) ; +- xc = ceil(abs(@neighbour*x))/@neighbour yc = ceil(abs(@neighbour*y))/@neighbour xf = -xc yf = -yc elseif (@neighbourhood == 6) ; +- float nd = cabs(zStart) xc = @neighbour*x/nd yc = @neighbour*y/nd xf = -xc yf = -yc elseif (@neighbourhood == 7) ; +- float nd = |zStart| xc = sqrt(@neighbour*abs(x)/nd) yc = sqrt(@neighbour*abs(y)/nd) xf = -xc yf = -yc elseif (@neighbourhood == 8) ; +- xc = @neighbour*cabs(zStart) yc = atan2(zStart)/(2*#pi) if (yc<0) yc=yc+1 endif yc = @neighbour*yc xf = -xc yf = -yc endif ; matrix a = xf + 1i*yc b = xc + 1i*yc c = xf + 1i*yf d = xc + 1i*yf if(@operation == 2 || @operation == 3 || @operation == 4) zq = @fn2(zStart) else zq = 0 endif if (@operation == 0) ; linear ; matrix algebra zStart = a*x + b*y + 1i*(c*x+d*y) elseif (@operation == 1) ; elliptic nenner = c*zStart + d if (nenner == 0) nenner = nenner+0.001 endif zStart = (a*zStart + b)/nenner elseif (@operation == 2) ; Plane1 zStart = a*zStart + b*zq elseif (@operation == 3) ; Plane2 zStart = c*zStart + d*zq elseif (@operation == 4) ; Scalar Product zStart = a*zStart^2 + (b+c)*zStart*zq + d*zq^2 elseif (@operation == 5) ; Real Scalar zStart = a*x^2 + (b+c)*x*y + d*y^2 elseif (@operation == 5) ; Pseudo Scalar zStart = a*x^2 + b*x*y + 1i*(c*x*y + d*y^2) endif if (@exponent != 1) zStart = zStart^@exponent endif if (zStart != 0 && @jouk != 0) zStart = zStart + @jouk/zStart endif if (@pure) zStart = zStart + #pixel endif _dist = cabs(zStart - #z) _rd = real(zStart - #z) _id = imag(zStart - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(zStart - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(zStart-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(zStart-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(zStart)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) complex _zz = zStart if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*abs(textureSFBM) endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Hevia" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param neighbourhood caption = "Neighbourhood" enum = "round" "floor/ceil" "trunc" "flow" "sfbm" \ "ceil+-" "cabs+-" "sqrt+-" "polar+-" default = 1 endparam param neighbour caption = "Neighbour Factor" default = 1.0 endparam param operation caption = "Operation" enum = "Linear" "Elliptic" "Plane 1" "Plane 2" \ "Scalar Product" "Real Scalar" "Pseudo Scalar" default = 0 endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param zJouk caption = "Joukowskij: Lattice" default = (0.0,0.0) endparam param vectorJouk caption = "Joukowskij: Vector " default = (0.0,0.0) endparam param jouk caption = "Joukowskij: Constant" default = (0.01,0.00) endparam param pure caption = "With Pixel Addition" default = FALSE endparam param exponent caption = "Transfer Exponent" default = 1.0 endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 1 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func fn2 caption = "Operational Function" default = conj() hint = "Works with Operations Plane1/2 and Scalar Product" endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() hint = "Last Transfer to Index" endfunc } ; hevia coord_vs_coord { ; ; Demonstrates how the coordination transform ; works ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord int l_coord_dist = @coordLoop_dist int coord_dist = @coord_dist int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) ;zStart = #z iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode complex zz_ = zStart int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zz_ = cabs(zz_) + 1i*atan2(zz_) elseif (koord == 2) float rad = cabs(zz_) float phi = atan2(zz_) zz_ = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zz_) float phi = atan2(zz_) zz_ = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zz_) float phi = atan2(zz_) zz_ = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zz_ = real(sin(zz_)) + 1i*cos(zz_) elseif (koord == 6) zz_ = real(sinh(zz_)) + 1i*cosh(zz_) elseif (koord == 7) zz_ = real(asin(zz_)) + 1i*acos(zz_) elseif (koord == 8) zz_ = real(asinh(zz_)) + 1i*acosh(zz_) elseif (koord == 9) zz_ = abs(zz_) + conj(zz_)/(|zz_|+1e-20) elseif (koord >= 10 && koord <= 19) if (zz_ != 0) float rad = cabs(zz_) float re = real(zz_)/rad float im = imag(zz_)/rad if (koord == 10) zz_ = re*zz_ + im*conj(zz_) elseif (koord == 11) zz_ = re*zz_ + im*flip(zz_) elseif (koord == 12) zz_ = re*sin(zz_) + im*cos(zz_) elseif (koord == 13) zz_ = re*sin(zz_) + 1i*im*cos(zz_) elseif (koord == 14) zz_ = re*asin(zz_) + im*acos(zz_) elseif (koord == 15) zz_ = re*asin(zz_) + 1i*im*acos(zz_) elseif (koord == 16) zz_ = re*sinh(zz_) + im*cosh(zz_) elseif (koord == 17) zz_ = re*sinh(zz_) + 1i*im*cosh(zz_) elseif (koord == 18) zz_ = re*asinh(zz_) + im*acosh(zz_) elseif (koord == 19) zz_ = re*asinh(zz_) + 1i*im*acosh(zz_) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif if (@pureMethod) compare = zStart else compare = zz_ endif ; @pureMethod if (compare != 0) if (@transformation == 0) ; None compare = compare ; Never ask why these lines are necessary... ; If I delete them, ; Transformation "None" does not work!!! elseif (@transformation == 1) ; Joukowskij compare = @HarlFkt(compare + @transfConst/compare) elseif (@transformation == 2) ; Elliptic compare = -(compare+@transfConst)/@HarlFkt(compare) elseif (@transformation == 3 || @transformation == 4) ; Harlequin1+2 if (@transformation == 3) ; Harlequin1 if (@townsend == 0) compare = 2*atan(imag(compare)/real(compare)) else compare = 2*atan2(imag(compare)/real(compare)) endif else ; Harlequin2 if (@townsend == 0) compare = 2*atan(compare) else compare = 2*atan2(compare) endif endif compare = @HarlFkt(1-compare^(@transfConst*4)) elseif (@transformation >= 5 && @transformation <= 8) ; Hevia1-4 compare = @HarlFkt(compare) x = real(compare) y = imag(compare) xf = @transfConst*round(x) yf = @transfConst*round(y) xc = xf+@transfConst yc = yf+@transfConst a = xf + 1i*yc b = xc + 1i*yc c = xf + 1i*yf d = xc + 1i*yf if (@transformation == 5) compare = a*x + b*y + 1i*(c*x+d*y) elseif (@transformation == 6) compare = a*compare^2 + (b+c)*compare*conj(compare) + d*conj(compare)^2 elseif (@transformation == 7) compare = a*x^2 + (b+c)*x*y + d*y^2 elseif (@transformation == 8) compare = a*x^2 + b*x*y + 1i*(c*x*y + d*y^2) endif elseif (@transformation == 9 || @transformation == 10) ; Lissajous a = sin (2*compare) b = cos (3*compare) c = @HarlFkt(a+1i*b) if (c == 0) c = compare endif if (@transformation == 9) compare = c^@transfConst else compare = @HarlFkt(compare^@transfConst) + c endif ; compare = 1/c^@transfConst elseif (@transformation >= 11 && @transformation <= 14) ; MT-Sine* x = |compare| ; MT: r if (@townsend == 0) y = atan(compare) ; MT: theta else y = atan2(compare) ; MT: theta endif if (real(y) < 0) y = y + 2*#pi endif if (@transformation == 11) ; MT-Sine compare = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 12) ; MT-ArcSine compare = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 13) ; MT-SineHyp compare = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 14) ; MT-ArSineHyp compare = x*(acosh(y) + 1i*asinh(y)) endif compare = @HarlFkt(compare) elseif (@transformation >= 15 && @transformation <= 18) ; Cardioid if (@townsend == 0) y = atan(compare) ; MT: theta and atan2 else y = atan2(compare) ; MT: theta and atan2 endif x = 1-cos(y) ; MT: radius if (@transformation == 15) ; MT-Cardioid compare = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 16) ; ArcDroid compare = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 17) ; CardioHype compare = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 18) ; ArDioidHype compare = x*(acosh(y) + 1i*asinh(y)) endif ; @transformation == 15,16,17,18 compare = @HarlFkt(compare) elseif (@transformation >= 19 && @transformation <= 21) ; Sam's Julia complex zz = (compare+#z+#pixel)/4 compare = exp(-1i*#pi/180)*compare float samsBail = 1000 if (@transformation == 20) samsBail = samsBail + iter*100000 elseif(@transformation == 21) samsBail = 1e20 endif ; @transformation == 20 x = 1/sqrt(2)*real(compare) y = sqrt(2)*imag(compare) complex start = x+1i*y ; compare ; (-1.745,.01) int i = 0 while (i < 10 && |zz| < samsBail) i=i+1 zz = zz^2/@transfConst + start endwhile compare = @HarlFkt(zz) endif ; @transformation == xx endif ; compare != 0 zz_ = compare ; ; Transformation = another pack of coordinates ; complex _zz = zStart int loop_i_dist = 0 while (loop_i_dist < l_coord_dist) loop_i_dist = loop_i_dist + 1 if (@coordMode_dist == 1) ; cyclic coord_dist = (coord_dist+1)%19 endif if (coord_dist == 1) _zz = cabs(_zz) + 1i*atan2(_zz) elseif (coord_dist == 2) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(sinh(phi) + 1i*cosh(phi)) elseif (coord_dist == 3) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asin(phi) + 1i*acos(phi)) elseif (coord_dist == 4) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asinh(phi) + 1i*acosh(phi)) elseif (coord_dist == 5) _zz = real(sin(_zz)) + 1i*cos(_zz) elseif (coord_dist == 6) _zz = real(sinh(_zz)) + 1i*cosh(_zz) elseif (coord_dist == 7) _zz = real(asin(_zz)) + 1i*acos(_zz) elseif (coord_dist == 8) _zz = real(asinh(_zz)) + 1i*acosh(_zz) elseif (coord_dist == 9) _zz = abs(_zz) + conj(_zz)/(|_zz|+1e-20) elseif (coord_dist >= 10 && coord_dist <= 19) if (_zz != 0) float rad = cabs(_zz) float re = real(_zz)/rad float im = imag(_zz)/rad if (coord_dist == 10) _zz = re*_zz + im*conj(_zz) elseif (coord_dist == 11) _zz = re*_zz + im*flip(_zz) elseif (coord_dist == 12) _zz = re*sin(_zz) + im*cos(_zz) elseif (coord_dist == 13) _zz = re*sin(_zz) + 1i*im*cos(_zz) elseif (coord_dist == 14) _zz = re*asin(_zz) + im*acos(_zz) elseif (coord_dist == 15) _zz = re*asin(_zz) + 1i*im*acos(_zz) elseif (coord_dist == 16) _zz = re*sinh(_zz) + im*cosh(_zz) elseif (coord_dist == 17) _zz = re*sinh(_zz) + 1i*im*cosh(_zz) elseif (coord_dist == 18) _zz = re*asinh(_zz) + im*acosh(_zz) elseif (coord_dist == 19) _zz = re*asinh(_zz) + 1i*im*acosh(_zz) endif endif endif endwhile ; Schleife über die Koordinaten ; ; Calculate distances ; if (@with_zStart == 0) _dist = cabs(_zz - zStart) _rd = real(_zz - zStart) _id = imag(_zz - zStart) elseif (@with_zStart == 1) _dist = cabs(_zz - #z) _rd = real(_zz - #z) _id = imag(_zz - #z) elseif (@with_zStart == 2) _dist = cabs(_zz - zz_) _rd = real(_zz - zz_) _id = imag(_zz - zz_) elseif (@with_zStart == 3) _dist = cabs(zz_ - zStart) _rd = real(zz_ - zStart) _id = imag(zz_ - zStart) elseif (@with_zStart == 4) _dist = cabs(zz_ - #z) _rd = real(zz_ - #z) _id = imag(zz_ - #z) endif _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(zStart - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(zStart-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(zStart-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(zStart)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) complex _zz = zStart if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float tx = real(zGnarl) float ty = imag(zGnarl) float txOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 txOld = tx tx = tx - sin(ty + sin(ty)) ty = ty - sin(txOld + sin(txOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(tx) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(tx)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(tx-ty) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(tx-ty)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(tx+ty)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(tx*ty)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(tx+1i*ty)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(tx^2+ty^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float tx = real(zPopCorn) float ty = imag(zPopCorn) float txOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 txOld = tx tx = tx - sin(ty + log(ty + cos(ty))) ty = ty - sin(txOld + log(txOld + cos(txOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(tx) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(tx)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(tx-ty) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(tx-ty)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(tx+ty)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(tx*ty)/(sqrt(tx^2+ty^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(tx+1i*ty)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(tx^2+ty^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Coord vs. Coord, Dist. Meth." param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param coord_dist caption = "D: Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 1 endparam param coordLoop_dist caption = "D: # Coord Loops" default = 1 min = 1 endparam param coordMode_dist caption = "D: Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param transformation caption = "Transformation" enum = "None" \ "Joukowskij" "Elliptic" \ "Harlequin 1" "Harlequin 2" \ "Hevia 1" "Hevia 2" "Hevia 3" "Hevia 4" \ "Lissajous" "Lissajous+" \ "MT-Sine" "MT-ArcSine" "MT-SineHyp" "MT-ArSineHyp" \ "MT-Cardioid" "ArcDroid" "CardioHype" "ArDioidHype" \ "Sam's Julia small" "Sam's Julia grow" "Sam's Julia big" endparam param transfConst caption = "Transf. Constant" default = 1.0 min = 0.01 endparam param pureMethod caption = "Pure Method Y/N" default = TRUE endparam param townsend caption = "For MT-Transforms" enum = "atan" "atan2" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param with_zStart caption = "zStart everywhere Y/N" enum = "Yes #1" "No #1" "Don't know" "Yes #2" "No #2" default = 2 hint = "Works with the lattices" endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture to the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() hint = "Last Transfer to Index" endfunc func HarlFkt caption = "Transform. Function" default = log() endfunc } ; coord_vs_coord pure_dist_method { ; ; This UCL does not contain a transformation ; only the pure calculations needed for ; creating a Dist.-Meth. colouring ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 ; if (@lattice > 0 || @init_z = 1) ; zStart = zStart + #z if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = 0 elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif _dist = cabs(zStart - #z) _rd = real(zStart - #z) _id = imag(zStart - #z) _rdist = abs(_rd) _idist = abs(_id) if _rd > _id _tdist = _rdist _cdist = _idist if _id == 0 _qdist = _rdist else _qdist = _rdist / _idist endif else _tdist = _idist _cdist = _rdist if _rd == 0 _qdist = _idist else _qdist = _idist / _rdist endif endif ; ; Calculate Min ; if @_mode == 0 && _dist < _min_dist _min_dist = _dist endif if @_mode == 1 && _rdist < _min_rdist _min_rdist = _rdist endif if @_mode == 2 && _idist < _min_idist _min_idist = _idist endif if @_mode == 3 && _tdist < _min_tdist _min_tdist = _tdist endif if @_mode == 4 && _tdist < _min_cdist _min_cdist = _cdist endif if @_mode == 29 && _qdist < _min_qdist _min_qdist = _qdist endif ; ; Calculate Max ; if @_mode == 5 && _dist > _max_dist _max_dist = _dist endif if @_mode == 6 && _rdist > _max_rdist _max_rdist = _rdist endif if @_mode == 7 && _rdist > _max_rdist _max_idist = _idist endif if @_mode == 8 && _tdist > _max_tdist _max_tdist = _tdist endif if @_mode == 9 && _cdist > _max_cdist _max_cdist = _cdist endif if @_mode == 30 && _qdist > _max_qdist _max_qdist = _qdist endif ; ; Calculate the traps ; if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max _do_trap = false _trap =_dist endif if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max _do_rtrap = false _rtrap =_rdist endif if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max _do_itrap = false _itrap =_idist endif if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max _do_ttrap = false _ttrap =_tdist endif if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max _do_ctrap = false _ctrap =_cdist endif ; ; Calculate the sums ; if @_mode == 24 _sum = _sum + _dist endif if @_mode == 25 _rsum = _rsum + _rdist endif if @_mode == 26 _isum = _isum + _idist endif if @_mode == 27 _tsum = _tsum + _tdist endif if @_mode == 28 _csum = _csum + _cdist endif if @_mode == 31 _qsum = _qsum + _qdist endif ; ; Calculate the weighted sums ; if @_mode == 33 _sum_w = _sum_w + _dist/iter endif if @_mode == 34 _rsum_w = _rsum_w + _rdist/iter endif if @_mode == 35 _isum_w = _isum_w + _idist/iter endif if @_mode == 36 _tsum_w = _tsum_w + _tdist/iter endif if @_mode == 37 _csum_w = _csum_w + _cdist/iter endif if @_mode == 38 _qsum_w = _qsum_w + _qdist/iter endif ; ; Calculate the square-weighted sums ; if @_mode == 39 _sum_w2 = _sum_w2 + _dist/iter^2 endif if @_mode == 40 _rsum_w2 = _rsum_w2 + _rdist/iter^2 endif if @_mode == 41 _isum_w2 = _isum_w2 + _idist/iter^2 endif if @_mode == 42 _tsum_w2 = _tsum_w2 + _tdist/iter^2 endif if @_mode == 43 _csum_w2 = _csum_w2 + _cdist/iter^2 endif if @_mode == 44 _qsum_w2 = _qsum_w2 + _qdist/iter^2 endif endif ; no_spare final: if (no_spare) if @_mode == 0 temp = _min_dist ; "Min Dist" elseif @_mode == 1 temp = _min_rdist ; "Min Real" elseif @_mode == 2 temp = _min_idist ; "Min Imag" elseif @_mode == 3 temp = _min_tdist ; "Min Triang" elseif @_mode == 4 temp = _min_cdist ; "Min Cubus" elseif @_mode == 5 temp = _max_dist ; "Max Dist" elseif @_mode == 6 temp = _max_rdist ; "Max Real" elseif @_mode == 7 temp = _max_idist ; "Max Imag" elseif @_mode == 8 temp = _max_tdist ; "Max Triang" elseif @_mode == 9 temp = _max_cdist ; "Max Cubus" elseif @_mode == 10 temp = cabs(zStart - #pixel) ; "Act Dist" elseif @_mode == 11 temp = abs(real(zStart-#pixel)) ; "Act Real" elseif @_mode == 12 temp = abs(imag(zStart-#pixel)) ; "Act Imag" elseif @_mode == 13 temp = _dist ; "Last Dist" elseif @_mode == 14 temp = _rdist ; "Last Real" elseif @_mode == 15 temp = _idist ; "Last Imag" elseif @_mode == 16 temp = _tdist ; "Last Triang" elseif @_mode == 17 temp = _cdist ; "Last Cubus" elseif @_mode == 18 temp = abs(cabs(zStart)-cabs(#pixel)) ; "Difference" elseif @_mode == 19 temp = _trap ; "Trap Dist" elseif @_mode == 20 temp = _rtrap ; "Trap Real" elseif @_mode == 21 temp = _itrap ; "Trap Imag" elseif @_mode == 22 temp = _ttrap ; "Trap Triang" elseif @_mode == 23 temp = _ctrap ; "Trap Cubus" elseif @_mode == 24 temp = _sum ; "Sum Dist" elseif @_mode == 25 temp = _rsum ; "Sum Real" elseif @_mode == 26 temp = _isum ; "Sum Imag" elseif @_mode == 27 temp = _tsum ; "Sum Triang" elseif @_mode == 28 temp = _csum ; "Sum Cubus" elseif @_mode == 29 temp = _min_qdist ; "Min MinQuot" elseif @_mode == 30 temp = _max_qdist ; "Max MinQuot" elseif @_mode == 31 temp = _qsum ; "Sum MinQuot" elseif @_mode == 32 temp = _qdist ; "Last MinQuot" elseif @_mode == 33 temp = _sum_w elseif @_mode == 34 temp = _rsum_w elseif @_mode == 35 temp = _isum_w elseif @_mode == 36 temp = _tsum_w elseif @_mode == 37 temp = _csum_w elseif @_mode == 38 temp = _qsum_w elseif @_mode == 39 temp = _sum_w2 elseif @_mode == 40 temp = _rsum_w2 elseif @_mode == 41 temp = _isum_w2 elseif @_mode == 42 temp = _tsum_w2 elseif @_mode == 43 temp = _csum_w2 elseif @_mode == 44 temp = _qsum_w2 endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) complex _zz = zStart if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Pure Distance Method" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 15 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Zero" "Pixel" "Mixel" default = 1 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() hint = "Last Transfer to Index" endfunc } ; pure_dist_method prime_twins { ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float rz = 0 float iz = 0 float _rz = 0 float _iz = 0 float mrz = 0 float miz = 0 float trz = 0 float tiz = 0 float startSnip = 10^@where2start float endOfSnip = 10^(@where2start+@lengthOfSnip) float maxMax = startSnip*endOfSnip if (@fixit == 2) ; Minimum mrz = maxMax miz = maxMax elseif (@fixit == 3) ; Maximum mrz = -1.0e20 miz = -1.0e20 endif int realPrime = 0 int imagPrime = 0 if (@smallPrime == 0) realPrime = 11 elseif (@smallPrime == 1) realPrime = 41 elseif (@smallPrime == 2) realPrime = 71 elseif (@smallPrime == 3) realPrime = 101 elseif (@smallPrime == 4) realPrime = 191 elseif (@smallPrime == 5) realPrime = 281 elseif (@smallPrime == 6) realPrime = 311 elseif (@smallPrime == 7) realPrime = 431 elseif (@smallPrime == 8) realPrime = 461 elseif (@smallPrime == 9) realPrime = 521 elseif (@smallPrime == 10) realPrime = 641 elseif (@smallPrime == 11) realPrime = 821 elseif (@smallPrime == 12) realPrime = 881 elseif (@smallPrime == 13) realPrime = 1031 elseif (@smallPrime == 14) realPrime = 1061 elseif (@smallPrime == 15) realPrime = 1091 elseif (@smallPrime == 16) realPrime = 1151 elseif (@smallPrime == 17) realPrime = 1451 elseif (@smallPrime == 18) realPrime = 1481 elseif (@smallPrime == 19) realPrime = 1721 elseif (@smallPrime == 21) realPrime = 1931 elseif (@smallPrime == 22) realPrime = 2081 endif if (@bigPrime == 0) imagPrime = 13 elseif (@bigPrime == 1) imagPrime = 43 elseif (@bigPrime == 2) imagPrime = 73 elseif (@bigPrime == 3) imagPrime = 103 elseif (@bigPrime == 4) imagPrime = 193 elseif (@bigPrime == 5) imagPrime = 283 elseif (@bigPrime == 6) imagPrime = 313 elseif (@bigPrime == 7) imagPrime = 433 elseif (@bigPrime == 8) imagPrime = 463 elseif (@bigPrime == 9) imagPrime = 523 elseif (@bigPrime == 10) imagPrime = 643 elseif (@bigPrime == 11) imagPrime = 823 elseif (@bigPrime == 12) imagPrime = 883 elseif (@bigPrime == 13) imagPrime = 1033 elseif (@bigPrime == 14) imagPrime = 1063 elseif (@bigPrime == 15) imagPrime = 1093 elseif (@bigPrime == 16) imagPrime = 1153 elseif (@bigPrime == 17) imagPrime = 1453 elseif (@bigPrime == 18) imagPrime = 1483 elseif (@bigPrime == 19) imagPrime = 1723 elseif (@bigPrime == 21) imagPrime = 1933 elseif (@bigPrime == 22) imagPrime = 2083 endif int prime_Sum = imagPrime+realPrime complex zStart = #z ;complex angle_z = 0 int l_coord = @coordLoop int koord = @coord bool do_loop = TRUE bool no_trap = TRUE int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 if (no_trap) if (@skipMode > 0) if (@skipMode == 1) ; skip first n if (iter > @skipConst) do_loop = TRUE else do_loop = FALSE endif elseif (@skipMode == 2) ; skip after n if (iter > @skipConst) do_loop = FALSE else do_loop = TRUE endif elseif (@skipMode == 3) ; skip every nth if (iter%@skipConst == 0) do_loop = FALSE else do_loop = TRUE endif elseif (@skipMode == 4) ; skip but the nth if (iter%@skipConst == 0) do_loop = TRUE else do_loop = FALSE endif endif endif ; skipMode > 0 else do_loop = FALSE endif ; no_trap if (do_loop) ;zStart = #z if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; if (@fixit > 0) int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL1 != 0) reZ = reZ%reL2 endif if (imL1 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif zStart = @fn2(zStart) if (@mode == 0) rz = |real(zStart)| iz = |imag(zStart)| elseif (@mode == 1) rz = |real(zStart)| iz = rz elseif (@mode == 2) iz = |imag(zStart)| rz = iz elseif (@mode == 3) rz = |zStart| iz = rz elseif (@mode == 4) rz = atan2(zStart) if (rz < 0) rz = rz + 2*#pi endif iz = rz elseif (@mode == 5) rz = real(atan(zStart)) if (rz < 0) rz = rz + 2*#pi endif iz = imag(atan(zStart)) if (iz < 0) iz = iz + 2*#pi endif elseif (@mode == 6) rz = atan2(zStart) if (rz < 0) rz = rz + 2*#pi endif iz = |zStart| endif _rz = (rz - trunc(rz*startSnip)/startSnip)*endOfSnip _iz = (iz - trunc(iz*startSnip)/startSnip)*endOfSnip if (@withFinalTrunc) _rz = trunc(_rz) _iz = trunc(_iz) endif if (@fixit == 1) ; last mrz = _rz miz = _iz elseif (@fixit == 2) ; min if (_rz < mrz) mrz = _rz endif if (_iz < miz) miz = _iz endif elseif (@fixit == 3) ; max if (_rz > mrz) mrz = _rz endif if (_iz > miz) miz = _iz endif elseif (@fixit == 4) ; sum mrz = mrz + _rz miz = miz + _iz elseif (@fixit == 5) ; w-sum mrz = mrz + _rz/iter miz = miz + _iz/iter elseif (@fixit == 6) ; w2-sum float itmp = iter^2 mrz = mrz + _rz/itmp miz = miz + _iz/itmp elseif (@fixit == 7) ; wS-sum float itmp = sqrt(iter) mrz = mrz + _rz/itmp miz = miz + _iz/itmp elseif (@fixit == 8) ; g-sum float itmp = exp(-iter) mrz = mrz + _rz*itmp miz = miz + _iz*itmp elseif (@fixit == 9) ; g'-sum float itmp = exp(-iter)*iter mrz = mrz + _rz*itmp miz = miz + _iz*itmp elseif (@fixit == 10) ; ag-sum float itmp = exp(-iter)*(-1)^iter mrz = mrz + _rz*itmp miz = miz + _iz*itmp elseif (@fixit == 11) ; l-sum mrz = mrz + log(_rz) miz = miz + log(_iz) elseif (@fixit == 12) ; lw-sum mrz = mrz + log(_rz)/iter miz = miz + log(_iz)/iter elseif (@fixit == 13) ; lw2-sum float itmp = iter^2 mrz = mrz + log(_rz)/itmp miz = miz + log(_iz)/itmp endif endif if (@trapMode > 0) if (@trapMode == 1) if ( mrz > @lowerTrap && mrz < @upperTrap \ && miz > @lowerTrap && miz < @upperTrap ) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 2) if (cabs(zStart) > @lowerTrap && cabs(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 3) if (real(zStart) > @lowerTrap && real(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 4) if (imag(zStart) > @lowerTrap && imag(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 5) if (|real(zStart)| > @lowerTrap && |real(zStart)| < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 6) if (|imag(zStart)| > @lowerTrap && |imag(zStart)| < @upperTrap) no_trap = FALSE do_loop = FALSE endif endif ; At last trap the values if !do_loop ;rtrap = sqrt(mrz^2+miz^2) trz = mrz tiz = miz ;itrap = iter ;ztrap = zStart ;ctrap = p endif endif endif ; do_loop endif ; no_spare final: if (no_spare) if (@fixit == 0) ; final int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL1 != 0) reZ = reZ%reL2 endif if (imL1 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif zStart = @fn2(zStart) if (@mode == 0) rz = |real(zStart)| iz = |imag(zStart)| elseif (@mode == 1) rz = |real(zStart)| iz = rz elseif (@mode == 2) iz = |imag(zStart)| rz = iz elseif (@mode == 3) rz = |zStart| iz = rz elseif (@mode == 4) rz = atan2(zStart) if (rz < 0) rz = rz + 2*#pi endif iz = rz elseif (@mode == 5) rz = real(atan(zStart)) if (rz < 0) rz = rz + 2*#pi endif iz = imag(atan(zStart)) if (iz < 0) iz = iz + 2*#pi endif elseif (@mode == 6) rz = atan2(zStart) if (rz < 0) rz = rz + 2*#pi endif iz = |zStart| endif mrz = (rz - trunc(rz*startSnip)/startSnip)*endOfSnip miz = (iz - trunc(iz*startSnip)/startSnip)*endOfSnip if (@withFinalTrunc) mrz = trunc(mrz) miz = trunc(miz) endif if (@trapMode > 0) if (@trapMode == 1) if ( mrz > @lowerTrap && mrz < @upperTrap \ && miz > @lowerTrap && miz < @upperTrap ) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 2) if (cabs(zStart) > @lowerTrap && cabs(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 3) if (real(zStart) > @lowerTrap && real(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 4) if (imag(zStart) > @lowerTrap && imag(zStart) < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 5) if (|real(zStart)| > @lowerTrap && |real(zStart)| < @upperTrap) no_trap = FALSE do_loop = FALSE endif elseif (@trapMode == 6) if (|imag(zStart)| > @lowerTrap && |imag(zStart)| < @upperTrap) no_trap = FALSE do_loop = FALSE endif endif ; At last trap the values if !do_loop ;rtrap = sqrt(mrz^2+miz^2) trz = mrz tiz = miz ;itrap = iter ;ztrap = zStart ;ctrap = p endif endif endif float temp = 0 if (@colorby == 0) temp = 400*((mrz%realPrime) + (miz%imagPrime))/prime_Sum elseif (@colorby == 1) temp = sqrt((trz%realPrime)^2 + (tiz%imagPrime)^2) elseif (@colorby == 2) temp = 400*((trz%realPrime) + (tiz%imagPrime))/prime_Sum elseif (@colorby == 3) temp = sqrt((trz%realPrime)^2 + (tiz%imagPrime)^2) endif float mask = 0 bool no_mask = true if (@masking > 0) if (@maskType == 0) ; Index mask = temp elseif (@maskType == 1) ; Re z mask = real(zStart) elseif (@maskType == 2) ; Im z mask = imag(zStart) elseif (@maskType == 3) ; Angle mask = atan2(zStart)/(2*#pi) if mask < 0 mask = mask + 1 endif mask = mask*360 elseif (@maskType == 4) ; Iteration mask = iter elseif (@maskType == 5) ; Re Mixel mask = real(zStart+#pixel)/2 elseif (@maskType == 6) ; Im Mixel mask = imag(zStart+#pixel)/2 elseif (@maskType == 7) ; Abs Mixel mask = cabs(zStart+#pixel)/2 elseif (@maskType == 8) ; Dist(z,Pixel) mask = cabs(zStart-#pixel) elseif (@maskType == 9) ; |z| mask = cabs(zStart) endif endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true no_mask = false endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true no_mask = false endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true no_mask = false endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true no_mask = false endif else no_mask = true endif if (no_mask) float to_index = real(@fkt(temp)) complex _zz = zStart if (@base4txtr == 1) _zz = #pixel elseif (@base4txtr == 2) _zz = (#pixel+_zz)/2 elseif (@base4txtr == 3) _zz = abs(#pixel-_zz) elseif (@base4txtr == 4) _zz = cabs(#pixel-_zz) endif if (@colour_limit != 0) to_index = to_index%@colour_limit endif if (@f_randomness != 0) to_index = to_index + @f_randomness * real(#random) endif if (@txtr_gnarl != 0) complex zGnarl = _zz zGnarl = zGnarl-trunc(zGnarl*@txtr_gnarl_scale)/@txtr_gnarl_scale if (@txtr_gnarl_size != 0 && @txtr_gnarl_size != 1) zGnarl = zGnarl/@txtr_gnarl_size endif if (@reachThrough) _zz = zGnarl endif float x = real(zGnarl) float y = imag(zGnarl) float xOld = 0 int iter3 = @txtr_gnarl_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) endwhile float textureGnarl = 0 if (@txtr_gnarl_type == 0) textureGnarl = abs(x) elseif (@txtr_gnarl_type == 1) textureGnarl = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 2) textureGnarl = abs(x-y) elseif (@txtr_gnarl_type == 3) textureGnarl = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 4) textureGnarl = abs(x+y)/2 elseif (@txtr_gnarl_type == 5) textureGnarl = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_gnarl_type == 6) textureGnarl = atan2(x+1i*y)/(2*#pi) if (textureGnarl < 0) textureGnarl = textureGnarl + 1 endif elseif (@txtr_gnarl_type == 7) textureGnarl = sqrt(x^2+y^2) endif if (@txtr_Gnarl_limit != 0) textureGnarl = textureGnarl%@txtr_Gnarl_limit endif to_index = to_index + @txtr_gnarl*textureGnarl endif if (@txtr_PopCorn != 0) complex zPopCorn = _zz zPopCorn = zPopCorn-trunc(zPopCorn*@txtr_PopCorn_scale)/@txtr_PopCorn_scale if (@txtr_PopCorn_size != 0 && @txtr_PopCorn_size != 1) zPopCorn = zPopCorn/@txtr_PopCorn_size endif if (@reachThrough) _zz = zPopCorn endif float x = real(zPopCorn) float y = imag(zPopCorn) float xOld = 0 int iter3 = @txtr_PopCorn_octaves while (iter3 > 0) iter3 = iter3-1 xOld = x x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endwhile float texturePopCorn = 0 if (@txtr_PopCorn_type == 0) texturePopCorn = abs(x) elseif (@txtr_PopCorn_type == 1) texturePopCorn = abs(x)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 2) texturePopCorn = abs(x-y) elseif (@txtr_PopCorn_type == 3) texturePopCorn = abs(x-y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 4) texturePopCorn = abs(x+y)/2 elseif (@txtr_PopCorn_type == 5) texturePopCorn = abs(x*y)/(sqrt(x^2+y^2)+1e-20) elseif (@txtr_PopCorn_type == 6) texturePopCorn = atan2(x+1i*y)/(2*#pi) if (texturePopCorn < 0) texturePopCorn = texturePopCorn + 1 endif elseif (@txtr_PopCorn_type == 7) texturePopCorn = sqrt(x^2+y^2) endif if (@txtr_PopCorn_limit != 0) texturePopCorn = texturePopCorn%@txtr_PopCorn_limit endif to_index = to_index + @txtr_PopCorn*texturePopCorn endif if (@txtr_SFBM != 0) float mod = 1 float d1 = 0 float d2 = 0 float d3 = 0 float d4 = 0 float nindex = 0 float textureSFBM = 0 float scale = 0 cr1 = 0 cr2 = 0 cr3 = 0 cr4 = 0 float crp1 = 0 float crp2 = 0 float crp3 = 0 float crp4 = 0 complex tv1 = 0 complex tv2 = 0 complex tv3 = 0 complex tv4 = 0 complex seed = @txtr_SFBM_seed rotAngleFBM = exp(1i*pi/180*@txtr_SFBM_rot) if (@txtr_SFBM_scaledis == 4) ; min textureSFBM = 1e20 elseif (@txtr_SFBM_scaledis == 5) ; max textureSFBM = -1e20 endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex zSFBM = _zz zSFBM = zSFBM-trunc(zSFBM*@txtr_SFBM_scale)/@txtr_SFBM_scale if (@txtr_SFBM_size != 0 && @txtr_SFBM_size != 1) zSFBM = zSFBM/@txtr_SFBM_size endif if (@reachThrough) _zz = zSFBM endif int iter3 = 0 complex ttmp = 0 while (iter3 < @txtr_SFBM_octaves) scale = @txtr_SFBM_magn^iter3 zSFBM = zSFBM*rotAngleFBM iter3 = iter3 + 1 if @txtr_SFBM_mod == 1 mod = sqrt(iter3) endif zc = round(scale*zSFBM)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale ttmp = seed/(mod*zc1+124), cr1 = ttmp-floor(ttmp) ttmp = seed/(mod*zc2+124), cr2 = ttmp-floor(ttmp) ttmp = seed/(mod*zc3+124), cr3 = ttmp-floor(ttmp) ttmp = seed/(mod*zc4+124), cr4 = ttmp-floor(ttmp) if (@txtr_SFBM_mode == 0) tv1 = (zSFBM - zc1)*scale tv2 = (zSFBM - zc2)*scale tv3 = (zSFBM - zc3)*scale tv4 = (zSFBM - zc4)*scale crp1 = real(cr1)*real(tv1) + imag(cr1)*imag(tv1) crp2 = real(cr2)*real(tv2) + imag(cr2)*imag(tv2) crp3 = real(cr3)*real(tv3) + imag(cr3)*imag(tv3) crp4 = real(cr4)*real(tv4) + imag(cr4)*imag(tv4) endif ttmp = zSFBM - zc d1 = real(ttmp)*scale + 0.5 d2 = 1 - d1 d3 = imag(ttmp)*scale + 0.5 d4 = 1 - d3 if (@txtr_SFBM_power != 1) d1 = d1^@txtr_SFBM_power d2 = d2^@txtr_SFBM_power d3 = d3^@txtr_SFBM_power d4 = d4^@txtr_SFBM_power endif if @txtr_SFBM_mode == 0 nindex = 10 + crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 elseif @txtr_SFBM_mode == 1 nindex = cabs(cr1*d1*d3 + cr3*d1*d4 + cr2*d2*d3 + cr4*d2*d4) endif if (@txtr_SFBM_scaledis == 0) textureSFBM = textureSFBM + nindex/scale elseif (@txtr_SFBM_scaledis == 1) textureSFBM = textureSFBM + nindex/sqrt(scale) elseif (@txtr_SFBM_scaledis == 2) textureSFBM = textureSFBM + nindex/(scale^(1/scale)) elseif (@txtr_SFBM_scaledis == 3) textureSFBM = textureSFBM + nindex/iter3 elseif (@txtr_SFBM_scaledis == 4) if (nindex < textureSFBM) textureSFBM = nindex endif elseif (@txtr_SFBM_scaledis == 5) if (nindex > textureSFBM) textureSFBM = nindex endif endif endwhile if (@txtr_SFBM_limit != 0) textureSFBM = textureSFBM%@txtr_SFBM_limit endif to_index = to_index + @txtr_SFBM*textureSFBM endif if (@txtr_primes != 0) complex zPrimes = _zz zPrimes = zPrimes-trunc(zPrimes*@txtr_Primes_scale)/@txtr_Primes_scale if (@txtr_Primes_size != 0 && @txtr_Primes_size != 1) zPrimes = zPrimes/@txtr_Primes_size endif if (@reachThrough) _zz = zPrimes endif float texturePrimes = 0 float trz = 0 float tiz = 0 float t_rz = 0 float t_iz = 0 float tstartSnip = 10^@txtr_primes_where2start float tendOfSnip = 10^(@txtr_primes_where2start+@txtr_primes_lengthOfSnip) if (@txtr_primes_mode == 0) trz = |real(zPrimes)| tiz = |imag(zPrimes)| elseif (@txtr_primes_mode == 1) trz = |real(zPrimes)| tiz = trz elseif (@txtr_primes_mode == 2) tiz = |imag(zPrimes)| trz = tiz elseif (@txtr_primes_mode == 3) trz = |zPrimes| tiz = trz elseif (@txtr_primes_mode == 4) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = trz elseif (@txtr_primes_mode == 5) trz = real(atan(zPrimes)) if (trz < 0) trz = trz + 2*#pi endif tiz = imag(atan(zPrimes)) if (tiz < 0) tiz = tiz + 2*#pi endif elseif (@txtr_primes_mode == 6) trz = atan2(zPrimes) if (trz < 0) trz = trz + 2*#pi endif tiz = |zPrimes| endif t_rz = (trz - trunc(trz*tstartSnip)/tstartSnip)*tendOfSnip t_iz = (tiz - trunc(tiz*tstartSnip)/tstartSnip)*tendOfSnip if (@txtr_primes_withFinalTrunc) t_rz = trunc(t_rz) t_iz = trunc(t_iz) endif texturePrimes = 10*((t_rz%821) + (t_iz%823))/1644 if (@txtr_Primes_limit != 0) texturePrimes = texturePrimes%@txtr_Primes_limit endif to_index = to_index + @txtr_Primes*texturePrimes endif ; @txtr_primes != 0 if (@txtr_Gauss != 0) complex zGauss = _zz zGauss = zGauss-trunc(zGauss*@txtr_Gauss_scale)/@txtr_Gauss_scale if (@txtr_Gauss_size != 0 && @txtr_Gauss_size != 1) zGauss = zGauss/@txtr_Gauss_size endif if (@reachThrough) _zz = zGauss endif float textureGauss = 0 float t_d = cabs(zGauss) float t_r = real(zGauss) float t_i = imag(zGauss) if (@txtr_Gauss_type == 0) textureGauss = t_d elseif (@txtr_Gauss_type == 1) textureGauss = |t_r| elseif (@txtr_Gauss_type == 2) textureGauss = |t_i| elseif (@txtr_Gauss_type == 3) textureGauss = |t_i-t_r| elseif (@txtr_Gauss_type == 4) textureGauss = |t_i*t_r| elseif (@txtr_Gauss_type == 5) textureGauss = |t_i/t_r| elseif (@txtr_Gauss_type == 6) if (|t_i| < |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 7) if (|t_i| > |t_r|) textureGauss = |t_i| else textureGauss = |t_r| endif elseif (@txtr_Gauss_type == 8) textureGauss = atan2(zGauss)/(2*#pi) if textureGauss < 0 textureGauss = textureGauss + 1 endif elseif (@txtr_Gauss_type == 9) textureGauss = (|t_i|+|t_r|+t_d)/3 elseif (@txtr_Gauss_type == 10) textureGauss = (|t_i|*|t_r|*t_d)^(1/3) endif if (@txtr_Gauss_limit != 0) textureGauss = textureGauss%@txtr_Gauss_limit endif to_index = to_index + @txtr_Gauss*textureGauss endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "Prime Twins" param Mode caption = "Primes Mode (Watch)" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param where2start caption = "Start of Snip" default = 1 min = 0 endparam param lengthOfSnip caption = "Length of Snip" default = 1 min = 1 endparam param fixit caption = "Fixit for Color by" enum = "Final" "Last" "Minimum" "Maximum" "Sum" \ "W-Sum" "W^2-Sum" "WR-Sum" \ "G-Sum" "G'-Sum" "AG-Sum" \ "L-Sum" "LW-Sum" "LW^2-Sum" default = 1 endparam param colorby caption = "Color by" enum = "Prime Decomposition" "Prime Dist"\ "Trapped Decomposition" "Trapped Dist" default = 0 endparam param trapMode caption = "Trap Mode" enum = "None" "Distance" "Cabs" "Real" "Imag" "|Real|" "|Imag|" endparam param lowerTrap caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param upperTrap caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param skipMode caption = "Skip Mode: Skip..." enum = "None" \ "...first n" "...after n" \ "...every nth" "...but the nth" endparam param skipConst caption = "Skip Constant" default = 3 min = 1 endparam param smallPrime caption = "Smaller Prime" enum = "11" "41" "71" "101" "191" "281" "311" \ "431" "461" "521" "641" "821" "881" "1031" \ "1061" "1091" "1151" "1451" "1481" "1721" \ "1931" "2081" default = 0 hint = "Smaller Prime (for decomposition of the real part)" endparam param bigPrime caption = "Bigger Prime" enum = "13" "43" "73" "103" "193" "283" "313" \ "433" "463" "523" "643" "823" "883" "1033" \ "1063" "1093" "1153" "1453" "1483" "1723" \ "1933" "2083" default = 10 hint = "Bigger Prime (for decomposition of the imaginary part)" endparam param zJouk caption = "Joukowskij: Constant" default = (1.0,0.0) endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func fn2 caption = "After Lattice Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc }