mmf
Class MMF_LayerMergeBase

Object
  extended by common:Generic
      extended by mmf:MMF_LayerMergeBase
Direct Known Subclasses:
MMF_LayerMerge

class 
Generic:MMF_LayerMergeBase

PLEASE NOTE This class is obsolete/deprecated.
Instead of using this class and its derived classes you should use
the Layer class and its derived classes.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_LayerMergeBase(common.ulb:Generic) {
 ; PLEASE NOTE This class is obsolete/deprecated.<br>
 ; Instead of using this class and its derived classes you should use<br>
 ; the Layer class and its derived classes.<br>
 public:
   ; <p>
   ; @param pparent typically 'this' from the parent or zero
   func MMF_LayerMergeBase(Generic pparent)
     Generic.Generic(pparent)
   endfunc
   ; <p>
   ; @param pbottom the base color
   ; @param ptop the top color
   ; @return merged color
   color func Merge(color pbottom, color ptop)
     return ptop
   endfunc
   ; <p>
   ; @param pbottom the base color
   ; @param ptop the top color
   ; @return layer merged color
   color func FullMerge(color pbottom, color ptop)
     if @f_invertcompose
       if @f_invertmerge
         return compose(ptop, \
                        blend(pbottom,Merge(ptop,pbottom),alpha(ptop)), \
                        @f_opacity)
       else
         return compose(ptop, \
                        blend(ptop,Merge(pbottom,ptop),alpha(pbottom)), \
                        @f_opacity)
       endif
     elseif @f_invertmerge
       return compose(pbottom, \
                      blend(pbottom,Merge(ptop,pbottom),alpha(ptop)), \
                      @f_opacity)
     else
       return compose(pbottom, \
                      blend(ptop,Merge(pbottom,ptop),alpha(pbottom)), \
                      @f_opacity)
     endif
   endfunc
   ; <p>
   ; @param clr the base color
   ; @param index the gradient index for the top colour
   ; @return layer merged color
   color func GradientMerge(color clr,float index)
     return FullMerge(clr, gradient(index))
   endfunc
   ; <p>
   ; @param clr the base color
   ; @return layer merged color
   color func SolidMerge(color clr)
     return FullMerge(clr, @f_solid)
   endfunc
 
 default:
   int param v_mmflayermergebase
     caption = "Version (MMF_LayerMergeBase)"
     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_mmflayermergebase < 100
   endparam
   heading
     text = "PLEASE NOTE that this class is obsolete/deprecated. If you are \
             using the old 'MMF Multi Layer' formula and you are creating a \
             new UPR then you should switch to using 'MMF Layered' instead."
   endheading
   color param f_solid
     caption = "Solid Colour"
     default = RGBA(0,0,0,1)
   endparam
   bool param f_invertmerge
     caption = "Inverted Merge"
     default = false
     hint = "When enabled this layer is treated as the lower layer in the \
             merge instead of as the upper layer, this inverts the way the \
             RGBA values are treated."
   endparam
   bool param f_invertcompose
     caption = "Inverted Compose"
     default = false
     hint = "When enabled this layer is treated as the lower layer in the \
             compose instead of as the upper layer, so reduced opacity \
             fades to this layer's colour instead of the underlying colour."
   endparam
   float param f_opacity
     caption = "Layer Opacity"
     default = 1.0
     hint = "The normal range to use is from 0.0 to 1.0."
   endparam
 }
 


Constructor Summary
MMF_LayerMergeBase()
           
MMF_LayerMergeBase(Generic pparent)
          
 
Method Summary
 color FullMerge(color pbottom, color ptop)
          
 color GradientMerge(color clr, float index)
          
 color Merge(color pbottom, color ptop)
          
 color SolidMerge(color clr)
          
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_LayerMergeBase

public MMF_LayerMergeBase(Generic pparent)

Parameters:
pparent - typically 'this' from the parent or zero

MMF_LayerMergeBase

public MMF_LayerMergeBase()
Method Detail

Merge

public color Merge(color pbottom,
                   color ptop)

Parameters:
pbottom - the base color
ptop - the top color
Returns:
merged color

FullMerge

public color FullMerge(color pbottom,
                       color ptop)

Parameters:
pbottom - the base color
ptop - the top color
Returns:
layer merged color

GradientMerge

public color GradientMerge(color clr,
                           float index)

Parameters:
clr - the base color
index - the gradient index for the top colour
Returns:
layer merged color

SolidMerge

public color SolidMerge(color clr)

Parameters:
clr - the base color
Returns:
layer merged color