dmj5
Class DMJ_ScreenRelative

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UtilityTransform
              extended by dmj5:DMJ_ScreenRelative

class 
UtilityTransform:DMJ_ScreenRelative



Ultra Fractal Source

Toggle UF Source Code Display

 class DMJ_ScreenRelative(common.ulb:UtilityTransform) {
 public:
   import "common.ulb"
 
   func DMJ_ScreenRelative(Generic pparent)
     UtilityTransform.UtilityTransform(pparent)
     
     if (@p_screenrelative)
       m_Aspect = #width/#height
     else
       m_Aspect = 1.0
     endif
   endfunc
   
   func Init(complex pz)
   endfunc
   
   complex func Iterate(complex pz)
     if (@p_screenrelative)
       return real(#screenpixel)/#width + flip(1.0-imag(#screenpixel)/#height)
     else
       return pz
     endif
   endfunc
 
   ; provide information about transformation style
   ; this is required by the Handles helper class which
   ; has to be able to reverse the transformation
   int func GetScreenRelative()
     if (@p_screenrelative)
       return 1
     else
       return 0
     endif
   endfunc
 
   float m_Aspect
 
 default:
   title = "Screen Relative"
   
   int param v_dmj_screenrelative
     caption = "Version (DMJ_ScreenRelative)"
     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_dmj_screenrelative < 100
   endparam
 
   bool param @p_screenrelative
     caption = "Screen Relative Coordinates"
     default = false
     hint = "If set, coordinates will be fixed with (0,0) in the lower left corner and (1,1) in the upper right corner, regardless of how you zoom your image."
   endparam
 ;  bool param @p_imagestyle ; stretches screen-relative range to (-1,-1)
 }
 


Constructor Summary
DMJ_ScreenRelative()
           
DMJ_ScreenRelative(Generic pparent)
           
 
Method Summary
 int GetScreenRelative()
          provide information about transformation style this is required by the Handles helper class which has to be able to reverse the transformation
 void Init(complex pz)
          Set up for a sequence of values
 complex Iterate(complex pz)
          Transform a single point within a sequence
 
Methods inherited from class common:Transform
IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

DMJ_ScreenRelative

public DMJ_ScreenRelative(Generic pparent)

DMJ_ScreenRelative

public DMJ_ScreenRelative()
Method Detail

Init

public void Init(complex pz)
Description copied from class: Transform
Set up for a sequence of values

This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit). It will be called even if only one value is being transformed (e.g. a normal transformation formula). Use this to perform any setup that is exactly the same for each value in the sequence being transformed.

Overrides:
Init in class Transform
Parameters:
pz - the value representing the sequence; for a normal transformation formula use, this will be #pixel. In some cases this may differ from the first value passed to Iterate() if the calling code applies some other transformations.

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value

GetScreenRelative

public int GetScreenRelative()
provide information about transformation style this is required by the Handles helper class which has to be able to reverse the transformation