common
Class ColorTrapWrapper

Object
  extended by common:Generic
      extended by common:ColorTrap
          extended by common:ColorTrapWrapper

class 
ColorTrap:ColorTrapWrapper

This wrapper allows you to use any regular trap shape and trap color mode as a color trap shape.


Ultra Fractal Source

Toggle UF Source Code Display

 class ColorTrapWrapper(ColorTrap) {
   ; This wrapper allows you to use any regular trap shape and
   ; trap color mode as a color trap shape.
   
 public:
   func ColorTrapWrapper(Generic pparent)
     ColorTrap.ColorTrap(pparent)
     
     m_TrapShape = new @f_trapshape(this)
     m_TrapMode = new TrapModeFirst(this)
     m_TrapColoring = new @f_trapcoloring(this)
     m_Gradient = new @f_gradient(this)
     
     m_TrapMode.SetThreshold(@p_threshold)
   endfunc
 
   func Init(complex pz)
     ColorTrap.Init(pz)
 
     m_TrapShape.Init(pz)
   endfunc
 
   color func Iterate(complex pz)
     float distance = m_TrapShape.Iterate(pz)
     complex zt = m_TrapShape.GetTransformedPoint()
     float texture = m_TrapShape.GetTextureValue()
 
     m_TrapMode.Init(pz)
     m_TrapMode.Iterate(pz, zt, distance, texture)
     if (m_TrapMode.IsSolid())
       return rgba(0,0,0,0)  ; outside trap shape; return fully transparent
     else
       float g = m_TrapColoring.Result(m_TrapMode)  ; else return gradient from coloring mode
       return m_Gradient.getColorChannel(g, m_TrapShape.GetColorChannel())
     endif
   endfunc
 
 protected:
   TrapShape m_TrapShape
   TrapModeWithThreshold m_TrapMode
   TrapColoring m_TrapColoring
   GradientWrapper m_Gradient
 
 default:
   title = "Trap Shape Wrapper"
   
   int param v_colortrapwrapper
     caption = "Version (ColorTrapWrapper)"
     default = 101
     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_colortrapwrapper < 100
   endparam
 
   TrapShape param f_trapshape
     caption = "Trap Shape"
     default = TrapShapePoint
   endparam
   float param p_threshold
     caption = "Trap Threshold"
     default = 0.25
     hint = "This is the overall size or thickness of the trap area."
   endparam
   TrapColoring param f_trapcoloring
     caption = "Trap Color Mode"
     default = TrapColoringDistance
   endparam
   GradientWrapper param f_gradient
     caption = "Gradient"
     default = DefaultGradient
   endparam
 }
 


Constructor Summary
ColorTrapWrapper()
           
ColorTrapWrapper(Generic pparent)
           
 
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
 
Methods inherited from class common:ColorTrap
IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

ColorTrapWrapper

public ColorTrapWrapper(Generic pparent)

ColorTrapWrapper

public ColorTrapWrapper()
Method Detail

Init

public void Init(complex pz)
Description copied from class: ColorTrap
call this before each sequence of values to be trapped

Overrides:
Init in class ColorTrap

Iterate

public color Iterate(complex pz)
Description copied from class: ColorTrap
call this to produce a result you should always override this function

Overrides:
Iterate in class ColorTrap