DisplaceMap method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

 

Syntax

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:

image\ColorBalance_Befor_1.gif

And you were to use the following bitmap as your displacement map:

image\displacementmap.gif

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:

image\displacementmapafter.gif

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

Elements:

AddNoise method, Emboss method, Mosaic method, MotionBlur method, Oilify method, Posterize method, RemoveRedeye method, Solarize method, Underlay method, Bending method, Cylindrical method, FreeHandShear method, FreeHandWave method, Pixelate method, Impressionist method, Polar method, Punch method, RadialBlur method, RadWave method, Ripple method, Spherize method, Swirl method, Wind method, ZoomBlur method, ZoomWave method, BumpMap method, Cubism method, DrawStar method, Dry method, FreePlaneBend method, FreeRadBend method, GlassEffect method, GlowFilter method, LensFlare method, Light method, Ocean method, PlaneBend method, Plane method, SampleTarget method, Tunnel method

Topics:

Raster Images: Doing Geometric Transformations.