comment { Coloring methods by Andreas Lober strongly based on methods by Mark Townsend, who gave me permission to use the central idea and is parent of the texturing and masking ideas. 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. } mt+akl-gnarly_traps { ; ; Third attempt to play with Mark Townsend's ; formulas. ; ; ; This formula is based on mt-gnarly-traps ; Mark Townsend, Aug 27, 1999. ; ; Andreas Lober, Feb 09, 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 complex zStart = 0 ; ; from MT ; w = 0 int iter = 0 float x = 0 float y = 0 float xx = 0 float average = 0 float frm_dist = 0 float min_w = 1e20 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) ;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 ; calculate the "vector" w = @fn1(zStart + @offset) x = real(w) * 1/@scale y = imag(w) * 1/@scale ; Iterate trap formula int frm_iter = 0 average = 0 min_w = 1e20 while frm_iter < @max_iter xx = x if @formula == 0 ; Martin x = y - sin(x) y = @a - xx elseif @formula == 1 ; Popcorn x = x - @h * sin(y + tan(@a * y)) y = y - @h * sin(xx + tan(@a * xx)) elseif @formula == 2 ; Vine if @flavor == 0 x = x - @h * sin(y + sin(@a * y )) y = y + @h * sin(xx + sin(@a * xx)) elseif @flavor == 1 x = x - @h * sin(y^@b + sin(@a * y)) y = y + @h * sin(xx^@b + sin(@a * xx)) elseif @flavor == 2 x = x - @h * sin(y + sin(@a * (y + sin(@a * y)))) y = y + @h * sin(xx + sin(@a * (xx + sin(@a * xx)))) else float newx = y float newy = x int i = 0 while i < @flavor i = i + 1 newx = y + sin(@a * newx) newy = x + sin(@a * newy) endwhile x = x - @h * sin(newx) y = y + @h * sin(newy) endif elseif @formula == 3 ; Gnarl x = x - @h * real(@gn1(y + @gn2(@a * (y + @gn3(@b * y))))) y = y + @h * real(@gn1(xx + @gn2(@a * (xx + @gn3(@b * xx))))) endif w = @fn2(x + flip(y)) if @trap_mode == 0 || @trap_mode == 2 ; Closest & Average ; Choose the variable that we want to watch... if @frm_mode == 0 frm_dist = cabs(w) elseif @frm_mode == 1 frm_dist = cabs(w - zStart) elseif @frm_mode == 2 frm_dist = cabs(w - #pixel) elseif @frm_mode == 3 frm_dist = cabs(w - @offset) endif endif if @trap_mode == 0 ; Closest if frm_dist < min_w min_w = frm_dist endif elseif @trap_mode == 2 ; Average average = average + frm_dist endif frm_iter = frm_iter + 1 endwhile ; end of formula loop if @trap_mode == 3 ; Martin x = real(w) * 1/@mscale y = imag(w) * 1/@mscale ; Iterate the Martin formula i = 0 while i < @m_iterations xx = x x = y - sin(x) y = @m - xx i = i + 1 endwhile w = x + flip(y) endif if @trap_mode == 1 || @trap_mode == 3 ; Final & Martin ; Choose the variable that we want to watch... if @frm_mode == 0 min_w = cabs(w) elseif @frm_mode == 1 min_w = cabs(w - zStart) elseif @frm_mode == 2 min_w = cabs(w - #pixel) elseif @frm_mode == 3 min_w = cabs(w - @offset) endif elseif @trap_mode == 2 ; Average min_w = average / @max_iter endif ; ; Transfer from MT->AKL ; _zz = min_w ; ; 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 = "M Gnarly Orbit Trap, Dist. Method" param formula caption = "Formula" enum = "Martin" "Popcorn" "Vine" "Gnarl" default = 1 endparam param trap_mode caption = "Trap Mode" enum = "Closest" "Final" "Average" "Martin" default = 1 endparam 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 frm_mode caption = "Variable" enum = "Magnitude" "Distance" "Pixel distance" "Offset distance" endparam param offset caption = "Offset" hint = "This is added to the value of z before the trap \ formula is iterated." endparam param scale caption = "Scale" hint = "This affects the size of the shapes." default = 0.5 min = 1e-20 endparam param a caption = "Alpha" hint = "This parameter is used for all of the formulas." default = 3.0 endparam param b caption = "Beta" hint = "This parameter is used only for Vine flavor 1 and Gnarl." default = 2.0 endparam param h caption = "Step size" hint = "This parameter usually affects the 'harshness' of the \ shapes." default = 0.05 min = 1e-20 endparam param flavor caption = "Vine flavor" hint = "This is the 'flavor' for the Vine formula." default = 2 min = 0 endparam param max_iter caption = "Iterations" hint = "This is the number of times to iterate the trap formula." default = 10 min = 1 endparam param m caption = "Martin parameter" hint = "This is the parameter for the Martin moade." default = 3.14159 endparam param m_iterations caption = "Martin iterations" hint = "This is the number of iterations for the \ Martin mode." default = 10 min = 1 endparam param mscale caption = "Martin scale" hint = "This is the scale for the Martin mode." default = 0.1 min = 1e-20 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 fn1 caption = "First function" hint = "This function changes the overall shape of \ the trap." default = ident() endfunc func fn2 caption = "Second function" hint = "This function changes the overall shape of \ the trap." default = ident() endfunc func gn1 caption = "Gnarl function #1" hint = "This is the first function for the Gnarl \ formula only." default = sin() endfunc func gn2 caption = "Gnarl function #2" hint = "This is the second function for the Gnarl \ formula only." default = tan() endfunc func gn3 caption = "Gnarl function #3" hint = "This is the third function for the Gnarl \ formula only." default = cos() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } mt+akl-harlequin { ; ; First attempt to play with Mark Townsend's ; formulas. ; ; ; This formula is based on mt-harlequin ; Mark Townsend, Jan 13, 2000 ; which is based on the Paul Carlson orbit trap. ; ; At first glance, there is nearly no difference ; between mt+akl-harlequin in MinDist mode with Real/Imag on ; and mt-harlequin in default settings ; ; But change the settings... ; Or play with the lattices... ; ; Andreas Lober, Feb 10, 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 a = 0 complex _zz = 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) ;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 a = 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 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 ; ; transformation ; if (@_pseudo) float _x = real(zStart) float _y = imag(zStart) if (@_pseudoMix) if (@_mixMode == 0) ; normal mix a = @m * atan(_x/_y) elseif (@_mixMode == 1) ; diff mix a = @m * atan((_x-_y)/_y) elseif (@_mixMode == 2) ; sum mix a = @m * atan((_x+_y)/_y) elseif (@_mixMode == 3) ; prod mix a = @m * atan(_x^2/_y) elseif (@_mixMode == 4) ; expo mix a = @m * atan(_x^_y/_y) endif else a = @m * atan(_y/_x) endif else a = @m * atan(zStart) endif if (@variation == 0) a = a * a + @c a = fn1(1 - a) / a elseif (@variation == 1) a = a * a + @c a = fn1(1 - a^2) elseif (@variation == 2) a = @m * fn1(a + @c)^2 elseif (@variation == 3) a = @m * fn1(1i*a + @c)^2 / fn1(a - @c) elseif (@variation == 4) a = @m * fn1(1i*a + @c)^2 * fn1(a - @c) elseif (@variation == 5) a = @m * fn1(1i*a + @c)^2 + fn1(a - @c) endif ; ; Transfer from MT->AKL ; _zz = a ; ; 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 = "M Harlequin, Dist. Method" param variation caption = "Variation" enum = "1" "2" "3" "4" "5" "6" default = 1 endparam param m caption = "Angle Multiplier" default = 2.0 endparam param c caption = "Harlequin Seed" default = (0,0) endparam 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 _pseudo caption = "Real/Imag" default = true hint = "Real/Imag is the default in MT-Harlequin" 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 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 fn1 caption = "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() endfunc } pope_corn { ; This formula is based on Popcorn Trap ; by Mark Townsend ; ; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex p = 0 float r = 0 float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float ifix = 0 float itrap = 0 complex zfix = (0.0,0.0) complex cfix = (0.0,0.0) complex ztrap = (0.0,0.0) complex ctrap = (0.0,0.0) float x = 0 float y = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord bool do_loop = TRUE bool no_trap = TRUE 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; 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 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 ;t=0.0 r=0.0 if (@startDistortion == 0) p = #z elseif (@startDistortion == 1) p = zStart elseif (@startDistortion == 2) p = #pixel elseif (@startDistortion == 3) p = (zStart+#pixel)/2 endif p = p/@scale - @offset x = real(p) y = imag(p) int i = @maxIter while (i > 0) float xOld = x x = x - real(@fn1(y + @fn2(y))) y = y - real(@fn3(xOld + @fn4(xOld))) i = i - 1 endwhile if (@minMax) float xm = -1 float ym = -1 if (x < y) xm = x ym = y else xm = y ym = x endif x = xm y = ym endif if (@curveJouk != 0) if (x != 0) x = x + real(@curveJouk)/x endif if (y != 0) y = y + imag(@curveJouk)/y endif endif p = x + 1i*y z = zStart - p float rz = |real(z)| float iz = |imag(z)| if (@watch == 0) ; real r = rz elseif (@watch == 1) ; imag r = iz elseif (@watch == 2) ; magn r = |z| elseif (@watch == 3) ; diff r = |rz-iz| elseif (@watch == 4) ; min (r,i) if (rziz) r = rz else r = iz endif elseif (@watch == 6) ; MinQuot if (rz < iz && iz != 0) r = rz/iz elseif (rz > iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 7) ; MaxQuot if (rz > iz && iz != 0) r = rz/iz elseif (rz < iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 8) ; Diff2 r = |z-zStart| elseif (@watch >= 9 && @watch <= 17) ; Astro... float ang = atan(rz/iz) complex zwatch = 0 if (@watch == 9) ; Astro01 zwatch = z elseif (@watch == 10) ; Astro02 zwatch = zStart elseif (@watch == 11) ; Astro03 zwatch = #pixel elseif (@watch == 12) ; Astro12 zwatch = z-zStart elseif (@watch == 13) ; Astro21 zwatch = zStart-z elseif (@watch == 14) ; Astro31 zwatch = #pixel-z elseif (@watch == 15) ; Astro13 zwatch = z-#pixel elseif (@watch == 16) ; Astro32 zwatch = #pixel-zStart elseif (@watch == 17) ; Astro23 zwatch = zStart-#pixel endif r = |zwatch - cos(ang)^3 + 1i*sin(ang)^3| elseif (@watch == 18) ; Re+Im r = rz+iz elseif (@watch == 19) ; Re*Im r = rz*iz endif if (@fixit == 0) ; Last rfix = r ifix = iter zfix = zStart cfix = p elseif (@fixit == 1) ; Minimum if (r < rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 2) ; Maximum if (r > rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + zStart cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + zStart/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 6) ; wS-sum float itmp = sqrt(iter) rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 7) ; g-sum float itmp = exp(-iter) rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 8) ; g'-sum float itmp = exp(-iter)*iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 9) ; ag-sum float itmp = exp(-iter)*(-1)^iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 10) ; l-sum rfix = rfix + log(r) ifix = ifix + log(iter) zfix = zfix + log(zStart) cfix = cfix + log(p) elseif (@fixit == 11) ; lw-sum rfix = rfix + log(r)/iter ifix = (ifix + log(iter))/iter zfix = zfix + log(zStart)/iter cfix = cfix + log(p)/iter elseif (@fixit == 12) ; lw-sum float itmp = iter^2 rfix = rfix + log(r)/itmp ifix = (ifix + log(iter))/itmp zfix = zfix + log(zStart)/itmp cfix = cfix + log(p)/itmp endif if (@rotDegree != 0) zfix = (zfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre cfix = (cfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre endif if (@trapMode > 0) if (@trapMode == 1) if (rfix > @lowerTrap && rfix < @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 = r itrap = iter ztrap = zStart ctrap = p endif endif endif ; do_loop (at the very beginning endif ; no_spare final: if (no_spare) float temp = 0 if (@colorby == 0) ; Fiximum Distance temp = rfix elseif (@colorby == 1) ; Iteration@Fix temp = 0.01*ifix + |atan(zfix)|/(2*#pi) elseif (@colorby >= 2 && @colorby <= 16) ; Angle@Fix / Angle@Calc ; Angel@Fix / Angel@Calc ; Real+@Fix / Real+@Calc ; Imag+@Fix / Imag+@Calc ; RaTan@Fix / RaTan@Calc ; IaTan@Fix / IaTan@Calc if (@colorby == 2) temp = atan2(zfix) elseif (@colorby == 3) temp = atan2(zfix-cfix*ifix)*ifix elseif (@colorby == 4) temp = |atan(zfix)| elseif (@colorby == 5) temp = |atan(zfix-cfix*ifix)|*ifix elseif (@colorby == 6) temp = real(zfix)*|atan(zfix)| elseif (@colorby == 7) temp = real(zfix-cfix*ifix)*ifix elseif (@colorby == 8) temp = imag(zfix)*|atan(zfix)| elseif (@colorby == 9) temp = imag(zfix-cfix*ifix)*ifix elseif (@colorby == 10) temp = real(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 11) temp = (real(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 12) temp = imag(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 13) temp = (imag(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 14) ; temp = atan2(real(zfix-cfix*ifix)^imag(zfix-cfix*ifix)) elseif (@colorby == 15) ; temp = atan2(imag(zfix-cfix*ifix)^real(zfix-cfix*ifix)) elseif (@colorby == 16) temp = atan2(zfix-cfix) endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif elseif (@colorby == 17) ; Trapped Distance temp = rtrap elseif (@colorby == 18) ; Iteration@Trap temp = 0.01*itrap + |atan(ztrap)|/(2*#pi) elseif (@colorby >= 19 && @colorby <= 22) if (@colorby == 19) temp = atan2(ztrap) elseif (@colorby == 20) temp = atan2(ztrap-ctrap*itrap)*itrap elseif (@colorby == 21) temp = |atan(ztrap)| elseif (@colorby == 22) temp = |atan(ztrap-ctrap*itrap)|*itrap endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif endif ; list of colorby's 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 = "M Pope Corn" param watch caption = "Watch for Fixit" enum = "Real" "Imag" "Magn" "Diff" \ "Min(r,i)" "Max(r,i)" "MinQuot" "MaxQuot" "Diff2" \ "Astro01" "Astro02" "Astro03" "Astro12" "Astro21" \ "Astro31" "Astro13" "Astro32" "Astro23" \ "Re+Im" "Re*Im" default = 4 endparam param fixit caption = "Fixit for Color by" enum = "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 = "Fiximum Distance" "Iteration@Fix" \ "Angle@Fix" "Angle@Calc" \ "Angel@Fix" "Angel@Calc" \ "Real+@Fix" "Real+@Calc" "Imag+@Fix" "Imag+@Calc" \ "RaTan@Fix" "RaTan@Calc" "IaTan@Fix" "IaTan@Calc" \ "réel^imag" "imag^réel" "Angle to trap" \ "Trapped Distance" "Iteration@Trap" \ "Angle@Trap" "AngleC@Trap" \ "Angel@Trap" "AngelC@Trap" 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 scale caption = "Scale" default = 3.0 endparam param offset caption = "Offset" default = (0,0) endparam param startDistortion caption = "Start Distortion" enum = "#z" "Transformed z" "Pixel" "Mixel" default = 0 endparam param maxIter caption = "Maximum Iterations" default = 5 endparam param minMax caption = "Min/Max" default = FALSE endparam param rotDegree caption = "Degré de Rotation" default = 0.0 min = -359.99999 max = 359.99999 hint = "Does not work with Color by Fiximum Distance" endparam param rotCentre caption = "Centre de Rotation" default = (0.0,0.0) endparam param zJouk caption = "Joukowskij: Constant" default = (0.0,0.0) endparam param vectorJouk caption = "Joukowskij: Vector " default = (0.0,0.0) endparam param curveJouk caption = "Joukowskij Curvature" default = (0.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 startFct caption = "Start Function" default = atan() endfunc func fkt caption = "Additional Function" default = ident() endfunc func fn1 caption = "Re Popcorn #1" default = sin() endfunc func fn2 caption = "Re Popcorn #2" default = sin() endfunc func fn3 caption = "Im Popcorn #1" default = sin() endfunc func fn4 caption = "Im Popcorn #2" default = sin() endfunc } pope_corn_gen { ; This formula is based on Popcorn Trap ; by Mark Townsend ; ; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex p = 0 float r = 0 float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float ifix = 0 float itrap = 0 complex zfix = (0.0,0.0) complex cfix = (0.0,0.0) complex ztrap = (0.0,0.0) complex ctrap = (0.0,0.0) float x = 0 float y = 0 complex zStart = 0 complex zfix = (0.0,0.0) complex cfix = (0.0,0.0) int l_coord = @coordLoop int koord = @coord bool do_loop = TRUE bool no_trap = TRUE 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; 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) zRound = round(zStart*@turnScale)/@turnScale 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 ; calculate the "vector" x = real(zStart) y = imag(zStart) if (@vectorJouk != 0 && zStart != 0) zStart = zStart + @vectorJouk/zStart endif r=0.0 if (@startDistortion == 0) p = #z elseif (@startDistortion == 1) p = zStart elseif (@startDistortion == 2) p = #pixel elseif (@startDistortion == 3) p = (zStart+#pixel)/2 endif p = p/@scale - @offset x = real(p) y = imag(p) int i = @maxIter while (i > 0) float xOld = x int j = @numberOfPopes float tmpX = 0 float tmpY = 0 while (j > 0) decidre = j%3 if (decidre == 0) tmpX = real(@fnX0(y + tmpX)) tmpY = real(@fnY0(xOld + tmpY)) elseif (decidre == 1) tmpX = real(@fnX1(y + tmpX)) tmpY = real(@fnY1(xOld + tmpY)) elseif (decidre == 2) tmpX = real(@fnX2(y + tmpX)) tmpY = real(@fnY2(xOld + tmpY)) endif j = j - 1 endwhile ; j x = x - tmpX y = y - tmpY i = i - 1 endwhile ; i if (@minMax) float xm = -1 float ym = -1 if (x < y) xm = x ym = y else xm = y ym = x endif x = xm y = ym endif if (@curveJouk != 0) if (x != 0) x = x + real(@curveJouk)/x endif if (y != 0) y = y + imag(@curveJouk)/y endif endif p = x + 1i*y z = zStart - p float rz = |real(z)| float iz = |imag(z)| if (@watch == 0) ; real r = rz elseif (@watch == 1) ; imag r = iz elseif (@watch == 2) ; magn r = |z| elseif (@watch == 3) ; diff r = |rz-iz| elseif (@watch == 4) ; min (r,i) if (rziz) r = rz else r = iz endif elseif (@watch == 6) ; MinQuot if (rz < iz && iz != 0) r = rz/iz elseif (rz > iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 7) ; MaxQuot if (rz > iz && iz != 0) r = rz/iz elseif (rz < iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 8) ; Diff2 r = |z-zStart| elseif (@watch >= 9 && @watch <= 17) ; Astro... float ang = atan(rz/iz) complex zwatch = 0 if (@watch == 9) ; Astro01 zwatch = z elseif (@watch == 10) ; Astro02 zwatch = zStart elseif (@watch == 11) ; Astro03 zwatch = #pixel elseif (@watch == 12) ; Astro12 zwatch = z-zStart elseif (@watch == 13) ; Astro21 zwatch = zStart-z elseif (@watch == 14) ; Astro31 zwatch = #pixel-z elseif (@watch == 15) ; Astro13 zwatch = z-#pixel elseif (@watch == 16) ; Astro32 zwatch = #pixel-zStart elseif (@watch == 17) ; Astro23 zwatch = zStart-#pixel endif r = |zwatch - cos(ang)^3 + 1i*sin(ang)^3| elseif (@watch == 18) ; Re+Im r = rz+iz elseif (@watch == 19) ; Re*Im r = rz*iz endif if (@fixit == 0) ; Last rfix = r ifix = iter zfix = zStart cfix = p elseif (@fixit == 1) ; Minimum if (r < rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 2) ; Maximum if (r > rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + zStart cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + zStart/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 6) ; wS-sum float itmp = sqrt(iter) rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 7) ; g-sum float itmp = exp(-iter) rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 8) ; g'-sum float itmp = exp(-iter)*iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 9) ; ag-sum float itmp = exp(-iter)*(-1)^iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 10) ; l-sum rfix = rfix + log(r) ifix = ifix + log(iter) zfix = zfix + log(zStart) cfix = cfix + log(p) elseif (@fixit == 11) ; lw-sum rfix = rfix + log(r)/iter ifix = (ifix + log(iter))/iter zfix = zfix + log(zStart)/iter cfix = cfix + log(p)/iter elseif (@fixit == 12) ; lw-sum float itmp = iter^2 rfix = rfix + log(r)/itmp ifix = (ifix + log(iter))/itmp zfix = zfix + log(zStart)/itmp cfix = cfix + log(p)/itmp endif if (@rotDegree != 0) zfix = (zfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre cfix = (cfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre endif if (@trapMode > 0) if (@trapMode == 1) if (rfix > @lowerTrap && rfix < @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 = r itrap = iter ztrap = zStart ctrap = p endif endif endif ; do_loop (at the very beginning endif ; no_spare final: if (no_spare) float temp = 0 if (@colorby == 0) ; Fiximum Distance temp = rfix elseif (@colorby == 1) ; Iteration@Fix temp = 0.01*ifix + |atan(zfix)|/(2*#pi) elseif (@colorby >= 2 && @colorby <= 16) ; Angle@Fix / Angle@Calc ; Angel@Fix / Angel@Calc ; Real+@Fix / Real+@Calc ; Imag+@Fix / Imag+@Calc ; RaTan@Fix / RaTan@Calc ; IaTan@Fix / IaTan@Calc if (@colorby == 2) temp = atan2(zfix) elseif (@colorby == 3) temp = atan2(zfix-cfix*ifix)*ifix elseif (@colorby == 4) temp = |atan(zfix)| elseif (@colorby == 5) temp = |atan(zfix-cfix*ifix)|*ifix elseif (@colorby == 6) temp = real(zfix)*|atan(zfix)| elseif (@colorby == 7) temp = real(zfix-cfix*ifix)*ifix elseif (@colorby == 8) temp = imag(zfix)*|atan(zfix)| elseif (@colorby == 9) temp = imag(zfix-cfix*ifix)*ifix elseif (@colorby == 10) temp = real(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 11) temp = (real(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 12) temp = imag(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 13) temp = (imag(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 14) ; temp = atan2(real(zfix-cfix*ifix)^imag(zfix-cfix*ifix)) elseif (@colorby == 15) ; temp = atan2(imag(zfix-cfix*ifix)^real(zfix-cfix*ifix)) elseif (@colorby == 16) temp = atan2(zfix-cfix) endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif elseif (@colorby == 17) ; Trapped Distance temp = rtrap elseif (@colorby == 18) ; Iteration@Trap temp = 0.01*itrap + |atan(ztrap)|/(2*#pi) elseif (@colorby >= 19 && @colorby <= 22) if (@colorby == 19) temp = atan2(ztrap) elseif (@colorby == 20) temp = atan2(ztrap-ctrap*itrap)*itrap elseif (@colorby == 21) temp = |atan(ztrap)| elseif (@colorby == 22) temp = |atan(ztrap-ctrap*itrap)|*itrap endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif 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 = "M Poppy's Corner" param numberOfPopes caption = "Number of Poppies" default = 3 endparam param watch caption = "Watch for Fixit" enum = "Real" "Imag" "Magn" "Diff" \ "Min(r,i)" "Max(r,i)" "MinQuot" "MaxQuot" "Diff2" \ "Astro01" "Astro02" "Astro03" "Astro12" "Astro21" \ "Astro31" "Astro13" "Astro32" "Astro23" \ "Re+Im" "Re*Im" default = 4 endparam param fixit caption = "Fixit for Color by" enum = "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 = "Fiximum Distance" "Iteration@Fix" \ "Angle@Fix" "Angle@Calc" \ "Angel@Fix" "Angel@Calc" \ "Real+@Fix" "Real+@Calc" "Imag+@Fix" "Imag+@Calc" \ "RaTan@Fix" "RaTan@Calc" "IaTan@Fix" "IaTan@Calc" \ "réel^imag" "imag^réel" "Angle to trap" \ "Trapped Distance" "Iteration@Trap" \ "Angle@Trap" "AngleC@Trap" \ "Angel@Trap" "AngelC@Trap" 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 scale caption = "Scale" default = 3.0 endparam param offset caption = "Offset" default = (0,0) endparam param startDistortion caption = "Start Distortion" enum = "#z" "Transformed z" "Pixel" "Mixel" default = 0 endparam param maxIter caption = "Maximum Iterations" default = 5 endparam param minMax caption = "Min/Max" default = FALSE endparam param rotDegree caption = "Degré de Rotation" default = 0.0 min = -359.99999 max = 359.99999 hint = "Does not work with Color by Fiximum Distance" endparam param rotCentre caption = "Centre de Rotation" default = (0.0,0.0) endparam param zJouk caption = "Joukowskij: Constant" default = (0.0,0.0) endparam param vectorJouk caption = "Joukowskij: Vector " default = (0.0,0.0) endparam param curveJouk caption = "Joukowskij Curvature" default = (0.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 startFct caption = "Start Function" default = atan() endfunc func fkt caption = "Additional Function" default = ident() endfunc func fnX0 caption = "Re Popcorn #0" default = sin() endfunc func fnX1 caption = "Re Popcorn #1" default = sin() endfunc func fnX2 caption = "Re Popcorn #2" default = sin() endfunc func fnY0 caption = "Im Popcorn #0" default = sin() endfunc func fnY1 caption = "Im Popcorn #1" default = sin() endfunc func fnY2 caption = "Im Popcorn #2" default = sin() endfunc } pop_sine { ; This formula is based on Sine ; by Mark Townsend ; and on ideas for Poppy's corner ; by Mark Townsend and Andreas Lober ; ; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; complex p = 0 float r = 0 float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float ifix = 0 float itrap = 0 complex zfix = (0.0,0.0) complex cfix = (0.0,0.0) complex ztrap = (0.0,0.0) complex ctrap = (0.0,0.0) float x = 0 float y = 0 complex zStart = 0 complex zfix = (0.0,0.0) complex cfix = (0.0,0.0) int l_coord = @coordLoop int koord = @coord bool do_loop = TRUE bool no_trap = TRUE float xArg = 0 float yArg = 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; 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 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 r=0.0 if (@startDistortion == 0) p = #z elseif (@startDistortion == 1) p = zStart elseif (@startDistortion == 2) p = #pixel elseif (@startDistortion == 3) p = (zStart+#pixel)/2 endif p = p/@scale - @offset x = real(p) y = imag(p) int i = @maxIter while (i > 0) int j = @numberOfPopes float tmpX = 0 float tmpY = 0 while (j > 0) decidre = j%3 if (@argMode == 0) xArg = x yArg = y elseif (@argMode == 1) xArg = tmpX yArg = tmpY elseif (@argMode == 2) xArg = x+tmpX yArg = y+tmpY elseif (@argMode == 3) xArg = x-tmpX yArg = y-tmpY elseif (@argMode == 4) xArg = x+tmpY yArg = y+tmpX elseif (@argMode == 5) xArg = x-tmpY yArg = y-tmpX endif if (decidre == 0) tmpX = real(@fnX0(xArg)) tmpY = real(@fnY0(yArg)) elseif (decidre == 1) tmpX = real(@fnX1(xArg)) tmpY = real(@fnY1(yArg)) elseif (decidre == 2) tmpX = real(@fnX2(xArg)) tmpY = real(@fnY2(yArg)) endif j = j - 1 endwhile ; j if (@apresSki == 1) x = x - tmpX y = y - tmpY elseif (@apresSki == 2) x = x + tmpX y = y + tmpY elseif (@apresSki == 3) x = x - tmpY y = y - tmpX elseif (@apresSki == 4) x = x + tmpY y = y + tmpX endif i = i - 1 endwhile ; i if (@minMax) float xm = -1 float ym = -1 if (x < y) xm = x ym = y else xm = y ym = x endif x = xm y = ym endif if (@curveJouk != 0) if (x != 0) x = x + real(@curveJouk)/x endif if (y != 0) y = y + imag(@curveJouk)/y endif endif p = x + 1i*y z = zStart - p float rz = |real(z)| float iz = |imag(z)| if (@watch == 0) ; real r = rz elseif (@watch == 1) ; imag r = iz elseif (@watch == 2) ; magn r = |z| elseif (@watch == 3) ; diff r = |rz-iz| elseif (@watch == 4) ; min (r,i) if (rziz) r = rz else r = iz endif elseif (@watch == 6) ; MinQuot if (rz < iz && iz != 0) r = rz/iz elseif (rz > iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 7) ; MaxQuot if (rz > iz && iz != 0) r = rz/iz elseif (rz < iz && rz != 0) r = iz/rz else r = (iz+rz)/2 endif elseif (@watch == 8) ; Diff2 r = |z-zStart| elseif (@watch >= 9 && @watch <= 17) ; Astro... float ang = atan(rz/iz) complex zwatch = 0 if (@watch == 9) ; Astro01 zwatch = z elseif (@watch == 10) ; Astro02 zwatch = zStart elseif (@watch == 11) ; Astro03 zwatch = #pixel elseif (@watch == 12) ; Astro12 zwatch = z-zStart elseif (@watch == 13) ; Astro21 zwatch = zStart-z elseif (@watch == 14) ; Astro31 zwatch = #pixel-z elseif (@watch == 15) ; Astro13 zwatch = z-#pixel elseif (@watch == 16) ; Astro32 zwatch = #pixel-zStart elseif (@watch == 17) ; Astro23 zwatch = zStart-#pixel endif r = |zwatch - cos(ang)^3 + 1i*sin(ang)^3| elseif (@watch == 18) ; Re+Im r = rz+iz elseif (@watch == 19) ; Re*Im r = rz*iz endif if (@fixit == 0) ; Last rfix = r ifix = iter zfix = zStart cfix = p elseif (@fixit == 1) ; Minimum if (r < rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 2) ; Maximum if (r > rfix) rfix = r ifix = iter zfix = zStart cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + zStart cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + zStart/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 6) ; wS-sum float itmp = sqrt(iter) rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp elseif (@fixit == 7) ; g-sum float itmp = exp(-iter) rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 8) ; g'-sum float itmp = exp(-iter)*iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 9) ; ag-sum float itmp = exp(-iter)*(-1)^iter rfix = rfix + r*itmp ifix = (ifix + iter)*itmp zfix = zfix + zStart*itmp cfix = cfix + p*itmp elseif (@fixit == 10) ; l-sum rfix = rfix + log(r) ifix = ifix + log(iter) zfix = zfix + log(zStart) cfix = cfix + log(p) elseif (@fixit == 11) ; lw-sum rfix = rfix + log(r)/iter ifix = (ifix + log(iter))/iter zfix = zfix + log(zStart)/iter cfix = cfix + log(p)/iter elseif (@fixit == 12) ; lw-sum float itmp = iter^2 rfix = rfix + log(r)/itmp ifix = (ifix + log(iter))/itmp zfix = zfix + log(zStart)/itmp cfix = cfix + log(p)/itmp endif if (@rotDegree != 0) zfix = (zfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre cfix = (cfix-@rotCentre)*exp(iter*1i*#pi/180*@rotDegree) + @rotCentre endif if (@trapMode > 0) if (@trapMode == 1) if (rfix > @lowerTrap && rfix < @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 = r itrap = iter ztrap = zStart ctrap = p endif endif endif ; do_loop (at the very beginning endif ; no_spare final: if (no_spare) float temp = 0 if (@colorby == 0) ; Fiximum Distance temp = rfix elseif (@colorby == 1) ; Iteration@Fix temp = 0.01*ifix + |atan(zfix)|/(2*#pi) elseif (@colorby >= 2 && @colorby <= 16) ; Angle@Fix / Angle@Calc ; Angel@Fix / Angel@Calc ; Real+@Fix / Real+@Calc ; Imag+@Fix / Imag+@Calc ; RaTan@Fix / RaTan@Calc ; IaTan@Fix / IaTan@Calc if (@colorby == 2) temp = atan2(zfix) elseif (@colorby == 3) temp = atan2(zfix-cfix*ifix)*ifix elseif (@colorby == 4) temp = |atan(zfix)| elseif (@colorby == 5) temp = |atan(zfix-cfix*ifix)|*ifix elseif (@colorby == 6) temp = real(zfix)*|atan(zfix)| elseif (@colorby == 7) temp = real(zfix-cfix*ifix)*ifix elseif (@colorby == 8) temp = imag(zfix)*|atan(zfix)| elseif (@colorby == 9) temp = imag(zfix-cfix*ifix)*ifix elseif (@colorby == 10) temp = real(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 11) temp = (real(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 12) temp = imag(zfix)*atan2(zfix) + |atan(zfix)| elseif (@colorby == 13) temp = (imag(zfix-cfix*ifix)*atan2(zfix-cfix*ifix) + \ |atan(zfix-cfix*ifix)|)*ifix elseif (@colorby == 14) ; temp = atan2(real(zfix-cfix*ifix)^imag(zfix-cfix*ifix)) elseif (@colorby == 15) ; temp = atan2(imag(zfix-cfix*ifix)^real(zfix-cfix*ifix)) elseif (@colorby == 16) temp = atan2(zfix-cfix) endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif elseif (@colorby == 17) ; Trapped Distance temp = rtrap elseif (@colorby == 18) ; Iteration@Trap temp = 0.01*itrap + |atan(ztrap)|/(2*#pi) elseif (@colorby >= 19 && @colorby <= 22) if (@colorby == 19) temp = atan2(ztrap) elseif (@colorby == 20) temp = atan2(ztrap-ctrap*itrap)*itrap elseif (@colorby == 21) temp = |atan(ztrap)| elseif (@colorby == 22) temp = |atan(ztrap-ctrap*itrap)|*itrap endif temp = temp/(2*#pi) if (temp < 0) temp = temp + 1.0 endif 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 if (@txtr_Turn!= 0) complex zTurn = _zz zTurn = zTurn-trunc(zTurn*@txtr_Turn_scale)/@txtr_Turn_scale complex zTurned = zTurn float txtr_testAngle1 = #pi/@txtr_Turn_corte1 float txtr_testAngle2 = 3*testAngle1 complex txtr_rotAngle1 = @txtr_Turn_corte2*1i*testAngle1 complex txtr_rotAngle2 = @txtr_Turn_corte2*1i*testAngle2 if (@txtr_Turn_size != 0 && @txtr_Turn_size != 1) zTurn = zTurn/@txtr_Turn_size endif if (@reachThrough) _zz = zTurn endif float textureTurn = 0 float txtr_arg = atan2(zTurn) ; "Turn around" part taken from Sam if (abs(txtr_arg) < txtr_testAngle1) zTurned = zTurn*exp(txtr_rotAngle1) elseif (abs(txtr_arg) > txtr_testAngle2) zTurned = zTurn*exp(txtr_rotAngle2) endif textureTurn = |zTurn-zTurned| if (@txtr_Turn_limit != 0) textureTurn = textureTurn%@txtr_Turn_limit endif to_index = to_index + @txtr_Turn*textureTurn endif #index = to_index endif ; no_mask else if (@spareMask) #solid = true endif endif ; no_spare default: title = "M Popsyne Wopsyne" param numberOfPopes caption = "Number of Popsies" default = 3 endparam param argMode caption = "Popsyne Mode" enum = "Pop" "Wop" "Syne+" "Syne-" "PopWop+" "PopWop-" default = 2 endparam param apresSki caption = "Après Ski?" enum = "No" "Perhaps later" "At once" \ "Go with my wife" "Take my guy" default = 1 endparam param watch caption = "Watch for Fixit" enum = "Real" "Imag" "Magn" "Diff" \ "Min(r,i)" "Max(r,i)" "MinQuot" "MaxQuot" "Diff2" \ "Astro01" "Astro02" "Astro03" "Astro12" "Astro21" \ "Astro31" "Astro13" "Astro32" "Astro23" \ "Re+Im" "Re*Im" default = 4 endparam param fixit caption = "Fixit for Color by" enum = "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 = "Fiximum Distance" "Iteration@Fix" \ "Angle@Fix" "Angle@Calc" \ "Angel@Fix" "Angel@Calc" \ "Real+@Fix" "Real+@Calc" "Imag+@Fix" "Imag+@Calc" \ "RaTan@Fix" "RaTan@Calc" "IaTan@Fix" "IaTan@Calc" \ "réel^imag" "imag^réel" "Angle to trap" \ "Trapped Distance" "Iteration@Trap" \ "Angle@Trap" "AngleC@Trap" \ "Angel@Trap" "AngelC@Trap" 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 scale caption = "Scale" default = 3.0 endparam param offset caption = "Offset" default = (0,0) endparam param startDistortion caption = "Start Distortion" enum = "#z" "Transformed z" "Pixel" "Mixel" default = 0 endparam param maxIter caption = "Maximum Iterations" default = 5 endparam param minMax caption = "Min/Max" default = FALSE endparam param rotDegree caption = "Degré de Rotation" default = 0.0 min = -359.99999 max = 359.99999 hint = "Does not work with Color by Fiximum Distance" endparam param rotCentre caption = "Centre de Rotation" default = (0.0,0.0) endparam param zJouk caption = "Joukowskij: Constant" default = (0.0,0.0) endparam param vectorJouk caption = "Joukowskij: Vector " default = (0.0,0.0) endparam param curveJouk caption = "Joukowskij Curvature" default = (0.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 txtr_Turn caption = "T: Turn Texture" hint = "This adds a Turn texture to the coloring." default = 0.0 endparam param txtr_Turn_type caption = "T: Turn 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_Turn_scale caption = "T: Turn Scale" hint = "Scaling Factor for this Turn texture." default = 1.0 endparam param txtr_Turn_size caption = "T: Turn Pattern Size" default = 1.0 endparam param txtr_Turn_limit caption = "T: Turn Limitation" default = 0.0 min = 0.0 endparam param txtr_Turn_corte1 caption = "T: Turnaround #1" default = 4.0 endparam param txtr_Turn_corte2 caption = "T: Turnaround #2" default = 2.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 = atan() endfunc func fkt caption = "Additional Function" default = ident() endfunc func fnX0 caption = "Re Wopcorn #0" default = sin() endfunc func fnX1 caption = "Re Wopcorn #1" default = ident() endfunc func fnX2 caption = "Re Wopcorn #2" default = ident() endfunc func fnY0 caption = "Im Wopcorn #0" default = ident() endfunc func fnY1 caption = "Im Wopcorn #1" default = sin() endfunc func fnY2 caption = "Im Wopcorn #2" default = sin() endfunc }