reb
Class ImageTrapModeSignAverage

Object
  extended by common:Generic
      extended by reb:ImageTrapMode
          extended by reb:ImageTrapModeWithThreshold
              extended by reb:ImageTrapModeSignAverage

class 
ImageTrapModeWithThreshold:ImageTrapModeSignAverage

trap mode average variant based upon a class of Damien Jones


Ultra Fractal Source

Toggle UF Source Code Display

 class ImageTrapModeSignAverage(ImageTrapModeWithThreshold) {
 ; trap mode average variant based upon a class of Damien Jones
 public:
   import "common.ulb"
 
   ; constructor
   func ImageTrapModeSignAverage(Generic pparent)
     ImageTrapModewithThreshold.ImageTrapModewithThreshold(pparent)
   endfunc
   
   ; initialize the object
   func Init(complex pz)
     ImageTrapModewithThreshold.Init(pz)
     m_Solid = true
     m_PreviousDistance = 0
   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_PreviousDistance && m_a >= m_AThreshold)
       m_Distances[0] = m_Distances[0] + 1
       m_Textures[0] = m_Textures[0] + ptexture
       m_UntransformedPoints[0] = m_UntransformedPoints[0] + pz
       m_TransformedPoints[0] = m_TransformedPoints[0] + pzt
       m_IterationPoints[0] = m_IterationPoints[0] + 1
       m_Solid = false
       m_ImagePoints[0] = pcolor
       edgefade(pdistance)
     else
       m_IterationPoints[0] = m_IterationPoints[0] - 1
     endif
     m_PreviousDistance = pdistance
   endfunc
 
   func Result()
     float ii = 1.0 / m_Iterations
     m_Distances[0] = m_Distances[0] * ii
     m_Textures[0] = m_Textures[0] * ii
     m_UntransformedPoints[0] = m_UntransformedPoints[0] * ii
     m_TransformedPoints[0] = m_TransformedPoints[0] * ii
   endfunc
   
 protected:
   float m_PreviousDistance
   
 default:
   title = "Sign Average"
 
   int param v_trapmodesignaverage
     caption = "Version (TrapMode Sign Average)"
     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_trapmodesignaverage < 100
   endparam
 }
 


Constructor Summary
ImageTrapModeSignAverage()
           
ImageTrapModeSignAverage(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 this to compute final results
 
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

ImageTrapModeSignAverage

public ImageTrapModeSignAverage(Generic pparent)
constructor


ImageTrapModeSignAverage

public ImageTrapModeSignAverage()
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()
Description copied from class: ImageTrapMode
call this to compute final results

Overrides:
Result in class ImageTrapMode