imaqScale
Usage
int imaqScale(Image* dest, const Image* source, int xScale, int yScale, ScalingMode scaleMode, Rect rect);
Purpose
Scales an image or area of an image. The source image and destination image must be the same image type. This function makes an image larger by duplicating pixels, and it makes an image smaller by subsampling pixels. For more sophisticated scaling techniques, use imaqResample().
Image Types Supported
IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL
Parameters
Name
|
Type
|
Description
|
---|---|---|
dest | Image* | The destination image. |
source | const Image* | The source image to scale. |
xScale | int | The scaling factor in the x direction. If you set scaleMode to IMAQ_SCALE_LARGER, xScale is a multiplication factor, meaning the function duplicates each source pixel xScale times. If you set scaleMode to IMAQ_SCALE_SMALLER, xScale is a division factor, meaning the function takes one pixel for every xScale pixels. |
yScale | int | The scaling factor in the y direction. If you set scaleMode to IMAQ_SCALE_LARGER, yScale is a multiplication factor, meaning the function duplicates each source pixel yScale times. If you set scaleMode to IMAQ_SCALE_SMALLER, yScale is a division factor, meaning the function takes one pixel for every yScale pixels. |
scaleMode | ScalingMode | The scaling mode. |
rect | Rect | Specifies the rectangular region of the source image to scale. Set this parameter to IMAQ_NO_RECT to scale the whole image. |
Return Value
Type |
Description |
---|---|
int | On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError(). |