dmj5
Class DMJ_MotionBlur

Object
  extended by common:Generic
      extended by dmj5:DMJ_ConvolutionFilter
          extended by dmj5:DMJ_VariableConvolutionFilter
              extended by dmj5:DMJ_MotionBlur

class 
DMJ_VariableConvolutionFilter:DMJ_MotionBlur

Basic Unsharp Mask filter. Provides even, dispersed sharpening. (This is the opposite of Gaussian Blur.)


Ultra Fractal Source

Toggle UF Source Code Display

 class DMJ_MotionBlur(DMJ_VariableConvolutionFilter) {
   ; Basic Unsharp Mask filter. Provides even, dispersed sharpening. (This is the opposite of Gaussian Blur.)
   
 public:
   import "common.ulb"
   
   func DMJ_MotionBlur(Generic pparent)
     DMJ_VariableConvolutionFilter.DMJ_VariableConvolutionFilter(pparent)
     
     int elements = (@p_samples*2+1)
     setLength(m_Offsets, elements)
     setLength(m_Weights, elements)
   endfunc
 
   func Init(complex pz)
     m_Bias = 0.0
     m_Multiplier = 0.0
 
     int j = -@p_samples
     int l = 0
     complex v = @p_radius * ((0,1) ^ (@p_angle / 90.0)) / @p_samples
     complex c = 0
     complex t
     if (@p_type == 1)
       c = pz - @p_center
       c = atan2(c) + flip(cabs(c))
     elseif (@p_type == 2)
       v = v * (pz - @p_center)
     endif
     while (j <= @p_samples)
       if (@p_type == 1)
         t = v * j
         t = real(t) + flip(imag(t)*imag(c))
         t = t + c
         t = cos(real(t))*imag(t) + flip(sin(real(t))*imag(t))
         m_Offsets[l] = t - (pz - @p_center)
       else
         m_Offsets[l] = v * j
       endif
       if (@p_style == 0)
         m_Weights[l] = 1
       elseif (@p_style == 1)
         m_Weights[l] = @p_samples + 1 - abs(j)
       elseif (@p_style == 2)
         if (j <= 0)
           m_Weights[l] = @p_samples + 1 - abs(j)
         else
           m_Weights[l] = 0
         endif
       endif
       if (j == 0)
         m_Weights[l] = m_Weights[l] + @p_centerweight * @p_samples
       endif
       m_Multiplier = m_Multiplier + m_Weights[l]
       l = l + 1
       j = j + 1
     endwhile
     
     m_Multiplier = 1.0 / m_Multiplier
   endfunc
   
 default:
   title = "Motion/Radial/Zoom Blur"
 
   int param v_dmj_motionblur
     caption = "Version (DMJ_MotionBlur)"
     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_motionblur < 100
   endparam
 
   int param p_type
     caption = "Blur Type"
     default = 0
     enum = "motion blur" "radial blur" "zoom blur"
     hint = "Sets the type of blur. Motion blur is a blur in a single direction regardless of position. Radial and zoom blurs changes the direction of the blur from one position to the next."
   endparam
   int param p_style
     caption = "Blur Style"
     default = 0
     enum = "normal" "weighted" "wind"
     hint = "Sets the style of the blur. 'Normal' gives a standard motion blur; 'weighted' gives a softer effect; 'wind' gives a one-sided blur."
   endparam
   float param p_centerweight
     caption = "Center Weight"
     default = 0
     hint = "Sets the extra weight that will be applied to the center position. Increasing this will reduce the amount of blur and allow the original image to appear more crisply."
   endparam
   float param p_angle
     caption = "Blur Angle"
     default = 0.0
     hint = "Sets the angle of the blur. Note that for radial and zoom blurs, this is relative to the 'natural' angle for each position."
   endparam
   complex param p_center
     caption = "Blur Center"
     default = (0,0)
     hint = "Sets the center of the blur."
   endparam
   float param p_radius
     caption = "Filter Radius"
     default = 0.1
     hint = "Sets the radius of the filter. A smaller radius will result in less blurring."
   endparam
   int param p_samples
     caption = "Sample Density"
     default = 9
     min = 1
     hint = "Sets the density of samples used to compute the blur. Increasing the density will dramatically increase the rendering time (increasing with 4x the square of the density) but for very wide blurs you will need to do this to get even blurring."
   endparam
 }
 


Constructor Summary
DMJ_MotionBlur()
           
DMJ_MotionBlur(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
           
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

DMJ_MotionBlur

public DMJ_MotionBlur(Generic pparent)

DMJ_MotionBlur

public DMJ_MotionBlur()
Method Detail

Init

public void Init(complex pz)
Overrides:
Init in class DMJ_ConvolutionFilter