common
Class ColorTrap

Object
  extended by common:Generic
      extended by common:ColorTrap
Direct Known Subclasses:
ColorTrapChecker, ColorTrapFormulaDirectColoring, ColorTrapGnarl, ColorTrapImage, ColorTrapImageTiles, ColorTrapNoColor, ColorTrapShapeBlock, ColorTrapWrapper, DMJ_BlurTrapWrapper, Monnier_SFBM_II_TextureC, REB_ColorTrapModPerlin, REB_ColorTrapWorley, REB_ConvolutionWrapper, Standard_ColorTrapWrapper

class 
Generic:ColorTrap

This is a generic color trap formula. It takes a complex point and returns a color.


Ultra Fractal Source

Toggle UF Source Code Display

 class ColorTrap(Generic) {
   ; This is a generic color trap formula. It takes a complex
   ; point and returns a color.
   
 public:
   ; constructor
   func ColorTrap(Generic pparent)
     Generic.Generic(pparent)
   endfunc
   
   ; call this before each sequence of values to be trapped
   func Init(complex pz)
     m_Iterations = 0
   endfunc
   
   ; call this to produce a result
   ; you should always override this function
   color func Iterate(complex pz)
     m_Iterations = m_Iterations + 1
     return gradient(cabs(pz))
   endfunc
 
   ; Update internal counters without transforming a value
   ;
   func IterateSilent()
     ; Perform the same iteration-count update as Iterate(), but
     ; don't return a value. See the comments in Iterate() for
     ; more information on when to call this.
     m_Iterations = m_Iterations + 1
   endfunc
 
 protected:
   int m_Iterations
 
 default:
   int param v_colortrap
     caption = "Version (ColorTrap)"
     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_colortrap < 100
   endparam
 }
 


Constructor Summary
ColorTrap()
           
ColorTrap(Generic pparent)
          constructor
 
Method Summary
 void Init(complex pz)
          call this before each sequence of values to be trapped
 color Iterate(complex pz)
          call this to produce a result you should always override this function
 void IterateSilent()
          Update internal counters without transforming a value
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

ColorTrap

public ColorTrap(Generic pparent)
constructor


ColorTrap

public ColorTrap()
Method Detail

Init

public void Init(complex pz)
call this before each sequence of values to be trapped


Iterate

public color Iterate(complex pz)
call this to produce a result you should always override this function


IterateSilent

public void IterateSilent()
Update internal counters without transforming a value