reb
Class ImageTrapModeSecondClosest

Object
  extended by common:Generic
      extended by reb:ImageTrapMode
          extended by reb:ImageTrapModeWithThreshold
              extended by reb:ImageTrapModeSecondClosest
Direct Known Subclasses:
ImageTrapModeTwoClosest

class 
ImageTrapModeWithThreshold:ImageTrapModeSecondClosest

traps the second closest point


Ultra Fractal Source

Toggle UF Source Code Display

 class ImageTrapModeSecondClosest(ImageTrapModeWithThreshold) {
 ; traps the second closest point
 public:
   import "common.ulb"
 
   ; constructor
   func ImageTrapModeSecondClosest(Generic pparent)
     ImageTrapModeWithThreshold.IMageTrapModeWithThreshold(pparent)
   endfunc
 
   ; initialize the object
   func Init(complex pz)
     ImageTrapModeWithThreshold.Init(pz)
 
     m_Solid = true
     int j = 0
     while (j < 4)
       m_Distances[j] = 1e20
       j = j + 1
     endwhile
   endfunc
 
   ; call for each iterated point
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture, color pcolor)
     ImageTrapModeWithThreshold.Iterate(pz, pzt, pdistance,ptexture,pcolor)
     m_a = alpha(pcolor)
     if pdistance < m_Threshold && m_a >= m_AThreshold
       m_solid = false
     endif
     if (pdistance < m_Distances[0])
       m_Distances[1] = m_Distances[0]
       m_Textures[1] = m_Textures[0]
       m_UntransformedPoints[1] = m_UntransformedPoints[0]
       m_TransformedPoints[1] = m_TransformedPoints[0]
       m_IterationPoints[1] = m_IterationPoints[0]
       m_ImagePoints[1] = m_ImagePoints[0]
 
       m_Distances[0] = pdistance
       m_Textures[0] = ptexture
       m_UntransformedPoints[0] = pz
       m_TransformedPoints[0] = pzt
       m_IterationPoints[0] = m_Iterations
       m_ImagePoints[0] = pcolor
       edgefade(pdistance)
     elseif (pdistance < m_Distances[1])
       m_Distances[1] = pdistance
       m_UntransformedPoints[1] = pz
       m_Textures[1] = ptexture
       m_TransformedPoints[1] = pzt
       m_IterationPoints[1] = m_Iterations
       m_ImagePoints[1] = pcolor
       edgefade(pdistance)
     endif
   endfunc
 
   ; call in the final section of the coloring formula/class
   func Result()
     m_Distances[0] = abs(m_Distances[0] - m_Distances[1])
     m_UntransformedPoints[0] = m_UntransformedPoints[0] - m_UntransformedPoints[1]
     m_Textures[0] = m_Textures[0] - m_Textures[1]
     m_TransformedPoints[0] = m_TransformedPoints[0] - m_TransformedPoints[1]
     m_IterationPoints[0] = abs(m_IterationPoints[0] - m_IterationPoints[1])
     m_ImagePoints[0] = (m_ImagePoints[1]+m_ImagePoints[0])/2
   endfunc
 
 default:
   title = "Second Closest"
   int param v_secondclosest
     caption = "Version (Second Closest)"
     default = 100
     hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
     visible = @v_secondclosest < 100
   endparam
 }
 


Constructor Summary
ImageTrapModeSecondClosest()
           
ImageTrapModeSecondClosest(Generic pparent)
          constructor
 
Method Summary
 void Init(complex pz)
          initialize the object
 void Iterate(complex pz, complex pzt, float pdistance, float ptexture, color pcolor)
          call for each iterated point
 void Result()
          call in the final section of the coloring formula/class
 
Methods inherited from class reb:ImageTrapModeWithThreshold
EdgeFade, GetAThreshold, GetThreshold, SetAThreshold, SetThreshold, UsesAThreshold, UsesThreshold
 
Methods inherited from class reb:ImageTrapMode
GetColor, GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

ImageTrapModeSecondClosest

public ImageTrapModeSecondClosest(Generic pparent)
constructor


ImageTrapModeSecondClosest

public ImageTrapModeSecondClosest()
Method Detail

Init

public void Init(complex pz)
initialize the object

Overrides:
Init in class ImageTrapMode

Iterate

public void Iterate(complex pz,
                    complex pzt,
                    float pdistance,
                    float ptexture,
                    color pcolor)
call for each iterated point

Overrides:
Iterate in class ImageTrapMode

Result

public void Result()
call in the final section of the coloring formula/class

Overrides:
Result in class ImageTrapMode