common
Class ImageWrapper

Object
  extended by common:Generic
      extended by common:ImageWrapper
Direct Known Subclasses:
DMJ_ImageColorize, ImageImport, MMF_ImageImport

class 
Generic:ImageWrapper

ImageWrapper base class.

This class provides access to UF's native Image object in an extensible class. If you use an Image object directly, you allow no opportunity for other Image-like classes to be used with your code. If instead you use an ImageWrapper object, you will get the Image features in the default case and still allow Image-like classes to be used with your code.


Ultra Fractal Source

Toggle UF Source Code Display

 class ImageWrapper(Generic) {
   ; ImageWrapper base class.
   ; <p>
   ; This class provides access to UF's native Image object
   ; in an extensible class. If you use an Image object
   ; directly, you allow no opportunity for other Image-like
   ; classes to be used with your code. If instead you use
   ; an ImageWrapper object, you will get the Image features
   ; in the default case and still allow Image-like classes
   ; to be used with your code.
 
 public:
   ; constructor
   func ImageWrapper(Generic pparent)
     Generic.Generic(pparent)
   endfunc
   
   ; member functions
   ; these are pass-throughs to the Image class
   color func getColor(complex pz)
     return rgba(0,0,0,0)
   endfunc
   
   color func getPixel(int px, int py)
     return rgba(0,0,0,0)
   endfunc
 
   bool func getEmpty()
     return true
   endfunc
   
   int func getWidth()
     return 0
   endfunc
 
   int func getHeight()
     return 0
   endfunc
 
   ; this is not a pass-through; it aspect-corrects a pixel to the
   ; correct range. UF's default Image object maps the entire image
   ; into the (-1,-1) .. (1,1) range regardless of size; this will
   ; shrink the real or imaginary component of pz as appropriate to
   ; restore the original image proportions.
   ; Note: UF's default Image coloring algorithm does this as well.
   complex func NormalizePixel(complex pz)
     if (this.getEmpty())
       return pz
     elseif (this.getWidth() > this.getHeight())
       return real(pz) + flip(imag(pz) * this.getWidth() / this.getHeight())
     else
       return real(pz) * this.getHeight() / this.getWidth() + flip(imag(pz))
     endif
   endfunc
   
 protected:
 
 default:
   int param v_imagewrapper
     caption = "Version (ImageWrapper)"
     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_imagewrapper < 100
   endparam
 }
 


Constructor Summary
ImageWrapper()
           
ImageWrapper(Generic pparent)
          constructor
 
Method Summary
 color getColor(complex pz)
          member functions these are pass-throughs to the Image class
 boolean getEmpty()
           
 int getHeight()
           
 color getPixel(int px, int py)
           
 int getWidth()
           
 complex NormalizePixel(complex pz)
          this is not a pass-through; it aspect-corrects a pixel to the correct range.
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

ImageWrapper

public ImageWrapper(Generic pparent)
constructor


ImageWrapper

public ImageWrapper()
Method Detail

getColor

public color getColor(complex pz)
member functions these are pass-throughs to the Image class


getPixel

public color getPixel(int px,
                      int py)

getEmpty

public boolean getEmpty()

getWidth

public int getWidth()

getHeight

public int getHeight()

NormalizePixel

public complex NormalizePixel(complex pz)
this is not a pass-through; it aspect-corrects a pixel to the correct range. UF's default Image object maps the entire image into the (-1,-1) .. (1,1) range regardless of size; this will shrink the real or imaginary component of pz as appropriate to restore the original image proportions. Note: UF's default Image coloring algorithm does this as well.