comment { ; Transformations by Andreas Lober Last update on October 27, 2000 For the latest version of this file email abmlober@t-online.de or look into the formula db: http://formulas.ultrafractal.com If you post images using akl stuff to abpf or similar newsgroups or to galleries I would be glad if you could place a note that you used my formulas/transformations/colourings... The same is true for using parts of my code. } elliptic_module_transform { ; The elliptic module group GAMMA1 ; ; / a b \ ; is made of all matrixes M = | | ; \ c d / ; ; with det M = 1 and a,b,c,d integer. ; ; It operates on the upper complex plane , i.e. real(z) > 0, ; ; via Mz = (az+b)/(cz+d) ; ; having N(Mz) = (NM)z ; ; / 1 1 \ / 0 -1 \ ; GAMMA1 is generated by | | and | | ; \ 0 1 / \ 1 0 / ; ; A A ; | | ; +- move to the | ; right by 1 | ; z -> z+1 | ; | ; +- Inversion z -> -1/z ; ; ; Freitag,Busam: Funktionentheorie (function theory) Chapter VI, Springer ; transform: complex _zz = 0 ; init _zz float _xx = 0 float _yy = 0 if (@_pseudo) float _x = real(#pixel) float _y = imag(#pixel) ; ; calculate the temp real _xx ; if (@_c * _x + @_d == 0) ; don't divide by 0!! _xx = @_a * _x + @_b else if (@_pseudoMix) if (@_mixMode == 0) ; normal mix _xx = (@_a * _y + @_b) / (@_c * _x + @_d) elseif (@_mixMode == 1) ; diff mix _xx = (@_a * (_x-_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 2) ; sum mix _xx = (@_a * (_x+_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 3) ; prod mix _xx = (@_a * (_x*_y)+ @_b) / (@_c * _x + @_d) elseif (@_mixMode == 4) ; prod mix _xx = (@_a * (_x^_y)+ @_b) / (@_c * _x + @_d) endif else _xx = (@_a * _x + @_b) / (@_c * _x + @_d) endif endif ; ; calculate the temp imag _yy ; if (@_c * _y + @_d == 0) ; don't divide by 0!! _yy = @_a * _y + @_b else if (@_pseudoMix) if (@_mixMode == 0) ; normal mix _yy = (@_a * _x + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 1) ; diff mix _yy = (@_a * (_y-_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 2) ; sum mix _yy = (@_a * (_y+_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 3) ; prod mix _yy = (@_a * (_y*_x) + @_b) / (@_c * _y + @_d) elseif (@_mixMode == 4) ; prod mix _yy = (@_a * (_y^_x) + @_b) / (@_c * _y + @_d) endif else _yy = (@_a * _y + @_b) / (@_c * _y + @_d) endif endif _zz = real(@mixFkt_x(_xx)) + 1i*real(@mixFkt_y(_yy)) else if (@_c * #pixel + @_d == 0) ; don't divide by 0!! _zz = @_a * #pixel + @_b else _zz = (@_a * #pixel + @_b) / (@_c * #pixel + @_d) endif endif #pixel = _zz default: title = "Elliptic Module Transformation" param _a caption = "a, upper left coefficient" default = 0 endparam param _b caption = "b, upper right coefficient" default = -1 endparam param _c caption = "c, lower left coefficient" default = 1 endparam param _d caption = "d, lower right coefficient" default = 0 endparam param _pseudo caption = "Pseudo Elliptic" default = false hint = "separate transforming real and imag" endparam param _pseudoMix caption = "Pseudo Mix Real and Imag" default = false hint = "only in use with Pseudo Elliptic" endparam param _mixMode caption = "Mix Mode for Pseudo Mix" enum = "Normal" "Difference" "Sum" "Product" "Exponent" endparam func mixFkt_x caption = "PseudoMix x-Function" default = ident() endfunc func mixFkt_y caption = "PseudoMix y-Function" default = ident() endfunc } ; elliptic_module_form joukowskij_transform { complex J_Fkt_z = (#pixel + @epsilon/#pixel)/2 if (@pure) #pixel = J_Fkt_z^@exponent + #pixel else #pixel = J_Fkt_z^@exponent endif default: title = "Joukowskij Transformation" param exponent caption="Exponent for Joukowskij" default=2.0 endparam param epsilon caption="Epsilon, Coeff. for 1/z" default=1.0 endparam param pure caption="With Pixel Addition" default=TRUE endparam } ; joukowskij_transform circle_ring_seg_rotation { transform: ; ; init ; float _pixDist = 0 float _pixDist_real = 0 float _pixDist_imag = 0 complex _degrOfRot = (0,0) complex _rotation = (0,0) complex _centOfRot = (0,0) float _flip = 1 float _flipModulo = -1 float _ringNumber = 0 float _magnification = 1 float _granulation = 1 float _shift = 1 ; ; determine the center ; if (@_image_center) _centOfRot = #center else _centOfRot = @_transCenter endif ; ; determine the distance between pixel and center ; if (@_topology == 0) ; Euklid _pixDist = cabs(#pixel-_centOfRot) else _pixDist_real = abs(real(#pixel-_centOfRot)) _pixDist_imag = abs(imag(#pixel-_centOfRot)) ; ; Min ; if (@_topology == 1) ; Min if (_pixDist_real < _pixDist_imag) _pixDist = _pixDist_real else _pixDist = _pixDist_imag endif ; ; Max ; elseif (@_topology == 2) ; Max if (_pixDist_real < _pixDist_imag) _pixDist = _pixDist_imag else _pixDist = _pixDist_real endif ; ; Sum ; elseif (@_topology == 3) ; Sum _pixDist = _pixDist_real + _pixDist_imag ; ; Sum of Cubes ; elseif (@_topology == 4) ; Sum of Cubes _pixDist = _pixDist_real^3 + _pixDist_imag^3 ; ; Product ; elseif (@_topology == 5) ; Product _pixDist = _pixDist_real * _pixDist_imag ; ; Difference ; elseif (@_topology == 6) ; Difference _pixDist = | _pixDist_real - _pixDist_imag | ; ; MinQuotient ; elseif (@_topology == 7) ; MinQuotient if (_pixDist_real < _pixDist_imag) if (_pixDist_imag == 0) _pixDist = _pixDist_real else _pixDist = _pixDist_real / _pixDist_imag endif else if (_pixDist_real == 0) _pixDist = _pixDist_imag else _pixDist = _pixDist_imag / _pixDist_real endif endif ; ; MaxQuotient ; elseif (@_topology == 8) ; MinQuotient if (_pixDist_real > _pixDist_imag) if (_pixDist_imag == 0) _pixDist = _pixDist_real else _pixDist = _pixDist_real / _pixDist_imag endif else if (_pixDist_real == 0) _pixDist = _pixDist_imag else _pixDist = _pixDist_imag / _pixDist_real endif endif ; ; End of If ; endif endif ; @_topology == 0, != 0 _pixDist = real(@_dist_fkt(_pixDist)) ; ; Use Magnfication? ; _shift = @_shift if (@_use_magnification) _magnification = #magn _shift = _shift * #magn else _magnification = 1 endif _granulation = _magnification * @_granulation ; ; determine the rotation ; if (@_continuous) _degrOfRot = _pixDist _flip = 1 else _ringNumber = floor(_pixDist * _granulation) _degrOfRot = _ringNumber / _granulation if (@_flipMode == 0) _flip = 1 elseif (@_flipMode == 1) _flipModulo = _ringNumber % 2 if (_flipModulo == 0) _flip = 1 else _flip = -1 endif elseif (@_flipMode == 2) _flipModulo = _ringNumber % 3 _flip = _flipModulo - 1 ; => -1,0,+1 endif ; @_flipMode == 0,1,2 endif if ( _flip == 0 ) #pixel = #pixel else _degrOfRot = @_rot_fkt(_degrOfRot) _rotation = (1i * _degrOfRot * _shift * _flip) /(2*#pi) ; ; rotate ; #pixel = (#pixel-_centOfRot) * exp(_rotation) + _centOfRot endif ; _flip == 0 default: title = "Circle Ring Rotation" param _transCenter caption = "Rotation Center" default = (0,0) hint = "Where the circle rings start" endparam param _image_center caption = "Use Screen Center" default = FALSE hint = "If set, the Ring Rotation will be at the center of \ the window, regardless of the Circle Ring Rotation Center \ setting." endparam param _use_magnification caption = "Use Magnification" default = TRUE hint = "Hello" endparam param _topology caption = "Topology" enum = "Euklid" "Min" "Max" "Sum" "Sum of Cubes" \ "Product" "Difference" "MinQuotient" "MaxQuotient" hint = "Different methods for calculating the distance." endparam func _dist_fkt caption = "Distance function" default = ident() hint = "Changes the distance calculation." endfunc param _continuous caption = "Continuous" default = FALSE hint = "If set, the Ring Rotation will be at continuous, \ no rings can be seen. Similar to a high granulation." endparam param _granulation caption = "Granulation" default = 1.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam param _shift caption = "Rotational Shift" default = 1.0 hint = "Shifts the degree of rotation. Negative value inverses direction." endparam func _rot_fkt caption = "Shift function" default = ident() hint = "Similar to Shift, but function instead of constant factor." endfunc param _flipMode caption = "Flip Mode" enum = "None" "Normal" "Triple" hint = "Works together with Discontinuous Mode.\ Flips the rotating direction." endparam } ; circle_ring_seg_rotation squares_seg_rotation { transform: ; ; init ; float _pixDist = 0 float _pixDist_real = 0 float _pixDist_imag = 0 complex _degrOfRot = (0,0) complex _rotation = (0,0) complex _centOfRot = (0,0) float _flip = 1 float _flipModulo = -1 float _ringNumber = 0 ; ; determine the center ; if (@_image_center) _centOfRot = #center else _centOfRot = @_transCenter endif ; ; determine the distance between pixel and center ; _pixDist_real = abs(real(#pixel-_centOfRot)) _pixDist_imag = abs(imag(#pixel-_centOfRot)) if (_pixDist_real < _pixDist_imag) _pixDist = _pixDist_imag else _pixDist = _pixDist_real endif ; ; determine the rotation ; if (@_continuous) _degrOfRot = _pixDist _flip = 1 else _ringNumber = floor(_pixDist * @_granulation) _degrOfRot = _ringNumber / @_granulation if (@_flipMode == 0) _flip = 1 elseif (@_flipMode == 1) _flipModulo = _ringNumber % 2 if (_flipModulo == 0) _flip = 1 else _flip = -1 endif elseif (@_flipMode == 2) _flipModulo = _ringNumber % 3 _flip = _flipModulo - 1 ; => -1,0,+1 endif ; @_flipMode == 0,1,2 endif if ( _flip == 0 ) #pixel = #pixel else _degrOfRot = @_rot_fkt(_degrOfRot) _rotation = (1i * _degrOfRot * @_shift * _flip) /(2*#pi) ; ; rotate ; #pixel = (#pixel-_centOfRot) * exp(_rotation) + _centOfRot endif ; _flip == 0 default: title = "Square Ring Rotation" param _transCenter caption = "Rotation Center" default = (0,0) hint = "Where the circle rings start" endparam param _continuous caption = "Continuous" default = FALSE hint = "If set, the Ring Rotation will be at continuous, \ no rings can be seen. Similar to a high granulation." endparam param _granulation caption = "Granulation" default = 1.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam param _shift caption = "Rotational Shift" default = 1.0 hint = "Shifts the degree of rotation. Negative value inverses direction." endparam func _rot_fkt caption = "Shift function" default = ident() hint = "Similar to Shift, but function instead of constant factor." endfunc param _flipMode caption = "Flip Mode" enum = "None" "Normal" "Triple" hint = "Works together with Discontinuous Mode.\ Flips the rotating direction." endparam param _image_center caption = "Use Screen Center" default = FALSE hint = "If set, the Ring Rotation will be at the center of \ the window, regardless of the Circle Ring Rotation Center \ setting." endparam } ; squares_seg_rotation stripes_and_squares { transform: ; ; init ; float _pixDist_real = 0 float _pixDist_imag = 0 complex _degrOfRot_real = (0,0) complex _degrOfRot_imag = (0,0) complex _centOfRot = (0,0) float _flip_real = 1 float _flip_imag = 1 float _flipModulo_real = -1 float _flipModulo_imag = -1 float _ringNumber_real = 0 float _ringNumber_imag = 0 float _addReal = 0 float _addImag = 0 ; ; determine the center ; if (@_image_center) _centOfRot = #center else _centOfRot = @_transCenter endif ; ; determine the distance between pixel and center ; _pixDist_real = abs(real(#pixel-_centOfRot)) _pixDist_imag = abs(imag(#pixel-_centOfRot)) ; ; determine the rotation ; if (@_continuous) _degrOfRot_real = _pixDist_real _degrOfRot_imag = _pixDist_imag _flip = 1 else _ringNumber_real = floor(_pixDist_real * @_granulation) _ringNumber_imag = floor(_pixDist_imag * @_granulation) _degrOfRot_real = _ringNumber_real / @_granulation _degrOfRot_imag = _ringNumber_imag / @_granulation if (@_flipMode == 0) _flip = 1 elseif (@_flipMode == 1) _flipModulo_real = _ringNumber_real % 2 if (_flipModulo_real == 0) _flip_real = 1 else _flip_real = -1 endif _flipModulo_imag = _ringNumber_imag % 2 if (_flipModulo == 0) _flip_imag = 1 else _flip_imag = -1 endif elseif (@_flipMode == 2) _flipModulo_real = _ringNumber_real % 3 _flip_real = _flipModulo_real - 1 ; => -1,0,+1 _flipModulo_imag = _ringNumber_imag % 3 _flip_imag = _flipModulo_imag - 1 ; => -1,0,+1 endif ; @_flipMode == 0,1,2 endif ; @_continuous if ( _flip == 0 ) #pixel = #pixel else _degrOfRot_real = @_rot_fkt(_degrOfRot_real)*_flip_real _degrOfRot_imag = @_rot_fkt(_degrOfRot_imag)*_flip_imag if ( @_stripeMode == 0 || @_stripeMode == 2 ) ; Real or Both _addReal = real(_degrOfRot_real)*@_shift endif if ( @_stripeMode == 1 || @_stripeMode == 2 ) ; Imag or Both _addImag = real(_degrOfRot_imag)*@_shift endif ; ; rotate ; #pixel = real(#pixel)+_addReal + 1i*(imag(#pixel)+_addImag) endif ; _flip == 0 default: title = "Stripes and Squares" param _transCenter caption = "Stripes' Center" default = (0,0) hint = "Where the circle rings start" endparam param _continuous caption = "Continuous" default = FALSE hint = "If set, the Ring Rotation will be at continuous, \ no rings can be seen. Similar to a high granulation." endparam param _granulation caption = "Granulation" default = 1.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam param _shift caption = "Striping Shift" default = 1.0 hint = "Shifts the degree of rotation. Negative value inverses direction." endparam func _rot_fkt caption = "Shift function" default = sin() hint = "Similar to Shift, but function instead of constant factor." endfunc param _flipMode caption = "Flip Mode" enum = "None" "Normal" "Triple" hint = "Works together with Discontinuous Mode." endparam param _stripeMode caption = "Stripe Mode" enum = "Real" "Imaginary" "Both" endparam param _image_center caption = "Use Screen Center" default = FALSE hint = "If set, the Stripes' Center will be at the center of \ the window, regardless of the Stripes' Center \ setting." endparam } ; stripes_and_squares stripes_unexpected { transform: ; ; init ; float _pixDist = 0 complex _degrOfRot = (0,0) complex _centOfRot = (0,0) float _flip = 1 float _flipModulo = -1 float _ringNumber = 0 float _addReal = 0 float _addImag = 0 ; ; determine the center ; if (@_image_center) _centOfRot = #center else _centOfRot = @_transCenter endif ; ; determine the distance between pixel and center ; _pixDist = cabs(#pixel-_centOfRot) ; ; determine the rotation ; if (@_continuous) _degrOfRot = _pixDist _flip = 1 else _ringNumber = floor(_pixDist * @_granulation) _degrOfRot = _ringNumber / @_granulation if (@_flipMode == 0) _flip = 1 elseif (@_flipMode == 1) _flipModulo = _ringNumber % 2 if (_flipModulo == 0) _flip = 1 else _flip = -1 endif elseif (@_flipMode == 2) _flipModulo = _ringNumber % 3 _flip = _flipModulo - 1 ; => -1,0,+1 endif ; @_flipMode == 0,1,2 endif if ( _flip == 0 ) #pixel = #pixel else _degrOfRot = @_rot_fkt(_degrOfRot)*_flip*@_shift if ( @_stripeMode == 0 || @_stripeMode == 2 ) ; Real or Both _addReal = real(_degrOfRot) endif if ( @_stripeMode == 1 || @_stripeMode == 2 ) ; Imag or Both _addImag = real(_degrOfRot) endif ; ; rotate ; #pixel = real(#pixel)+_addReal + 1i*(imag(#pixel)+_addImag) endif ; _flip == 0 default: title = "Stripes I" param _transCenter caption = "Stripes' Center" default = (0,0) hint = "Where the circle rings start" endparam param _continuous caption = "Continuous" default = FALSE hint = "If set, the Ring Rotation will be at continuous, \ no rings can be seen. Similar to a high granulation." endparam param _granulation caption = "Granulation" default = 1.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam param _shift caption = "Striping Shift" default = 1.0 hint = "Shifts the degree of rotation. Negative value inverses direction." endparam func _rot_fkt caption = "Shift function" default = sin() hint = "Similar to Shift, but function instead of constant factor." endfunc param _flipMode caption = "Flip Mode" enum = "None" "Normal" "Triple" hint = "Works together with Discontinuous Mode." endparam param _stripeMode caption = "Stripe Mode" enum = "Real" "Imaginary" "Both" endparam param _image_center caption = "Use Screen Center" default = FALSE hint = "If set, the Stripes' Center will be at the center of \ the window, regardless of the Stripes' Center \ setting." endparam } ; stripes_unexpected squares { transform: ; ; init ; float oldReal = real(#pixel) float oldImag = imag(#pixel) float minRealCoord = floor(oldReal * @_granulation) / @_granulation float maxRealCoord = ceil(oldReal * @_granulation) / @_granulation float minImagCoord = floor(oldImag * @_granulation) / @_granulation float maxImagCoord = ceil(oldImag * @_granulation) / @_granulation float minRealDist = oldReal - minRealCoord float maxRealDist = maxRealCoord - oldReal float minImagDist = oldImag - minImagCoord float maxImagDist = maxImagCoord - oldImag float newReal = 0 float newImag = 0 ; if (minRealDist < maxRealDist) ; newReal = oldReal + ((minRealCoord - oldReal) / @_squeeze) ; elseif (minRealDist > maxRealDist) ; newReal = oldReal + ((maxRealCoord - oldReal) / @_squeeze) ; endif ; if (minImagDist < maxImagDist) ; newImag = oldImag + ((minImagCoord - oldImag) / @_squeeze) ; elseif (minImagDist > maxImagDist) ; newImag = oldImag + ((maxImagCoord - oldImag) / @_squeeze) ; endif if (minRealDist < maxRealDist) newReal = oldReal + (0.5*sin(2*#pi*(oldReal - minRealCoord)*@_granulation)/@_granulation)^(2*@_squeeze) elseif (minRealDist > maxRealDist) newReal = oldReal + (0.5*sin(2*#pi*(maxRealCoord - oldReal)*@_granulation)/@_granulation)^(2*@_squeeze) endif if (minImagDist < maxImagDist) newImag = oldImag + (0.5*sin(2*#pi*(oldImag - minImagCoord)*@_granulation)/@_granulation)^(2*@_squeeze) elseif (minImagDist > maxImagDist) newImag = oldImag + (0.5*sin(2*#pi*(maxImagCoord - oldImag)*@_granulation)/@_granulation)^(2*@_squeeze) endif #pixel = newReal + 1i*newImag default: title = "Squares" param _granulation caption = "Granulation" default = 10.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam param _squeeze caption = "Squeeze" default = 2.0 min = 2.0 hint = "Degree of Squeezing inside the squares." endparam } ; squares Lake { ; ; Transformation written by Sylvie Gallet ; December 11, 1999 ; Third and almost final version... ; experimental extensions by Andreas Lober ; December 13, 1999 ; transform: if (@use_sc) centr = #center else centr = @wl endif waterline = imag(centr) if (@use_la) ang = #angle else ang = @rot * pi / 180 endif ; rotation if (ang != 0) #pixel = (#pixel - centr) * e^(-ang*1i) + centr endif ; height y = imag(#pixel) if (y < waterline) ; Pixel above Waterline dy = waterline - y ; dist to Waterline y = @mirror * imag(centr) - y ; mirror with Waterline y = y + @ampl * dy * ( @strfac * @stretch (@frq * dy^0.2) + (@foscill (@frq * dy^0.2))^@eoscill ) #pixel = real(#pixel) + y*1i endif if (ang != 0) #pixel = (#pixel - centr) * e^(ang*1i) + centr endif default: title = "Lake'n'Shadow" param wl caption = "Water level" default = (0.0,0.0) endparam param mirror caption = "Mirror level" default = 2.0 endparam param eoscill caption = "Oscillation Exponent" default = 1.0 endparam param strfac caption = "Stretching Factor" default = 1.0 endparam param use_sc caption = "Use screen center" default = true endparam param rot caption = "Angle" default = 0.0 min = -360.0 max = 360.0 endparam param use_la caption = "Use Location tab angle" default = true endparam param ampl caption = "Amplitude" default = 0.2 endparam param frq caption = "Frequency" default = 300 min = 0.0 endparam func foscill caption = "Oscillation Function" default = sin() endfunc func stretch caption = "Stretching Function" default = ident() endfunc } try { transform: _rotation = 2i / (2*#pi) _centOfRot = floor (#pixel * @_granulation) / @_granulation _rel2centre = #pixel - _centOfRot _dist = abs (_rel2centre) #pixel = (_rel2centre) * exp(_rotation*_dist) + _centOfRot default: title = "Try" param _granulation caption = "Granulation" default = 1.0 min = 0.0000000001 hint = "If set, the Ring Rotation will be finer." endparam } weierstrass_func { ; transform: complex _zz = #pixel ; init _zz int lat_real = 0 int lat_imag = 0 complex lat_comp_pp = 0 complex lat_comp_pn = 0 complex lat_comp_np = 0 complex lat_comp_nn = 0 complex W_Fkt_z = 0 if (_zz == 0) W_Fkt_z = 0 else if (@Weierstrass == 0) ; P-Function W_Fkt_z = 1/_zz^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = 1/_zz elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = _zz endif endif ; ; Calculate the P-Function ; while (lat_real <= @numIter) while (lat_imag <= @numIter) ; ; Calculate all 4 directions in the lattice ; lat_comp_pp = lat_real*@vector1 + lat_imag*@vector2 lat_comp_pn = lat_real*@vector1 - lat_imag*@vector2 lat_comp_np = -lat_real*@vector1 + lat_imag*@vector2 lat_comp_np = -lat_real*@vector1 - lat_imag*@vector2 if (lat_comp_pp != 0 && (_zz != lat_comp_pp || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pp)^2 - 1/lat_comp_pp^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pp) + 1/lat_comp_pp \ + _zz/lat_comp_pp^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_pp) \ * exp(_zz/lat_comp_pp + 0.5*(_zz/lat_comp_pp)^2) endif endif if (lat_comp_pn != 0 && (_zz != lat_comp_pn || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pn)^2 - 1/lat_comp_pn^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_pn) + 1/lat_comp_pn \ + _zz/lat_comp_pn^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_pn) \ * exp(_zz/lat_comp_pn + 0.5*(_zz/lat_comp_pn)^2) endif endif if (lat_comp_np != 0 && (_zz != lat_comp_np || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_np)^2 - 1/lat_comp_np^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_np) + 1/lat_comp_np \ + _zz/lat_comp_np^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_np) \ * exp(_zz/lat_comp_np + 0.5*(_zz/lat_comp_np)^2) endif endif if (lat_comp_nn != 0 && (_zz != lat_comp_nn || @Weierstrass == 2)) if (@Weierstrass == 0) ; P-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_nn)^2 - 1/lat_comp_nn^2 elseif (@Weierstrass == 1) ; Zeta-Function W_Fkt_z = W_Fkt_z + 1/(_zz-lat_comp_nn) + 1/lat_comp_nn \ + _zz/lat_comp_nn^2 elseif (@Weierstrass == 2) ; Sigma-Function W_Fkt_z = W_Fkt_z * (1-_zz/lat_comp_nn) \ * exp(_zz/lat_comp_nn + 0.5*(_zz/lat_comp_nn)^2) endif endif lat_imag = lat_imag+1 endwhile ; lat_imag <= iter lat_real = lat_real+1 endwhile ; lat_real <= iter #pixel = W_Fkt_z^@exponent default: title = "Three Weierstrass Functions Transformation" param Weierstrass caption = "Weierstrass Function" enum = "P-Function" "Zeta-Function" "Sigma-Function" endparam param exponent caption="Exponent for P" default=1.0 endparam param vector1 caption="Lattice Vector 1" default=(1,0) endparam param vector2 caption="Lattice Vector 2" default=(0,1) endparam param numIter caption="Summation Limit" default=10 endparam } ; weierstrass_func riemann_zeta_func { ; transform: complex _zz = #pixel ; init _zz int n = 1 complex R_Fkt_z = 0 ; ; Calculate the Riemann Zeta-Function ; while (n <= @numIter) R_Fkt_z = R_Fkt_z + 1/n^_zz n = n+1 endwhile ; n <= @numIter #pixel = R_Fkt_z^@exponent default: title = "Riemann Zeta Function" param exponent caption="Exponent for Zeta" default=1.0 endparam param numIter caption="Summation Limit" default=10 endparam } ; weierstrass_func allinone { ; transform: complex _zz = #pixel ; init _zz complex oldPixel = #pixel ; ; Start with the lattices ; if (@lattice == 1) _zz = (round(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 2) _zz = (trunc(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 3) _zz = (floor(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 4) _zz = (ceil(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 5) _zz = (abs(@lattFac1*_zz) - @lattFac2*_zz^2) elseif (@lattice == 6) _zz = (round(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 7) _zz = (trunc(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 8) _zz = (floor(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 9) _zz = (ceil(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 10) _zz = (abs(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 11) _zz = (round((round(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 12) _zz = (trunc((trunc(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 13) _zz = (floor((floor(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 14) _zz = (ceil((ceil(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 15) _zz = (abs((abs(@lattFac1*_zz) \ - @lattFac1*_zz^2)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 16) _zz = (round((round(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 17) _zz = (trunc((trunc(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 18) _zz = (floor((floor(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 19) _zz = (ceil((ceil(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 20) _zz = (abs((abs(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) endif if (@transformation == 0) ; None _zz = @HarlFkt(_zz) elseif (@transformation == 1) ; Joukowskij _zz = @HarlFkt(_zz + @transfConst/_zz) elseif (@transformation == 2) ; Elliptic _zz = -(_zz+@transfConst)/@HarlFkt(_zz) elseif (@transformation == 3 || @transformation == 4) ; Harlequin1+2 if (@transformation == 3) ; Harlequin1 if (@townsend == 0) _zz = 2*atan(imag(_zz)/real(_zz)) else _zz = 2*atan2(imag(_zz)/real(_zz)) endif else ; Harlequin2 if (@townsend == 0) _zz = 2*atan(_zz) else _zz = 2*atan2(_zz) endif endif _zz = @HarlFkt(1-_zz^(@transfConst*4)) elseif (@transformation >= 5 && @transformation <= 8) ; Hevia1-4 _zz = @HarlFkt(_zz) x = real(_zz) y = imag(_zz) xf = @transfConst*round(x) yf = @transfConst*round(y) xc = xf+@transfConst yc = yf+@transfConst a = xf + 1i*yc b = xc + 1i*yc c = xf + 1i*yf d = xc + 1i*yf if (@transformation == 5) _zz = a*x + b*y + 1i*(c*x+d*y) elseif (@transformation == 6) _zz = a*_zz^2 + (b+c)*_zz*conj(_zz) + d*conj(_zz)^2 elseif (@transformation == 7) _zz = a*x^2 + (b+c)*x*y + d*y^2 elseif (@transformation == 8) _zz = a*x^2 + b*x*y + 1i*(c*x*y + d*y^2) endif elseif (@transformation == 9 || @transformation == 10) ; Lissajous a = sin (2*_zz) b = cos (3*_zz) c = @HarlFkt(a+1i*b) if (c == 0) c = _zz endif if (@transformation == 9) _zz = c^@transfConst else _zz = @HarlFkt(_zz^@transfConst) + c endif ; _zz = 1/c^@transfConst elseif (@transformation >= 11 && @transformation <= 14) ; MT-Sine* x = |_zz| ; MT: r if (@townsend == 0) y = atan(_zz) ; MT: theta else y = atan2(_zz) ; MT: theta endif if (y > 0) y = y + 2*#pi endif if (@transformation == 11) ; MT-Sine _zz = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 12) ; MT-ArcSine _zz = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 13) ; MT-SineHyp _zz = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 14) ; MT-ArSineHyp _zz = x*(acosh(y) + 1i*asinh(y)) endif _zz = @HarlFkt(_zz) elseif (@transformation >= 15 && @transformation <= 18) ; Cardioid if (@townsend == 0) y = atan(_zz) ; MT: theta and atan2 else y = atan2(_zz) ; MT: theta and atan2 endif x = 1-cos(y) ; MT: radius if (@transformation == 15) ; MT-Cardioid _zz = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 16) ; ArcDroid _zz = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 17) ; CardioHype _zz = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 18) ; ArDioidHype _zz = x*(acosh(y) + 1i*asinh(y)) endif _zz = @HarlFkt(_zz) elseif (@transformation >= 19 || @transformation <= 21) ; Sam's Julia complex zz = #pixel _zz = exp(-1i*#pi/180)*_zz float samsBail = 1000 if (@transformation == 20) samsBail = samsBail + |#pixel|*100000 elseif(@transformation == 21) samsBail = 1e20 endif x = 1/sqrt(2)*real(_zz) y = sqrt(2)*imag(_zz) complex start = x+1i*y ; _zz ; (-1.745,.01) int i = 0 while (i < 100 && |zz| < samsBail) i=i+1 zz = zz^2/@transfConst + start endwhile _zz = @HarlFkt(zz) endif #pixel = @fkt(_zz) if (@masking > 0) float mask = real(@fm(|#pixel-oldPixel|)) if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true endif endif endif default: title = "Alli None" param transformation caption = "Transformation" enum = "None" \ "Joukowskij" "Elliptic" \ "Harlequin 1" "Harlequin 2" \ "Hevia 1" "Hevia 2" "Hevia 3" "Hevia 4" \ "Lissajous" "Lissajous+" \ "MT-Sine" "MT-ArcSine" "MT-SineHyp" "MT-ArSineHyp" \ "MT-Cardioid" "ArcDroid" "CardioHype" "ArDioidHype" \ "Sam's Julia small" "Sam's Julia grow" "Sam's Julia big" default = 1 endparam param transfConst caption = "Transf. Constant" default = 1.0 min = 0.01 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" default = 0 endparam param lattFac1 caption = "Lattice Factor 1" default = (0.1,0.0) endparam param lattFac2 caption = "Lattice Factor 2" default = (0.1,0.0) endparam param townsend caption = "For MT-Transforms" enum = "atan" "atan2" default = 0 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" 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 func HarlFkt caption = "Transf. Function" default = log() endfunc func fkt caption = "Additional Function" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } ; allinone allinone_mask { ; transform: complex _zz = #pixel ; init _zz complex oldPixel = 0 if (@initialisation == 1) ; oldPixel = _zz endif ; ; Start with the lattices ; if (@lattice == 1) _zz = (round(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 2) _zz = (trunc(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 3) _zz = (floor(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 4) _zz = (ceil(@lattFac1*_zz) - @lattFac2*_zz) elseif (@lattice == 5) _zz = (abs(@lattFac1*_zz) - @lattFac2*_zz^2) elseif (@lattice == 6) _zz = (round(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 7) _zz = (trunc(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 8) _zz = (floor(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 9) _zz = (ceil(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 10) _zz = (abs(@lattFac1*_zz) \ - @lattFac2*sqrt(real(_zz)*imag(_zz))) elseif (@lattice == 11) _zz = (round((round(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 12) _zz = (trunc((trunc(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 13) _zz = (floor((floor(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 14) _zz = (ceil((ceil(@lattFac1*_zz) \ - @lattFac1*_zz)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 15) _zz = (abs((abs(@lattFac1*_zz) \ - @lattFac1*_zz^2)^2) \ - @lattFac2*_zz^2) elseif (@lattice == 16) _zz = (round((round(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 17) _zz = (trunc((trunc(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 18) _zz = (floor((floor(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 19) _zz = (ceil((ceil(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) elseif (@lattice == 20) _zz = (abs((abs(@lattFac1*_zz) \ - @lattFac1*sqrt(real(_zz)*imag(_zz)))^2) \ - @lattFac2*_zz^2) endif if (@initialisation == 2) ; oldPixel = _zz endif if (@transformation == 0) ; None _zz = @HarlFkt(_zz) elseif (@transformation == 1) ; Joukowskij _zz = @HarlFkt(_zz + @transfConst/_zz) elseif (@transformation == 2) ; Elliptic _zz = -(_zz+@transfConst)/@HarlFkt(_zz) elseif (@transformation == 3 || @transformation == 4) ; Harlequin1+2 if (@transformation == 3) ; Harlequin1 if (@townsend == 0) _zz = 2*atan(imag(_zz)/real(_zz)) else _zz = 2*atan2(imag(_zz)/real(_zz)) endif else ; Harlequin2 if (@townsend == 0) _zz = 2*atan(_zz) else _zz = 2*atan2(_zz) endif endif _zz = @HarlFkt(1-_zz^(@transfConst*4)) elseif (@transformation >= 5 && @transformation <= 8) ; Hevia1-4 _zz = @HarlFkt(_zz) x = real(_zz) y = imag(_zz) xf = @transfConst*round(x) yf = @transfConst*round(y) xc = xf+@transfConst yc = yf+@transfConst a = xf + 1i*yc b = xc + 1i*yc c = xf + 1i*yf d = xc + 1i*yf if (@transformation == 5) _zz = a*x + b*y + 1i*(c*x+d*y) elseif (@transformation == 6) _zz = a*_zz^2 + (b+c)*_zz*conj(_zz) + d*conj(_zz)^2 elseif (@transformation == 7) _zz = a*x^2 + (b+c)*x*y + d*y^2 elseif (@transformation == 8) _zz = a*x^2 + b*x*y + 1i*(c*x*y + d*y^2) endif elseif (@transformation == 9 || @transformation == 10) ; Lissajous a = sin (2*_zz) b = cos (3*_zz) c = @HarlFkt(a+1i*b) if (c == 0) c = _zz endif if (@transformation == 9) _zz = c^@transfConst else _zz = @HarlFkt(_zz^@transfConst) + c endif ; _zz = 1/c^@transfConst elseif (@transformation >= 11 && @transformation <= 14) ; MT-Sine* x = |_zz| ; MT: r if (@townsend == 0) y = atan(_zz) ; MT: theta else y = atan2(_zz) ; MT: theta endif if (y > 0) y = y + 2*#pi endif if (@transformation == 11) ; MT-Sine _zz = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 12) ; MT-ArcSine _zz = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 13) ; MT-SineHyp _zz = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 14) ; MT-ArSineHyp _zz = x*(acosh(y) + 1i*asinh(y)) endif _zz = @HarlFkt(_zz) elseif (@transformation >= 15 && @transformation <= 18) ; Cardioid if (@townsend == 0) y = atan(_zz) ; MT: theta and atan2 else y = atan2(_zz) ; MT: theta and atan2 endif x = 1-cos(y) ; MT: radius if (@transformation == 15) ; MT-Cardioid _zz = x*( cos(y) + 1i* sin(y)) elseif (@transformation == 16) ; ArcDroid _zz = x*(acos(y) + 1i*asin(y)) elseif (@transformation == 17) ; CardioHype _zz = x*( cosh(y) + 1i* sinh(y)) elseif (@transformation == 18) ; ArDioidHype _zz = x*(acosh(y) + 1i*asinh(y)) endif _zz = @HarlFkt(_zz) elseif (@transformation >= 19 || @transformation <= 21) ; Sam's Julia complex zz = #pixel _zz = exp(-1i*#pi/180)*_zz float samsBail = 1000 if (@transformation == 20) samsBail = samsBail + |#pixel|*100000 elseif(@transformation == 21) samsBail = 1e20 endif x = 1/sqrt(2)*real(_zz) y = sqrt(2)*imag(_zz) complex start = x+1i*y ; _zz ; (-1.745,.01) int i = 0 while (i < 100 && |zz| < samsBail) i=i+1 zz = zz^2/@transfConst + start endwhile _zz = @HarlFkt(zz) endif float mask = real(@fm(|@fkt(_zz)-oldPixel|)) if (@masking == 0) ; Lower if (mask < @threshold_l) #solid = true endif elseif (@masking == 1) ; Upper if (mask > @threshold_u) #solid = true endif elseif (@masking == 2) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true endif elseif (@masking == 3) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true endif endif default: title = "Alli None Mask" param transformation caption = "Transformation" enum = "None" \ "Joukowskij" "Elliptic" \ "Harlequin 1" "Harlequin 2" \ "Hevia 1" "Hevia 2" "Hevia 3" "Hevia 4" \ "Lissajous" "Lissajous+" \ "MT-Sine" "MT-ArcSine" "MT-SineHyp" "MT-ArSineHyp" \ "MT-Cardioid" "ArcDroid" "CardioHype" "ArDioidHype" \ "Sam's Julia small" "Sam's Julia grow" "Sam's Julia big" default = 1 endparam param transfConst caption = "Transf. Constant" default = 1.0 min = 0.01 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" 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 initialisation caption = "Pick old pixel" enum = "Zero" "Pre-Lattice" "Post-Lattice" default = 1 endparam param townsend caption = "For MT-Transforms" enum = "atan" "atan2" default = 0 endparam param masking caption = "Masking" enum = "Lower" "Upper" "Between" "Outside" 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 func HarlFkt caption = "Transf. Function" default = log() endfunc func fkt caption = "Additional Function" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } ; allinone_mask lissajous_curve_mask { ; Mark Townsend 3 February 2000 ; ; Adapted from Kerry Mitchell's Bezier Curve coloring method ; ; Prepared for Lissajous Curve Mask March 11, 2000 ; float x0 = real(@centre) float y0 = imag(@centre) float t = 0.0 float r = 0.0 float x = 0.0 float y = 0.0 float u = 0.0 float v = 0.0 u = real(#pixel) v = imag(#pixel) bool trapped = false float loopEnd = @loop_count*#pi + @dt ;t=0.0 while (t <= loopEnd) x = sin(@x_loop*t) + x0 y = cos(@y_loop*t) + y0 r = (x - u) * (x - u) + (y - v) * (y - v) if (r < @threshold) trapped = true endif t = t + @dt endwhile if !@inverse if trapped #solid = true endif else if !trapped #solid = true endif endif default: title="Lissajous Curve Mask" param x_loop caption = "X Loop" default = 2 min = 1 hint = "Choose a Prime != Y Loop" endparam param y_loop caption = "Y Loop" default = 3 min = 1 hint = "Choose a Prime != X Loop" endparam param loop_count caption = "Loop Count" default = 2.0 min = 0.0 endparam param centre caption = "Center of Lissajous figure" default = (0.0,0.0) endparam param dt caption="Step Size" default=0.1 hint="Decrease for smoother line, increase \ to see dots. Should be between 0 & 1." min=0.0 max=1.0 endparam param threshold caption = "Threshold" default = 0.1 endparam param inverse caption = "Inverse Mask" default = false endparam } coordinates { transform: int l_coord = @coordLoop int koord = @coord complex _zz = #pixel ; init _zz complex oldPixel = #pixel int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) _zz = cabs(_zz) + 1i*atan2(_zz) elseif (koord == 2) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) _zz = real(sin(_zz)) + 1i*cos(_zz) elseif (koord == 6) _zz = real(sinh(_zz)) + 1i*cosh(_zz) elseif (koord == 7) _zz = real(asin(_zz)) + 1i*acos(_zz) elseif (koord == 8) _zz = real(asinh(_zz)) + 1i*acosh(_zz) elseif (koord == 9) _zz = abs(_zz) + conj(_zz)/(|_zz|+1e-20) elseif (koord >= 10 && koord <= 19) if (_zz != 0) float rad = cabs(_zz) float re = real(_zz)/rad float im = imag(_zz)/rad if (koord == 10) _zz = re*_zz + im*conj(_zz) elseif (koord == 11) _zz = re*_zz + im*flip(_zz) elseif (koord == 12) _zz = re*sin(_zz) + im*cos(_zz) elseif (koord == 13) _zz = re*sin(_zz) + 1i*im*cos(_zz) elseif (koord == 14) _zz = re*asin(_zz) + im*acos(_zz) elseif (koord == 15) _zz = re*asin(_zz) + 1i*im*acos(_zz) elseif (koord == 16) _zz = re*sinh(_zz) + im*cosh(_zz) elseif (koord == 17) _zz = re*sinh(_zz) + 1i*im*cosh(_zz) elseif (koord == 18) _zz = re*asinh(_zz) + im*acosh(_zz) elseif (koord == 19) _zz = re*asinh(_zz) + 1i*im*acosh(_zz) endif endif endif endwhile ; Schleife über die Koordinaten #pixel = @fkt(_zz) if (@masking > 0) float mask = real(@fm(|#pixel-oldPixel|)) if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true endif endif endif default: title = "Coordinates" 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 = 1 endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" 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 func fkt caption = "Additional Function" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } ; coordinates coordinates_mask { transform: int l_coord = @coordLoop int koord = @coord complex _zz = #pixel ; init _zz complex oldPixel = #pixel int loop_i = 0 while (loop_i < l_coord) loop_i = loop_i + 1 if (@coordMode == 1) ; cyclic koord = (koord+1)%19 endif if (koord == 1) _zz = cabs(_zz) + 1i*atan2(_zz) elseif (koord == 2) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(sinh(phi) + 1i*cosh(phi)) elseif (koord == 3) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asin(phi) + 1i*acos(phi)) elseif (koord == 4) float rad = cabs(_zz) float phi = atan2(_zz) _zz = rad*(asinh(phi) + 1i*acosh(phi)) elseif (koord == 5) _zz = real(sin(_zz)) + 1i*cos(_zz) elseif (koord == 6) _zz = real(sinh(_zz)) + 1i*cosh(_zz) elseif (koord == 7) _zz = real(asin(_zz)) + 1i*acos(_zz) elseif (koord == 8) _zz = real(asinh(_zz)) + 1i*acosh(_zz) elseif (koord == 9) _zz = abs(_zz) + conj(_zz)/(|_zz|+1e-20) elseif (koord >= 10 && koord <= 19) if (_zz != 0) float rad = cabs(_zz) float re = real(_zz)/rad float im = imag(_zz)/rad if (koord == 10) _zz = re*_zz + im*conj(_zz) elseif (koord == 11) _zz = re*_zz + im*flip(_zz) elseif (koord == 12) _zz = re*sin(_zz) + im*cos(_zz) elseif (koord == 13) _zz = re*sin(_zz) + 1i*im*cos(_zz) elseif (koord == 14) _zz = re*asin(_zz) + im*acos(_zz) elseif (koord == 15) _zz = re*asin(_zz) + 1i*im*acos(_zz) elseif (koord == 16) _zz = re*sinh(_zz) + im*cosh(_zz) elseif (koord == 17) _zz = re*sinh(_zz) + 1i*im*cosh(_zz) elseif (koord == 18) _zz = re*asinh(_zz) + im*acosh(_zz) elseif (koord == 19) _zz = re*asinh(_zz) + 1i*im*acosh(_zz) endif endif endif endwhile ; Schleife über die Koordinaten float mask = real(@fm(|@fkt(_zz)-oldPixel|)) if (@masking == 0) ; Lower if (mask < @threshold_l) #solid = true endif elseif (@masking == 1) ; Upper if (mask > @threshold_u) #solid = true endif elseif (@masking == 2) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true endif elseif (@masking == 3) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true endif endif default: title = "Coordinates' Mask" 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 = 1 endparam param masking caption = "Masking" enum = "Lower" "Upper" "Between" "Outside" 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 func fkt caption = "Additional Function" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } ; coordinates akl-cut_out { ; ; This cut-out transorm used to be the start ; of all the akl-m colourings and was proven ; to be better a transform... ; Here it is! ; ; Andreas Lober, Sep 24, 2000 ; transform: bool cut_out = false float cutOutVert = real(@cutOutPoint) float cutOutHori = imag(@cutOutPoint) complex pixpix = #pixel float rePix = 0 float imPix = 0 if (@cutOutMode <= 18) if (@cutOutRot%360 != 0) complex rotCentre = @cutOutPoint if (@cutOutMode > 12 && @cutOutMode < 19) rotCentre = (@cutOutPoint+@cutOutPoint2)/2 endif pixpix = (pixpix-rotCentre)*exp(-1i*#pi*@cutOutRot/180) + rotCentre endif rePix = real(pixpix) imPix = imag(pixpix) endif if (@cutOutMode <= 12) if (@cutOutMode == 1 || @cutOutMode == 5 || @cutOutMode == 6 \ || @cutOutMode == 9 || @cutOutMode == 10) ; upper upper+right upper+left ; upper&right upper&left if (imPix >= cutOutHori) if (@cutOutMode == 9) if (rePix < cutOutVert) cut_out = true endif elseif (@cutOutMode == 10) if (rePix >= cutOutVert) cut_out = true endif else cut_out = true endif endif elseif (@cutOutMode == 2 || @cutOutMode == 7 || @cutOutMode == 8 \ || @cutOutMode == 11 || @cutOutMode == 12) ; lower lower+right lower+left ; lower&right lower&left if (imPix < cutOutHori) if (@cutOutMode == 11) if (rePix < cutOutVert) cut_out = true endif elseif (@cutOutMode == 12) if (rePix >= cutOutVert) cut_out = true endif else cut_out = true endif endif endif if (@cutOutMode == 3 || @cutOutMode == 5 || @cutOutMode == 7) ; left upper+left lower+left if (rePix < cutOutVert) cut_out = true endif elseif (@cutOutMode == 4 || @cutOutMode == 6 || @cutOutMode == 8) ; right upper+right lower+right if (rePix >= cutOutVert) cut_out = true endif endif elseif (@cutOutMode <= 18) float rePnt = real(@cutOutPoint2) float imPnt = imag(@cutOutPoint2) float upper = imPnt float lower = cutOutHori float left = cutOutVert float right = rePnt if (imPnt < cutOutHori) upper = cutOutHori lower = imPnt endif if (cutOutVert > rePnt) left = rePnt right = cutOutVert endif if (@cutOutMode == 13) ; inside rect if (rePix > left && rePix < right && imPix > lower && imPix < upper) cut_out = true endif elseif (@cutOutMode == 14) ; outside rect if (rePix < left || rePix > right || imPix < lower || imPix > upper) cut_out = true endif elseif (@cutOutMode == 15) ; inside vert if (rePix > left && rePix < right) cut_out = true endif elseif (@cutOutMode == 16) ; outside vert if (rePix < left || rePix > right) cut_out = true endif elseif (@cutOutMode == 17) ; inside hori if (imPix > lower && imPix < upper) cut_out = true endif elseif (@cutOutMode == 18) ; outside hori if (imPix < lower || imPix > upper) cut_out = true endif endif elseif (@cutOutMode <= 20) float radiusOFCutCircle = cabs(@cutOutPoint-@cutOutPoint2) if (@cutOutMode == 19) ; inside circle if (cabs(#pixel-@cutOutPoint) < radiusOFCutCircle) cut_out = true endif elseif (@cutOutMode == 20) ; outside circle if (cabs(#pixel-@cutOutPoint) > radiusOFCutCircle) cut_out = true endif endif endif ; cutOutMode > 12 if (cut_out) if (@cutOutMask == 0) #solid = true elseif (@cutOutMask == 1) #pixel = flip(#pixel) elseif (@cutOutMask == 2) #pixel = conj(#pixel) elseif (@cutOutMask == 3) #pixel = flip(conj(#pixel)) elseif (@cutOutMask == 4) #pixel = #pixel+@cutOutShift elseif (@cutOutMask == 5) #pixel = #pixel-ceil(#pixel/@cutOutShift)*@cutOutShift endif endif default: title = "Cut-Out" param cutOutMode 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 cutOutPoint caption = "Line of Cut, 1. Point" default = (0,0) endparam param cutOutPoint2 caption = "Add. Point/Line for Cut" default = (1,1) endparam param cutOutRot caption = "Rotate Cut" default = 0.0 min = -90.0 max = 90.0 endparam param cutOutMask caption = "CutOut Mask" enum = "Mask" "Flip" "Conj" "Flip&Conj" "Shift" "Ceil" default = 0 endparam param cutOutShift caption = "CutOut Shift" default = (1.0,0.0) endparam } ; akl-cut_out akl-go! { ; ; Just to study this piece of code that ; can be found as the central idea of the ; Go! colouring. ; I made this transform just out of curiosity. ; ; Andreas Lober, Sep 24, 2000 ; transform: float reZ = real(#pixel) float imZ = imag(#pixel) 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(#pixel) left = @neighbour*reZ/nd down = @neighbour*imZ/nd right = -left up = -down elseif (@neighbourhood == 8) ; +- float nd = |#pixel| left = sqrt(@neighbour*abs(reZ)/nd) down = sqrt(@neighbour*abs(imZ)/nd) right = -left up = -down elseif (@neighbourhood == 9) ; +- left = @neighbour*cabs(#pixel) down = atan2(#pixel)/(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 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 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 #pixel = x + 1i*y 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 distExp caption = "Distance Exponent" default = 2 endparam param minMax caption = "Min/Max" default = FALSE endparam } akl-turnaround { ; ; Just to study this piece of code that ; can be found in my akl-m colourings ; ("L: Turnaround"). ; I made this transform just out of curiosity. ; ; Andreas Lober, Sep 24, 2000 ; transform: float testAngle1 = #pi/@corte1 float testAngle2 = 3*testAngle1 complex rotAngle1 = @corte2*1i*testAngle1 complex rotAngle2 = @corte2*1i*testAngle2 complex zRound = 0 complex zZ = #pixel if (@turnScale != 0) if (@turnScaleMode == 0) zRound = round(#pixel*@turnScale)/@turnScale elseif (@turnScaleMode == 1) zRound = round(cabs(#pixel)*@turnScale)/@turnScale elseif (@turnScaleMode == 2) zRound = sqrt(|round(#pixel*@turnScale)|)/@turnScale endif ; turnScaleMode complex zZ = #pixel-zRound endif float targ = atan2(zZ) ; "Turn around" part taken from Sam if (abs(targ) < testAngle1) #pixel = zZ*exp(rotAngle1)+zRound elseif (abs(targ) > testAngle2) #pixel = zZ*exp(rotAngle2)+zRound endif default: title = "Turnaround" param turnScale caption = "L: Turn Scale" default = 1.0 min = 0.0 endparam param turnScaleMode caption = "L: ScaleMode Turnaround" enum = "Round" "Magn1" "Magn2" default = 0 hint = "Effective only with Turnaround Scale > 0" endparam param corte1 caption = "L: Turnaround #1" default = 4.0 endparam param corte2 caption = "L: Turnaround #2" default = 2.0 endparam } akl-barnsley { ; ; Just to study this piece of code that ; can be found in some barnsley formulae. ; I made this transform just out of curiosity. ; ; Andreas Lober, Sep 24, 2000 ; transform: float barnRe = real(@barnSeed) float barnIm = imag(@barnSeed) complex zRound = 0 complex zZ = #pixel if (@barnScale != 0) if (@barnScaleMode == 0) zRound = round(#pixel*@barnScale)/@barnScale elseif (@barnScaleMode == 1) zRound = round(cabs(#pixel)*@barnScale)/@barnScale elseif (@barnScaleMode == 2) zRound = sqrt(|round(#pixel*@barnScale)|)/@barnScale endif ; barnScaleMode zZ = #pixel-zRound endif bool test = false if (@barnMode == 0) ; first test = (real(#pixel)*barnIm + barnRe*imag(#pixel) >= 0) else test = (|real(#pixel)*barnIm - barnRe*imag(#pixel)| < .5) endif ; barnMode if (test) #pixel = @barnFct1(zZ - @barnShift)*@barnSeed+zRound else #pixel = @barnFct2(zZ + @barnShift)*@barnSeed+zRound endif ; test default: title = "Barnsley" param barnMode caption = "L: Barnsley Mode" enum = "First" "Second" default = 0 endparam param barnScale caption = "L: Barnsley Scale" default = 0.0 min = 0.0 endparam param barnScaleMode caption = "L: ScaleMode Barnsley" enum = "Round" "Magn1" "Magn2" default = 0 hint = "Effective only with Barnsley Scale > 0" endparam param barnSeed caption = "L: Barnsley Seed" default = (0.6, 1.1) endparam param barnShift caption = "L: Barnsley Shift" default = 1.0 endparam func barnFct1 caption = "Barnsley Fnctn 1" default = flip() endfunc func barnFct2 caption = "Barnsley Fnctn 2" default = flip() endfunc } checker_mask { transform: complex zChecked = round(#pixel*@txtr_Check_scale) int checkFlag = 0 int testCheck = 0 int reChecked = trunc(real(zChecked)) int imChecked = trunc(imag(zChecked)) if (@txtr_Check_test == 0) testCheck = reChecked + imChecked elseif (@txtr_Check_test == 1) testCheck = reChecked * imChecked endif complex zCheckShape = #pixel*@txtr_Check_scale complex zShapedCheck = zChecked - zCheckShape float reShapedCheck = real(zShapedCheck) float imShapedCheck = imag(zShapedCheck) if (testCheck%@txtr_Checker == 0) ; Condition for the checkers if (@txtr_Check_shape == 0) ; Squares only checkFlag = 1 elseif (@txtr_Check_shape == 1) ; Circle if (|zShapedCheck| < .2*@txtr_Check_shConst) ; additional condition checkFlag = 1 ; for circles endif elseif (@txtr_Check_shape == 2) if (abs (|reShapedCheck| - |imShapedCheck|) > .1*@txtr_Check_shConst) checkFlag = 1 endif elseif (@txtr_Check_shape == 3) checkFlag = 1 ; draw a square if (|zShapedCheck| < .2*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 endif elseif (@txtr_Check_shape == 4) if (|reShapedCheck| - |imShapedCheck| > .05*@txtr_Check_shConst) ; segments checkFlag = 1 endif elseif (@txtr_Check_shape == 5) checkFlag = 1 ; draw a square if (|reShapedCheck| - |imShapedCheck| > .05*@txtr_Check_shConst) ; cut out segments checkFlag = 0 endif elseif (@txtr_Check_shape == 6) checkFlag = 1 ; draw a square if (|reShapedCheck| > .05*@txtr_Check_shConst) ; cut out horizontal lines checkFlag = 0 endif elseif (@txtr_Check_shape == 7) checkFlag = 1 ; draw a square if (|imShapedCheck| > .05*@txtr_Check_shConst) ; cut out vertical lines checkFlag = 0 endif elseif (@txtr_Check_shape == 8) checkFlag = 1 ; draw a square if ( |sin(imChecked*2*#pi) - sin(imag(zCheckShape)*2*#pi)| < .5*@txtr_Check_shConst) checkFlag = 0 ; cut out many vertical lines endif elseif (@txtr_Check_shape == 9) checkFlag = 1 ; draw a square if (|zShapedCheck| < .2*@txtr_Check_shConst) checkFlag = 0 ; cut out a circle if (|imShapedCheck| > .05*@txtr_Check_shConst) checkFlag = 1 ; fill in something endif endif elseif (@txtr_Check_shape == 10) if (|zShapedCheck| < .2*@txtr_Check_shConst) checkFlag = 1 ; draw a circle if (|imShapedCheck| < .01*@txtr_Check_shConst) checkFlag = 0 ; cut out horizontal if (|reShapedCheck| < .01*@txtr_Check_shConst) checkFlag = 1 ; fill in vertical endif endif endif elseif (@txtr_Check_shape == 11) checkFlag = 1 if (|imShapedCheck| > .01*@txtr_Check_shConst) checkFlag = 0 if (|reShapedCheck| < .01*@txtr_Check_shConst) checkFlag = 1 endif endif elseif (@txtr_Check_shape == 12) if (|imShapedCheck| > .01*@txtr_Check_shConst) checkFlag = 1 if (|reShapedCheck| < .01*@txtr_Check_shConst) checkFlag = 0 endif endif elseif (@txtr_Check_shape == 13) float txtr_arg = atan2(zShapedCheck)/(2*#pi) if (txtr_arg < 0) txtr_arg = txtr_arg + 1 endif if (abs(txtr_arg) < .25*#pi/@txtr_Check_shConst) checkFlag = 1 endif elseif (@txtr_Check_shape == 14) checkFlag = 1 float txtr_arg = atan2(zShapedCheck)/(2*#pi) if (txtr_arg < 0) txtr_arg = txtr_arg + 1 endif if (abs(txtr_arg) < .25*#pi/@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 15) checkFlag = 1 if (|zShapedCheck| > .1*@txtr_Check_shConst) checkFlag = 0 float txtr_arg = atan2(zShapedCheck)/(2*#pi) if (txtr_arg < 0) txtr_arg = txtr_arg + 1 endif if (abs(txtr_arg) < .25*#pi/@txtr_Check_shConst) checkFlag = 1 endif endif elseif (@txtr_Check_shape == 16) checkFlag = 1 if (|reShapedCheck| - |imShapedCheck| < 0.005*@txtr_Check_shConst || \ |reShapedCheck| + |imShapedCheck| < 0.005*@txtr_Check_shConst || \ |imShapedCheck| < 0.005*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 17) checkFlag = 1 if ((reShapedCheck) - (imShapedCheck) > 0.1*@txtr_Check_shConst && \ (reShapedCheck) + (imShapedCheck) > 0.1*@txtr_Check_shConst && \ (imShapedCheck) < 0.1*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 18) checkFlag = 1 if (abs(reShapedCheck) - abs(imShapedCheck) > 0.1*@txtr_Check_shConst && \ abs(reShapedCheck) + abs(imShapedCheck) > 0.1*@txtr_Check_shConst && \ abs(imShapedCheck) < 0.1*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 19) checkFlag = 1 if (|reShapedCheck| - |imShapedCheck| < 0.1*@txtr_Check_shConst && \ |reShapedCheck| + |imShapedCheck| > 0.1*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 20) checkFlag = 1 if ((reShapedCheck) - (imShapedCheck) > 0.1*@txtr_Check_shConst && \ (reShapedCheck) + (imShapedCheck) < 0.1*@txtr_Check_shConst && \ (imShapedCheck) < 0.1*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 21) if (|reShapedCheck| - |imShapedCheck| < 0.005*@txtr_Check_shConst || \ |imShapedCheck| < 0.005*@txtr_Check_shConst) checkFlag = 1 endif elseif (@txtr_Check_shape == 22) checkFlag = 1 if (|sin(reShapedCheck*2*#pi) - cos(imShapedCheck*2*#pi) | > 0.5*@txtr_Check_shConst || \ |imShapedCheck| < 0.01*@txtr_Check_shConst) checkFlag = 0 endif elseif (@txtr_Check_shape == 23) if (|zShapedCheck| < .2*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck-.2| < .15*@txtr_Check_shConst) ; fill in another circle checkFlag = 0 endif endif elseif (@txtr_Check_shape == 24) checkFlag = 1 ; draw a square if (|zShapedCheck| < .2*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck-.2| < .15*@txtr_Check_shConst) ; fill in another circle checkFlag = 1 endif endif elseif (@txtr_Check_shape == 25) if (|zShapedCheck| < .2*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck-.2| < .15*@txtr_Check_shConst) ; fill in another circle checkFlag = 0 if (|zShapedCheck-.3| < .0125*@txtr_Check_shConst) ; fill in another circle checkFlag = 1 endif endif endif elseif (@txtr_Check_shape == 26) checkFlag = 1 ; draw a square if (|zShapedCheck| < .2*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck-.2| < .15*@txtr_Check_shConst) ; fill in another circle checkFlag = 1 if (|zShapedCheck-.3| < .0125*@txtr_Check_shConst) ; fill in another circle checkFlag = 0 endif endif endif elseif (@txtr_Check_shape == 27) if (|zShapedCheck| < .25*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck| < .22*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck-.01| < .17*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck-.1| < .2*@txtr_Check_shConst) ; fill in another circle checkFlag = 0 if ((|zShapedCheck-(.16,.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.16,-.2)| < .0055*@txtr_Check_shConst)) checkFlag = 1 endif endif endif endif endif elseif (@txtr_Check_shape == 28) checkFlag = 1 if (|zShapedCheck| < .25*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck| < .22*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck-.01| < .17*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck-.1| < .2*@txtr_Check_shConst) ; fill in another circle checkFlag = 1 if ((|zShapedCheck-(.16,.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.16,-.2)| < .0055*@txtr_Check_shConst)) checkFlag = 0 endif endif endif endif endif elseif (@txtr_Check_shape == 29) if (|zShapedCheck| < .25*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if (|zShapedCheck| < .22*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if ((|zShapedCheck-(.16,.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.16,-.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.05,-.2)| < .001*@txtr_Check_shConst) \ ) checkFlag = 1 endif if (|zShapedCheck+.5| < .17*@txtr_Check_shConst) ; cut out a circle!! checkFlag = 1 if (|zShapedCheck+.6| < .22*@txtr_Check_shConst) ; fill in another circle!! checkFlag = 0 endif endif endif endif elseif (@txtr_Check_shape == 30) checkFlag = 1 if (|zShapedCheck| < .25*@txtr_Check_shConst) ; cut out a circle checkFlag = 0 if (|zShapedCheck| < .22*@txtr_Check_shConst) ; cut out a circle checkFlag = 1 if ((|zShapedCheck-(.16,.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.16,-.2)| < .0055*@txtr_Check_shConst) \ || (|zShapedCheck-(.05,-.2)| < .001*@txtr_Check_shConst) \ ) checkFlag = 0 endif if (|zShapedCheck+.5| < .17*@txtr_Check_shConst) ; cut out a circle!! checkFlag = 0 if (|zShapedCheck+.6| < .22*@txtr_Check_shConst) ; fill in another circle!! checkFlag = 1 endif endif endif endif endif if (@txtr_Check_divide == 1) if (reShapedCheck > imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 2) if (|reShapedCheck| > imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 3) if (cabs(reShapedCheck) > imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 4) if (|reShapedCheck| > |imShapedCheck|) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 5) if (reShapedCheck < imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 6) if (|reShapedCheck| < imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 7) if (cabs(reShapedCheck) < imShapedCheck) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 8) if (|reShapedCheck| < |imShapedCheck|) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 9) if (|atan2(zShapedCheck)/#pi|%.15 > .03) checkFlag = 1 - checkFlag endif elseif (@txtr_Check_divide == 10) if (cabs(zShapedCheck)%.1 > .03) checkFlag = 1 - checkFlag endif endif endif ; testCheck%@txtr_Checker == 0 if (@txtr_Check_invert) checkFlag = 1 - checkFlag endif if (checkFlag > 0) #solid = true endif default: title = "Checker Mask" param txtr_Check_scale caption = "T: Checker Scale" hint = "Scaling Factor for this Check texture." default = 1.0 endparam param txtr_Checker caption = "T: Checker Modulus" default = 2 min = 2 endparam param txtr_Check_test caption = "T: Checker Test Mode" enum = "Sum" "Prod" default = 1 endparam param txtr_Check_shape caption = "T: Checker Shape" enum = "Square" "Circle" \ "Square in Circle" "Circle in Square" \ "Segment" "Time" \ "H Bricks" "V Bricks" \ "I Ging" "I Went" \ "Broken Circle" \ "Cross" "Anti-Cross" \ "Bite" "Anti-Bite" "Mooon" "Trianguli" "Nose" \ "Broken Square" "BonBon" "Quizzle" "Hipster" "Broken Net" \ "New Moon" "Ti Moon" "Moon and Venus" "Venus and Moon" \ "Smiley" "Inv Smiley" "Frowney" "Inv Frowney" default = 0 endparam param txtr_Check_shConst caption = "T: Chk-Sh-Const" default = 1.0 endparam param txtr_Check_invert caption = "T: Inverse Checkers?" default = false endparam param txtr_Check_divide caption = "T: Divide Checkers?" enum = "None" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" default = 0 endparam } akl-rayon_soleil { ; ; ; ; Andreas Lober, Sep 24, 2000 ; transform: complex zRayon = #pixel-@center_rayons complex zRing = #pixel-@center_rings float ringd_z = cabs(zRayon) float ang = atan2(zRayon) if (ang < 0) ang = ang + 2*#pi endif float angle = 180*ang/#pi float offset_rayon = 0 if (@disturb_rayons > 0) offset_rayon = offset_rayon + @disturb_rayons*sin(ang*@frequency_rayons) endif if (@perturb_rayons > 0) offset_rayon = offset_rayon + @perturb_rayons*sin(ringd_z*@frequency_rayons_p) endif if (@perturb_rayons2 > 0) offset_rayon = offset_rayon + @perturb_rayons2*sin(ringd_z*@frequency_rayons_p2) endif if (@perturb_rayons3 > 0) offset_rayon = offset_rayon + @perturb_rayons3*sin(ringd_z*@frequency_rayons_p3/(1+ringd_z^2)) endif if (@perturb_rayons4 > 0) offset_rayon = offset_rayon + @perturb_rayons4*sin(ringd_z^2*@frequency_rayons_p4)/(1+ringd_z^2) endif if (@skew_rayons != 0) offset_rayon = offset_rayon + @skew_rayons*ringd_z endif float offset_ring = 0 if (@perturb_rings > 0) offset_ring = offset_ring + @perturb_rings*sin(angle*@frequency_rings_p) endif float ringd = cabs(zRing)+offset_ring ;;;;;;;;;;;;;; int flag = 0 float numOfRays = round(180/@numof_rayons) if (@rings_dbl) numOfRays = numOfRays/round(@factor_rings_dbl^(round(ringd_z/@scale_rings_dbl))) endif angle = angle/numOfRays+offset_rayon if ((round(angle))%@modulus_rayons == 0) flag = 1 if (@narrow_rayons != 0) if (cabs(angle-round(angle)) > 1/(@narrow_rayons*ringd_z)^@narrow_exp) flag = 0 endif endif if (@rings_z) if ((round(ringd_z*@scale_rings_z))%@modulus_rings_z == 0) flag = 0; endif endif endif if (@rings) if ((round(ringd*@scale_rings+offset_ring))%@modulus_rings == 0) flag = 1 - flag endif endif if (@inverseMask) flag = 1 - flag endif if (flag == 1) #solid = true endif default: title = "Rayons de Soleil" param center_rayons caption = "Center Rayons" default = (0.0,0.0) endparam param numof_rayons caption = "# Rayons" default = 30 endparam param modulus_rayons caption = "Modulus Rayons" default = 2.0 endparam param skew_rayons caption = "Skew Rayons" default = 0.0 endparam param narrow_rayons caption = "Narrow Rayons" default = 0.0 endparam param narrow_exp caption = "Narrow Grade" default = 1.0 endparam param disturb_rayons caption = "Disturb Rayons" default = 0.0 endparam param frequency_rayons caption = "Freq D-Rayons" default = 10.0 endparam param perturb_rayons caption = "Perturb 1 Rayons" default = 0.0 endparam param frequency_rayons_p caption = "Frequency 1 P-Rayons" default = 10.0 endparam param perturb_rayons2 caption = "Perturb 2 Rayons" default = 0.0 endparam param frequency_rayons_p2 caption = "Frequency 2 P-Rayons" default = 50.0 endparam param perturb_rayons3 caption = "Perturb 3 Rayons" default = 0.0 endparam param frequency_rayons_p3 caption = "Frequency 3 P-Rayons" default = 25.0 endparam param perturb_rayons4 caption = "Perturb 4 Rayons" default = 0.0 endparam param frequency_rayons_p4 caption = "Frequency 4 P-Rayons" default = 25.0 endparam param rings caption = "Rings Checker" default = false endparam param center_rings caption = "Center Rings Checker" default = (0.0,0.0) endparam param modulus_rings caption = "Modulus Rings Checker" default = 2.0 endparam param scale_rings caption = "Scale Rings Checker" default = 1.0 endparam param perturb_rings caption = "Perturb Rings Checker" default = 0.0 endparam param frequency_rings_p caption = "Frequency P-Rings Checker" default = 1.0 endparam param rings_z caption = "Rings Zebra" default = false endparam param modulus_rings_z caption = "Modulus Rings Zebra" default = 2.0 endparam param scale_rings_z caption = "Scale Rings Zebra" default = 1.0 endparam param rings_dbl caption = "Rings Multi" default = false endparam param scale_rings_dbl caption = "Scale Rings Multi" default = 1.0 endparam param factor_rings_dbl caption = "Factor Rings Multi" default = 2.0 endparam param inverseMask caption = "Inverse Mask?" default = false endparam } global_dither { ; ; ; ; Andreas Lober, Oct 26, 2000 ; transform: complex innerScaleZ = 0 complex innerOffset = 0 if (@inner_amount != 0 && #pixel != 0) innerScaleZ = #pixel*@inner_scale*@globalDither innerOffset = innerOffset + \ @inner_amount*round(innerScaleZ)/(innerScaleZ) endif if (@l_randomness != 0) innerOffset = innerOffset + @l_randomness*#random endif bool shapeCondition = true float ditherRadius = @radius/@globalDither if (@shape == 1) shapeCondition = (cabs(round(#pixel*@globalDither)/@globalDither - #pixel) < ditherRadius) elseif (@shape == 2) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel)) < .5*ditherRadius) elseif (@shape == 3) shapeCondition = (abs(imag(round(#pixel*@globalDither)/@globalDither - #pixel)) < .5*ditherRadius) elseif (@shape == 4) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel)) + \ abs(imag(round(#pixel*@globalDither)/@globalDither - #pixel)) < ditherRadius) elseif (@shape == 5) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel) + \ imag(round(#pixel*@globalDither)/@globalDither - #pixel)) < ditherRadius) elseif (@shape == 6) shapeCondition = (cabs(round(#pixel*@globalDither)/@globalDither - #pixel) > ditherRadius) elseif (@shape == 7) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel)) > .5*ditherRadius) elseif (@shape == 8) shapeCondition = (abs(imag(round(#pixel*@globalDither)/@globalDither - #pixel)) > .5*ditherRadius) elseif (@shape == 9) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel)) + \ abs(imag(round(#pixel*@globalDither)/@globalDither - #pixel)) > ditherRadius) elseif (@shape == 10) shapeCondition = (abs(real(round(#pixel*@globalDither)/@globalDither - #pixel) + \ imag(round(#pixel*@globalDither)/@globalDither - #pixel)) > ditherRadius) endif if (shapeCondition) #pixel = round(#pixel*@globalDither + innerOffset)/@globalDither \ - innerOffset/@globalDither endif default: title = "Global Dither" param shape caption = "L: Shape" enum = "None" "Circle" "Real" "Imag" "Diamond" "Skew" \ "!Circle" "!Real" "!Imag" "!Diamond" "!Skew" endparam param globalDither caption = "L: Global Scale" default = 5.0 endparam param radius caption = "L: Radius for Shapes" default = 0.5 endparam param inner_scale caption = "L: Inner Scale" default = 3.0 hint = "Choose 1, 10, 50, 100 as experimental values \ and then start fine tuning." endparam param inner_amount caption = "L: Inner Amount" default = 0.0 endparam param l_randomness caption = "L: Randomness" hint = "This adds a randomness in the outlines." default = 0.0 endparam }