reb
Class REB_ConvolutionShapeWrapper
Object
common:Generic
common:TrapShape
reb:REB_ConvolutionShapeWrapper
class
- TrapShape:REB_ConvolutionShapeWrapper
This wrapper allows you to use any trap shape and any convolution
filter to produce blurred or sharpened (or other) trap effects.
This is largely based upon BlurTrapWrapper of Damien Jones
Ultra Fractal Source
Toggle UF Source Code Display
class REB_ConvolutionShapeWrapper(common.ulb:TrapShape) {
; This wrapper allows you to use any trap shape and any convolution
; filter to produce blurred or sharpened (or other) trap effects.
; This is largely based upon BlurTrapWrapper of Damien Jones
public:
import "common.ulb"
import "dmj5.ulb"
func REB_ConvolutionShapeWrapper(Generic pparent)
TrapShape.TrapShape(pparent)
m_Filter = new @f_filter(this)
m_Samples = length(m_Filter.m_Offsets)
setLength(m_TrapShapes, m_Samples)
int j = 0
while (j < m_Samples)
m_TrapShapes[j] = new @f_trapshape(this)
j = j + 1
endwhile
endfunc
func Init(complex pz)
TrapShape.Init(pz)
int j = 0
while (j < m_Samples)
m_TrapShapes[j].Init(pz)
j = j + 1
endwhile
if (@p_filterreset == 0 && DMJ_VariableConvolutionFilter(m_Filter) != 0)
m_Filter.Init(pz)
endif
endfunc
float func Iterate(complex pz)
trapshape.Iterate(pz)
if (@p_filterreset == 1 && DMJ_VariableConvolutionFilter(m_Filter) != 0)
m_Filter.Init(pz)
endif
float dist = 0
float d = 0
float w = 0
float o = 0
int j = 0
while (j < m_Samples)
dist = m_TrapShapes[j].Iterate(pz+m_Filter.m_Offsets[j])
w = m_Filter.m_Weights[j]
d = d + dist * w
j = j + 1
endwhile
w = m_Filter.m_Multiplier
o = m_Filter.m_Bias
d = d * w + o
return d
endfunc
protected:
DMJ_ConvolutionFilter m_Filter
int m_Samples
TrapShape m_TrapShapes[]
default:
title = "Convolution Shape Wrapper"
int param v_REB_ConvolutionShapeWrapper
caption = "Version (REB_ConvolutionShapeWrapper)"
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_REB_ConvolutionShapeWrapper < 100
endparam
TrapShape param f_trapshape
caption = "Trap Shape"
default = TrapShapeBlock
hint = "Sets the trap shape that the convolution filter will be applied to."
endparam
DMJ_ConvolutionFilter param f_filter
caption = "Convolution Filter"
default = REB_NullFilter
hint = "Sets the filter that will be applied."
endparam
int param p_filterreset
caption = "Reset Filter"
default = 1
enum = "first iteration" "every iteration"
hint = "Some convolution filters are position-dependent: the filter's effect varies from one part of the complex plane to another. For this kind of filter, you may choose whether to recompute the filter's effect only at the first iteration or on every iteration."
visible = (@f_filter == DMJ_VariableConvolutionFilter)
endparam
}
Method Summary |
void |
Init(complex pz)
call this before each sequence of values to be trapped |
float |
Iterate(complex pz)
call this for each iteration being trapped |
Methods inherited from class Object |
|
REB_ConvolutionShapeWrapper
public REB_ConvolutionShapeWrapper(Generic pparent)
REB_ConvolutionShapeWrapper
public REB_ConvolutionShapeWrapper()
Init
public void Init(complex pz)
- Description copied from class:
TrapShape
- call this before each sequence of values to be trapped
- Overrides:
Init
in class TrapShape
Iterate
public float Iterate(complex pz)
- Description copied from class:
TrapShape
- call this for each iteration being trapped
- Overrides:
Iterate
in class TrapShape