comment { Coloring methods by Andreas Lober strongly based or at least inspired by methods of Samuel Monnier, who gave me permission to use the central idea, but does not want his name be part of a file name :-O. He often was a great help for the development of the files... 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. } turnaround { ; ; New: May 16, 2000 ; Updated with SFBM texture may 31, 2000 ; ; Gnarl and PopCorn parts and texture used ; with kind permission from Mark Townsend. ; It was taken from mt.ucl ; ; Turnaround transformational part used ; with kind permission from Samuel Monnier. ; It was taken from kpk.ufm (Peter Kubik), ; but that was not its real origin :-) ; ; SFBM texture used ; with kind permission from Samuel Monnier. ; It was taken from sam.ucl:SFBMpix ; ; Most of the rest seems to be ; made by Andreas Lober... ; ; Formula piece compilation ; made by Andreas Lober... ; ; Thank you Sam for writing a free ; alternate formula of fBm. ; You did more with it than you know... ; ; Thank you Angela, Michèle, Queri, ; Tina, Peter, Richard ; for encouraging me, testing this formula, ; and for your friendship. ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; complex temp = (-1,0) ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = #z ; init _zz int iter = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord float arg = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 float t_testAngle1 = #pi/@t_corte1 float t_testAngle2 = 3*t_testAngle1 complex t_rotAngle1 = @t_corte2*1i*t_testAngle1 complex t_rotAngle2 = @t_corte2*1i*t_testAngle2 loop: if (no_spare) iter = iter + 1 if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif if (@t_turnMode) complex t_zRound = 0 complex t_zZ = zStart if (@t_turnScale != 0) t_zRound = round(zStart*@t_turnScale)/@t_turnScale t_zZ = zStart-t_zRound endif float targ = atan2(t_zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = t_zZ*exp(t_rotAngle1)+t_zRound elseif (abs(targ) > t_testAngle2) zStart = t_zZ*exp(t_rotAngle2)+t_zRound endif endif ; @t_turnMode _zz = zStart arg = atan2(_zz) ; "Turn around" part taken from Sam if (abs(arg) < testAngle1) _zz = _zz*exp(rotAngle1) elseif (abs(arg) > testAngle2) _zz = _zz*exp(rotAngle2) else if (arg < 0) arg = arg + 2*#pi endif ; "Gnarl" and "PopCorn" parts from MarkT if (@turnMode == 0) _zz = @fn1(_zz)*arg elseif (@turnMode == 1) _zz = conj(@fn1(_zz)+1i*arg/(2*#pi)) elseif (@turnMode == 2 || @turnMode == 3 || @turnMode == 4) _zz = @fn1(_zz) float x = real(_zz)/arg float y = imag(_zz)/arg float xOld = 0 int iter2 = 0 while (iter2 < 5) iter2 = iter2+1 xOld = x if (@turnMode == 2) x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) elseif (@turnMode == 3) x = x - sin(y + sin(y + sin(y))) y = y - sin(xOld + sin(xOld + sin(xOld))) else x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endif endwhile _zz = x + 1i*y endif endif ; ; 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 Turnaround, Dist. Meth." param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param turnMode caption = "Turnaround Mode" enum = "firth" "twooth" "threeth" "fourth" "fifth" default = 0 endparam func fkt caption = "Additional Function" default = ident() endfunc param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param coord caption = "Coordinates" enum = "Rectangular" \ "Polar" "PolarH" "aPolar" "aPolarH" \ "sin/cos" "sinh/cosh" "asin/acos" "asinh/acosh" \ "z/inv(z)" "z/conj(z)" "z/flip(z)" \ "?sin/cos" "?sin/i*cos" "?asin/acos" "?asin/i*acos" \ "?sinh/cosh" "?sinh/i*cosh" "?asinh/acosh" "?asinh/i*acosh" default = 0 endparam param coordLoop caption = "# Coord Loops" default = 1 min = 1 endparam param coordMode caption = "Mode Coord Loop" enum = "Static" "Dynamic" default = 0 endparam param lattice caption = "Lattice Type" enum = "None" \ "round" "trunc" "floor" "ceil" "abs" \ "r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \ "round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \ "r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2" \ "Modulo" "Mod Quot" "Mod Inv" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (1.0,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (1.0,0.0) endparam param colour_limit caption = "Colour Limitation" default = 0.0 min = 0.0 max = 400.0 endparam param corte1 caption = "Old Cutting edges" default = 4.0 endparam param corte2 caption = "New Cutting edges" default = 2.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 t_turnMode caption = "L: Turnaround Mode" default = false endparam param t_turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param t_corte1 caption = "L: Turnaround #1" default = 4.0 endparam param t_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 = "Turnaround" default = flip() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; turnaround turnaroundOct { ; ; New: May 16, 2000 ; Updated with SFBM texture may 31, 2000 ; ; Gnarl and PopCorn parts and texture used ; with kind permission from Mark Townsend. ; It was taken from mt.ucl ; ; TurnaroundOct transformational part used ; with kind permission from Samuel Monnier. ; It was taken from kpk.ufm (Peter Kubik), ; but that was not its real origin :-) ; ; SFBM texture used ; with kind permission from Samuel Monnier. ; It was taken from sam.ucl:SFBMpix ; ; Most of the rest seems to be ; made by Andreas Lober... ; ; Formula piece compilation ; made by Andreas Lober... ; ; Thank you Sam for writing a free ; alternate formula of fBm. ; You did more with it than you know... ; ; Thank you Angela, Michèle, Queri, ; Tina, Peter, Richard ; for encouraging me, testing this formula, ; and for your friendship. ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; complex temp = (-1,0) ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = #z ; init _zz int iter = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord float arg = 0 float testAngle1 = #pi/@corte1 float testAngle2 = #pi/@corte2 complex rotAngle1 = 1i*testAngle1 complex rotAngle2 = 1i*testAngle2 float angle = @angle*pi/180 float t_testAngle1 = #pi/@t_corte1 float t_testAngle2 = 3*t_testAngle1 complex t_rotAngle1 = @t_corte2*1i*t_testAngle1 complex t_rotAngle2 = @t_corte2*1i*t_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 if (@t_turnMode) complex t_zRound = 0 complex t_zZ = zStart if (@t_turnScale != 0) t_zRound = round(zStart*@t_turnScale)/@t_turnScale t_zZ = zStart-t_zRound endif float targ = atan2(t_zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = t_zZ*exp(t_rotAngle1)+t_zRound elseif (abs(targ) > t_testAngle2) zStart = t_zZ*exp(t_rotAngle2)+t_zRound endif endif ; @t_turnMode _zz = zStart arg = atan2(_zz) ; "Turn around" part taken from Sam if (arg > testAngle1-angle) _zz = _zz*exp(-rotAngle1) elseif (arg < testAngle1-angle && arg > angle) _zz = _zz*exp(-rotAngle2) _zz = _zz*@trnFct1(angle)/@trnFct1(rotAngle2-angle) else if (arg < 0) arg = arg + 2*#pi endif ; "Gnarl" and "PopCorn" parts from MarkT if (@turnMode == 0) _zz = @fn1(_zz)*arg elseif (@turnMode == 1) _zz = conj(@fn1(_zz)+1i*arg/(2*#pi)) elseif (@turnMode == 2 || @turnMode == 3 || @turnMode == 4) _zz = @fn1(_zz) float x = real(_zz)/arg float y = imag(_zz)/arg float xOld = 0 int iter2 = 0 while (iter2 < 5) iter2 = iter2+1 xOld = x if (@turnMode == 2) x = x - sin(y + sin(y)) y = y - sin(xOld + sin(xOld)) elseif (@turnMode == 3) x = x - sin(y + sin(y + sin(y))) y = y - sin(xOld + sin(xOld + sin(xOld))) else x = x - sin(y + log(y + cos(y))) y = y - sin(xOld + log(xOld + cos(xOld))) endif endwhile _zz = x + 1i*y endif endif ; ; 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 TurnaroundOct, Dist. Meth." param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param angle caption = "Angle" default = 45.0 endparam param turnMode caption = "TurnaroundOct Mode" enum = "firth" "twooth" "threeth" "fourth" "fifth" default = 0 endparam param _trap_min caption = "Lower Border for Trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "Upper Border for Trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param 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 corte1 caption = "Old Cutting edges" default = 2.0 endparam param corte2 caption = "New Cutting edges" default = 4.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 t_turnMode caption = "L: Turnaround Mode" default = false endparam param t_turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param t_corte1 caption = "L: Turnaround #1" default = 4.0 endparam param t_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 = "TurnaroundOct" default = flip() endfunc func trnFct1 caption = "Turnaround8 #1" default = asin() endfunc func trnFct2 caption = "Turnaround8 #3" default = asin() endfunc func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } ; turnaroundOct sam+akl-OctogonalGradient(BOTH) { ; By Samuel Monnier, 27.2.00 ; Thank you Sam for letting me tweak it ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float arg = 0 float x = 0 float y = 0 float angle = @angle*#pi/180 float pi_half = 4*#pi/@polygon float pi_quart = pi_half/2.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 complex zfix = 0 complex cfix = 0 complex ztrap = (0.0,0.0) complex ctrap = (0.0,0.0) float ifix = 0 float itrap = 0 int iter = 0 complex zStart = 0 complex p = 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 ; init zStart if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode p = zStart x = real(p) y = imag(p) if x < 0 x = -x endif if y < 0 y = -y endif p = x + 1i*y arg = atan2(p) int angleFactor1 = -1 int angleFactor2 = -1 if (@rotMode == 1) ; +- angleFactor1 = 1 elseif (@rotMode == 2) ; -+ angleFactor2 = 1 elseif (@rotMode == 3) ; ?? if (iter%2 == 0) angleFactor1 = -1 else angleFactor1 = 1 endif elseif (@rotMode == 4) ; ?? if (iter%2 == 0) angleFactor1 = 1 else angleFactor1 = -1 endif endif if (@rotModeIter) angleFactor1 = angleFactor1*iter angleFactor2 = angleFactor2*iter endif if arg > pi_half - angle p = p*exp(angleFactor1*1i*pi_half) elseif arg < pi_half - angle && arg > angle p = p*exp(angleFactor2*1i*pi_quart) p = p*cos(angle)/cos(pi_quart-angle) endif float rz = real(p) float iz = imag(p) if (@watch == 0) ; real r = rz elseif (@watch == 1) ; imag r = iz elseif (@watch == 2) ; magn r = cabs(p) 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 = |p-zStart| elseif (@watch >= 9 && @watch <= 17) ; Astro1.. float ang = atan(rz/iz) complex zwatch = 0 if (@watch == 9) ; Astro01 zwatch = p elseif (@watch == 10) ; Astro02 zwatch = zStart elseif (@watch == 11) ; Astro03 zwatch = #pixel elseif (@watch == 12) ; Astro12 zwatch = p-zStart elseif (@watch == 13) ; Astro21 zwatch = zStart-p elseif (@watch == 14) ; Astro31 zwatch = #pixel-p elseif (@watch == 15) ; Astro13 zwatch = p-#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 zfix = zStart cfix = p ifix = iter elseif (@fixit == 1) ; min if (r < rfix) rfix = r zfix = zStart cfix = p ifix = iter endif elseif (@fixit == 2) ; max if (r > rfix) rfix = r zfix = zStart cfix = p ifix = iter endif elseif (@fixit == 3) ; sum rfix = rfix + r zfix = zfix + zStart cfix = cfix + p ifix = ifix + iter elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter zfix = zfix + zStart/iter cfix = cfix + p/iter ifix = (ifix + iter)/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp zfix = zfix + zStart/itmp cfix = cfix + p/itmp ifix = (ifix + iter)/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) ; lw2-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 (@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) ; Minimum 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)) 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 temp = temp*.3 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 Octogon Grad (Loop Vers.)" param angle caption = "Angle" default = 26.6 endparam param polygon caption = "Polygonal" default = 8.0 min = 1.0 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" 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 rotMode caption = "Rotation Mode" enum = "Sam's (--)" "+-" "-+" "??+-" "??-+" endparam param rotModeIter caption = "Rotation Mode Iter" default = false 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 = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } sam+akl-OctogonalGradient_dist { ; By Samuel Monnier, 27.2.00 ; Another tweak, this time transfer ; to a distance method ; ; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; z = 0 float arg = 0 float x = 0 float y = 0 float angle = @angle*#pi/180 float pi_half = 4*#pi/@polygon float pi_quart = pi_half/2.0 float _dist = 0 float _rdist = 0 float _idist = 0 float _tdist = 0 float _cdist = 0 float _qdist = 0 float _rd = 0 float _id = 0 float _min_dist = 1e20 float _max_dist = -1 float _min_rdist = 1e20 float _max_rdist = -1 float _min_idist = 1e20 float _max_idist = -1 float _min_tdist = 1e20 float _max_tdist = -1 float _min_cdist = 1e20 float _max_cdist = -1 float _min_qdist = 1e20 float _max_qdist = -1 float temp = -1 ; ; Traps ; bool _do_trap = true float _trap = 0.01 bool _do_rtrap = true float _rtrap = 0.01 bool _do_itrap = true float _itrap = 0.01 bool _do_ttrap = true float _ttrap = 0.01 bool _do_ctrap = true float _ctrap = 0.01 ; ; Sums ; float _sum = 0 float _rsum = 0 float _isum = 0 float _tsum = 0 float _csum = 0 float _qsum = 0 ; ; Weighted Sums ; float _sum_w = 0 float _rsum_w = 0 float _isum_w = 0 float _tsum_w = 0 float _csum_w = 0 float _qsum_w = 0 ; ; Square-Weighted Sums ; float _sum_w2 = 0 float _rsum_w2 = 0 float _isum_w2 = 0 float _tsum_w2 = 0 float _csum_w2 = 0 float _qsum_w2 = 0 complex _zz = 0 ; init _zz int iter = 0 complex zStart = 0 int l_coord = @coordLoop int koord = @coord bool do_loop = 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 (@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 if (do_loop) ;zStart = #z ; init zStart if (@init_z == 0) zStart = #z elseif (@init_z == 1) zStart = zStart + #z elseif (@init_z == 2) zStart = zStart + #z/iter elseif (@init_z == 3) zStart = zStart + #z/iter^2 elseif (@init_z == 4) zStart = zStart + #z + #pixel elseif (@init_z == 5) zStart = abs(#pixel - #z) elseif (@init_z == 6) zStart = (#pixel + #z)/2 endif; int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) zStart = cabs(zStart) + 1i*atan2(zStart) elseif (koord == 2) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(zStart) float phi = atan2(zStart) zStart = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) zStart = real(sin(zStart)) + 1i*cos(zStart) elseif (koord == 6) zStart = real(sinh(zStart)) + 1i*cosh(zStart) elseif (koord == 7) zStart = real(asin(zStart)) + 1i*acos(zStart) elseif (koord == 8) zStart = real(asinh(zStart)) + 1i*acosh(zStart) elseif (koord == 9) zStart = abs(zStart) + conj(zStart)/(|zStart|+1e-20) elseif (koord >= 10 && koord <= 19) if (zStart != 0) float rad = cabs(zStart) float re = real(zStart)/rad float im = imag(zStart)/rad if (koord == 10) zStart = re*zStart + im*conj(zStart) elseif (koord == 11) zStart = re*zStart + im*flip(zStart) elseif (koord == 12) zStart = re*sin(zStart) + im*cos(zStart) elseif (koord == 13) zStart = re*sin(zStart) + 1i*im*cos(zStart) elseif (koord == 14) zStart = re*asin(zStart) + im*acos(zStart) elseif (koord == 15) zStart = re*asin(zStart) + 1i*im*acos(zStart) elseif (koord == 16) zStart = re*sinh(zStart) + im*cosh(zStart) elseif (koord == 17) zStart = re*sinh(zStart) + 1i*im*cosh(zStart) elseif (koord == 18) zStart = re*asinh(zStart) + im*acosh(zStart) elseif (koord == 19) zStart = re*asinh(zStart) + 1i*im*acosh(zStart) endif endif endif endwhile ; Schleife über die Koordinaten zStart = @startFct(zStart) if (@l_randomness != 0) zStart = zStart + @l_randomness * #random endif ; ; Start with the lattices ; if (@lattice == 1) zStart = round(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 2) zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 3) zStart = floor(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 4) zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart elseif (@lattice == 5) zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2 elseif (@lattice == 6) zStart = round(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 7) zStart = trunc(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 8) zStart = floor(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 9) zStart = ceil(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 10) zStart = abs(@lattFac1*zStart) \ - @lattFac2*sqrt(real(zStart)*imag(zStart)) elseif (@lattice == 11) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 12) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 13) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 14) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*zStart)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 15) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*zStart^2)^2) \ - @lattFac2*zStart^2 elseif (@lattice == 16) zStart = round((round(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 17) zStart = trunc((trunc(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 18) zStart = floor((floor(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 19) zStart = ceil((ceil(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice == 20) zStart = abs((abs(@lattFac1*zStart) \ - @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \ - @lattFac2*zStart^2 elseif (@lattice >= 21 && @lattice <= 23) float reL1 = real(@lattFac1) float imL1 = imag(@lattFac1) float reL2 = real(@lattFac2) float imL2 = imag(@lattFac2) float reZ = reL1*real(zStart) float imZ = imL1*imag(zStart) if (reL2 != 0) reZ = reZ%reL2 endif if (imL2 != 0) imZ = imZ%imL2 endif if (@lattice == 21) zStart = reZ + 1i*imZ elseif (@lattice == 22) zStart = reZ/@lattFac1 + 1i*imZ/@lattFac2 elseif (@lattice == 23) zStart = @lattFac1/reZ + 1i*@lattFac2/imZ endif endif ; lattices if (@turnMode) complex zRound = 0 complex zZ = zStart if (@turnScale != 0) complex zRound = round(zStart*@turnScale)/@turnScale complex zZ = zStart-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) zStart = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) zStart = zZ*exp(rotAngle2)+zRound endif endif ; @turnMode if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif z = zStart x = real(z) y = imag(z) if (@vectorJouk != 0 && zStart != 0) zStart = zStart + @vectorJouk/zStart endif if x < 0 x = -x endif if y < 0 y = -y endif if (@curveJouk != 0) if (x != 0) x = x + real(@curveJouk)/x endif if (y != 0) y = y + imag(@curveJouk)/y endif endif z = x + 1i*y arg = atan2(z) int angleFactor1 = -1 int angleFactor2 = -1 if (@rotMode == 1) ; +- angleFactor2 = 1 endif if (@rotModeIter) angleFactor1 = angleFactor1*iter angleFactor2 = angleFactor2*iter endif if arg > pi_half - angle z = z*exp(angleFactor1*1i*pi_half) elseif arg < pi_half - angle && arg > angle z = z*exp(angleFactor2*1i*pi_quart) z = z*cos(angle)/cos(pi_quart-angle) endif ;Transfer from SAM -> AKL _zz = z ; AKL Dist.. ; ; 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 ; do_loop (at the very beginning endif ; no_spare final: if (no_spare) float temp = 0 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)) 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 Octogon Grad (Dist. Meth.)" param _mode caption = "Dist. Mode" enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \ "Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \ "Act Dist" "Act Real" "Act Imag" \ "Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \ "Difference" \ "Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \ "Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \ "Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot" \ "W-Sum Dist" "W-Sum Real" "W-Sum Imag" "W-Sum Triang" "W-Sum Cubus" \ "W^2-Sum Dist" "W^2-Sum Real" "W^2-Sum Imag" \ "W^2-Sum Triang" "W^2-Sum Cubus" endparam param _trap_min caption = "lower border for trap" default = 1.0 min = 0.0 hint = "Only usefull with Traps" endparam param _trap_max caption = "upper border for trap" default = 2.0 min = 0.0 hint = "Only usefull with Traps" endparam param 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 angle caption = "Angle" default = 26.6 endparam param polygon caption = "Polygonal" default = 8.0 min = 1.0 endparam param rotMode caption = "Rotation Mode" enum = "Sam's (--)" "-+" endparam param rotModeIter caption = "Rotation Mode Iter" default = false 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 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 init_z caption = "Z Initialisation" enum = "Always New" \ "Sum Up" "W-Sum Up" "W^2-Sum Up" \ "Summm" "Pixel" "Mixel" default = 0 endparam param turnMode caption = "L: Turnaround Mode" default = false endparam param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam param f_randomness caption = "T: Random Texture" hint = "This adds a random texture the the coloring." default = 0.0 endparam param base4txtr caption = "Texture Base" enum = "Z" "Pixel" "Mixel" "Diff(Z,Pixel)" "Dist(Z,Pixel)" default = 0 endparam param reachThrough caption = "T: Reach Through Scales" default = false hint = "Reaches the Scale and Pattern Size from one \ Texture to the next. Every Texture changes all \ that follow." endparam param txtr_gnarl caption = "T: Gnarl Texture" hint = "This adds a Gnarl texture the the coloring." default = 0.0 endparam param txtr_gnarl_type caption = "T: Gnarl Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_gnarl_scale caption = "T: Gnarl Scale" hint = "Scaling Factor for this Gnarl texture." default = 1.0 endparam param txtr_gnarl_size caption = "T: Gnarl Pattern Size" default = 1.0 endparam param txtr_gnarl_limit caption = "T: Gnarl Limitation" default = 0.0 min = 0.0 endparam param txtr_gnarl_octaves caption = "T: Gnarl Octaves" default = 5 min = 1 endparam param txtr_PopCorn caption = "T: PopCorn Texture" hint = "This adds a PopCorn texture the the coloring." default = 0.0 endparam param txtr_PopCorn_type caption = "T: PopCorn Type" enum = "x" "x/d" "x-y" "(x-y)/d" "(x+y)/2" "x*y/d" "Angle" "d" default = 0 endparam param txtr_PopCorn_scale caption = "T: PopCorn Scale" hint = "Scaling Factor for this PopCorn texture." default = 1.0 endparam param txtr_PopCorn_size caption = "T: PopCorn Pattern Size" default = 1.0 endparam param txtr_PopCorn_limit caption = "T: PopCorn Limitation" default = 0.0 min = 0.0 endparam param txtr_PopCorn_octaves caption = "T: PopCorn Octaves" default = 5 min = 1 endparam param txtr_SFBM caption = "T: SFBM Texture" hint = "This adds a SFBM texture to the coloring." default = 0.0 endparam param txtr_SFBM_mode caption = "T: SFBM Noise type" default = 1 enum = "Perlin's" "Raw... (Sam's)" endparam param txtr_SFBM_scale caption = "T: SFBM Scale" hint = "Scaling Factor for this SFBM texture." default = 1.0 endparam param txtr_SFBM_scaledis caption = "T: SFBM Scale Distribution" default = 0 enum = "1/scale" "1/sqrt(scale)" "Fancy" "1/i" endparam param txtr_SFBM_size caption = "T: SFBM Pattern Size" default = 0.1 endparam param txtr_SFBM_magn caption = "T: SFBM Magnification Step" default = 1.2 endparam param txtr_SFBM_limit caption = "T: SFBM Limitation" default = 0.0 min = 0.0 endparam param txtr_SFBM_rot caption = "T: SFBM Rotation Step" default = 28.0 endparam param txtr_SFBM_power caption = "T: SFBM Power" default = 1.0 endparam param txtr_SFBM_mod caption = "Vary Random Numbers?" default = 1 enum = "No" "Use sqrt(i)" endparam param txtr_SFBM_seed caption = "T: SFBM Seed" default = 123094 endparam param txtr_SFBM_octaves caption = "T: SFBM Octaves" default = 5 min = 1 endparam param txtr_Primes caption = "T: Primes Texture" hint = "This adds a Primes texture to the coloring." default = 0.0 endparam param txtr_Primes_scale caption = "T: Primes Scale" hint = "Scaling Factor for this Primes texture." default = 1.0 endparam param txtr_Primes_size caption = "T: Primes Pattern Size" default = 0.5 endparam param txtr_primes_withFinalTrunc caption = "With Final Truncation" default = TRUE endparam param txtr_primes_where2start caption = "T: Start of Snip" default = 1 min = 0 endparam param txtr_primes_lengthOfSnip caption = "T: Length of Snip" default = 1 min = 1 endparam param txtr_primes_Mode caption = "T: Primes Mode" enum = "Real,Imag" "Real" "Imag" "|z|" "Angle" "Angel" "Polar" default = 5 endparam param txtr_primes_limit caption = "T: Primes Limitation" default = 0.0 min = 0.0 endparam param txtr_Gauss caption = "T: Gauss Texture" hint = "This adds a Gauss texture to the coloring." default = 0.0 endparam param txtr_Gauss_type caption = "T: Gauss Type" enum = "d" "x" "y" "x-y" "x*y" "y/x" "min x,y" "max x,y" "Angle" \ "Pyth. am" "Pyth. gm" default = 0 endparam param txtr_Gauss_scale caption = "T: Gauss Scale" hint = "Scaling Factor for this Gauss texture." default = 1.0 endparam param txtr_Gauss_size caption = "T: Gauss Pattern Size" default = 1.0 endparam param txtr_Gauss_limit caption = "T: Gauss Limitation" default = 0.0 min = 0.0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param maskType caption = "Mask Type" enum = "Index" "Re z" "Im z" "Angle" "Iteration" \ "Re Mixel" "Im Mixel" "Abs Mixel" \ "Dist(z,Pixel)" "|z|" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam param spareMode caption = "Cut Out" enum = "None" "Upper" "Lower" \ "Left" "Right" \ "Upper + Left" "Upper + Right" "Lower + Left" "Lower + Right" \ "Upper & Left" "Upper & Right" "Lower & Left" "Lower & Right" \ "Inside Rectangle" "Outside Rectangle" \ "Between Vertical" "Outside Vertical" \ "Between Horizontal" "Outside Horizontal" \ "Inside Circle" "Outside Circle" default = 0 endparam param sparePoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param sparePoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param spareRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param spareMask caption = "Mask Cut" default = true endparam func startFct caption = "Start Function" default = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } sam-FractalTree-lattice { ; By Samuel Monnier, 11.1.00 ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float arg = 0 int j = 0 float r = 0 float rfix = 0 float rtrap = 0 if (@fixit == 1) ; min rfix = 1e20 elseif (@fixit == 2) ; max rfix = -1e20 endif 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) complex zStart = 0 complex p = 0 int l_coord = @coordLoop int koord = @coord float x = 0 float y = 0 float dr = pi/180*@rotincr/2 bool do_loop = TRUE bool no_trap = TRUE int iter = 0 float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 loop: if (no_spare) iter = iter + 1 if (@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 == 0) zStart = zStart elseif (@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 if iter == @itertr p = zStart endif endif ; no_spare final: if (no_spare) ; Performs translation, rotation ; and magnification p = p - @center p = p*exp(-1i*@rot*pi/180) p = p/@size do_loop = TRUE no_trap = TRUE iter = 0 while iter < @niter 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) x = abs(real(p)) y = imag(p) p = x + 1i*y arg = -atan2(p) + pi/2 ; Estimate distance if y >= -1 && y <= 0 r = x elseif y < -1 r = cabs(p + 1i) elseif y > 0 r = cabs(p) endif ; Computes the rotation to apply j = @order-1 rotincr = j*dr while j > 0 j = j - 2 if arg < (j+1)*dr rotincr = j*dr endif endwhile ; Performs transformation p = p*exp(1i*rotincr) p = p*@magnincr p = p - 1i if (@fixit == 0) ; last rfix = r zfix = zStart cfix = p ifix = iter elseif (@fixit == 1) ; min if r < rfix rfix = r zfix = zStart cfix = p ifix = iter endif elseif (@fixit == 2) ; max if r > rfix rfix = r zfix = zStart cfix = p ifix = iter 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 (@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 endwhile float temp = 0 if (@colorby == 0) ; Minimum 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 Fractal Tree +" 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 niter caption = "Number of Iteration" default = 20 endparam param itertr caption = "Iteration to observe" default = 1 endparam param order caption = "Tree Order" default = 2 endparam param rotincr caption = "Angle Between Branches" default = 40.0 endparam param magnincr caption = "Tree Magnification Increment" default = 1.9 endparam param center caption = "Center" default = (0,0) endparam param rot caption = "Rotation" default = 0.0 endparam param size caption = "Size" default = 1.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 = ident() endfunc func fkt caption = "Additional Function" default = ident() endfunc } akl-go-mask { ; ; Go! is a funny idea that worked well ; in a colouring... ; ; It has a totally geometric approach ; that was inspired by Samuel Monnier's ; way in creating fractals. ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float r = 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) complex zStart = 0 complex p = 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 bool do_transform = true 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 if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif if (@turnMode > 0) if (@turnMode == 1 || @turnMode == 3) do_transform = true else ; 2 do_transform = false endif 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 elseif (@turnMode != 3) zStart = 1/zStart*1i do_transform = !do_transform endif else do_transform = true endif ; @turnMode > 0 complex z4fixing = 0 complex z4start = 0 if (@startTheCurve == 0) ; #z z4fixing = #z z4start = #z elseif (@startTheCurve == 1) ; transformed z z4fixing = zStart z4start = zStart elseif (@startTheCurve == 2) ; automatic if (@colorby == 0 && @coord == 0 && @lattice == 0) z4fixing = #z z4start = #z else z4fixing = zStart z4start = zStart endif elseif (@startTheCurve == 3) ; mixed z4start = zStart z4fixing = #z elseif (@startTheCurve == 4) ; mixed2 z4start = #z z4fixing = zStart endif if (@flipTheCurve) z4start = flip(z4start) endif u = real(z4Start) v = imag(z4Start) float reZ = real(z4fixing) float imZ = imag(z4fixing) float left = 0 float right = 0 float up = 0 float down = 0 if (@neighbourhood == 0) ; round left = @neighbour*round(reZ) down = @neighbour*round(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 1) ; floor/ceil left = floor(@neighbour*reZ)/@neighbour down = floor(@neighbour*imZ)/@neighbour right = ceil(@neighbour*reZ)/@neighbour up = ceil(@neighbour*imZ)/@neighbour elseif (@neighbourhood == 2) ; trunc left = @neighbour*trunc(reZ) down = @neighbour*trunc(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 3) ; flow left = @neighbour*reZ down = @neighbour*imZ right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 4) ; round2 left = round(@neighbour*reZ)/@neighbour down = round(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 5) ; trunc2 left = trunc(@neighbour*reZ)/@neighbour down = trunc(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 6) ; +- left = ceil(abs(@neighbour*reZ))/@neighbour down = ceil(abs(@neighbour*imZ))/@neighbour right = -left up = -down elseif (@neighbourhood == 7) ; +- float nd = cabs(zStart) left = @neighbour*reZ/nd down = @neighbour*imZ/nd right = -left up = -down elseif (@neighbourhood == 8) ; +- float nd = |zStart| left = sqrt(@neighbour*abs(reZ)/nd) down = sqrt(@neighbour*abs(imZ)/nd) right = -left up = -down elseif (@neighbourhood == 9) ; +- left = @neighbour*cabs(zStart) down = atan2(zStart)/(2*#pi) if (down<0) down=down+1 endif down = @neighbour*down right = -left up = -down endif float d2left = (abs(left-reZ))^@distExp float d2right = (abs(right-reZ))^@distExp float d2up = (abs(up-imZ))^@distExp float d2down = (abs(down-imZ))^@distExp bool go_left = false bool go_right = false bool go_up = false bool go_down = false float x = 0 float y = 0 if (do_transform) if d2left < d2right && d2left < d2up && d2left < d2down go_left = true elseif d2right < d2up && d2right < d2down go_right = true elseif d2up < d2down go_up = true elseif d2down < d2up go_down = true endif if (@circular) bool go_left_hlp = go_up bool go_right_hlp = go_down bool go_up_hlp = go_right bool go_down_hlp = go_left go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif if (@inverse) bool go_left_hlp = go_right bool go_right_hlp = go_left bool go_up_hlp = go_down bool go_down_hlp = go_up go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif x = reZ y = imZ float denom = 1+@goWeight if (denom == 0) denom = 1 endif if go_left x = (reZ + @goWeight*left)/denom elseif go_right x = (reZ + @goWeight*right)/denom elseif go_up y = (imZ + @goWeight*up)/denom elseif go_down y = (imZ + @goWeight*down)/denom endif endif 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 complex z = u + 1i*v - p float rz = |x-u| ; = |real(z)| float iz = |y-v| ; = |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 = |p| 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) if (r < rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 2) if (r > rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + z4fixing cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + z4fixing/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + z4fixing/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 = 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 if (@nexp != 1) temp = temp^@nexp 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 = "Go!" param neighbourhood caption = "Neighbourhood" enum = "round" "floor/ceil" "trunc" "flow" \ "round2" "trunc2" \ "ceil+-" "cabs+-" "sqrt+-" "polar+-" default = 1 endparam param neighbour caption = "Neighbour Factor" default = 1.0 endparam param circular caption = "Go in circles?" default = false endparam param inverse caption = "Go in inverse direction?" default = false endparam param goWeight caption = "Go Weight" default = 1.0 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 = 2 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 distExp caption = "Distance Exponent" default = 2 endparam param minMax caption = "Min/Max" default = FALSE 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 startTheCurve caption = "Start Calculations..." enum = "With #z" "With transformed z" "Automatically" \ "Mixed" "Mixed 2" default = 1 hint = "Useful with coordinates not rectangular and lattices" endparam param flipTheCurve caption = "Flip the Figures?" default = false 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 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 curveJouk caption = "Joukowskij Curvature" default = (0.0,0.0) endparam param nexp caption = "Power" default = 0.5 min = 0.0 hint = "decrease to make thinner lines" 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" enum = "None" "Turn" "Around" "Always" default = 0 endparam param turnScale caption = "L: Turn Scale" default = 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 fkt caption = "Additional Function" default = ident() endfunc } akl-oct-mask { ; ; Oct! is another funny idea that worked well ; in a colouring... ; ; It has a totally geometric approach ; that was inspired by Samuel Monnier's ; way in creating fractals. ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float r = 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) complex zStart = 0 complex p = 0 int l_coord = @coordLoop int koord = @coord bool do_loop = TRUE bool no_trap = TRUE float granulation = 1/@thickness float sqrtTwo = sqrt(2) bool do_transform = true float arg = 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 if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif if (@turnMode > 0) if (@turnMode == 1 || @turnMode == 3) do_transform = true else ; 2 do_transform = false endif 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 elseif (@turnMode != 3) zStart = 1/zStart*1i do_transform = !do_transform endif else do_transform = true endif ; @turnMode > 0 complex z4fixing = 0 complex z4start = 0 if (@startTheCurve == 0) ; #z z4fixing = #z z4start = #z elseif (@startTheCurve == 1) ; transformed z z4fixing = zStart z4start = zStart elseif (@startTheCurve == 2) ; automatic if (@colorby == 0 && @coord == 0 && @lattice == 0) z4fixing = #z z4start = #z else z4fixing = zStart z4start = zStart endif elseif (@startTheCurve == 3) ; mixed z4start = zStart z4fixing = #z elseif (@startTheCurve == 4) ; mixed2 z4start = #z z4fixing = zStart endif if (@flipTheCurve) z4start = flip(z4start) endif u = real(z4Start) v = imag(z4Start) float reZ = real(z4fixing) float imZ = imag(z4fixing) float x = abs(reZ)-0.01 float y = abs(imZ)-0.01 bool isOct = false if (do_transform) ; Test if within Square or Octangle if ( (round(@neighbour*x) + round(@neighbour*y))%2 != 0 || \ (round(@thickness*@neighbour*x) + round(@thickness*@neighbour*y))%2 != 0) isOct = true endif ; Determine the whole coordinate x = round(reZ) y = round(imZ) float dx = abs(reZ-x) float dy = abs(imZ-y) if (isOct) if (dx >= sqrtTwo*granulation && dy > sqrtTwo*granulation) if (reZ > x) x = x - @neighbour elseif (reZ < x) x = x + @neighbour endif if (imZ > y) y = y - @neighbour elseif (imZ < y) y = y + @neighbour endif elseif (dy >= granulation && dx < granulation) if (imZ > y) y = y - @neighbour elseif (imZ < y) y = y + @neighbour endif elseif (dx >= granulation && dy < granulation) if (reZ > x) x = x - @neighbour elseif (reZ < x) x = x + @neighbour endif endif endif float denom = 1+@goWeight if (denom == 0) denom = 1 endif if (isOct) x = (@goWeight*x+reZ)/denom y = (@goWeight*y+imZ)/denom if (@inverse) float hlp = x x = y y = hlp endif else if (@circular) x = (x+@goWeight*imZ)/denom y = (y+@goWeight*reZ)/denom endif endif endif 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 complex z = u + 1i*v - p float rz = |x-u| ; = |real(z)| float iz = |y-v| ; = |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 = |p| 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) if (r < rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 2) if (r > rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + z4fixing cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + z4fixing/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + z4fixing/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 = 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 if (@nexp != 1) temp = temp^@nexp 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 = "Oct!" param neighbour caption = "Granulation" default = 1.0 endparam param thickness caption = "Thickness" default = 2.0 endparam param circular caption = "Show the Net?" default = true endparam param inverse caption = "Go in inverse direction?" default = false endparam param goWeight caption = "Go Weight" default = 1.0 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 = 2 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 distExp caption = "Distance Exponent" default = 2 endparam param minMax caption = "Min/Max" default = FALSE 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 startTheCurve caption = "Start Calculations..." enum = "With #z" "With transformed z" "Automatically" \ "Mixed" "Mixed 2" default = 1 hint = "Useful with coordinates not rectangular and lattices" endparam param flipTheCurve caption = "Flip the Figures?" default = false 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 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 curveJouk caption = "Joukowskij Curvature" default = (0.0,0.0) endparam param nexp caption = "Power" default = 0.5 min = 0.0 hint = "decrease to make thinner lines" 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" enum = "None" "Turn" "Around" "Always" default = 0 endparam param turnScale caption = "L: Turn Scale" default = 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 fkt caption = "Additional Function" default = ident() endfunc } akl-measles-mask { ; ; developped from Go! ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float r = 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) complex zStart = 0 complex p = 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 bool do_transform = true 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 if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif if (@turnMode > 0) if (@turnMode == 1 || @turnMode == 3) do_transform = true else ; 2 do_transform = false endif 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 elseif (@turnMode != 3) zStart = 1/zStart*1i do_transform = !do_transform endif else do_transform = true endif ; @turnMode > 0 complex z4fixing = 0 complex z4start = 0 if (@startTheCurve == 0) ; #z z4fixing = #z z4start = #z elseif (@startTheCurve == 1) ; transformed z z4fixing = zStart z4start = zStart elseif (@startTheCurve == 2) ; automatic if (@colorby == 0 && @coord == 0 && @lattice == 0) z4fixing = #z z4start = #z else z4fixing = zStart z4start = zStart endif elseif (@startTheCurve == 3) ; mixed z4start = zStart z4fixing = #z elseif (@startTheCurve == 4) ; mixed2 z4start = #z z4fixing = zStart endif if (@flipTheCurve) z4start = flip(z4start) endif u = real(z4Start) v = imag(z4Start) float reZ = real(z4fixing) float imZ = imag(z4fixing) float left = 0 float right = 0 float up = 0 float down = 0 if (@neighbourhood == 0) ; round left = @neighbour*round(reZ) down = @neighbour*round(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 1) ; floor/ceil left = floor(@neighbour*reZ)/@neighbour down = floor(@neighbour*imZ)/@neighbour right = ceil(@neighbour*reZ)/@neighbour up = ceil(@neighbour*imZ)/@neighbour elseif (@neighbourhood == 2) ; trunc left = @neighbour*trunc(reZ) down = @neighbour*trunc(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 3) ; flow left = @neighbour*reZ down = @neighbour*imZ right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 4) ; round2 left = round(@neighbour*reZ)/@neighbour down = round(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 5) ; trunc2 left = trunc(@neighbour*reZ)/@neighbour down = trunc(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 6) ; +- left = ceil(abs(@neighbour*reZ))/@neighbour down = ceil(abs(@neighbour*imZ))/@neighbour right = -left up = -down elseif (@neighbourhood == 7) ; +- float nd = cabs(zStart) left = @neighbour*reZ/nd down = @neighbour*imZ/nd right = -left up = -down elseif (@neighbourhood == 8) ; +- float nd = |zStart| left = sqrt(@neighbour*abs(reZ)/nd) down = sqrt(@neighbour*abs(imZ)/nd) right = -left up = -down elseif (@neighbourhood == 9) ; +- left = @neighbour*cabs(zStart) down = atan2(zStart)/(2*#pi) if (down<0) down=down+1 endif down = @neighbour*down right = -left up = -down endif float d2left = (abs(left-reZ))^@distExp float d2right = (abs(right-reZ))^@distExp float d2up = (abs(up-imZ))^@distExp float d2down = (abs(down-imZ))^@distExp float d2 = 0 float x2 = 0 float y2 = 0 bool go_left = false bool go_right = false bool go_up = false bool go_down = false float x = 0 float y = 0 if (do_transform) if d2left < d2right && d2left < d2up && d2left < d2down go_left = true d2 = d2left elseif d2right < d2up && d2right < d2down go_right = true d2 = d2right elseif d2up < d2down go_up = true d2 = d2up elseif d2down < d2up go_down = true d2 = d2down endif if d2left < d2right x2 = left else x2 = right endif if d2up < d2down y2 = up else y2 = down endif x = reZ y = imZ if (@enableGo) if (@circular) bool go_left_hlp = go_up bool go_right_hlp = go_down bool go_up_hlp = go_right bool go_down_hlp = go_left go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif if (@inverse) bool go_left_hlp = go_right bool go_right_hlp = go_left bool go_up_hlp = go_down bool go_down_hlp = go_up go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif float denom = 1+@goWeight if (denom == 0) denom = 1 endif if go_left x = (reZ + @goWeight*left)/denom elseif go_right x = (reZ + @goWeight*right)/denom elseif go_up y = (imZ + @goWeight*up)/denom elseif go_down y = (imZ + @goWeight*down)/denom endif endif endif 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 if (@measleMode == 0) p = (x-x2 + 1i*(y-y2))*exp(1i*2*#pi*d2) + (x2 + 1i*y2) else p = (x2-x + 1i*(y2-y))*exp(1i*2*#pi*d2) + (x + 1i*y) endif complex z = u + 1i*v - p float rz = |x-u| ; = |real(z)| float iz = |y-v| ; = |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 = |p| 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) if (r < rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 2) if (r > rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + z4fixing cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + z4fixing/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + z4fixing/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 = 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 if (@nexp != 1) temp = temp^@nexp 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 = "Measles! (Min version)" param measleMode caption = "Measle Mode" enum = "1st Try" "2nd Try" default = 0 endparam param neighbourhood caption = "Neighbourhood" enum = "round" "floor/ceil" "trunc" "flow" \ "round2" "trunc2" \ "ceil+-" "cabs+-" "sqrt+-" "polar+-" default = 1 endparam param neighbour caption = "Neighbour Factor" default = 1.0 endparam param enableGo caption = "Enable Go features?" default = true endparam param circular caption = "Go in circles?" default = false endparam param inverse caption = "Go in inverse direction?" default = false endparam param goWeight caption = "Go Weight" default = 1.0 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 = 2 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 distExp caption = "Distance Exponent" default = 2 endparam param minMax caption = "Min/Max" default = FALSE 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 startTheCurve caption = "Start Calculations..." enum = "With #z" "With transformed z" "Automatically" \ "Mixed" "Mixed 2" default = 1 hint = "Useful with coordinates not rectangular and lattices" endparam param flipTheCurve caption = "Flip the Figures?" default = false 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 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 curveJouk caption = "Joukowskij Curvature" default = (0.0,0.0) endparam param nexp caption = "Power" default = 0.5 min = 0.0 hint = "decrease to make thinner lines" 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" enum = "None" "Turn" "Around" "Always" default = 0 endparam param turnScale caption = "L: Turn Scale" default = 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 fkt caption = "Additional Function" default = ident() endfunc } akl-measles2-mask { ; ; developped from Go! ; ; Andreas Lober, July 30, 2000 ; init: bool no_spare = true if (@spareMode > 0) float spareVert = real(@sparePoint) float spareHori = imag(@sparePoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@spareMode <= 18) if (@spareRot%360 != 0) complex rotCentre = @sparePoint if (@spareMode > 12 && @spareMode < 19) rotCentre = (@sparePoint+@sparePoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@spareRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@spareMode <= 12) if (@spareMode == 1 || @spareMode == 5 || @spareMode == 6 \ || @spareMode == 9 || @spareMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= spareHori) if (@spareMode == 9) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 10) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif elseif (@spareMode == 2 || @spareMode == 7 || @spareMode == 8 \ || @spareMode == 11 || @spareMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < spareHori) if (@spareMode == 11) if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 12) if (rePix >= spareVert) no_spare = false endif else no_spare = false endif endif endif if (@spareMode == 3 || @spareMode == 5 || @spareMode == 7) ; left upper+left lower+left if (rePix < spareVert) no_spare = false endif elseif (@spareMode == 4 || @spareMode == 6 || @spareMode == 8) ; right upper+right lower+right if (rePix >= spareVert) no_spare = false endif endif elseif (@spareMode <= 18) float rePnt = real(@sparePoint2) float imPnt = imag(@sparePoint2) float upper = imPnt float lower = spareHori float left = spareVert float right = rePnt if (imPnt < spareHori) upper = spareHori lower = imPnt endif if (spareVert > rePnt) left = rePnt right = spareVert endif if (@spareMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) no_spare = false endif elseif (@spareMode == 15) ; inside vert if (rePix > left && rePix < right) no_spare = false endif elseif (@spareMode == 16) ; outside vert if (rePix < left || rePix > right) no_spare = false endif elseif (@spareMode == 17) ; inside hori if (imPix > lower && imPix < upper) no_spare = false endif elseif (@spareMode == 18) ; outside hori if (imPix < lower || imPix > upper) no_spare = false endif endif elseif (@spareMode <= 20) float radiusOFCutCircle = cabs(@sparePoint-@sparePoint2) if (@spareMode == 19) ; inside circle if (cabs(#pixel-@sparePoint) < radiusOFCutCircle) no_spare = false endif elseif (@spareMode == 20) ; outside circle if (cabs(#pixel-@sparePoint) > radiusOFCutCircle) no_spare = false endif endif endif ; spareMode > 12 endif ; @spareMode > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; float rfix = 0 float rtrap = 0 if (@fixit == 1) ; Minimum rfix = 1.0e20 elseif (@fixit == 2) ; Maximum rfix = -1.0e20 endif int iter = 0 float r = 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) complex zStart = 0 complex p = 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 bool do_transform = true 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 if (@zJouk != 0 && zStart != 0) zStart = zStart + @zJouk/zStart endif if (@turnMode > 0) if (@turnMode == 1 || @turnMode == 3) do_transform = true else ; 2 do_transform = false endif 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 elseif (@turnMode != 3) zStart = 1/zStart*1i do_transform = !do_transform endif else do_transform = true endif ; @turnMode > 0 complex z4fixing = 0 complex z4start = 0 if (@startTheCurve == 0) ; #z z4fixing = #z z4start = #z elseif (@startTheCurve == 1) ; transformed z z4fixing = zStart z4start = zStart elseif (@startTheCurve == 2) ; automatic if (@colorby == 0 && @coord == 0 && @lattice == 0) z4fixing = #z z4start = #z else z4fixing = zStart z4start = zStart endif elseif (@startTheCurve == 3) ; mixed z4start = zStart z4fixing = #z elseif (@startTheCurve == 4) ; mixed2 z4start = #z z4fixing = zStart endif if (@flipTheCurve) z4start = flip(z4start) endif u = real(z4Start) v = imag(z4Start) float reZ = real(z4fixing) float imZ = imag(z4fixing) float left = 0 float right = 0 float up = 0 float down = 0 if (@neighbourhood == 0) ; round left = @neighbour*round(reZ) down = @neighbour*round(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 1) ; floor/ceil left = floor(@neighbour*reZ)/@neighbour down = floor(@neighbour*imZ)/@neighbour right = ceil(@neighbour*reZ)/@neighbour up = ceil(@neighbour*imZ)/@neighbour elseif (@neighbourhood == 2) ; trunc left = @neighbour*trunc(reZ) down = @neighbour*trunc(imZ) right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 3) ; flow left = @neighbour*reZ down = @neighbour*imZ right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 4) ; round2 left = round(@neighbour*reZ)/@neighbour down = round(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 5) ; trunc2 left = trunc(@neighbour*reZ)/@neighbour down = trunc(@neighbour*imZ)/@neighbour right = left + @neighbour up = down + @neighbour elseif (@neighbourhood == 6) ; +- left = ceil(abs(@neighbour*reZ))/@neighbour down = ceil(abs(@neighbour*imZ))/@neighbour right = -left up = -down elseif (@neighbourhood == 7) ; +- float nd = cabs(zStart) left = @neighbour*reZ/nd down = @neighbour*imZ/nd right = -left up = -down elseif (@neighbourhood == 8) ; +- float nd = |zStart| left = sqrt(@neighbour*abs(reZ)/nd) down = sqrt(@neighbour*abs(imZ)/nd) right = -left up = -down elseif (@neighbourhood == 9) ; +- left = @neighbour*cabs(zStart) down = atan2(zStart)/(2*#pi) if (down<0) down=down+1 endif down = @neighbour*down right = -left up = -down endif float d2left = (abs(left-reZ))^@distExp float d2right = (abs(right-reZ))^@distExp float d2up = (abs(up-imZ))^@distExp float d2down = (abs(down-imZ))^@distExp float d2 = 0 float x2 = 0 float y2 = 0 bool go_left = false bool go_right = false bool go_up = false bool go_down = false float x = 0 float y = 0 if (do_transform) if d2left > d2right && d2left > d2up && d2left > d2down go_left = true d2 = d2left elseif d2right > d2up && d2right > d2down go_right = true d2 = d2right elseif d2up > d2down go_up = true d2 = d2up elseif d2down > d2up go_down = true d2 = d2down endif if (@inverseLogic) go_left = !go_left go_right = !go_right go_up = !go_up go_down = !go_down endif if d2left > d2right x2 = left else x2 = right endif if d2up > d2down y2 = up else y2 = down endif x = reZ y = imZ if (@enableGo) if (@circular) bool go_left_hlp = go_up bool go_right_hlp = go_down bool go_up_hlp = go_right bool go_down_hlp = go_left go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif if (@inverse) bool go_left_hlp = go_right bool go_right_hlp = go_left bool go_up_hlp = go_down bool go_down_hlp = go_up go_up = go_up_hlp go_down = go_down_hlp go_left = go_left_hlp go_right = go_right_hlp endif float denom = 1+@goWeight if (denom == 0) denom = 1 endif if go_left x = (reZ + @goWeight*left)/denom endif if go_right x = (reZ + @goWeight*right)/denom endif if go_up y = (imZ + @goWeight*up)/denom endif if go_down y = (imZ + @goWeight*down)/denom endif endif endif 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 if (@measleMode == 0) p = (x-x2 + 1i*(y-y2))*exp(1i*2*#pi*d2) + (x2 + 1i*y2) else p = (x2-x + 1i*(y2-y))*exp(1i*2*#pi*d2) + (x + 1i*y) endif complex z = u + 1i*v - p float rz = |x-u| ; = |real(z)| float iz = |y-v| ; = |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 = |p| 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) if (r < rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 2) if (r > rfix) rfix = r ifix = iter zfix = z4fixing cfix = p endif elseif (@fixit == 3) ; sum rfix = rfix + r ifix = ifix + iter zfix = zfix + z4fixing cfix = cfix + p elseif (@fixit == 4) ; w-sum rfix = rfix + r/iter ifix = (ifix + iter)/iter zfix = zfix + z4fixing/iter cfix = cfix + p/iter elseif (@fixit == 5) ; w2-sum float itmp = iter^2 rfix = rfix + r/itmp ifix = (ifix + iter)/itmp zfix = zfix + z4fixing/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 = 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 if (@nexp != 1) temp = temp^@nexp 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 = "Measles! (Max version)" param measleMode caption = "Measle Mode" enum = "1st Try" "2nd Try" default = 0 endparam param neighbourhood caption = "Neighbourhood" enum = "round" "floor/ceil" "trunc" "flow" \ "round2" "trunc2" \ "ceil+-" "cabs+-" "sqrt+-" "polar+-" default = 1 endparam param neighbour caption = "Neighbour Factor" default = 1.0 endparam param enableGo caption = "Enable Go features?" default = true endparam param inverseLogic caption = "Invert Go Logics?" default = false endparam param circular caption = "Go in circles?" default = false endparam param inverse caption = "Go in inverse direction?" default = false endparam param goWeight caption = "Go Weight" default = 1.0 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 = 2 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 distExp caption = "Distance Exponent" default = 2 endparam param minMax caption = "Min/Max" default = FALSE 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 startTheCurve caption = "Start Calculations..." enum = "With #z" "With transformed z" "Automatically" \ "Mixed" "Mixed 2" default = 1 hint = "Useful with coordinates not rectangular and lattices" endparam param flipTheCurve caption = "Flip the Figures?" default = false 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 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 curveJouk caption = "Joukowskij Curvature" default = (0.0,0.0) endparam param nexp caption = "Power" default = 0.5 min = 0.0 hint = "decrease to make thinner lines" 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" enum = "None" "Turn" "Around" "Always" default = 0 endparam param turnScale caption = "L: Turn Scale" default = 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 fkt caption = "Additional Function" default = ident() endfunc }