|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:TrapShape kcc5:KCC_SquaresTrap
class
The Squares trap.
For an example of what this trap looks like,
click here.
class KCC_SquaresTrap( common.ulb:TrapShape ) { ; The Squares trap. ; <p> ; For an example of what this trap looks like, ; <a href="../additional/kcc5/images/Squares Trap.jpg">click here</a>. ; public: import "common.ulb" ; constructor func KCC_SquaresTrap( Generic pparent ) TrapShape.TrapShape( pparent ) endfunc ; call this before each sequence of values to be trapped func Init( complex pz ) TrapShape.Init( pz ) Px = 0.5 + @squareSize Py = 0.5 - @squareSize endfunc ; call this for each iteration being trapped float func Iterate( complex pz ) TrapShape.Iterate( pz ) Xabs = abs( real( pz ) - real( @squaresOffset ) ) Yabs = abs( imag( pz ) - imag( @squaresOffset ) ) if( (Xabs < Px) && (Xabs > Py) && (Yabs < Px) && (Yabs > Py) ) float awr5 = abs( Xabs - 0.5 ) float awi5 = abs( Yabs - 0.5 ) if( awr5 <= awi5 ) distance = awr5 else distance = awi5 endif if( distance < @squareSize ) m_LastChannel = m_Iterations m_Texture = distance / @squareSize return distance else return 1e20 endif else return 1e20 endif endfunc float func GetTextureValue() return m_Texture endfunc protected: float distance float Xabs float Yabs float Px float Py float m_Texture default: title = "Squares Trap" int param v_KCC_SquaresTrap caption = "Version (KCC_SquaresTrap)" 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_KCC_SquaresTrap < 100 endparam float param squareSize caption = "Square Size" default = 0.1 hint = "The size of the squares. Suggested range (0.02 to 0.3)." endparam complex param squaresOffset caption = "Offset" default = (0.0,0.0) hint = "Offset for the center of the Squares." endparam }
Constructor Summary | |
---|---|
KCC_SquaresTrap()
|
|
KCC_SquaresTrap(Generic pparent)
constructor |
Method Summary | |
---|---|
float |
GetTextureValue()
Get texture value. |
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 common:TrapShape |
---|
GetColorChannel, GetTransformedPoint, IterateSilent, SetThreshold |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public KCC_SquaresTrap(Generic pparent)
public KCC_SquaresTrap()
Method Detail |
---|
public void Init(complex pz)
Init
in class TrapShape
public float Iterate(complex pz)
Iterate
in class TrapShape
public float GetTextureValue()
TrapShape
Ordinarily, a trap shape does not have a native texture (it is flat). Some formulas may pair trap shapes with trap textures, and may need more information about trap textures when trap shapes are nested via TrapShapeMerge. This function provides support for accessing texture information.
GetTextureValue
in class TrapShape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |