reb
Class ImageTrapModeWithThreshold

Object
  extended by common:Generic
      extended by reb:ImageTrapMode
          extended by reb:ImageTrapModeWithThreshold
Direct Known Subclasses:
ImageTrapModeAlternatingAverage, ImageTrapModeAlternatingAverage2, ImageTrapModeChangeAverage, ImageTrapModeClosest, ImageTrapModeExponentialAverage, ImageTrapModeFarthest, ImageTrapModeFirst, ImageTrapModeInvertedSum, ImageTrapModeLast, ImageTrapModeProduct, ImageTrapModeSecondClosest, ImageTrapModeSecondFarthest, ImageTrapModeSignAverage, ImageTrapModeSmallest, ImageTrapModeStacked, ImageTrapModeSum, ImageTrapTrapOnly

class 
ImageTrapMode:ImageTrapModeWithThreshold

Variant of ImageTrapMode that is thresholdable

Manages both trap thresholds and alpha image thresholds.


Ultra Fractal Source

Toggle UF Source Code Display

 class ImageTrapModeWithThreshold(ImageTrapMode) {
 ; Variant of ImageTrapMode that is thresholdable <br>
 ; <p>
 ; Manages both trap thresholds and alpha image thresholds.
 
 public:
   import "common.ulb"
   
   ; constructor
   func ImageTrapModeWithThreshold(Generic pparent)
     ImageTrapMode.ImageTrapMode(pparent)
     m_Threshold = 1.0
     m_aThreshold = 1.0
   endfunc
 
   ; provides alpha fading at the edges of an image
   func EdgeFade(float pdistance)
     float m_alph = 0
     if @edgefade
       if alpha(m_ImagePoints[0]) !=0
           m_alph =  abs(m_Threshold-pdistance)/m_Threshold
       else
         m_alph = alpha(m_ImagePoints[0])
       endif
       m_ImagePoints[0] = rgba(red(m_ImagePoints[0]),green(m_ImagePoints[0]), \
                            blue(m_ImagePoints[0]),m_alph^(1/@fadepwr))
     endif
   endfunc
 
   ; get the trap threshold
   float func GetThreshold()
     return m_Threshold
   endfunc
 
   ; set the trap threshold
   func SetThreshold(float pthreshold)
     m_Threshold = pthreshold
   endfunc
 
   ; determines whether a threshold is being used
   bool func UsesThreshold()
     return true
   endfunc
 
   ; get the alpha threshold
   float func GetAThreshold()
     return m_AThreshold
   endfunc
 
   ; set the alpha threshold
   func SetAThreshold(float pathreshold)
     m_AThreshold = pathreshold
   endfunc
 
   ; determines whether an alpha threshold is being used.
   bool func UsesAThreshold()
     return true
   endfunc
 
 protected:
   float m_Threshold
   float m_AThreshold
   float m_a
 
 default:
   int param v_imagetrapmodethreshold
     caption = "Version (Image Trap Mode with Threshold)"
     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_imagetrapmodethreshold < 101
   endparam
 
   bool param edgefade
     caption = "Image edge fade"
     default = false
   endparam
   float param fadepwr
     caption = "Fade power"
     default = 1.0
     visible = @edgefade
   endparam
 }
 


Constructor Summary
ImageTrapModeWithThreshold()
           
ImageTrapModeWithThreshold(Generic pparent)
          constructor
 
Method Summary
 void EdgeFade(float pdistance)
          provides alpha fading at the edges of an image
 float GetAThreshold()
          get the alpha threshold
 float GetThreshold()
          get the trap threshold
 void SetAThreshold(float pathreshold)
          set the alpha threshold
 void SetThreshold(float pthreshold)
          set the trap threshold
 boolean UsesAThreshold()
          determines whether an alpha threshold is being used.
 boolean UsesThreshold()
          determines whether a threshold is being used
 
Methods inherited from class reb:ImageTrapMode
GetColor, GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, Init, IsSolid, Iterate, IterateSilent, Result
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

ImageTrapModeWithThreshold

public ImageTrapModeWithThreshold(Generic pparent)
constructor


ImageTrapModeWithThreshold

public ImageTrapModeWithThreshold()
Method Detail

EdgeFade

public void EdgeFade(float pdistance)
provides alpha fading at the edges of an image


GetThreshold

public float GetThreshold()
get the trap threshold

Overrides:
GetThreshold in class ImageTrapMode

SetThreshold

public void SetThreshold(float pthreshold)
set the trap threshold

Overrides:
SetThreshold in class ImageTrapMode

UsesThreshold

public boolean UsesThreshold()
determines whether a threshold is being used

Overrides:
UsesThreshold in class ImageTrapMode

GetAThreshold

public float GetAThreshold()
get the alpha threshold

Overrides:
GetAThreshold in class ImageTrapMode

SetAThreshold

public void SetAThreshold(float pathreshold)
set the alpha threshold

Overrides:
SetAThreshold in class ImageTrapMode

UsesAThreshold

public boolean UsesAThreshold()
determines whether an alpha threshold is being used.

Overrides:
UsesAThreshold in class ImageTrapMode