Using M2L Color Table

   Print  Previous  Next

Functions Provided For Using The M2L Color Table

Some effects provide more than one color. In this case the so-called »Using Color Table, »Using Color Gradient, »Using Color Gradient Dialog or M2L Color Table (described here) is offered by the effect to take control of the colors.

M2L Color Table

 

The following table provides an overview of all functions the effect can use to modify the colors in a M2L Color Table:

Function

Description

void M2LColorTableSetColor(int idx, color c)

Sets the color with the specified index to the given color value. If the index is out of range, nothing happens.

color M2LColorTableGetColor(int idx)

Returns the color with the specified index. If the index is out of range, black is returned.

void M2LColorTableSetPreset(int preset)

Sets the M2L Color Table preset. Please use a constant as described below for preset.

void M2LColorTableSetColorFade(int enable)

Sets the Fade option. Use TRUE to activate the fade. Use FALSE to deactivate it.

int M2LColorTableGetColorFade()

Returns TRUE, if Fade is activated, otherwise FALSE.

void M2LColorTableToggleColorFade()

Toggles the Fade option.

 

For a detailed description of the non-primitive data type color, see »Using Data Types

 

Remarks

Not every function might be available for each MADRIX Effect. Therefore, the functions M2LColorTableSetColorFade, M2LColorTableGetColorFade and M2LColorTableToggleColorFade are only available, if the effect offers Fade Mode.

 

M2L Color Table Preset Constants

Constant

Description

int M2L_COLORTABLE_PRESET_C1

Sets preset C1.

int M2L_COLORTABLE_PRESET_C2

Sets preset C2.

int M2L_COLORTABLE_PRESET_R

Sets preset R.

int M2L_COLORTABLE_PRESET_G

Sets preset G.

int M2L_COLORTABLE_PRESET_B

Sets preset B.

 

MADRIX 2.X To MADRIX 3.X Migration Hints

The following functions and constants are not supported anymore. Please follow the hints to migrate your macros.

Function/Constant

Description

void SetFade(int enable)

Use M2LColorTableSetColorFade(int enable) instead.

int GetFade()

Use M2LColorTableGetColorFade() instead.

 

Example

This example sets the M2L Color Table preset C1 and sets the last 12 colors to color black.

@scriptname="";

@author="";

@version="";

@description="";

 

void InitEffect()

{

 //Set Preset C1

 M2LColorTableSetPreset(M2L_COLORTABLE_PRESET_C1);

 

 //Sets the last 12 colors to black

 for(int i=12;i<24;i++)

         M2LColorTableSetColor(i,BLACK);

}

 

void PreRenderEffect()

{

 

}

 

void PostRenderEffect()

{

 

}

 

void MatrixSizeChanged()

{

 InitEffect();

}

 

MADRIX Version: 3.6j | Script Version: 2.22
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
Print   Previous   Next