mmf
Class MMF_FieldEstimator

Object
  extended by common:Generic
      extended by common:Coloring
          extended by common:GradientColoring
              extended by mmf:MMF_FieldEstimator

class 
GradientColoring:MMF_FieldEstimator

This is a combination of Distance Estimator or Smooth Iteration or Exponential Smoothing and Distance Estimator Angles or Field Lines that allows the use of either the distance estimate or the smooth iteration value or the exponential smoothing value combined with either the distance estimator angles or the field line angles for mapping an image into a fractal.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_FieldEstimator(common.ulb:GradientColoring) {
 ; <p>
 ; This is a combination of Distance Estimator or Smooth Iteration or
 ; Exponential Smoothing and Distance Estimator Angles or Field Lines
 ; that allows the use of either the distance estimate or the smooth
 ; iteration value or the exponential smoothing value combined with
 ; either the distance estimator angles or the field line angles for
 ; mapping an image into a fractal.<br>
 public:
   func MMF_FieldEstimator(Generic pparent)
     GradientColoring.GradientColoring(pparent)
     if @smooth!=1
       if @v_mmffieldestimator>=2 && @useplugin \
          && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
         distest = new @distest(this)
       endif
       if @mode!=3
         if @angles==0
           fltransfer = new @fltransfer(this)
         else;if @angles==1
           datransfer = new @datransfer(this)
         endif
       endif
       if @mode!=2
         if @distances==0
           ittransfer = new @ittransfer(this)
         elseif @distances==1
           detransfer = new @detransfer(this)
         else;if @distances==2
           extransfer = new @extransfer(this)
         endif
       endif
       if @v_mmffieldestimator>0 && @mode<2
         m_Transform = new @f_transformnew(this)
       endif
       if @mode==0
         m_Image = new @f_image(this)
         if @v_mmffieldestimator==0
           m_Transform = new @f_transform(this)
         endif
         if @adjustlayer
           m_Adjust = new @f_adjust(this)
         endif
       endif
       if @mode==4 || (@mode<2 && @usetexture)
         m_Transferx = new @f_transferx(this)
         m_Transfery = new @f_transfery(this)
         m_TexTransform = new @f_textransform(this)
         m_Texture = new @f_texture(this)
         m_TextureScale = new @f_texturescale(this)
         if @mode<2
           m_Merge = new @f_Merge(this)
         endif
       endif
     endif
     if @smooth>0
       if (@modec!=3 && @anglesc==1) || (@modec!=2 && @distancesc==1)
         distestc = new @distestc(this)
       endif
       if @modec!=3
         if @anglesc==0
           fltransferc = new @fltransferc(this)
         else;if @angles==1
           datransferc = new @datransferc(this)
         endif
       endif
       if @modec!=2
         if @distancesc==0
           ittransferc = new @ittransferc(this)
         elseif @distancesc==1
           detransferc = new @detransferc(this)
         else;if @distancesc==2
           extransferc = new @extransferc(this)
         endif
       endif
       if @modec<2
         m_Transformc = new @f_transformnewc(this)
       endif
       if @modec==0
         m_Imagec = new @f_imagec(this)
         if @adjustlayerc
           m_Adjustc = new @f_adjustc(this)
         endif
       endif
       if @modec==4 || (@modec<2 && @usetexturec)
         m_Transferxc = new @f_transferxc(this)
         m_Transferyc = new @f_transferyc(this)
         m_TexTransformc = new @f_textransformc(this)
         m_Texturec = new @f_texturec(this)
         m_TextureScalec = new @f_texturescalec(this)
         if @modec<2
           m_Mergec = new @f_Mergec(this)
         endif
       endif
     endif
   endfunc
   func Init(complex pz, complex ppixel)
     m_Iterations = 0
     m_Solid = false
     m_Pixel = ppixel
     zolder = (0,0)
     zold = pz
     sz = dz = 1.0
     ex = exp(-cabs(pz))
     exc = 0.0
     if @julia
       zz[0] = pz
       zzc[0] = pz
       if @mode!=3 && @angles==1 && @smooth!=1 \
          && (@v_mmffieldestimator<2 || !@useplugin)
         sz = @power*pz^(@power-1)
       endif
       m_Iterations = 1
     endif
     if @smooth!=1
       if @v_mmffieldestimator>=2 && @useplugin \
          && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
         distest.Init(pz,ppixel)
       endif
       if @v_mmffieldestimator>0
         if @mode!=3
           if @angles==0
             fltransfer.Init(0)
           else;if @angles==1
             datransfer.Init(0)
           endif
         endif
         if @mode!=2
           if @distances==0
             ittransfer.Init(0)
           elseif @distances==1
             detransfer.Init(0)
           else;if @distances==2
             extransfer.Init(0)
           endif
         endif
       endif
       if @mode==0 || (@v_mmffieldestimator>0 && @mode==1)
         m_Transform.Init(pz)
       endif
       if @mode==4 || (@mode<2 && @usetexture)
         m_Transferx.Init(0)
         m_Transfery.Init(0)
         m_TexTransform.Init(pz)
         m_Texture.Init(pz)
         m_TextureScale.Init(0)
       endif
     endif
     if @smooth>0
       if (@modec!=3 && @anglesc==1) || (@modec!=2 && @distancesc==1)
         distestc.Init(pz,ppixel)
       endif
       if @modec!=3
         if @anglesc==0
           fltransferc.Init(0)
         else;if @anglesc==1
           datransferc.Init(0)
         endif
       endif
       if @modec!=2
         if @distancesc==0
           ittransferc.Init(0)
         elseif @distancesc==1
           detransferc.Init(0)
         else;if @distancesc==2
           extransferc.Init(0)
         endif
       endif
       if @modec==0 || @modec==1
         m_Transformc.Init(pz)
       endif
       if @modec==4 || (@modec<2 && @usetexturec)
         m_Transferxc.Init(0)
         m_Transferyc.Init(0)
         m_TexTransformc.Init(pz)
         m_Texturec.Init(pz)
         m_TextureScalec.Init(0)
       endif
     endif
   endfunc
   func Iterate(complex pz)
     if @smooth!=1
       if @mode!=3 && @angles==0
         if m_Iterations>=@skip && m_Iterations<@skip+1000
           zz[m_Iterations-@skip] = pz
         endif
       endif
       if @v_mmffieldestimator>=2 && @useplugin \
          && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
         distest.Iterate(pz)
       elseif @mode!=3 && @angles==1 && (!@julia && m_Iterations==0)
         sz = @power*pz^(@power-1.0)
       elseif ((@mode!=2 && @distances==1) || (@mode!=3 && @angles==1)) \
              && (@julia || m_Iterations>0)
         dz = @power*dz*pz^(@power-1.0)
       endif
       if @mode!=2 && @distances==2
         ex = ex + exp(-cabs(pz))
       endif
     endif
     if @smooth>0
       if @modec!=3 && @anglesc==0
         if m_Iterations>=@skipc && m_Iterations<@skipc+1000
           zzc[m_Iterations-@skip] = pz
         endif
       endif
       if (@modec!=3 && @anglesc==1) || (@modec!=2 && @distancesc==1)
         distestc.Iterate(pz)
       endif
       if @modec!=2 && @distancesc==2
         exc = exc + exp(-1.0/cabs(pz-zold))
       endif
       zolder = zold
     endif
     zold = pz
     m_Iterations = m_Iterations + 1
   endfunc
   float func ResultIndex(complex pz)
     float a = 0.0
     float b = 0.0
     float v = 0.0
     complex tc = 0.0
     s = 0.0
     t = 0.0
     u = 0.0
     if @smooth!=1 && |pz|>@bailout && |pz-zold|>1.0
       if @mode!=3 && @angles==0
         bool f = false
         if (@julia && imag(pz - zold^@power)>=0.0) \
            || (!@julia && imag(m_Pixel)>=0.0)
           f = true
         endif
         int i = m_Iterations - @skip
         if i<1000
           s = atan2(pz)*(0.5/#pi)
         else
           s = atan2(zz[(i=i-1)])*(0.5/#pi)
         endif
         if s<0.0
           s = s + 1.0
         endif
         while (i=i-1)>=0
           if (a = atan2(zz[i])*(0.5/#pi))<0.0
             a = a + 1.0
           endif
           if @original
             b = a = a*@power
           else
             b = b + (a = a*@power)
           endif
           b = b - (s = s + floor(a))
           if f && b>=0.5
             s = s + 1.0
             b = b - @offset
           elseif !f && b<-0.5
             s = s - 1.0
             b = b + @offset
           endif
           if !@accident || @original
             b = @scale*b/@power
           endif
           s = s/@power
         endwhile
         if @accident2
           s = b
         endif
         if (s = s%1)<0.0
           s = s + 1.0
         endif
         if @mode==4 || (@mode<2 && @usetexture)
           u = m_Transferx.Iterate(s)
         endif
         s = fltransfer.Iterate(s)
         if @mode==2
           return s
         endif
       endif
       if @mode!=3 && @angles==1
         if @useplugin
           s = distest.ResultAngle(pz)
         elseif (s = atan2(pz/(dz*sz))*(0.5/#pi))<0.0
           s = s + 1.0
         endif
         if @mode==4 || (@mode<2 && @usetexture)
           u = m_Transferx.Iterate(s)
         endif
         s = datransfer.Iterate(s)
         if @mode==2
           return s
         endif
       endif
       if @mode!=2 && @distances==0
         if !@julia
           m_Iterations = m_Iterations + 1
         endif
         if @autopower && (b=|zold|)>0.0
           a = log(|pz|)
           t = m_Iterations + (log(0.5*log(@bailout)) - log(0.5*a)) \
                              /log(a/log(b))
         else
           t = m_Iterations + (log(0.5*log(@bailout)) - log(0.5*log(|pz|))) \
                              /log(@power)
         endif
         if @mode==4 || (@mode<2 && @usetexture)
           v = m_Transfery.Iterate(t)
         endif
         t = ittransfer.Iterate(t)
         if @mode==3
           return t
         endif
       endif
       if @mode!=2 && @distances==1
         if @useplugin
           t = distest.ResultDistance(pz)
         else
           t = cabs(pz)
           t = (@power*log(t)*t/cabs(dz))^(1.0/@power)
           if (@mode==4 || (@mode<2 && @usetexture)) && @v_mmffieldestimator<3
             v = m_Transfery.Iterate(t)
           endif
         endif
         if (@mode==4 || (@mode<2 && @usetexture)) && @v_mmffieldestimator>=3
           v = m_Transfery.Iterate(t)
         endif
         t = detransfer.Iterate(t)
         if @mode==3
           return t
         endif
       endif
       if @mode!=2 && @distances==2
         if @fixexp
           ex = ex + exp(-cabs(pz))
         endif
         if @mode==4 || (@mode<2 && @usetexture)
           v = m_Transfery.Iterate(ex)
         endif
         t = extransfer.Iterate(ex)
         if @mode==3
           return t
         endif
       endif
       if @f_transformnew!=NullTransform && @v_mmffieldestimator>0
         tc = m_Transform.Iterate(s + flip(t))
         s = real(tc)
         t = imag(tc)
       endif
       if @polar
         s = s*2.0*#pi
         if @v_mmffieldestimator>0 && @mode>0
           tc = 0.5*t*(cos(s)+1.0 - flip(sin(s)-1.0))
         else
           tc = t*(cos(s) - flip(sin(s)))
         endif
         s = real(tc)
         t = imag(tc)
       endif
       if @mode==4 || (@mode<2 && @usetexture)
         tc = m_TexTransform.Iterate(u+flip(v))
         if @polartex
           u = real(tc)*2.0*#pi
           v = imag(tc)
           if @mode>0
             tc = 0.5*v*(cos(u)+1.0 - flip(sin(u)-1.0))
           else
             tc = v*(cos(u) - flip(sin(u)))
           endif
         endif
         u = m_TextureScale.Iterate(m_Texture.Iterate(tc))
       endif
       if @mode==4
         return u
       elseif @mode==1
         if @usetexture
           if @mix=="Sum"
             return s + t + u
           elseif @mix=="Product"
             return s*t + u
           elseif @mix=="Absolute Difference"
             return abs(s - t) + u
           elseif @mix=="Quotient 1"
             return s/(t + 1) + u
           else;if @mix=="Quotient 2"
             return t/(s + 1) + u
           endif
         elseif @mix=="Sum"
           return s + t
         elseif @mix=="Product"
           return s*t
         elseif @mix=="Absolute Difference"
           return abs(s - t)
         elseif @mix=="Quotient 1"
           return s/(t + 1)
         else;if @mix=="Quotient 2"
           return t/(s + 1)
         endif
       else
         if !@polar
           s = 2*s - 1.0
           t = 2*t - 1.0
         endif
         if @v_mmffieldestimator==0
           clr = m_Image.GetColor(m_Transform.Iterate(s+flip(t)))
         else
           clr = m_Image.GetColor(s+flip(t))
         endif
         if @usetexture
           if @mapmethod=="Image All"
             return 0.299*red(clr) + 0.587*green(clr) + 0.114*blue(clr) + u
           elseif @mapmethod=="Image Red"
             return red(clr) + u
           elseif @mapmethod=="Image Green"
             return green(clr) + u
           elseif @mapmethod=="Image Blue"
             return blue(clr) + u
           elseif @mapmethod=="Image Alpha"
             return alpha(clr) + u
           elseif @mapmethod=="Image Hue"
             return hue(clr)/6.0 + u
           elseif @mapmethod=="Image Saturation"
             return sat(clr) + u
           else;if @mapmethod=="Image Luminance"
             return lum(clr) + u
           endif
         elseif @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)
         else;if @mapmethod=="Image Luminance"
           return lum(clr)
         endif
       endif
     elseif @smooth>0 && |pz-zold|<1.0
       if @modec!=3 && @anglesc==0
         int i = m_Iterations - @skipc
         float fix = #pi - atan2(pz)
         if i<1000
           s = (atan2(pz-zzc[i-1]) + fix)*(0.5/#pi)
         else
           i = i - 1
           s = (atan2(zzc[i]-zzc[i-1]) + fix)*(0.5/#pi)
         endif
         if s<0.0
           s = s + 1.0
         elseif s>=1.0
           s = s - 1.0
         endif
         if (s=s+@fixconv)>=1.0
           s = s - 1.0
         endif
         while (i=i-1)>=1
           if (a = (atan2(zzc[i]-zzc[i-1]) + fix)*(0.5/#pi))<0.0
             a = a + 1.0
           elseif a>=1.0
             a = a - 1.0
           endif
           if (a=a+@fixconv)>=1.0
             a = a - 1.0
           endif
           if !@originalc
             b = b + (a = a*@powerc)
           else
             b = a = a*@powerc
           endif
           b = b - (s = s + floor(a))
           if b>=0.5
             s = s + 1.0
             b = b - @offsetc
           elseif b<-0.5
             s = s - 1.0
             b = b + @offsetc
           endif
           if !@accidentc || @originalc
             b = @scalec*b/@powerc
           endif
           s = s/@powerc
         endwhile
         if @accident2c
           s = b
         endif
         if (s = s%1)<0.0
           s = s + 1.0
         endif
         if @modec==4 || (@modec<2 && @usetexturec)
           u = m_Transferxc.Iterate(s)
         endif
         s = fltransferc.Iterate(s)
         if @modec==2
           return s
         endif
       endif
       if @modec!=3 && @anglesc==1
         s = distestc.ResultAngle(pz)
         if @modec==4 || (@modec<2 && @usetexturec)
           u = m_Transferxc.Iterate(s)
         endif
         s = datransferc.Iterate(s)
         if @modec==2
           return s
         endif
       endif
       if @modec!=2 && @distancesc==0
         if !@julia
           m_Iterations = m_Iterations + 1
         endif
         if @fixedconv
           if @autopowerc
             a = log(|pz-@convval|)
             t = m_Iterations + (log(-0.5*log(@smallbail)) - log(-0.5*a)) \
                                /log(a/log(|zold-@convval|))
           else
             t = m_Iterations + (log(-0.5*log(@smallbail)) - log(-0.5*log(|pz-@convval|))) \
                                /log(@powerc)
           endif
         elseif @autopowerc && m_Iterations>1
           a = log(|pz-zold|)
           t = m_Iterations + (log(-0.5*log(@smallbail)) - log(-0.5*a)) \
                              /log(a/log(|zold-zolder|))
         else
           t = m_Iterations + (log(-0.5*log(@smallbail)) - log(-0.5*log(|pz-zold|))) \
                              /log(@powerc)
         endif
         if @modec==4 || (@modec<2 && @usetexturec)
           v = m_Transferyc.Iterate(t)
         endif
         t = ittransferc.Iterate(t)
         if @modec==3
           return t
         endif
       endif
       if @modec!=2 && @distancesc==1
         t = distestc.ResultDistance(pz)
         if @modec==4 || (@modec<2 && @usetexturec)
           v = m_Transferyc.Iterate(t)
         endif
         t = detransferc.Iterate(t)
         if @modec==3
           return t
         endif
       endif
       if @modec!=2 && @distancesc==2
         if @fixexpc
           exc = exc + exp(-1.0/cabs(pz-zold))
         endif
         if @modec==4 || (@modec<2 && @usetexturec)
           v = m_Transferyc.Iterate(exc)
         endif
         t = extransferc.Iterate(exc)
         if @modec==3
           return t
         endif
       endif
       if @f_transformnewc!=NullTransform
         tc = m_Transformc.Iterate(s + flip(t))
         s = real(tc)
         t = imag(tc)
       endif
       if @polarc
         s = s*2.0*#pi
         if @modec>0
           tc = 0.5*t*(cos(s)+1.0 - flip(sin(s)-1.0))
         else
           tc = t*(cos(s) - flip(sin(s)))
         endif
         s = real(tc)
         t = imag(tc)
       endif
       if @modec==4 || (@modec<2 && @usetexturec)
         tc = m_TexTransformc.Iterate(u+flip(v))
         if @polartexc
           u = real(tc)*2.0*#pi
           v = imag(tc)
           if @modec>0
             tc = 0.5*v*(cos(u)+1.0 - flip(sin(u)-1.0))
           else
             tc = v*(cos(u) - flip(sin(u)))
           endif
         endif
         u = m_TextureScalec.Iterate(m_Texturec.Iterate(tc))
       endif
       if @modec==4
         return u
       elseif @modec==1
         if @usetexturec
           if @mixc=="Sum"
             return s + t + u
           elseif @mixc=="Product"
             return s*t + u
           elseif @mixc=="Absolute Difference"
             return abs(s - t) + u
           elseif @mixc=="Quotient 1"
             return s/(t + 1) + u
           else;if @mixc=="Quotient 2"
             return t/(s + 1) + u
           endif
         elseif @mixc=="Sum"
           return s + t
         elseif @mixc=="Product"
           return s*t
         elseif @mixc=="Absolute Difference"
           return abs(s - t)
         elseif @mixc=="Quotient 1"
           return s/(t + 1)
         else;if @mixc=="Quotient 2"
           return t/(s + 1)
         endif
       else
         if !@polarc
           s = 2*s - 1.0
           t = 2*t - 1.0
         endif
         clr = m_Imagec.GetColor(s+flip(t))
         if @usetexturec
           if @mapmethodc=="Image All"
             return 0.299*red(clr) + 0.587*green(clr) + 0.114*blue(clr) + u
           elseif @mapmethodc=="Image Red"
             return red(clr) + u
           elseif @mapmethodc=="Image Green"
             return green(clr) + u
           elseif @mapmethodc=="Image Blue"
             return blue(clr) + u
           elseif @mapmethodc=="Image Alpha"
             return alpha(clr) + u
           elseif @mapmethodc=="Image Hue"
             return hue(clr)/6.0 + u
           elseif @mapmethodc=="Image Saturation"
             return sat(clr) + u
           else;if @mapmethodc=="Image Luminance"
             return lum(clr) + u
           endif
         elseif @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)
         else;if @mapmethodc=="Image Luminance"
           return lum(clr)
         endif
       endif
     else
       m_Solid = true
       return 0.0
     endif
   endfunc
   color func Result(complex pz)
     float v = ResultIndex(pz)
     if @smooth!=1 && |pz|>@bailout && |pz-zold|>1.0
       if @mode==0 && @mapmethod=="Image All"
         if @usetexture
           clr = m_Merge.GradientMerge(clr, u)
         endif
         if @adjustlayer
           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
         return clr
       endif
     elseif @smooth>0 && |pz-zold|<1.0
       if @modec==0 && @mapmethodc=="Image All"
         if @usetexturec
           clr = m_Mergec.GradientMerge(clr, u)
         endif
         if @adjustlayerc
           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
         return clr
       endif
     endif
     return gradient(v)
   endfunc
 private:
   ImageWrapper m_Image
   DistanceEstimatorBase distest
   Transform m_Transform
   Transform m_TexTransform
   ColorMerge m_Adjust
   Transfer fltransfer
   Transfer datransfer
   Transfer ittransfer
   Transfer detransfer
   Transfer extransfer
   Transfer m_Transferx
   Transfer m_Transfery
   Transfer m_TextureScale
   TrapShape m_Texture
   GradientLayer m_Merge
   ImageWrapper m_Imagec
   DistanceEstimatorBase distestc
   Transform m_Transformc
   Transform m_TexTransformc
   ColorMerge m_Adjustc
   Transfer fltransferc
   Transfer datransferc
   Transfer ittransferc
   Transfer detransferc
   Transfer extransferc
   Transfer m_Transferxc
   Transfer m_Transferyc
   Transfer m_TextureScalec
   TrapShape m_Texturec
   GradientLayer m_Mergec
   complex zz[1000]
   complex zzc[1000]
   complex zold
   complex zolder
   complex sz
   complex dz
   float ex
   float s
   float t
   float u
   float exc
   color clr
 default:
   title = "MMF Field Estimator"
   rating = recommended
   int param v_mmffieldestimator
     caption = "Version (MMF Field Estimator)"
     enum = "1.0" "1.1" "1.2" "1.3"
     default = 3
     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."
     visible = @v_mmffieldestimator<3
   endparam
   heading
     caption = "Main Control"
   endheading
   int param smooth
     caption = "Area to Colour"
     enum = "Divergent" "Convergent" "Both"
     default = 0
     visible = @v_mmffieldestimator>=2
   endparam
   bool param julia
     caption = "Julia Mode ?"
     default = false
     hint = "Enable for main formulas that are in Julia mode."
     visible = ((@mode!=3 || @distances==1) && @smooth!=1) \
               || ((@modec!=3 || @distancesc==1) && @smooth>0)
   endparam
   heading
     caption = "Divergent Control"
     visible = @smooth!=1
   endheading
   int param mode
     caption = "Colouring Mode"
     enum = "Image Mapping" "Mix" "Angles" "Distances" "Texture Only"
     default = 0
     visible = @smooth!=1
   endparam
   bool param usetexture
     caption = "Add Texture"
     default = false
     hint = "Adds texturing when enabled. Normally this will be mixed in as \
             a gradient index but if the colouring is in direct mode and \
             you're using 'Image Mapping' then the texturing is applied as \
             a colour merge layer."
     visible = @mode<2 && @smooth!=1
   endparam
   bool param polar
     caption = "Go Polar"
     default = false
     hint = "When enabled the angle values are used as angles and the \
             distance values as a magnitude, when disabled the angle values \
             and distance values are taken as being on perpendicular axes."
     visible = @mode<2 && @smooth!=1
   endparam
   int param mix
     caption = "Mix Method"
     enum = "Sum" "Product" "Absolute Difference" "Quotient 1" "Quotient 2"
     default = 0
     visible = @mode==1 && @smooth!=1
   endparam
   int param angles
     caption = "Angle Method"
     enum = "Field Lines" "Dist.Est. Angles"
     default = 0
     visible = @mode!=3 && @smooth!=1
   endparam
   int param distances
     caption = "Distance/Potential"
     enum = "Smooth Iteration" "Distance Estimator" "Exponential Smoothing"
     default = 0
     visible = @mode!=2 && @smooth!=1
   endparam
   bool param useplugin
     caption = "Plug-in Distance Estimation ?"
     default = false
     hint = "The built-in divergent Distance Estimation is only accurate for \
             standard fractals of the form z^p+c. Enabling the plug-in option \
             allows you to plug-in distance estimation calculating algorithms \
             for other fractal formulas."
     visible = @v_mmffieldestimator>=2 && @smooth!=1 \
               && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
   endparam
   heading
     text = "Choose the correct distance estimator for your main fractal \
             formula. Note that you can ignore the 'Mode' parameter in the \
             distance estimator formula but you need to set the 'Julia ?', \
             'Power' and any other parameters correctly."
     visible = @v_mmffieldestimator>=2 && @smooth!=1 && @useplugin \
               && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
   endheading
   DistanceEstimatorBase param distest
     caption = "Distance Estimator"
     default = MMF_StandardDistanceEstimator
     hint = "Choose the correct distance estimator for your main fractal \
             formula. Note that you can ignore the 'Mode' parameter in the \
             distance estimator formula but you need to set the 'Julia ?', \
             'Power' and any other parameters correctly."
     visible = @v_mmffieldestimator>=2 && @smooth!=1 && @useplugin \
               && ((@mode!=3 && @angles==1) || (@mode!=2 && @distances==1))
   endparam
   float param power
     caption = "Power/Degree/Exponent"
     default = 2.0
     hint = "The power/degree/exponent of your main formula. The field lines \
             algorithm will only work 'correctly' with fractal \
             formulas that have positive integer values >=2."
     visible = ((@mode!=3 && (@angles==0 || !@useplugin)) \
                || (@mode!=2 && (@distances==0 \
                    || (@distances==1 && !@useplugin)))) && @smooth!=1
   endparam
   float param bailout
     caption = "Bailout Value"
     default = 128.0
     hint = "The value you use should match the (divergent) bailout value \
             from the main fractal formula."
     visible = (@mode!=2 && @distances==0) \
               || (@v_mmffieldestimator>=2 && @smooth!=1)
   endparam
   Transform param f_transformnew
     caption = "Colouring Transform"
     default = NullTransform
     hint = "Use to position/flip/mirror/scale your image mapping."
     visible = @mode<2 && @v_mmffieldestimator>0 && @smooth!=1
   endparam
   heading
     caption = "Field Lines Settings (divergent)"
     visible = @mode!=3 && @angles==0 && @smooth!=1
   endheading
   int param skip
     caption = "Iteration Skip"
     default = 0
     min = 0
     hint = "Increasing the value extends the field line detail into areas \
             of higher iteration count."
     visible = @mode!=3 && @angles==0 && @smooth!=1
   endparam
   bool param original
     caption = "Use Old Algorithm"
     default = false
     hint = "Uses the original 'unfixed' version of the algorithm that wasn't \
             previously released. May produce more pleasing results on some \
             Julia Sets."
     visible = @mode!=3 && @angles==0 && @smooth!=1
   endparam
   float param offset
     caption = "Error Reset"
     default = 1.0
     min = 0.0
     hint = "Use in combination with 'Error Scale' to correct errors in the \
             Field Lines. Note that different areas of a Mandelbrot may \
             require different values."
     visible = @mode!=3 && @angles==0 && !@original && @smooth!=1
   endparam
   float param scale
     caption = "Error Scale"
     default = 1.0
     min = 0.0
     hint = "Use in combination with 'Error Reset' to correct errors in the \
             Field Lines. Note that different areas of a Mandelbrot may \
             require different values."
     visible = @mode!=3 && @angles==0 && !@original && @smooth!=1
   endparam
   bool param accident
     caption = "Happy Accident"
     default = false
     hint = "When enabled the algorithm for the field lines uses a 'broken' \
             version. The option is available because the broken version \
             can produce interesting effects."
     visible = @mode!=3 && @angles==0 && !@original && @smooth!=1
   endparam
   bool param accident2
     caption = "Happy Accident 2"
     default = false
     hint = "When enabled the algorithm for the field lines uses a test \
             version. The option is available because the test version \
             can produce interesting effects."
     visible = @mode!=3 && @angles==0 && @smooth!=1
   endparam
   Transfer param fltransfer
     caption = "Field Lines Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the field line density."
     visible = @mode<3 && @angles==0 && @smooth!=1
   endparam
   heading
     caption = "Dist. Est. Angles Settings (divergent)"
     visible = @mode<3 && @angles==1 && @smooth!=1
   endheading
   Transfer param datransfer
     caption = "Dist. Est. Angles Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the distance estimator angles density."
     visible = @mode<3 && @angles==1 && @smooth!=1
   endparam
   heading
     caption = "Smooth Iteration Settings (divergent)"
     visible = @mode!=2 && @distances==0 && @smooth!=1
   endheading
   bool param autopower
     caption = "Auto-Power"
     default = true
     hint = "When enabled the degree of divergence of the fractal is \
             calculated rather than using the 'Power/Degree/Exponent' value."
     visible = @mode!=2 && @distances==0 && @smooth!=1
   endparam
   Transfer param ittransfer
     caption = "Smooth Iteration Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the iteration density."
     visible = @mode!=2 && @mode!=4 && @distances==0 && @smooth!=1
   endparam
   heading
     caption = "Distance Estimator Settings (divergent)"
     visible = @mode!=2 && @mode!=4 && @distances==1 && @smooth!=1
   endheading
   Transfer param detransfer
     caption = "Distance Estimator Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the distance estimator density."
     visible = @mode!=2 && @mode!=4 && @distances==1 && @smooth!=1
   endparam
   heading
     caption = "Exponential Smoothing Settings (divergent)"
     visible = @mode!=2 && @mode!=4 && @distances==2 && @smooth!=1
   endheading
   bool param fixexp
     caption = "Improved Exponential"
     default = false
     hint = "When enabled the final z value is used in calculating the \
             exponential smoothing. This will noticeably improve the results \
             at less extreme bailout values."
     visible = @mode!=2 && @mode!=4 && @distances==2 && @smooth!=1
   endparam
   Transfer param extransfer
     caption = "Exponential Smoothing Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the exponential smoothing density."
     visible = @mode!=2 && @mode!=4 && @distances==2 && @smooth!=1
   endparam
   heading
     caption = "Image Settings (divergent)"
     visible = @mode==0 && @smooth!=1
   endheading
   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 = @mode==0 && @smooth!=1
   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 = @mode==0 && @mapmethod=="Image All" && @smooth!=1
   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 = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @smooth!=1
   endparam
   float param adjred
     caption = "Red Value"
     default = 1.0
     hint = "The red part of the adjust colour (0 to 1)."
     visible = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @adjusttype==0 && @smooth!=1
   endparam
   float param adjgreen
     caption = "Green Value"
     default = 1.0
     hint = "The green part of the adjust colour (0 to 1)."
     visible = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @adjusttype==0 && @smooth!=1
   endparam
   float param adjblue
     caption = "Blue Value"
     default = 1.0
     hint = "The blue part of the adjust colour (0 to 1)."
     visible = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @adjusttype==0 && @smooth!=1
   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 = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @adjusttype==1 && @smooth!=1
   endparam
   ColorMerge param f_adjust
     caption = "Adjustment Layer Merge"
     default = MMF_ExtendedColorMerge
     visible = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @smooth!=1
   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 = @mode==0 && @mapmethod=="Image All" && @adjustlayer \
               && @smooth!=1
   endparam
   Transform param f_transform
     caption = "Image Transform"
     default = NullTransform
     hint = "Use to position/flip/mirror/scale your image mapping."
     visible = @mode==0 && @v_mmffieldestimator==0 && @smooth!=1
   endparam
   ImageWrapper param f_image
     caption = "Image Object"
     default = MMF_ImageImport
     hint = "The image to use."
     visible = @mode==0 && @smooth!=1
   endparam
   heading
     caption = "Texture Settings (divergent)"
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endheading
   bool param polartex
     caption = "Go Polar"
     default = false
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   Transfer param f_transferx
     caption = "Angle Transfer"
     default = NullTransfer
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   Transfer param f_transfery
     caption = "Distance/Potential Transfer"
     default = NullTransfer
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   Transform param f_textransform
     caption = "Texture Transform"
     default = NullTransform
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   Transfer param f_texturescale
     caption = "Texture Amplitude"
     default = NullTransfer
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   TrapShape param f_texture
     caption = "Texture"
     default = MMF_TrapShapefBm
     visible = (@mode==4 || (@mode<2 && @usetexture)) && @smooth!=1
   endparam
   GradientLayer param f_merge
     caption = "Texture Merge"
     default = MMF_GradientLayer
     hint = "Only used if the main colouring is being used in direct colouring \
             mode and using 'Image Mapping'. Use to merge the texture value \
             with the image. Note that the gradient you choose controls the \
             colour of the texture/iteration layer which is normally treated \
             as the top layer."
     visible = @mode<2 && @usetexture && @smooth!=1
     expanded = false
   endparam
   heading
     caption = "Convergent Control"
     visible = @smooth>0
   endheading
   int param modec
     caption = "Colouring Mode"
     enum = "Image Mapping" "Mix" "Angles" "Distances" "Texture Only"
     default = 0
     visible = @smooth>0
   endparam
   bool param usetexturec
     caption = "Add Texture"
     default = false
     hint = "Adds texturing when enabled. Normally this will be mixed in as \
             a gradient index but if the colouring is in direct mode and \
             you're using 'Image Mapping' then the texturing is applied as \
             a colour merge layer."
     visible = @modec<2 && @smooth>0
   endparam
   bool param polarc
     caption = "Go Polar"
     default = false
     hint = "When enabled the angle values are used as angles and the \
             distance values as a magnitude, when disabled the angle values \
             and distance values are taken as being on perpendicular axes."
     visible = @modec<2 && @smooth>0
   endparam
   int param mixc
     caption = "Mix Method"
     enum = "Sum" "Product" "Absolute Difference" "Quotient 1" "Quotient 2"
     default = 0
     visible = @modec==1 && @smooth>0
   endparam
   int param anglesc
     caption = "Angle Method"
     enum = "Field Lines" "Dist.Est. Angles"
     default = 0
     visible = @modec!=3 && @smooth>0
   endparam
   int param distancesc
     caption = "Distance/Potential"
     enum = "Smooth Iteration" "Distance Estimator" "Exponential Smoothing"
     default = 0
     visible = @modec!=2 && @smooth>0
   endparam
   DistanceEstimatorBase param distestc
     caption = "Distance Estimator"
     default = MMF_NewtonDistanceEstimator
     hint = "Choose the correct distance estimator for your main fractal \
             formula. Note that you can ignore the 'Mode' parameter in the \
             distance estimator formula but you need to set any 'Julia ?', \
             'Power' and other parameters correctly."
     visible = @smooth>0 \
               && ((@modec!=3 && @anglesc==1) || (@modec!=2 && @distancesc==1))
   endparam
   float param powerc
     caption = "Degree of Convergence"
     default = 2.0
     hint = "The degree of convergence of your main formula. The field lines \
             algorithm will only work 'correctly' with fractal \
             formulas that have positive integer values >=2. For many \
             convergent main formulas the value should be 2."
     visible = (@modec!=3 && @anglesc==0) || (@modec!=2 && @distancesc==0) \
               && @smooth>0
   endparam
   float param smallbail
     caption = "Small Bailout Value"
     default = 1e-5
     hint = "The value you use should match he (convergent) bailout value \
             from the main fractal formula."
     visible = @smooth>0
   endparam
   Transform param f_transformnewc
     caption = "Colouring Transform"
     default = NullTransform
     hint = "Use to position/flip/mirror/scale your image mapping."
     visible = @modec<2 && @smooth>0
   endparam
   heading
     caption = "Field Lines Settings (convergent)"
     visible = @modec!=3 && @anglesc==0 && @smooth>0
   endheading
   int param skipc
     caption = "Iteration Skip"
     default = 0
     min = 0
     hint = "Increasing the value extends the field line detail into areas \
             of higher iteration count."
     visible = @modec!=3 && @anglesc==0 && @smooth>0
   endparam
   bool param originalc
     caption = "Use Old Algorithm"
     default = false
     hint = "Uses the original 'unfixed' version of the algorithm that wasn't \
             previously released. May produce more pleasing results on some \
             Julia Sets."
     visible = @modec!=3 && @anglesc==0 && @smooth>0
   endparam
   float param fixconv
     caption = "Angle Fix"
     default = 0.0
     visible = @modec!=3 && @anglesc==0 && @smooth>0
   endparam
   float param offsetc
     caption = "Error Reset"
     default = 1.0
     min = 0.0
     hint = "Use in combination with 'Error Scale' to correct errors in the \
             Field Lines. Note that different areas of a Mandelbrot may \
             require different values."
     visible = @modec!=3 && @anglesc==0 && !@originalc && @smooth>0
   endparam
   float param scalec
     caption = "Error Scale"
     default = 1.0
     min = 0.0
     hint = "Use in combination with 'Error Reset' to correct errors in the \
             Field Lines. Note that different areas of a Mandelbrot may \
             require different values."
     visible = @modec!=3 && @anglesc==0 && !@originalc && @smooth>0
   endparam
   bool param accidentc
     caption = "Happy Accident"
     default = false
     hint = "When enabled the algorithm for the field lines uses a 'broken' \
             version. The option is available because the broken version \
             can produce interesting effects."
     visible = @modec!=3 && @anglesc==0 && !@originalc && @smooth>0
   endparam
   bool param accident2c
     caption = "Happy Accident 2"
     default = false
     hint = "When enabled the algorithm for the field lines uses a test \
             version. The option is available because the test version \
             can produce interesting effects."
     visible = @modec!=3 && @anglesc==0 && @smooth>0
   endparam
   Transfer param fltransferc
     caption = "Field Lines Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the field line density."
     visible = @modec<3 && @anglesc==0 && @smooth>0
   endparam
   heading
     caption = "Dist. Est. Angles Settings (convergent)"
     visible = @modec<3 && @anglesc==1 && @smooth>0
   endheading
   Transfer param datransferc
     caption = "Dist. Est. Angles Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the distance estimator angles density."
     visible = @modec<3 && @anglesc==1 && @smooth>0
   endparam
   heading
     caption = "Smooth Iteration Settings (convergent)"
     visible = @modec!=2 && @distancesc==0 && @smooth>0
   endheading
   bool param autopowerc
     caption = "Auto-Power"
     default = true
     hint = "When enabled the degree of divergence of the fractal is \
             calculated rather than using the 'Power/Degree/Exponent' value."
     visible = @modec!=2 && @distancesc==0 && @smooth>0
   endparam
   bool param fixedconv
     caption = "Fixed Convergence"
     default = false
     hint = "Enable when the main formula is testing for bailout using a \
             fixed convergence value rather than the change in z i.e. when \
             the main formula tests using |z-value| rather than |z-zold|."
     visible = @modec!=2 && @distancesc==0 && @smooth>0
   endparam
   complex param convval
     caption = "Convergence Value"
     default = (1,0)
     hint = "Set this to the value that the main formula is using for testing \
             for convergence i.e. value in |z-value|."
     visible = @modec!=2 && @distancesc==0 && @smooth>0 && @fixedconv
   endparam
   Transfer param ittransferc
     caption = "Smooth Iteration Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the iteration density."
     visible = @modec!=2 && @modec!=4 && @distancesc==0 && @smooth>0
   endparam
   heading
     caption = "Distance Estimator Settings (convergent)"
     visible = @modec!=2 && @modec!=4 && @distancesc==1 && @smooth>0
   endheading
   Transfer param detransferc
     caption = "Distance Estimator Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the distance estimator density."
     visible = @modec!=2 && @modec!=4 && @distancesc==1 && @smooth>0
   endparam
   heading
     caption = "Exponential Smoothing Settings (convergent)"
     visible = @modec!=2 && @modec!=4 && @distancesc==2 && @smooth>0
   endheading
   bool param fixexpc
     caption = "Improved Exponential"
     default = false
     hint = "When enabled the final z value is used in calculating the \
             exponential smoothing. This will noticeably improve the results \
             at less extreme bailout values."
     visible = @modec!=2 && @modec!=4 && @distancesc==2 && @smooth>0
   endparam
   Transfer param extransferc
     caption = "Exponential Smoothing Transfer"
     default = NullTransfer
     hint = "Use to scale/adjust the exponential smoothing density."
     visible = @modec!=2 && @modec!=4 && @distancesc==2 && @smooth>0
   endparam
   heading
     caption = "Image Settings (convergent)"
     visible = @modec==0 && @smooth>0
   endheading
   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 = @modec==0 && @smooth>0
   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 = @modec==0 && @mapmethodc=="Image All" && @smooth>0
   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 = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @smooth>0
   endparam
   float param adjredc
     caption = "Red Value"
     default = 1.0
     hint = "The red part of the adjust colour (0 to 1)."
     visible = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @adjusttypec==0 && @smooth>0
   endparam
   float param adjgreenc
     caption = "Green Value"
     default = 1.0
     hint = "The green part of the adjust colour (0 to 1)."
     visible = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @adjusttypec==0 && @smooth>0
   endparam
   float param adjbluec
     caption = "Blue Value"
     default = 1.0
     hint = "The blue part of the adjust colour (0 to 1)."
     visible = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @adjusttypec==0 && @smooth>0
   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 = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @adjusttypec==1 && @smooth>0
   endparam
   ColorMerge param f_adjustc
     caption = "Adjustment Layer Merge"
     default = MMF_ExtendedColorMerge
     visible = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @smooth>0
   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 = @modec==0 && @mapmethodc=="Image All" && @adjustlayerc \
               && @smooth>0
   endparam
   ImageWrapper param f_imagec
     caption = "Image Object"
     default = MMF_ImageImport
     hint = "The image to use."
     visible = @modec==0 && @smooth>0
   endparam
   heading
     caption = "Texture Settings (convergent)"
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endheading
   bool param polartexc
     caption = "Go Polar"
     default = false
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   Transfer param f_transferxc
     caption = "Angle Transfer"
     default = NullTransfer
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   Transfer param f_transferyc
     caption = "Distance/Potential Transfer"
     default = NullTransfer
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   Transform param f_textransformc
     caption = "Texture Transform"
     default = NullTransform
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   Transfer param f_texturescalec
     caption = "Texture Amplitude"
     default = NullTransfer
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   TrapShape param f_texturec
     caption = "Texture"
     default = MMF_TrapShapefBm
     visible = (@modec==4 || (@modec<2 && @usetexturec)) && @smooth>0
   endparam
   GradientLayer param f_mergec
     caption = "Texture Merge"
     default = MMF_GradientLayer
     hint = "Only used if the main colouring is being used in direct colouring \
             mode and using 'Image Mapping'. Use to merge the texture value \
             with the image. Note that the gradient you choose controls the \
             colour of the texture/iteration layer which is normally treated \
             as the top layer."
     visible = @modec<2 && @usetexturec && @smooth>0
     expanded = false
   endparam
 }
 


Constructor Summary
MMF_FieldEstimator()
           
MMF_FieldEstimator(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

MMF_FieldEstimator

public MMF_FieldEstimator(Generic pparent)

MMF_FieldEstimator

public MMF_FieldEstimator()
Method Detail

Init

public void Init(complex pz,
                 complex ppixel)
Description copied from class: GradientColoring
Set up for a sequence of values

This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).

Overrides:
Init in class GradientColoring
Parameters:
pz - first value for the sequence; for a normal coloring formula, this will be #z
ppixel - seed value for the sequence; for a normal coloring formula, this will be #pixel

Iterate

public void Iterate(complex pz)
Description copied from class: GradientColoring
Process the next value in the sequence

As 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.

Overrides:
Iterate in class GradientColoring
Parameters:
pz - next value in the sequence; corresponds to #z in a coloring formula

ResultIndex

public float ResultIndex(complex pz)
Description copied from class: GradientColoring
Produce a resulting color index after a sequence is finished

This 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.

Overrides:
ResultIndex in class GradientColoring
Returns:
the gradient index (corresponding to #index in a coloring formula)

Result

public color Result(complex pz)
Description copied from class: GradientColoring
Produce a resulting color index after a sequence is finished

This 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.

Overrides:
Result in class GradientColoring
Returns:
the color (corresponding to #color in a coloring formula)