|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Class | Foreground | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Synopsis |
Blends an image using a mask.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Arguments |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Location | lishpro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
The name of the file
containing the image data may be provided as a string to parameter
"file name", which can be in any format for which
the appropriate image driver is installed.
Alternatively a pointer to a valid LtImage data structure may be given via parameter "image". If the value NULL is given then the image will be extracted from the file represented by "file name", otherwise the "image" parameter takes precedence. It is the application's responsibility to ensure that the image pointed to by "image" remains valid throughout the lifetime of the shader. This can be done in two ways; either by simply ensuring that the original LtImage structure remains untouched, or by using the "keep texture" parameter. This is done by `switching' the shader to keep the texture after it has been created. The shader is initially created with the "image" argument pointing to a valid LtImage and the "keep texture" argument set to FALSE. The shader is then reset using LiShaderReset. The shader's arguments are then altered so that "image" is NULL and "keep texture is TRUE. The LtImage can then safely be destroyed. If the "keep texture" argument is TRUE then the arguments "image" and "file name" are taken into account only if no texture has been created yet. Switching the parameter to FALSE will result in rebuilding the texture during the next call to LiShaderReset or to a shaded rendering execution method. The way in which the image is scaled to fit the viewport is set using the "aspect mode" parameter. The value can be any one of the following:
The "x offset" and "y offset" parameters allow the image to be moved relative to the viewport. Sensible values are between -1.0 and 1.0, although other values may be set if desired. At the moment the offsets are only applied if "aspect mode" is LI_ASPECT_MODE_STRETCH or LI_ASPECT_MODE_PRESERVE. LI_ASPECT_MODE_LETTERBOX and LI_ASPECT_MODE_VIEW calculate their own offsets and ignore these parameters. The image may also be rotated through either 90, -90, or 180 degrees via the parameter "rotation". Note that supplying any other number for this parameter will have no effect. Predefined values of the parameters are given by LI_ANGLE_DEG_0, LI_ANGLE_DEG_90, LI_ANGLE_DEG_MINUS_90 and LI_ANGLE_DEG_180. These should always be used rather than passing numbers directly. The brightness of the image may be manipulated using the "image brightness" parameter. This is applied to the colour as a simple scale factor. The parameter "softness" controls the degree of blurring on the image texture. Blending of the image is controlled by a mask. It may by supplied exactly as the image by "mask file name" or "mask image". "keep texture" affects both of these parameters exactly as in case of "file name" and "image". The mask determines the alpha channel of corresponding image pixels. Mask can be inverted by setting "invert mask" parameter to TRUE. This will hide parts of image that were previously visible, and show those, that were invisible. "coverage" is a scaling factor for alpha values. Values less than 1 make image more transparent and greater than 1 make image more opaque. Mask image can be any image with 1 or 3 channels. In case of images with 3 channels, only first (R) is used as source of alpha.
Previous page alphabetically (foglight) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 1990-2005, 2006 LightWork Design Limited. All rights reserved | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||