DisplaceMap method (ILEADRasterProcess)
short DisplaceMap(ILEADRaster * pRaster, ILEADRaster * pDisplacementMap, long lHorzFact, long lVertFact, OLE_COLOR crFill, long lFlags); | |
Overview |
Refer to Applying Artistic Effects. |
Remarks
(Raster Pro and above only) Displaces bitmap pixels horizontally and vertically according to the values of the displacement map image.
This effect shifts image pixels according to the values of the displacement map. Red values in the displacement map shift the original pixels horizontally. Green values in the displacement map shift the original values vertically. Blue values are ignored. A displacement map value of 128 means not to shift anything. A displacement map value of 0 means to shift pixels the complete vertical or horizontal percentage, to the left or down. A displacement map value of 255 means to shift pixels the complete vertical or horizontal percentage, to the right or up.
Displacement maps modify the geometry of the object. As a result, pixel shifts and forms may be added to the image, and the image may be warped or distorted.
As an example, if you use the following image:
And you were to use the following bitmap as your displacement map:
And you were to call DisplaceMap using the following settings:
Parameter |
Value |
lHorzFact |
17 |
lVertFact |
24 |
crFill |
na |
lFlags |
FILL_NOCHG | DSPL_STRETCH |
The following figure results:
If the bitmap has a region, the effect will be applied on the region only.
This method supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.
This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.
See Also