|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectcommon:Generic
common:Coloring
common:GradientColoring
mmf:MMF_ExtendedCilia
class
Object version of ExtendedCilia in mmf3.ucl.
This is an extension of Damien's Cilia colouring.
It can use the "finalz" smoothing where a smoothing fraction is passed from the main formula based on a method suggested by Earl Hinrichs and it has a new extension to standard logarithmic smoothing in which the power/degree/exponent required for smoothing is calculated automagically by the formula - this works extremely well as long as the bailout/s are correct.
It's also extended to allow Cilia for convergent areas and has new double-smoothed options that produce smooth results for those formulas with a smoothing power other than 2 (this is a cheat, there is a 'proper' way to do it but that only really works for whole integer powers (which you can now do using the "split" options with 'Interpolated', 'Sine Waves', 'Cells' or 'Bricks').
This version includes options to "fix" the rotation and skew.
NB. When using Hinrich's smoothing since the real part
of the final z value is the smoothing fraction the
formula doesn't know the actual final z value for
the cilia hence only using older iterations will
work unless you choose a main fractal formula using
"+Atan" Hinrich's smoothing in which case 'No' for
'Old iterations' will work.
Written by David Makin including ideas from many sources
Original mmf3 formula November 2004
This version May 2008
class MMF_ExtendedCilia(common.ulb:GradientColoring) {
;
; Object version of ExtendedCilia in mmf3.ucl.<br>
; This is an extension of Damien's Cilia colouring.<p>
; It can use the "finalz" smoothing where a smoothing
; fraction is passed from the main formula based on
; a method suggested by Earl Hinrichs and it has a new
; extension to standard logarithmic smoothing in which
; the power/degree/exponent required for smoothing is
; calculated automagically by the formula - this works
; extremely well as long as the bailout/s are correct.<p>
; It's also extended to allow Cilia for convergent areas
; and has new double-smoothed options that produce
; smooth results for those formulas with a smoothing
; power other than 2 (this is a cheat, there is a 'proper'
; way to do it but that only really works for whole
; integer powers (which you can now do using the "split"
; options with 'Interpolated', 'Sine Waves', 'Cells' or 'Bricks').<p>
; This version includes options to "fix" the rotation and skew.<p>
; NB. When using Hinrich's smoothing since the real part
; of the final z value is the smoothing fraction the
; formula doesn't know the actual final z value for
; the cilia hence only using older iterations will
; work unless you choose a main fractal formula using
; "+Atan" Hinrich's smoothing in which case 'No' for
; 'Old iterations' will work.<br><p>
;
; Written by David Makin including ideas from many sources<br>
; Original mmf3 formula November 2004<br>
; This version May 2008<br>
;
public:
; @param pparent the parent, generally "this" for the parent, or zero
func MMF_ExtendedCilia(Generic pparent)
float rv = @rot*@split^-@rpwr
float crv = @crot*@csplit^-@crpwr
int gi = 0
il = real(1.0/log(@power)) ; for divergent smoothing
lp = log(0.5*log(@bailout))
ilp = il*lp
cil = real(1.0/log(@cpower)) ; for convergent smoothing
clp = log(-0.5*log(@smallbail))
cilp = cil*clp
iv = 0.0001*@iterval*@iterweight
ivc = 0.0001*@citerval*@iterweightc
iw = 1.0 - 0.01*@iterweight
iwc = 1.0 - 0.01*@iterweightc
co = 0.0025*@convoffset
if @ciliamode!=6 && @ciliamode!=7
if @fixrot
repeat
rv = @split*rv
rval[gi] = rv = rv - floor(rv)
until (gi=gi+1)>#maxiter
if @fixskew && @skew!=0.0
rv = 0.0
gi = 0
repeat
rval[gi] = rval[gi] + rv
rv = (rv + @skew)*@split
rv = rv - floor(rv)
until (gi=gi+1)>#maxiter
endif
endif
if @cfixrot
gi = 0
repeat
crv = @csplit*crv
crval[gi] = crv = crv - floor(crv)
until (gi=gi+1)>#maxiter
if @cfixskew && @cskew!=0.0
crv = 0.0
gi = 0
repeat
crval[gi] = crval[gi] + crv
crv = (crv + @cskew)*@csplit
crv = crv - floor(crv)
until (gi=gi+1)>#maxiter
endif
endif
endif
if @mapimage
m_Image = new @f_image(this)
m_Transform = new @f_transform(this)
if @iterval>0
m_Merge = new @f_merge(this)
endif
if @adjustlayer
m_Adjust = new @f_adjust(this)
endif
endif
if @mapimagec
m_Imagec = new @f_imagec(this)
m_Transformc = new @f_transformc(this)
if @citerval>0 || @zbasin>0
m_Mergec = new @f_mergec(this)
endif
if @adjustlayerc
m_Adjustc = new @f_adjustc(this)
endif
endif
endfunc
; @param pz the initial z value
; @param ppixel the location, normally #pixel
func Init(complex pz, complex ppixel)
GradientColoring.Init(pz, ppixel)
if @mapimage
m_Transform.Init(pz)
endif
if @mapimagec
m_Transformc.Init(pz)
endif
z1 = z2 = z3 = z4 = z5 = z6 = pz
endfunc
; @param pz the z value
func Iterate(complex pz)
GradientColoring.Iterate(pz)
z6 = z5
z5 = z4
z4 = z3; save them
z3 = z2
z2 = z1
z1 = pz
endfunc
; @param pz the z value
; @return colour gradient index value
float func ResultIndex(complex pz)
float d1 = 0.0
float d2 = 0.0
float od = 0.0
float of = 0.0
float fz = 0.0
float fz1 = 0.0
float fz4 = 0.0
float fz5 = 0.0
float r = 0.0
float or = 0.0
float s = 0.0
int cm = 0
int oi = 0
float ivuse = 0.0
float iwuse = 0.0
int li = 0
bool usebasins = false
bool isstandard = true
int it = m_iterations + 1
float d = 0.0
float f = 0.0
float o = 0.0
iterbasin = 0.0
; determine potential and decomposition
; this gives us a "coordinate" in d and f, ranging from 0 to 1
f = real(pz); fractional iteration if using Hinrich's smoothing
fz = imag(pz) ; atan2(finalz) if using Hinrich's+Atan
d1 = |pz|
if @cfixed
d2 = |pz-@cfixedval|
else
d2 = |pz-z1|
endif
if f<0 && d1<@bailout && (@method==4 || @method==5 || @method==6)
usebasins = true
isstandard = false
o = co
f = 1.0+@fudge1c*f
IF (@colditer == 0)
z6 = z3
z5 = z2
z4 = z1
ELSEIF (@colditer == 1)
z6 = z4
z5 = z3
z4 = z2
ELSEIF (@colditer == 2)
z6 = z5
z5 = z4
z4 = z3
ENDIF
fz1 = atan2(z1 - z2)
fz4 = atan2(z4 - z5)
fz5 = atan2(z5 - z6)
if @fixconv
d1 = #pi - atan2(z1)
fz = fz + d1
fz1 = fz1 + d1
fz4 = fz4 + d1
fz5 = fz5 + d1
endif
if @cfixrot && @cciliamode!=6 && @cciliamode!=7
r = crval[it]
or = crval[it-1]
else
r = @crot
endif
s = @cskew
cm = @cciliamode
oi = @colditer
ivuse = ivc
iwuse = iwc
li = @logiterc
wasdivergent = false
elseif d1>=@bailout && (@method==0 || @method==2 || @method==6)
IF (@olditer == 0)
z6 = z3
z5 = z2
z4 = z1
ELSEIF (@olditer == 1)
z6 = z4
z5 = z3
z4 = z2
ELSEIF (@olditer == 2)
z6 = z5
z5 = z4
z4 = z3
ENDIF
if @dauto && it>1
f = 1.0 + @fudge*real(lp - log(0.5*log(|pz|)))/log(log(|pz|)/log(|z1|))
else
f = 1.0 + @fudge*real(ilp - il*log(0.5*log(|pz|)))
endif
fz = atan2(pz)
fz1 = atan2(z1)
fz4 = atan2(z4)
fz5 = atan2(z5)
if @fixrot && @ciliamode!=6 && @ciliamode!=7
r = rval[it]
or = rval[it-1]
else
r = @rot
endif
s = @skew
cm = @ciliamode
oi = @olditer
ivuse = iv
iwuse = iw
li = @logiter
wasdivergent = true
elseif f>=0 && d2>@smallbail && d1<@bailout \
&& (@method==3 || @method==5 || @method==7)
isstandard = false
f = @fudge1*f
IF (@olditer == 0)
z6 = z3
z5 = z2
z4 = z1
ELSEIF (@olditer == 1)
z6 = z4
z5 = z3
z4 = z2
ELSEIF (@olditer == 2)
z6 = z5
z5 = z4
z4 = z3
ENDIF
fz1 = atan2(z1)
fz4 = atan2(z4)
fz5 = atan2(z5)
if @fixrot && @ciliamode!=6 && @ciliamode!=7
r = rval[it]
or = rval[it-1]
else
r = @rot
endif
s = @skew
cm = @ciliamode
oi = @olditer
ivuse = iv
iwuse = iw
li = @logiter
wasdivergent = true
elseif d2<=@smallbail && (@method==1 || @method==2 || @method==7)
usebasins = true
o = co
IF (@colditer == 0)
z6 = z3
z5 = z2
z4 = z1
ELSEIF (@colditer == 1)
z6 = z4
z5 = z3
z4 = z2
ELSEIF (@colditer == 2)
z6 = z5
z5 = z4
z4 = z3
ENDIF
if @cfixed
if @cauto && it>2
f = 1.0 + @fudgec*real(clp - log(-0.5*log(|pz-@cfixedval|))) \
/log(log(|pz-@cfixedval|)/log(|z1-@cfixedval|))
else
f = 1.0 + @fudgec*real(cilp - cil*log(-0.5*log(|pz-@cfixedval|)))
endif
elseif @cauto && it>2
f = 1.0 + @fudgec*real(clp - log(-0.5*log(|pz-z1|))) \
/log(log(|pz-z1|)/log(|z1-z2|))
else
f = 1.0 + @fudgec*real(cilp - cil*log(-0.5*log(|pz-z1|)))
endif
fz = atan2(pz - z1)
fz1 = atan2(z1 - z2)
fz4 = atan2(z4 - z5)
fz5 = atan2(z5 - z6)
if @fixconv
d1 = #pi - atan2(pz)
fz = fz + d1
fz1 = fz1 + d1
fz4 = fz4 + d1
fz5 = fz5 + d1
endif
if @cfixrot && @cciliamode!=6 && @cciliamode!=7
r = crval[it]
or = crval[it-1]
else
r = @crot
endif
s = @cskew
cm = @cciliamode
oi = @colditer
ivuse = ivc
iwuse = iwc
li = @logiterc
wasdivergent = false
else
m_solid = true
wasdivergent = true
if @v_mmfextendedcilia>0
return 0
endif
endif
if cm>7 && cm!=14
of = 1-f ; this is the cheating method !!
if (oi<4)
od = fz5; angle of z
else
od = fz1; angle of z
endif
if (od < 0); it's negative
od = od + #pi * 2; make it positive
endif
od = od / (#pi * 2); scale so full angle range is 0..1
; apply rotation and skew
od = od + or + s*of
od = od - floor(od)
; convert decomp and pot to tileable value d
; this is where the patterns are made
IF cm==8; sawtooth
IF (od < 0.5)
od = od * (of+1.0)
ELSE
od = (od-0.5) * (of+1.0) - 0.5*of + 0.5
ENDIF
od = abs(1.0-od*2.0)
ELSEIF cm==9; interpolated
d1 = abs(1.0-od*2.0)
if @v_mmfextendedcilia<2 || wasdivergent
d2 = abs(1.0-(od*@split-floor(od*@split))*2.0)
else
d2 = abs(1.0-(od*@csplit-floor(od*@csplit))*2.0)
endif
od = d1 + of*(d2-d1)
ELSEIF cm==10; sine waves
d1 = cos(od*#pi*2.0)*0.5 + 0.5
if @v_mmfextendedcilia<2 || wasdivergent
d2 = cos(od*#pi*2.0*@split)*0.5 + 0.5
else
d2 = cos(od*#pi*2.0*@csplit)*0.5 + 0.5
endif
od = d1 + of*(d2-d1)
ELSEIF cm==11; cells
od = ((0.25-sqr(od-0.5)) * (0.25-sqr(of-0.5))) * 16.0
ELSEIF cm==12; bricks
d1 = 1.0 - abs(od-0.5)*2.0
d2 = 1.0 - abs(of-0.5)*2.0
IF (d1 < d2)
od = d1
ELSE
od = d2
ENDIF
ELSEIF cm==13; diamonds
od = 0.5 - abs(od - 0.5)
IF (of < 2.0/3.0)
od = od + of*0.75
od = abs(1.0-od*2.0)
ELSE
IF (od < of*0.75-0.5)
od = of*3.0-2.0-od*4.0
ELSE
od = 1.0-(0.5-od)/(1.0-of*0.75)
ENDIF
ENDIF
endif
endif
if (oi<4)
d = fz4; angle of z
else
d = fz
endif
IF (d < 0); it's negative
d = d + #pi * 2.0; make it positive
ENDIF
d = d / (#pi * 2.0); scale so full angle range is 0..1
; apply rotation and skew
d = d + r + s*f
d = d - floor(d)
; convert decomp and pot to tileable value d
; this is where the patterns are made
IF (cm == 0) || cm==8; sawtooth
IF (d < 0.5)
d = d * (f+1.0)
ELSE
d = (d-0.5) * (f+1.0) - 0.5*f + 0.5
ENDIF
d = abs(1.0-d*2.0)
ELSEIF (cm == 1) || cm==9; interpolated
d1 = abs(1.0-d*2.0)
if @v_mmfextendedcilia<2 || wasdivergent
d2 = abs(1.0-(d*@split-floor(d*@split))*2.0)
else
d2 = abs(1.0-(d*@csplit-floor(d*@csplit))*2.0)
endif
d = d1 + f*(d2-d1)
ELSEIF (cm == 2) || cm==10; sine waves
d1 = cos(d*#pi*2.0)*0.5 + 0.5
if @v_mmfextendedcilia<2 || wasdivergent
d2 = cos(d*#pi*2.0*@split)*0.5 + 0.5
else
d2 = cos(d*#pi*2.0*@csplit)*0.5 + 0.5
endif
d = d1 + f*(d2-d1)
ELSEIF (cm == 3) || cm==11; cells
d = ((0.25-sqr(d-0.5)) * (0.25-sqr(f-0.5))) * 16.0
ELSEIF (cm == 4) || cm==12; bricks
d1 = 1.0 - abs(d-0.5)*2.0
d2 = 1.0 - abs(f-0.5)*2.0
IF (d1 < d2)
d = d1
ELSE
d = d2
ENDIF
ELSEIF (cm == 5) || cm==13; diamonds
d = 0.5 - abs(d - 0.5)
IF (f < 2.0/3.0)
d = d + f*0.75
d = abs(1.0-d*2.0)
ELSE
IF (d < f*0.75-0.5)
d = f*3.0-2.0-d*4.0
ELSE
d = 1.0-(0.5-d)/(1.0-f*0.75)
ENDIF
ENDIF
elseif (cm == 6) ;Smoothed angles
if oi<4
if fz4<-#pi
fz4 = fz4 + 2*#pi
elseif fz4>#pi
fz4 = fz4 - 2*#pi
endif
if fz5<-#pi
fz5 = fz5 + 2*#pi
elseif fz5>#pi
fz5 = fz5 - 2*#pi
endif
d = cos(0.5*fz4)
d1 = cos(0.5*fz5); angle of older z
else
if fz<-#pi
fz = fz + 2*#pi
elseif fz>#pi
fz = fz - 2*#pi
endif
if fz1<-#pi
fz1 = fz1 + 2*#pi
elseif fz1>#pi
fz1 = fz1 - 2*#pi
endif
d = cos(0.5*fz)
d1 = cos(0.5*fz1)
endif
d1 = d1 + s*f
d = d + r*f
d1 = d1 + r*(1-f)
d = abs(d1 + (d-d1)*f)
elseif (cm == 7) ;Just smooth iteration
d = (-0.125 + 0.05*(it+f))^@ip
ENDIF
if cm>7 && cm!=14
d = od+(d-od)*f
endif
duse = d
if cm != 7 && ivuse>0
d1 = it + f
if li==1
d1 = log(1.0+d1)
elseif li==2
d1 = log(1.0+log(1.0+d1))
endif
iterbasin = d1
d = ivuse*d1 + iwuse*d
endif
if usebasins && @zbasin>0
if isstandard
z2 = z1
z1 = pz
endif
if @zbasin==1
d1 = abs(real(2.0*#pi+atan2(z1)))
od = abs(real(2.0*#pi+atan2(z2)))
elseif @zbasin==2
d1 = abs(real(z1))
od = abs(real(z2))
elseif @zbasin==3
d1 = abs(imag(z1))
od = abs(imag(z2))
elseif @zbasin==4
d1 = abs(real(z1)+imag(z1))
od = abs(real(z2)+imag(z2))
elseif @zbasin==5
d1 = abs(2.0*real(z1)+imag(z1))
od = abs(2.0*real(z2)+imag(z2))
elseif @zbasin==6
d1 = abs(real(z1)+2.0*imag(z1))
od = abs(real(z2)+2.0*imag(z2))
elseif @zbasin==7
d1 = abs(real(z1)/(abs(imag(z1))+1.0))
od = abs(real(z2)/(abs(imag(z2))+1.0))
elseif @zbasin==8
d1 = abs(imag(z1)/(abs(real(z1))+1.0))
od = abs(imag(z2)/(abs(real(z2))+1.0))
elseif @zbasin==9
d1 = abs(2.0*real(sqrt(z1))+imag(sqrt(z1)))
od = abs(2.0*real(sqrt(z2))+imag(sqrt(z2)))
elseif @zbasin==10
d1 = abs(real(sqrt(z1))+2.0*imag(sqrt(z1)))
od = abs(real(sqrt(z2))+2.0*imag(sqrt(z2)))
endif
d = d + (od=@zscale*(od+(d1-od)*f))
iterbasin = iterbasin + od
endif
if @mapimage && wasdivergent
if f<0.0
f = f + 1.0
endif
d = 2*((o+d)- floor(o+d)) - 1
duse = 2*((o+duse)- floor(o+duse)) - 1
fuse = f = 2*((it%@spread) + f)/@spread - 1
clr = m_Image.GetColor(m_Transform.Iterate(d+flip(f)))
if @mapmethod=="Image All"
return 0.299*red(clr) + 0.587*green(clr) + 0.114*blue(clr)
elseif @mapmethod=="Image Red"
return red(clr)
elseif @mapmethod=="Image Green"
return green(clr)
elseif @mapmethod=="Image Blue"
return blue(clr)
elseif @mapmethod=="Image Alpha"
return alpha(clr)
elseif @mapmethod=="Image Hue"
return hue(clr)/6.0
elseif @mapmethod=="Image Saturation"
return sat(clr)
elseif @mapmethod=="Image Luminance"
return lum(clr)
endif
elseif @mapimagec && !wasdivergent
d = 2*((o + d)- floor(o+d)) - 1
duse = 2*((o+duse)- floor(o+duse)) - 1
fuse = f = 2*((it%@spreadc) + f)/@spreadc - 1
clr = m_Imagec.GetColor(m_Transformc.Iterate(d+flip(f)))
if @mapmethodc=="Image All"
return 0.299*red(clr) + 0.587*green(clr) + 0.114*blue(clr)
elseif @mapmethodc=="Image Red"
return red(clr)
elseif @mapmethodc=="Image Green"
return green(clr)
elseif @mapmethodc=="Image Blue"
return blue(clr)
elseif @mapmethodc=="Image Alpha"
return alpha(clr)
elseif @mapmethodc=="Image Hue"
return hue(clr)/6.0
elseif @mapmethodc=="Image Saturation"
return sat(clr)
elseif @mapmethodc=="Image Luminance"
return lum(clr)
endif
endif
return o + d * 0.9975
endfunc
; @param pz the z value
; @return colour value
color func Result(complex pz)
float v = ResultIndex(pz)
if (@mapimage && @mapmethod=="Image All" && wasdivergent) \
|| (@mapimagec && @mapmethodc=="Image All" && !wasdivergent)
if wasdivergent
clr = m_Image.GetColor(m_Transform.Iterate(duse+flip(fuse)))
if @adjustlayer
if @iterval>0
clr = m_Merge.GradientMerge(clr, iterbasin)
endif
color c = @f_adjustcolour
if @adjusttype==0
c = RGB(@adjred, @adjgreen, @adjblue)
endif
c = compose(clr, m_Adjust.Merge(clr, c), @f_opacity)
return RGBA(red(c), green(c), blue(c), alpha(clr))
endif
if @iterval>0
return m_Merge.GradientMerge(clr, iterbasin)
endif
return clr
else
clr = m_Imagec.GetColor(m_Transformc.Iterate(duse+flip(fuse)))
if @adjustlayerc
if @citerval>0
clr = m_Mergec.GradientMerge(clr, iterbasin)
endif
color c = @f_adjustcolourc
if @adjusttypec==0
c = RGB(@adjredc, @adjgreenc, @adjbluec)
endif
c = compose(clr, m_Adjustc.Merge(clr, c), @f_opacityc)
return RGBA(red(c), green(c), blue(c), alpha(clr))
endif
if @citerval>0
return m_Mergec.GradientMerge(clr, iterbasin)
endif
return clr
endif
endif
return gradient(v)
endfunc
private:
ImageWrapper m_Image
Transform m_Transform
GradientLayer m_Merge
ColorMerge m_Adjust
ImageWrapper m_Imagec
Transform m_Transformc
GradientLayer m_Mergec
ColorMerge m_Adjustc
float rval[#maxiter+1]
float crval[#maxiter+1]
complex z1
complex z2
complex z3
complex z4
complex z5
complex z6
color clr
float iterbasin
float duse
float fuse
float il
float lp
float ilp
float cil
float clp
float cilp
float iv
float ivc
float iw
float iwc
float co
bool wasdivergent
default:
title = "MMF Extended Cilia"
rating = recommended
int param v_mmfextendedcilia
caption = "Version (MMF Extended Cilia)"
enum = "1.0" "1.1" "1.2"
default = 2
hint = "This field is to absolutely ensure backward compatibility, \
the default will always be set to the latest version, but \
there may be some cases where an older effect that you like \
is lost in an update and you could still use it by selecting \
the older version number. Version 1.1 has a minor change for \
when the 'solid' flag gets set. Version 1.2 fixes an issue with \
the convergent 'Split' value."
visible = @v_mmfextendedcilia<2
endparam
heading
caption = "Main control"
endheading
int param method
caption = "Smoothing"
default = 0
enum = "Standard Div." "Standard Conv." "Standard both" \
"Hinrich's Div." "Hinrich's Conv." "Hinrich's both" \
"St.Div. H.Conv." "H.Div St.Conv."
hint = "Specifies the type of smoothing to use and whether to \
colour divergent or convergent areas or both. \
Standard uses standard iteration smoothing and hence \
requires appropriate bailout (and power and fudge) values. \
Hinrich's uses what I've previously called 'finalz' \
smoothing where the final value of z from the main formula \
passes a smoothing fraction as real(z) and maybe atan(#z) \
as imag(z)."
endparam
heading
caption = "Divergent smoothing"
endheading
float param bailout
caption = "Bailout"
default = 128.0
hint = "This should match the bailout in the fractal formula. \
Larger values work best, especially when using 'Old iterations'. \
When NOT using standard divergent smoothing \
you should still ensure this is a suitable value (eg. >=10)."
endparam
bool param dauto
caption = "Auto-power"
default = true
hint = "When enabled should produce smoothing for any divergent \
areas without you needing to set a divergent power value \
for the colouring."
visible = @method==0 || @method==2 || @method==6
endparam
complex param power
caption = "Power/exponent/degree"
default = (2,0)
hint = "This should match the power/degree/exponent in the \
fractal formula. If the value to use isn't immediately \
obvious from the main formula itself then it's best to \
choose the 'Just iteration' mode and modify this value \
(and maybe the Scaling fudge) until you get completely \
smooth colouring, or just enable auto-power."
visible = @method==0 || @method==2 || @method==6
endparam
float param fudge
caption = "Scaling fudge"
default = 1.0
hint = "This is a scaling fudge value, it's used to scale \
the calculated iteration fraction when the value \
doesn't reach 1, it's unlikely to be required for \
divergent smoothing but I added it just in case. If \
'Auto-power' or the best value you can find for \
the power parameter don't produce smooth results then \
modifying this value may help."
visible = @method==0 || @method==2 || @method==6
endparam
float param fudge1
caption = "Scaling fudge 1"
default = 1.0
hint = "This is a scaling fudge value, it's used to scale \
the calculated iteration fraction when the value \
doesn't reach 1, it's unlikely to be required for \
divergent smoothing but I added it just in case."
visible = @method==3 || @method==5 || @method==7
endparam
heading
caption = "Divergent colouring"
visible = @method==0 || @method==2 || @method==3 || @method>4
endheading
bool param mapimage
caption = "Image Mapping"
default = false
hint = "When enabled you can map an image into the Cilia. Note that the \
'Image Only' Cilia Mode is specifically designed for the use of \
images but you may get interesting results for images in any of \
the Cilia Modes."
visible = @method==0 || @method==2 || @method==3 || @method>4
endparam
ImageWrapper param f_image
caption = "Image Object"
default = MMF_ImageImport
hint = "The image to use."
visible = @mapimage && (@method==0 || @method==2 || @method==3 || @method>4)
endparam
Transform param f_transform
caption = "Image Transform"
default = NullTransform
hint = "Use to position/flip/mirror/scale your image mapping."
visible = @mapimage && (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param mapmethod
caption = "Image Method"
enum = "Image All" "Image Red" "Image Green" "Image Blue" "Image Alpha" \
"Image Hue" "Image Saturation" "Image Luminance"
hint = "'Image All' maps the image brightness (Yiq) to UF's gradient \
if the colouring is being used as a gradient colouring or uses \
the image colours if the colouring is being used as a direct \
colouring. 'Image Red' maps the image red to a gradient, \
'Image Green' the green, 'Image Blue' the blue, 'Image Hue' \
the hue, 'Image Saturation' the saturation and 'Image Luminance' \
the luminance."
visible = @mapimage && (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param spread
caption = "Image Spread"
default = 1
min = 1
hint = "The number of iteration bands over which to spread your image."
visible = @mapimage && (@method==0 || @method==2 || @method==3 || @method>4)
endparam
GradientLayer param f_merge
caption = "Iteration Merge"
default = MMF_GradientLayer
hint = "Only used if the main colouring is being used in direct colouring \
mode and texturing is in use. Use to merge the texture with the \
image. Note that the gradient you choose controls the colour of \
the texture layer which is normally treated as the top layer."
visible = @mapimage && @mapmethod=="Image All" && @iterval>0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
expanded = false
endparam
bool param adjustlayer
caption = "Add Adjust layer"
default = false
hint = "Allows you to add an adjustment layer in a given colour to merge \
on top of the image/texture. Only active if the main colouring \
is in direct mode."
visible = @mapimage && @mapmethod=="Image All" \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param adjusttype
caption = "Colour or RGB"
enum = "RGB values" "Colour Parameter"
default = 1
hint = "This option is specifically added so that if you choose \
'RGB values' you can 'explore' them and see changes to the image \
as you change the RGB. The option may become redundant in a \
future version of UF."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param adjred
caption = "Red Value"
default = 1.0
hint = "The red part of the adjust colour (0 to 1)."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& @adjusttype==0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param adjgreen
caption = "Green Value"
default = 1.0
hint = "The green part of the adjust colour (0 to 1)."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& @adjusttype==0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param adjblue
caption = "Blue Value"
default = 1.0
hint = "The blue part of the adjust colour (0 to 1)."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& @adjusttype==0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
color param f_adjustcolour
caption = "Adjust Layer Colour"
default = RGB(1,1,1)
hint = "Allows you to apply overall adjustments to your colouring."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& @adjusttype==1 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
ColorMerge param f_adjust
caption = "Adjustment Layer Merge"
default = MMF_ExtendedColorMerge
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param f_opacity
caption = "Adjustment Opacity"
default = 1.0
hint = "Use to modify the adjustment opacity, the normal range is from \
0 to 1."
visible = @mapimage && @mapmethod=="Image All" && @adjustlayer \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param ciliamode
caption = "Cilia Mode"
default = 0
enum = "Sawtooth" "Interpolated" "Sine waves" "Cells" "Bricks" \
"Diamonds" "Smoothed angles" "Just iteration" "Smooth saw" \
"Smooth interpolated" "Smooth sine" "Smooth cells" "Smooth bricks" \
"Smooth diamonds" "Image Only"
hint = "This is the periodic function used to generate the \
cilia pieces. Each has a different 'flavor'. \
The 'Smooth' versions produce smoothed results for \
Sawtooth, Interpolated, Sine waves and Diamonds when \
the degree of divergence or convergence is not 2, eg. z^3+c \
Note that 'Just iteration' is exactly that, the \
other parameters become irrelevant."
visible = @method==0 || @method==2 || @method==3 || @method>4
endparam
float param split
caption = "Split"
default = 2.0
hint = "Allows you to choose how the colouring 'splits' from one iteration \
to the next i.e. the increase in density of the colouring from one \
iteration to the next. Should 'correctly' be equal to the rate of \
divergence of the fractal e.g. 2 for z^2+c. Note that when using \
'Sawtooth' or 'Diamonds' then only fractals where the correct \
value is 2 will work as intended."
visible = @ciliamode!=6 && @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param olditer
caption = "Old Iterations"
default = 4
enum = "1 older" "2 older" "3 older" "4 older" "No"
hint = "Uses older iterations for decomposition angle; this \
has the effect of spreading out the pattern. Best \
used to compensate for extreme bailouts. Note that \
'No' requires the angle passed as the imaginary \
part of final z when using Hinrich's smoothing."
visible = @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param iterval
caption = "+Iter amount"
default = 0.0
min = 0.0
hint = "Adds some iteration count to the colour value, \
thus producing colour change over the iterations. \
The larger the value the faster the colour change \
per iteration."
visible = @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param iterweight
caption = "Iter %age (div)"
default = 50.0
hint = "Allows you to control the mixing of the smooth iteration value \
and the normal formula colouring value. Zero will use no iteration \
value and 100 will use all iteration value."
visible = @ciliamode!=7 && @iterval>0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
int param logiter
caption = "+Iter function"
enum = "Ident" "Log()" "Log(Log())"
hint = "Allows you to apply log or double log to the iteration component."
visible = @ciliamode!=7 && @iterval>0 && @iterweight!=0 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param skew
caption = "Skew"
default = 0.0
hint = "This skews the pattern. Unless you enable 'Fix Rotation' and 'Fix \
Skew' then only certain values will maintain the pattern e.g. \
multiples of 0.5 for z^2+c whereas when the 'fixes' are enabled \
the pattern will be maintained whatever value you use. When using \
Smoothed angles it changes the pattern rather than skewing it."
visible = @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param rot
caption = "Rotation"
default = 0.0
hint = "This rotates the pattern, only values from -1 to +1 \
make sense for rotation except when using 'Fix Rotation' in which \
case the entire pattern rotates together provided the 'Split' \
value is correct. When using Smoothed angles it \
changes the pattern rather than rotating it and any \
reasonable values make sense."
visible = @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
bool param fixrot
caption = "Fix Rotation"
default = false
hint = "When enabled the rotation is 'fixed'."
visible = @ciliamode!=6 && @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
float param rpwr
caption = "Rotation adjust"
default = 5.0
min = 0.0
max = 20.0
hint = "Use to scale the effect of the 'Rotation' value, the larger the \
value you use the smaller the effect of changes to 'Rotation'. \
Typically increase the value in areas of higher iteration counts. \
Only needed when using a 'Split' greater than 1."
visible = @fixrot && @ciliamode!=6 && @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
bool param fixskew
caption = "Fix Skew"
default = false
hint = "When enabled the skew is 'fixed' for any skew values."
visible = @fixrot && @ciliamode!=6 && @ciliamode!=7 \
&& (@method==0 || @method==2 || @method==3 || @method>4)
endparam
heading
caption = "Convergent smoothing"
endheading
float param smallbail
caption = "Bailout"
default = 1e-5
hint = "This should match the small bailout in your fractal formula. \
When NOT using standard convergent smoothing \
you should still ensure this is a suitable value (eg. <=1e-5)."
endparam
bool param cauto
caption = "Auto-power"
default = true
hint = "When enabled should produce smoothing for any convergent \
areas without you needing to set a convergent power value \
for the colouring."
visible = @method==1 || @method==2 || @method==7
endparam
complex param cpower
caption = "Power/exponent/degree"
default = (2,0)
hint = "This should match the power (exponent/degree) for the \
convergent areas of your main fractal formula. If the \
value to use isn't immediately obvious from the main \
formula itself then it's best to choose the 'Just \
iteration' mode and modify this value (and maybe the \
Scaling fudge) until you get completely smooth colouring, \
or just try auto-power."
visible = @method==1 || @method==2 || @method==7
endparam
float param fudgec
caption = "Scaling Fudge"
default = 1.0
hint = "This is a scaling fudge value, it's used to scale \
the calculated iteration fraction when the value \
doesn't reach 1. If 'Auto-power' or the best value you can \
find for the 'Convergent Power' parameter don't \
produce smooth results then modifying this value \
should help."
visible = @method==1 || @method==2 || @method==7
endparam
float param fudge1c
caption = "Scaling Fudge 1"
default = 1.0
hint = "This is a scaling fudge value, it's used to scale \
the calculated iteration fraction when the value \
doesn't reach 1."
visible = @method==4 || @method==5 || @method==6
endparam
bool param cfixed
caption = "Absolute convergence"
default = false
hint = "For when using a main formula that tests for convergence by \
using (only) |#z-value| rather than |#z-zold|, a typical example \
would be a Magnet formula where |#z-1.0| is often used. When \
enabled set the value of 'Convergence root' appropriately."
visible = @method==1 || @method==2 || @method==7
endparam
complex param cfixedval
caption = "Convergence root"
default = (1,0)
hint = "Use (1.0,0) for some Magnet formulas."
visible = (@method==1 || @method==2 || @method==7) && @cfixed
endparam
heading
caption = "Convergent colouring"
visible = @method==1 || @method==2 || @method>3
endheading
bool param mapimagec
caption = "Image Mapping"
default = false
hint = "When enabled you can map an image into the Cilia. Note that the \
'Image Only' Cilia Mode is specifically designed for the use of \
images but you may get interesting results for images in any of \
the Cilia Modes."
visible = @method==1 || @method==2 || @method>3
endparam
ImageWrapper param f_imagec
caption = "Image Object"
default = MMF_ImageImport
hint = "The image to use."
visible = @mapimagec && (@method==1 || @method==2 || @method>3)
endparam
Transform param f_transformc
caption = "Image Transform"
default = NullTransform
hint = "Use to position/flip/mirror/scale your image mapping."
visible = @mapimagec && (@method==1 || @method==2 || @method>3)
endparam
int param mapmethodc
caption = "Image Method"
enum = "Image All" "Image Red" "Image Green" "Image Blue" "Image Alpha" \
"Image Hue" "Image Saturation" "Image Luminance"
hint = "'Image All' maps the image brightness (Yiq) to UF's gradient \
if the colouring is being used as a gradient colouring or uses \
the image colours if the colouring is being used as a direct \
colouring. 'Image Red' maps the image red to a gradient, \
'Image Green' the green, 'Image Blue' the blue, 'Image Hue' \
the hue, 'Image Saturation' the saturation and 'Image Luminance' \
the luminance."
visible = @mapimagec && (@method==1 || @method==2 || @method>3)
endparam
int param spreadc
caption = "Image Spread"
default = 1
min = 1
hint = "The number of iteration bands over which to spread your image."
visible = @mapimagec && (@method==1 || @method==2 || @method>3)
endparam
GradientLayer param f_mergec
caption = "Iteration/Zbasin Merge"
default = MMF_GradientLayer
hint = "Only used if the main colouring is being used in direct colouring \
mode and texturing is in use. Use to merge the texture with the \
image. Note that the gradient you choose controls the colour of \
the texture layer which is normally treated as the top layer."
visible = @mapimagec && @mapmethodc=="Image All" \
&& (@citerval>0 || @zbasin>0) \
&& (@method==1 || @method==2 || @method>3)
expanded = false
endparam
bool param adjustlayerc
caption = "Add Adjust layer"
default = false
hint = "Allows you to add an adjustment layer in a given colour to merge \
on top of the image/texture. Only active if the main colouring \
is in direct mode."
visible = @mapimagec && @mapmethodc=="Image All" \
&& (@method==1 || @method==2 || @method>3)
endparam
int param adjusttypec
caption = "Colour or RGB"
enum = "RGB values" "Colour Parameter"
default = 1
hint = "This option is specifically added so that if you choose \
'RGB values' you can 'explore' them and see changes to the image \
as you change the RGB. The option may become redundant in a \
future version of UF."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& (@method==1 || @method==2 || @method>3)
endparam
float param adjredc
caption = "Red Value"
default = 1.0
hint = "The red part of the adjust colour (0 to 1)."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& @adjusttypec==0 && (@method==1 || @method==2 || @method>3)
endparam
float param adjgreenc
caption = "Green Value"
default = 1.0
hint = "The green part of the adjust colour (0 to 1)."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& @adjusttypec==0 && (@method==1 || @method==2 || @method>3)
endparam
float param adjbluec
caption = "Blue Value"
default = 1.0
hint = "The blue part of the adjust colour (0 to 1)."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& @adjusttypec==0 && (@method==1 || @method==2 || @method>3)
endparam
color param f_adjustcolourc
caption = "Adjust Layer Colour"
default = RGB(1,1,1)
hint = "Allows you to apply overall adjustments to your colouring."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& @adjusttypec==1 && (@method==1 || @method==2 || @method>3)
endparam
ColorMerge param f_adjustc
caption = "Adjustment Layer Merge"
default = MMF_ExtendedColorMerge
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& (@method==1 || @method==2 || @method>3)
endparam
float param f_opacityc
caption = "Adjustment Opacity"
default = 1.0
hint = "Use to modify the adjustment opacity, the normal range is from \
0 to 1."
visible = @mapimagec && @mapmethodc=="Image All" && @adjustlayerc \
&& (@method==1 || @method==2 || @method>3)
endparam
int param cciliamode
caption = "Cilia Mode"
default = 0
enum = "Sawtooth" "Interpolated" "Sine waves" "Cells" "Bricks" \
"Diamonds" "Smoothed angles" "Just iteration" "Smooth saw" \
"Smooth interpolated" "Smooth sine" "Smooth cells" "Smooth bricks" \
"Smooth diamonds" "Image Only"
hint = "This is the periodic function used to generate the \
cilia pieces. Each has a different 'flavor'. \
The 'Smooth' versions produce smoothed results for \
Sawtooth, Interpolated, Sine waves and diamonds when \
the degree of divergence or convergence is not 2, eg. Nova formulas. \
Note that 'Just iteration' is exactly that, the \
other parameters become irrelevant."
visible = @method==1 || @method==2 || @method>3
endparam
float param csplit
caption = "Split"
default = 2.0
hint = "Allows you to choose how the colouring 'splits' from one iteration \
to the next i.e. the increase in density of the colouring from one \
iteration to the next. Should 'correctly' be 2 for the Newton or \
Magnet fractals. Note that when using 'Sawtooth' or 'Diamonds' \
then only fractals where the correct value is 2 will work as \
intended."
visible = @cciliamode!=6 && @cciliamode!=7 \
&& (@method==1 || @method==2 || @method>3)
endparam
bool param fixconv
caption = "Convergent 'fix'"
default = true
hint = "Fixes the convergent areas of some fractals (eg. Newton) \
so areas in different z basins will have consistent colouring. \
Turn this off to get more variety in your fractal \
but then plain Sawtooth, Sine and Interpolated will \
have iteration bands in some areas - you could use the \
Smooth versions instead. You may find 'Smoothed angles' better \
with this switched off."
visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3)
endparam
int param colditer
caption = "Old Iterations"
default = 0
enum = "1 older" "2 older" "3 older" "4 older" "No"
hint = "Uses older iterations for decomposition angle; this \
has the effect of spreading out the pattern. Best \
used to compensate for extreme bailouts. Note that \
'No' requires the angle passed as the imaginary \
part of final z when using Hinrich's smoothing."
visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3)
endparam
float param citerval
caption = "+Iter amount"
default = 0.0
min = 0.0
hint = "Adds some iteration count to the colour value, \
thus producing colour change over the iterations. \
The larger the value the faster the colour change \
per iteration."
visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3)
endparam
float param iterweightc
caption = "Iter %age (conv)"
default = 50.0
hint = "Allows you to control the mixing of the smooth iteration value \
and the normal formula colouring value. Zero will use no iteration \
value and 100 will use all iteration value."
visible = @cciliamode!=7 && @citerval>0 \
&& (@method==1 || @method==2 || @method>3)
endparam
int param logiterc
caption = "+Iter function"
enum = "Ident" "Log()" "Log(Log())"
hint = "Allows you to apply log or double log to the iteration component."
visible = @cciliamode!=7 && @citerval>0 && @iterweightc!=0 \
&& (@method==1 || @method==2 || @method>3)
endparam
float param cskew
caption = "Skew"
default = 0.0
hint = "This skews the pattern. Unless you enable 'Fix Rotation' and 'Fix \
Skew' then only certain values will maintain the pattern e.g. \
multiples of 0.5 for Newton whereas when the 'fixes' are enabled \
the pattern will be maintained whatever value you use. When using \
Smoothed angles it changes the pattern rather than skewing it."
visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3)
endparam
float param crot
caption = "Rotation"
default = 0.0
hint = "This rotates the pattern, only values from -1 to +1 \
make sense for rotation except when using 'Fix Rotation' in which \
case the entire pattern rotates together provided the 'Split' \
value is correct. When using Smoothed angles it \
changes the pattern rather than rotating it and any \
reasonable values make sense."
visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3)
endparam
bool param cfixrot
caption = "Fix Rotation"
default = false
hint = "When enabled the rotation is 'fixed'."
visible = @cciliamode!=6 && @cciliamode!=7 \
&& (@method==1 || @method==2 || @method>3)
endparam
float param crpwr
caption = "Rotation adjust"
default = 5.0
min = 0.0
max = 20.0
hint = "Use to scale the effect of the 'Rotation' value, the larger the \
value you use the smaller the effect of changes to 'Rotation'. \
Typically increase the value in areas of higher iteration counts. \
Only needed when using a 'Split' greater than 1."
visible = @cfixrot && @cciliamode!=6 && @cciliamode!=7 \
&& (@method==1 || @method==2 || @method>3)
endparam
bool param cfixskew
caption = "Fix Skew"
default = false
hint = "When enabled the skew is 'fixed' for any skew value."
visible = @cfixrot && @cciliamode!=6 && @cciliamode!=7 \
&& (@method==1 || @method==2 || @method>3)
endparam
float param convoffset
caption = "Colour offset"
default = 0.0
hint = "Adds an offset to the final colour value in convergent areas, for \
when the main fractal has both convergent and divergent areas. \
The offset value corresponds to the number of gradient points when \
Color Density is 1 and Transfer Function is linear."
visible = @method==1 || @method==2 || @method>3
endparam
int param zbasin
caption = "Add z basins"
enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \
"abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \
"abs(imag/(abs(real)+1))" "Roots 1" "Roots 2"
default = 0
hint = "Allows you to add a value to the final colouring based on the \
penultimate value of z."
visible = (@method==1 || @method==2 || @method>3)
endparam
float param zscale
caption = "Basin scale"
default = 0.1
hint = "Scales the effect of the z basin value."
visible = (@method==1 || @method==2 || @method>3) && @zbasin>0
endparam
float param ip
caption = "Iteration Power"
default = 1.0
visible = @ciliamode==7
endparam
}
| Constructor Summary | |
|---|---|
MMF_ExtendedCilia()
|
|
MMF_ExtendedCilia(Generic pparent)
|
|
| Method Summary | |
|---|---|
void |
Init(complex pz,
complex ppixel)
Set up for a sequence of values |
void |
Iterate(complex pz)
Process the next value in the sequence |
color |
Result(complex pz)
Produce a resulting color index after a sequence is finished |
float |
ResultIndex(complex pz)
Produce a resulting color index after a sequence is finished |
| Methods inherited from class common:GradientColoring |
|---|
IsGradient, IsSolid |
| Methods inherited from class common:Coloring |
|---|
GetPixel |
| Methods inherited from class common:Generic |
|---|
GetParent |
| Methods inherited from class Object |
|---|
|
| Constructor Detail |
|---|
public MMF_ExtendedCilia(Generic pparent)
pparent - the parent, generally "this" for the parent, or zeropublic MMF_ExtendedCilia()
| Method Detail |
|---|
public void Init(complex pz,
complex ppixel)
GradientColoringThis function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).
Init in class GradientColoringpz - the initial z valueppixel - the location, normally #pixelpublic void Iterate(complex pz)
GradientColoringAs long as the sequence has not bailed out, this function will be continually called to produce sequence values. Note that such processing generally will not know in advance precisely how long the sequence is, and should be prepared to deal with sequences of arbitrary length.
Your coloring may determine at some point that a solid color should be used rather than an index value.
Iterate in class GradientColoringpz - the z valuepublic float ResultIndex(complex pz)
GradientColoringThis corresponds to the final: section in a coloring formula. Once it is called, no further calls to Iterate() should be made without calling Init() first.
ResultIndex in class GradientColoringpz - the z value
public color Result(complex pz)
GradientColoringThis corresponds to the final: section in a coloring formula. Once it is called, no further calls to Iterate() should be made without calling Init() first.
Result in class GradientColoringpz - the z value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||