mmf
Class MMF_TrapModeSmoothAverageAbove

Object
  extended by common:Generic
      extended by common:TrapMode
          extended by common:TrapModeWithThreshold
              extended by mmf:MMF_TrapModeSmoothWithThreshold
                  extended by mmf:MMF_TrapModeSmoothSumAbove
                      extended by mmf:MMF_TrapModeSmoothAverageAbove

class 
MMF_TrapModeSmoothSumAbove:MMF_TrapModeSmoothAverageAbove

Sums the values above than the user value and within the threshold of it and converts the values to averages.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapModeSmoothAverageAbove(MMF_TrapModeSmoothSumAbove) {
 ; Sums the values above than the user value and within the threshold of it
 ; and converts the values to averages.<br>
 public:
   import "common.ulb"
 
   func MMF_TrapModeSmoothAverageAbove(Generic pparent)
     MMF_TrapModeSmoothSumAbove.MMF_TrapModeSmoothSumAbove(pparent)
   endfunc
 
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture)
     MMF_TrapModeSmoothWithThreshold.Iterate(pz, pzt, pdistance, ptexture)
     pdistance = pdistance - @p_testdist
     if pdistance>=0 && pdistance < m_Threshold
       m_Distances[0] = m_Distances[0] + pdistance
       m_Textures[0] = m_Textures[0] + ptexture
       m_UntransformedPoints[0] = m_UntransformedPoints[0] + pz
       m_TransformedPoints[0] = m_TransformedPoints[0] + pzt
       m_IterationPoints[0] = m_IterationPoints[0] + 1
       m_Solid = false
       m_wastrapped = true
     endif
   endfunc
 
   func Result()
     float ii = 1.0 / m_IterationPoints[0]
     m_Distances[0] = m_Distances[0] * ii
     m_Textures[0] = m_Textures[0] * ii
     m_UntransformedPoints[0] = m_UntransformedPoints[0] * ii
     m_TransformedPoints[0] = m_TransformedPoints[0] * ii
   endfunc
   
   func OldResult()
     if m_OldIterationPoints[0]>0
       float ii = 1.0 / m_OldIterationPoints[0]
       m_Distances[0] = m_OldDistances[0] * ii
       m_Textures[0] = m_OldTextures[0] * ii
       m_UntransformedPoints[0] = m_OldUntransformedPoints[0] * ii
       m_TransformedPoints[0] = m_OldTransformedPoints[0] * ii
       m_IterationPoints[0] = m_OldIterationPoints[0]
       m_Iterations = m_Iterations - 1
     endif
   endfunc
   
 default:
   title = "Smooth Average Above"
   rating = recommended
   float param p_testdist
     caption = "Trap Test Distance"
     default = 0.5
     hint = "Gets the average of the distances from the test distance \
             where the original distance was above the test distance \
             and provided the distance from this distance is within \
             the threshold."
   endparam
 }
 


Constructor Summary
MMF_TrapModeSmoothAverageAbove()
           
MMF_TrapModeSmoothAverageAbove(Generic pparent)
           
 
Method Summary
 void Iterate(complex pz, complex pzt, float pdistance, float ptexture)
          call this for each point
 void OldResult()
          call this to compute penultimate results
 void Result()
          call this to compute final results
 
Methods inherited from class mmf:MMF_TrapModeSmoothSumAbove
Init
 
Methods inherited from class mmf:MMF_TrapModeSmoothWithThreshold
IterateSilent
 
Methods inherited from class common:TrapModeWithThreshold
GetThreshold, SetThreshold, UsesThreshold
 
Methods inherited from class common:TrapMode
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TrapModeSmoothAverageAbove

public MMF_TrapModeSmoothAverageAbove(Generic pparent)

MMF_TrapModeSmoothAverageAbove

public MMF_TrapModeSmoothAverageAbove()
Method Detail

Iterate

public void Iterate(complex pz,
                    complex pzt,
                    float pdistance,
                    float ptexture)
Description copied from class: MMF_TrapModeSmoothWithThreshold
call this for each point

Note that derived functions should always copy all used parameters to the "old" versions when they are changed as here.

m_wastrapped should be set to true in the derived function when the main (current) values get changed

Overrides:
Iterate in class MMF_TrapModeSmoothSumAbove
Parameters:
pz - the z value
pzt - the transformed z value
pdistance - the trap distance
ptexture - tyhe texture value

Result

public void Result()
Description copied from class: TrapMode
call this to compute final results

Overrides:
Result in class TrapMode

OldResult

public void OldResult()
Description copied from class: MMF_TrapModeSmoothWithThreshold
call this to compute penultimate results

This should only be called after previously calling Result() and getting the actual result value using the Trap Color Mode since the original result values are destroyed by this call.

Overrides:
OldResult in class MMF_TrapModeSmoothWithThreshold