reb
Class REB_GeneralSmoothingGradient
Object
common:Generic
common:Coloring
common:GradientColoring
reb:REB_GeneralSmoothingGradient
class
- GradientColoring:REB_GeneralSmoothingGradient
A smoothing algorithm that works for both convergent and divergent fractals.
Ultra Fractal Source
Toggle UF Source Code Display
class REB_GeneralSmoothingGradient(common.ulb:GradientColoring) {
; A smoothing algorithm that works for both convergent and divergent fractals. <br>
public:
import "common.ulb"
import "dmj5.ulb"
; constructor
func REB_GeneralSmoothingGradient(Generic pparent)
GradientColoring.GradientColoring(pparent)
m_Texture = new @ftexture(this)
endfunc
; initialize the objects
func Init(complex pz, complex ppixel)
GradientColoring.Init(pz, ppixel)
m_Texture.Init(pz)
m_iterexp = 0
m_zold = pz
endfunc
; call for each iterated point
func Iterate(complex pz)
GradientColoring.Iterate(pz)
m_iterexp = m_iterexp + exp(-cabs(pz)-0.5/(cabs(m_zold - pz)))
if (@mtile == "Fixed Iteration" && m_iterations == @iternum) || \
(@mtile == "Cabs(z)" && cabs(pz) < @tcabs)|| @mtile == "none"
ptexture = m_Texture.Iterate(pz)
endif
m_zold = pz
endfunc
; override the parent and call in the final section of the coloring formula. <br>
float func ResultIndex(complex pz)
return 0.2*m_iterexp + ptexture*@txamt
endfunc
protected:
float ptexture
TrapShape m_Texture
float m_iterexp
complex m_zold
default:
title = "General Smoothing Gradient"
int param v_generalsmoothinggrad
caption = "Version (General Smoothing Gradient)"
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_generalsmoothinggrad < 100
endparam
heading
text = "This is a gradient coloring formula with textures which works \
for both convergent and divergent \
fractals. It is highly recommended that the divergent bailout be \
set to at least 1e8 and the convergent bailout be set to no more than \
1e-8. If this is not done then the smoothing may be unsatisfactory. \
It works with fractals that have both divergent and convergent regions, \
such as the Magnet fractals."
endheading
float param txamt
caption = "Texture amount"
default = 0.0
visible = @fTexture != DMJ_TrapShapeFlat
endparam
heading
text = "Fixed Iteration will give a smoother tiling, while 'Cabs(z)' \
will more consistently follow the fractal shape."
visible = @fTexture != DMJ_TrapShapeFlat
endheading
param mtile
caption = "Tile method"
default = 1
enum = "None" "Fixed Iteration" "Cabs(z)"
visible = @fTexture != DMJ_TrapShapeFlat
endparam
int param iternum
caption = "Iter number"
default = 1
hint = "Changes the texture mapping."
visible = @fTexture != DMJ_TrapShapeFlat && \
@mtile == "Fixed iteration"
endparam
float param tcabs
caption = "Cabs limit"
default = 1.0
visible = @mtile == "Cabs(z)"
hint = "Changes the texture/image mapping."
visible = @fTexture != DMJ_TrapShapeFlat
endparam
TrapShape param fTexture
caption = "Texture"
default = DMJ_TrapShapeFlat
hint = "Use TrapShape plugins as textures."
endparam
}
Methods inherited from class Object |
|
REB_GeneralSmoothingGradient
public REB_GeneralSmoothingGradient(Generic pparent)
- constructor
REB_GeneralSmoothingGradient
public REB_GeneralSmoothingGradient()
Init
public void Init(complex pz,
complex ppixel)
- initialize the objects
- Overrides:
Init
in class GradientColoring
- Parameters:
pz
- first value for the sequence; for a normal coloring formula, this will be #zppixel
- seed value for the sequence; for a normal coloring formula, this will be #pixel
Iterate
public void Iterate(complex pz)
- call for each iterated point
- Overrides:
Iterate
in class GradientColoring
- Parameters:
pz
- next value in the sequence; corresponds to #z in a coloring formula
ResultIndex
public float ResultIndex(complex pz)
- override the parent and call in the final section of the coloring formula.
- Overrides:
ResultIndex
in class GradientColoring
- Returns:
- the gradient index (corresponding to #index in a coloring formula)