dmj5
Class DMJ_FastNormalMerge

Object
  extended by common:Generic
      extended by common:ColorMerge
          extended by dmj5:DMJ_FastNormalMerge

class 
ColorMerge:DMJ_FastNormalMerge

This color blend class only does Normal merge mode, but it supports IsOpaque() for speed optimizations.


Ultra Fractal Source

Toggle UF Source Code Display

 class DMJ_FastNormalMerge(common.ulb:ColorMerge) {
   ; This color blend class only does Normal merge mode, but it supports IsOpaque() for speed optimizations.
   
 public:
   func DMJ_FastNormalMerge(Generic pparent)
     ColorMerge.ColorMerge(pparent)
   endfunc
 
   color func Merge(color pbottom, color ptop)
     return mergenormal(pbottom, ptop)
   endfunc
   
   bool func IsOpaque(color ptop)
     return (alpha(ptop) == 1.0)
   endfunc
   
 default:
   title = "Fast Normal Merge"
   
   int param v_dmj_fastnormalmerge
     caption = "Version (DMJ_FastNormalMerge)"
     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_fastnormalmerge < 100
   endparam
 }
 


Constructor Summary
DMJ_FastNormalMerge()
           
DMJ_FastNormalMerge(Generic pparent)
           
 
Method Summary
 boolean IsOpaque(color ptop)
          Opaque test function
 color Merge(color pbottom, color ptop)
          Color merging function
 
Methods inherited from class common:ColorMerge
FullMerge, Stack
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

DMJ_FastNormalMerge

public DMJ_FastNormalMerge(Generic pparent)

DMJ_FastNormalMerge

public DMJ_FastNormalMerge()
Method Detail

Merge

public color Merge(color pbottom,
                   color ptop)
Description copied from class: ColorMerge
Color merging function

Overrides:
Merge in class ColorMerge
Parameters:
pbottom - color on the bottom
ptop - color on the top
Returns:
merged color; alpha value should be from the top color or composing won't work right

IsOpaque

public boolean IsOpaque(color ptop)
Description copied from class: ColorMerge
Opaque test function

In some cases, formulas want to know if, given a particular color, merging it onto another color will leave any of the other color visible (i.e. does all the color come from the top color). This function should return true in that case. The default implementation always returns false; if you write a merging class which can identify opaque colors, you should override this function. (Note this isn't as simple as just looking at the top color's opacity; in non-Normal merge modes the bottom color still influences the output.)

Overrides:
IsOpaque in class ColorMerge
Parameters:
ptop - top color to test
Returns:
true if top color is fully opaque