SCE Bitmap

   Print  Previous  Next

Functions Provided By SCE Bitmap

The following table provides an overview of all functions the effect can use:

Function

Description

void SetDirection(int)

Sets the movement direction. Allowed are all directions described by the DIR_ constants. Use DIR_NONE, to stop the image movement.

int GetDirection()

Retrieves the current movement direction. Returns DIR_NONE, if the movement has been stopped.

int GetPixelImagePositionX()

Returns the current absolute x - pixel coordinate of the image.

int GetPixelImagePositionY()

Returns the current absolute y - pixel coordinate of the image.

float GetVectorImagePositionX()

Returns the current absolute x - coordinate of the image.

float GetVectorImagePositionY()

Returns the current absolute y - coordinate of the image.

void SetPixelImagePosition(int x, int y)

Sets the position of the image with absolute pixel coordinates.

void SetVectorImagePosition(float x, float y)

Sets the position of the image using relative coordinates.

int GetPixelImageWidth()

Returns the width of the currently displayed image as absolute pixel value.

int GetPixelImageHeight()

Returns the height of the currently displayed image as absolute pixel value.

float GetVectorImageWidth()

Returns the width of the currently displayed image relative to the settings of the current matrix.

float GetVectorImageHeight()

Returns the height of the currently displayed image relative to the settings of the current matrix.

void SetStretch(int enable)

If enable is false, stretching will be disabled, otherwise it will be enabled.

int GetStretch()

Returns true, if stretch is currently enabled, otherwise false.

void SetTile(int enable)

Disables tile mode of the bitmap effect if enable is false, otherwise the tile mode will be enabled.

int GetTile()

Returns true if tile mode of the bitmap effect is currently enabled, otherwise false.

void SetGrey(int enable)

Disables grayscale mode if enable is false, otherwise it will be enabled.

int GetGrey()

Returns true if grayscale mode is currently active, otherwise false.

void SetRgbToRgbw(int enable)

Disables the RGB-to-RGBW mode if enable is false, otherwise it will be enabled.

int GetRgbToRgbw()

Returns true if RGB-to-RGBW mode is enabled, otherwise false.

void SetBpm(int bpm)

Sets the speed for the image movement. The value bpm must be within a range of 0 to 9999 BPM. E.g. a value of 60 means that the image moves one pixel per second into the given direction.

int GetBpm()

Returns the speed for the image movement in BPM.

void SetAnimationSpeed(float multiplier)

Sets the animation speed multiplier. See below for further details.

float GetAnimationSpeed()

Returns the current animation speed multiplier. See below for further details.

void SetFilterColor(color col)

Sets the filter color for the effect. Please note that the alpha value of the color structure is not used by this effect.

color GetFilterColor()

Returns the current filter color. Please note that the alpha value is not used and should be ignored.

void SetRotation(int angle)

Sets the rotation globally for all images of the image list. It is possible to rotate the images by multiples of 90°. This function is equal to the rotation button provided by the GUI of the effect. Valid values for angle are 0, 90, 180, and 270.

int GetRotation()

Returns the current rotation which is set on the effect itself.

int GetImageCount()

Returns the number of currently loaded images in the image table.

void SetCurrentImage(int idx)

Sets the image that should be displayed next. If idx is out of range, nothing happens.

int GetCurrentImage()

Returns the index of the currently displayed image.

 

This Effect uses the Color Picker. Learn more about Using Colors.

 

Deprecated Functions
Deprecated functions are outdated functions and should not be used anymore.

Function

Description

void SetMoveSpeed(float speed)

Sets the speed for the image movement. The speed must be given in frames per second. E.g. 2 means that the image will be moved 2 pixels per second. The available range can be set from 0 to 166. Please note: This function is deprecated and may be removed in one of the next releases. Use SetBpm instead.

float GetMoveSpeed()

Returns the speed for the image movement in frames per second. Please note: This function is deprecated and may be removed in one of the next releases. Use GetBpm instead.

 

Speed Settings Of The Bitmap Effect

The bitmap effect has two independent speed settings implemented. The first one is the movement speed of the picture moving over the matrix. The second one is the animation speed used to speed up or slow down the animation.

The following functions specify and retrieve the speed for the picture movement in frames per second:

void SetBpm(int bpm)
int GetBpm()

 

 

The next two functions control the animation speed:

void SetAnimationSpeed(float multiplier)
float GetAnimationSpeed()

 

The functions do not control the animation speed itself, but work with a multiplier. This means that if mulitplier is set to 2 for example, the animation speed is doubled. A multiplier of 0.5 is setting the animation speed to half of the original one.

(Description)
 

Examples

Moving An Image

The following example moves the image or animation back and forth on the matrix.

void InitEffect()

{

 

}

 

void PreRenderEffect()

{

    if(GetDirection() == DIR_LEFT)

    {

        if(GetVectorImagePositionX() <= 0.0)

        {

            SetVectorImagePosition(0.0, GetVectorImagePositionY());

            SetDirection(DIR_RIGHT);

        }

    }

    else if(GetDirection() == DIR_RIGHT)

    {

        if(GetVectorImagePositionX() + GetVectorImageWidth() >= 1.0)

        {

            SetVectorImagePosition(1.0 - GetVectorImageWidth(), GetVectorImagePositionY());

            SetDirection(DIR_LEFT);

        }

    }

    else

    {

        SetDirection(DIR_LEFT);

    }

 

}

 

void PostRenderEffect()

{

 

}

 

 

Controlling The Animation

The following example stops the animation and selects the images to show.

@scriptname="";

@author="";

@version="";

@description="";

 

int g_img;

 

void InitEffect()

{

    WriteText(GetAnimationSpeed());

    SetAnimationSpeed(0.0);

}

 

void PreRenderEffect()

{

    SetCurrentImage(g_img);

    g_img = (g_img + 1) % GetImageCount();

}

 

void PostRenderEffect()

{

 

}