|
LightWrap++
AC++wrapperfortheLightWave3DSDK
|
A Texture is a set of TextureLayer that drive a parameter. More...
#include <texture.h>
Inheritance diagram for lwpp::Texture:
Collaboration diagram for lwpp::Texture:Public Member Functions | |
| Texture (LWTextureID _txtr_id=0) | |
| Constructor. | |
| void | cleanup () |
| You call this when the calculations for the texture are finished, after the last frame has been rendered for example. | |
| LWTxtrContextID | context (void) |
| Returns the context of the texture. Is like the information of the first three parameter of the create function. | |
| void | contextAddParam (LWTxtrContextID lwtxtrcontextid, LWTxtrParamDesc pdesc) |
| Add a parameter to the context. | |
| LWTxtrContextID | contextCreate (LWTxtrParamFuncs lwtxtparamfunc) |
| void | contextDestroy (LWTxtrContextID lwtxtrcontextid) |
| Free the resources allocated by the previous function contextCreate. | |
| void | copy (LWTextureID to, LWTextureID from) |
| Copy a texture. | |
| void | create (int returntype, const char *name, LWTxtrContextID lwtxtrcontextid=0, void *userdata=0) |
| Creates a Texture. | |
| void | destroy () |
| Destroy the texture created with create. | |
| double | evaluate (LWMicropolID lwmp, double *value) |
| Evaluates the texture. | |
| int | getDataType () |
| Returns the type of value returned by the texture. | |
| LWTextureID | getID () const |
| Returns the ID of the texture. | |
| void | load (const LWLoadState *loadstate) |
| Read the texture from a file. | |
| const char * | name () |
| Returns name of the texture. | |
| void | newtime (LWTime time, LWFrame frame) |
| This allows do any pre calculation needed, that can depend on time. | |
| void | save (const LWSaveState *savestate) |
| Write the texture to a file. | |
| void | setEnvGroup (LWChanGroupID txtr_group_id) |
| Creates a group that will contain the Envelopes created for parameters of the texture. | |
Layer Management | |
Access to the TextureLayer within the Texture | |
| TextureLayer | layerAdd (int type) |
| Adds a new layer to the texture. | |
| TextureLayer | firstLayer () |
| Returns the ID of the first layer in the texture. This ID can be passed to functions the return the Layer data. | |
| TextureLayer | lastLayer () |
| Returns the ID of the last layer in the texture. This ID can be passed to functions the return the Layer data. | |
| TextureLayer | nextLayer (TextureLayer layer) |
| Returns the ID of the next layer in the texture, this is the Layer ID of the layer after the ID passed as parameter. | |
| LWTLayerID | layerAddID (int type) |
| Adds a new layer to the texture. | |
| LWTLayerID | firstLayerID () |
| Returns the ID of the first layer in the texture. This ID can be passed to functions the return the Layer data. | |
| LWTLayerID | lastLayerID () |
| Returns the ID of the last layer in the texture. This ID can be passed to functions the return the Layer data. | |
| LWTLayerID | nextLayerID (LWTLayerID lid) |
| Returns the ID of the next layer in the texture, this is the Layer ID of the layer after the ID passed as parameter. | |
Protected Member Functions | |
| bool | _acquireGlobal () |
| virtual bool | available () const |
| Check if the global is available. | |
| virtual LWTextureFuncs * | getGlobal () |
| Get the pointer to the global. | |
| LWTextureFuncs * | operator-> () |
| Get the pointer to the global. | |
Static Protected Attributes | |
| static LWTextureFuncs * | globPtr |
| Pointer to the global functions. | |
A Texture is a set of TextureLayer that drive a parameter.
Give access to the Texture engine to create Image, Gradient or Procedural Textures that can be used even for modulate parameters on plugins.
|
inline |
Constructor.
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Check if the global is available.
|
inline |
You call this when the calculations for the texture are finished, after the last frame has been rendered for example.
|
inline |
Returns the context of the texture. Is like the information of the first three parameter of the create function.
|
inline |
Add a parameter to the context.
For Gradients this is the way to add an Input Parameter for them. The added parameter will appear on the list of Input Parameters for the Gradient.
| lwtxtrcontextid | The context of the texture. You obtain this with the previous function contextCreate. |
|
inline |
The texture context is used to populate and support the Input Parameter menu for gradient layers in the Texture Editor. This function creates a texture context. The Texture Editor uses the callbacks in the paramfuncs argument to get the value of the parameters.
| lwtxtparamfunc | A LWTxtrParamFuncs structure that contains the callback to input parameters for the texture. |
LWTxtrParamFuncs has the members: double (*paramEvaluate)(LWTxtrParamDesc *pdesc, int paramnum, LWMicropol *lwmicropol, gParamData userdata); Returns the value of the parameter. pdesc is a description that you pass to contextAddParam. paramnum is the index order in wich the parameter was created. 0 is reserved for Previous Layer, so your Input Parameters will start as 1, 2, etc... In the order you created them lwmicropol is a micropolygon passed to the texture userdata is your own data returned from your paramTime callback gParamData (*paramTime)(void *userdata, LWTxtrParamDesc *pdesc, int paramnum, LWTime time, LWFrame frame); An initialization function for the parameter. Is called before paramEvaluate to realize pre calculations for it. userdata is your own data returned from your userdata function paramnum is the index order in wich the parameter was created. 0 is reserved for Previous Layer, so your Input Parameters will start as 1, 2, etc... In the order you created them time is the time in seconds frame is the time in frames void (*paramCleanup) (LWTxtrParamDesc *, int paramnum, gParamData userdata); Frees any resources allocated in paramTime pdesc is a description that you pass to contextAddParam. paramnum is the index order in wich the parameter was created. 0 is reserved for Previous Layer, so your Input Parameters will start as 1, 2, etc... In the order you created them userdata is your own data returned with userdata function
|
inline |
Free the resources allocated by the previous function contextCreate.
The context may only be destroyed if all the textures using it has been destroyed first.
| lwtxtrcontextid | The context of the texture. You obtain this with the previous function contextCreate. |
|
inline |
Copy a texture.
| to | ID of the destiny texture TO copy |
| from | ID of the source texture to copy from |
|
inline |
Creates a Texture.
will appear on the list of Input Parameters for the Gradient.
| returntype | Is the type of value returned by the texture. It can be TRT_VECTOR, TRT_COLOR, TRT_PERCENT, TRT_SCALAR, TRT_DISPLACEMENT |
| name | This is the name of the texture that will appear on the Interface. |
| lwtxtrcontextid | The id of the texture. It can contain one or more texture layers. You obtain this with the previous function contextCreate. Pass NULL if you do not want to create any Input Parameter. |
| userdata | is your own data returned with userdata function |
|
inline |
Destroy the texture created with create.
|
inline |
Evaluates the texture.
The double value returned is the alpha of the texture.
| lwmp | is a LWMicropol structure that must be initializated. |
| value | is where the resulting value of the texture is returned. |
| TextureLayer lwpp::Texture::firstLayer | ( | ) |
Returns the ID of the first layer in the texture. This ID can be passed to functions the return the Layer data.
|
inline |
Returns the ID of the first layer in the texture. This ID can be passed to functions the return the Layer data.
|
inline |
Returns the type of value returned by the texture.
|
inlinevirtualinherited |
Get the pointer to the global.
|
inline |
Returns the ID of the texture.
| TextureLayer lwpp::Texture::lastLayer | ( | ) |
Returns the ID of the last layer in the texture. This ID can be passed to functions the return the Layer data.
|
inline |
Returns the ID of the last layer in the texture. This ID can be passed to functions the return the Layer data.
| TextureLayer lwpp::Texture::layerAdd | ( | int | type | ) |
Adds a new layer to the texture.
| type | Is the type of Layer to create. Can be TLT_IMAGE (Image Layer), TLT_PROC (Procedural Layer), TLT_GRAD (Gradient Layer) |
|
inline |
Adds a new layer to the texture.
| type | Is the type of Layer to create. Can be TLT_IMAGE (Image Layer), TLT_PROC (Procedural Layer), TLT_GRAD (Gradient Layer) |
|
inline |
Read the texture from a file.
|
inline |
Returns name of the texture.
|
inline |
This allows do any pre calculation needed, that can depend on time.
| time | is the time in seconds. |
| frame | is the time in frames. |
| TextureLayer lwpp::Texture::nextLayer | ( | TextureLayer | layer | ) |
Returns the ID of the next layer in the texture, this is the Layer ID of the layer after the ID passed as parameter.
This ID can be passed to functions the return the Layer data.
|
inline |
Returns the ID of the next layer in the texture, this is the Layer ID of the layer after the ID passed as parameter.
This ID can be passed to functions the return the Layer data.
|
inlineinherited |
Get the pointer to the global.
|
inline |
Write the texture to a file.
| void lwpp::Texture::setEnvGroup | ( | LWChanGroupID | txtr_group_id | ) |
Creates a group that will contain the Envelopes created for parameters of the texture.
| txtr_group_id | A LWChanGroupID of the envelopes group. |
|
staticprotectedinherited |
Pointer to the global functions.