ImageGear for C and C++ on Windows v20.5 - Updated
IG_FX_motion
API Reference Guide > Core Component API Reference > Core Component Functions Reference > FX Functions > IG_FX_motion

This function makes the image look as though it was moving when the image was captured.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_FX_motion (
        HIGEAR hIGear, 
        const LPAT_RECT lpRect, 
        const UINT nExtent, 
        const AT_MODE nDirection
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpRect const LPAT_RECT Far pointer to an AT_RECT struct specifying the rectangular portion of the image to be processed. Set = NULL for the whole image to be processed. Before ImageGear performs this operation, it will check to see if an internal flag has been set to TRUE to make a mask active for this HIGEAR image. If a mask is active, and a valid pointer to a mask can be found, ImageGear will override the settings passed to this structure in favor of the non-rectangular ROI defined by the mask.
nExtent const UINT Set to a UINT for the amount of motion you would like applied. If nDirection will be set to "S, W, E, N", the correct range for this variable is 2 - 15. If nDirection will be set to "SE, NE, NW, SW", the correct range for this variable is 3 - 22. This variable determines the extent to which the pixels will be "moved" or "smeared", or literally how many pixel lengths each pixel will "move over."
nDirection const AT_MODE An AT_MODE Compass direction constant. Please see accucnst.h file or the description of IG_FX_emboss() function for full list of these constants.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++, except:
Indexed RGB with non-grayscale palette.

Sample:

FlashPix

Example:

 
Copy Code
HIGEAR hIGear;  /* HIGEAR handle of image */
/* Blur whole image to imply fast motion to the south-east:  */
IG_FX_motion ( hIGear, NULL, 6, IG_COMPASS_SE );

Remarks:

The amount of motion depends on the nAmount parameter. A larger nAmount makes the motion appear faster. Use nDirection to select which direction the image appears to be moving toward. lpRect specifies what portion of the image is to be affected.

This function, like other ImageGear Image Processing and Clipboard API calls, takes an AT_RECT structure as an argument, so that you can process a rectangular sub-region of an image. However, before ImageGear performs the operation specified by this function, it will check to see if an internal flag has been set to TRUE, indicating that a mask HIGEAR should be used with the image. If the flag is set to TRUE, and a valid pointer to a mask image has been assigned, ImageGear will override the settings passed to the AT_RECT structure and use the non-rectangular ROI defined by the mask HIGEAR. To create a non-rectangular region of interest, call IG_IP_NR_ROI_to_HIGEAR_mask().

Please see the descriptions of IG_IP_NR_ROI_mask_associate() and IG_IP_NR_ROI_to_HIGEAR_mask() for more details.
Is this page helpful?
Yes No
Thanks for your feedback.