```Object
common:Generic
common:Coloring
```

`class GradientColoring:REB_ExponentialSmoothing_Gradient`

Based on the original 1994 algorithm of Ron Barnett.

This is a direct coloring formula that supports trap shape textures and colortrap coloring, including image import.

Ultra Fractal Source
``` class REB_ExponentialSmoothing_Gradient(common.ulb:GradientColoring) {
; Based on the original 1994 algorithm of Ron Barnett. <br>
; <p>
; This is a direct coloring formula that supports trap shape textures and
; colortrap coloring, including image import.
public:
import "common.ulb"
import "dmj5.ulb"

; constructor
m_Texture = new @ftexture(this)
endfunc

; initialize the objects
func Init(complex pz, complex ppixel)
m_Texture.Init(pz)
m_iterexp = 0
m_zold = (0,0)
endfunc

; call for each iterated point
func Iterate(complex pz)
if (@mtile == "Fixed Iteration" && m_iterations == @iternum) || \
(@mtile == "Cabs(z)" && cabs(pz) < @tcabs)|| @mtile == "none"
ptexture = m_Texture.Iterate(pz)
endif
if (@converge > 0)
m_iterexp = m_iterexp + exp(-cabs(pz))
else
m_iterexp = m_iterexp + exp(-1/(cabs(m_zold - 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.01*m_iterexp + ptexture*@txamt
endfunc

protected:
float ptexture
TrapShape m_Texture
float m_iterexp
complex m_zold

default:
caption = "Version (Exponential 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."
endparam
text = "This is a direct gradient formula with textures"
param converge
caption = "Fractal Type"
default = 1
enum = "Convergent" "Divergent"
hint = "Mandelbrot is Divergent, Newton is Convergent."
endparam
float param txamt
caption = "Texture amount"
default = 0.0
visible = @fTexture != DMJ_TrapShapeFlat
endparam
text = "The 'Tile method' applies to textures. Fixed Iteration \
will give a smoother tiling, while 'Cabs(z)' will more consistently \
visible = @fTexture != DMJ_TrapShapeFlat
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
visible = @mtile == "Fixed iteration" && @fTexture != DMJ_TrapShapeFlat
hint = "Changes the texture/image mapping."
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
}
```

Constructor Summary
`REB_ExponentialSmoothing_Gradient()`

`REB_ExponentialSmoothing_Gradient(Generic pparent)`
constructor

Method Summary
` void` ```Init(complex pz, complex ppixel)```
initialize the objects
` void` `Iterate(complex pz)`
call for each iterated point
` float` `ResultIndex(complex pz)`
override the parent and call in the final section of the coloring formula.

`IsGradient, IsSolid, Result`

Methods inherited from class common:Coloring
`GetPixel`

Methods inherited from class common:Generic
`GetParent`

Methods inherited from class Object

Constructor Detail

`public REB_ExponentialSmoothing_Gradient(Generic pparent)`
constructor

`public REB_ExponentialSmoothing_Gradient()`
Method Detail

### 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 #z
`ppixel` - 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)