|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic reb:ImageTrapMode reb:ImageTrapModeWithThreshold
class
Variant of ImageTrapMode that is thresholdable
Manages both trap thresholds and alpha image thresholds.
class ImageTrapModeWithThreshold(ImageTrapMode) { ; Variant of ImageTrapMode that is thresholdable <br> ; <p> ; Manages both trap thresholds and alpha image thresholds. public: import "common.ulb" ; constructor func ImageTrapModeWithThreshold(Generic pparent) ImageTrapMode.ImageTrapMode(pparent) m_Threshold = 1.0 m_aThreshold = 1.0 endfunc ; provides alpha fading at the edges of an image func EdgeFade(float pdistance) float m_alph = 0 if @edgefade if alpha(m_ImagePoints[0]) !=0 m_alph = abs(m_Threshold-pdistance)/m_Threshold else m_alph = alpha(m_ImagePoints[0]) endif m_ImagePoints[0] = rgba(red(m_ImagePoints[0]),green(m_ImagePoints[0]), \ blue(m_ImagePoints[0]),m_alph^(1/@fadepwr)) endif endfunc ; get the trap threshold float func GetThreshold() return m_Threshold endfunc ; set the trap threshold func SetThreshold(float pthreshold) m_Threshold = pthreshold endfunc ; determines whether a threshold is being used bool func UsesThreshold() return true endfunc ; get the alpha threshold float func GetAThreshold() return m_AThreshold endfunc ; set the alpha threshold func SetAThreshold(float pathreshold) m_AThreshold = pathreshold endfunc ; determines whether an alpha threshold is being used. bool func UsesAThreshold() return true endfunc protected: float m_Threshold float m_AThreshold float m_a default: int param v_imagetrapmodethreshold caption = "Version (Image Trap Mode with Threshold)" default = 101 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_imagetrapmodethreshold < 101 endparam bool param edgefade caption = "Image edge fade" default = false endparam float param fadepwr caption = "Fade power" default = 1.0 visible = @edgefade endparam }
Constructor Summary | |
---|---|
ImageTrapModeWithThreshold()
|
|
ImageTrapModeWithThreshold(Generic pparent)
constructor |
Method Summary | |
---|---|
void |
EdgeFade(float pdistance)
provides alpha fading at the edges of an image |
float |
GetAThreshold()
get the alpha threshold |
float |
GetThreshold()
get the trap threshold |
void |
SetAThreshold(float pathreshold)
set the alpha threshold |
void |
SetThreshold(float pthreshold)
set the trap threshold |
boolean |
UsesAThreshold()
determines whether an alpha threshold is being used. |
boolean |
UsesThreshold()
determines whether a threshold is being used |
Methods inherited from class reb:ImageTrapMode |
---|
GetColor, GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, Init, IsSolid, Iterate, IterateSilent, Result |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public ImageTrapModeWithThreshold(Generic pparent)
public ImageTrapModeWithThreshold()
Method Detail |
---|
public void EdgeFade(float pdistance)
public float GetThreshold()
GetThreshold
in class ImageTrapMode
public void SetThreshold(float pthreshold)
SetThreshold
in class ImageTrapMode
public boolean UsesThreshold()
UsesThreshold
in class ImageTrapMode
public float GetAThreshold()
GetAThreshold
in class ImageTrapMode
public void SetAThreshold(float pathreshold)
SetAThreshold
in class ImageTrapMode
public boolean UsesAThreshold()
UsesAThreshold
in class ImageTrapMode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |