This function performs an arithmetic or logical operation on two images.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_IP_arithmetic( HIGEAR hIGear1, HIGEAR hIGear2, AT_MODE nOperation ); |
Name | Type | Description |
---|---|---|
hIGear1 | HIGEAR | HIGEAR handle of image 1, also the destination of the operation. |
hIGear2 | HIGEAR | HIGEAR handle of image 2. |
nOperation | AT_MODE | Specifies the kind of arithmetic operation to perform on the images. See enumIGMergeModes for possible values. |
All pixel formats supported by ImageGear for C and C++.
Copy Code
|
|
---|---|
HIGEAR hIGear1; // HIGEAR handle of the first image HIGEAR hIGear2; // HIGEAR handle of the second image AT_ERRCOUNT nErrcount; // Count of errs on stack upon ret from func // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear1); if(nErrcount == 0) { nErrcount = IG_load_file("picture.tif", &hIGear2); if(nErrcount == 0) { nErrcount = IG_IP_arithmetic(hIGear1, hIGear2, IG_ARITH_ADD); // ... // Destroy the second image IG_image_delete(hIGear2); } // Destroy the first image IG_image_delete(hIGear1); } |
IG_IP_arithmetic_rect is an extended version of IG_IP_arithmetic that allows specifying a rectangular area on the first image to be used for processing.
IG_IP_merge is an extended version of IG_IP_arithmetic that allows specifying a rectangular area on the first image to be used for processing, as well as the coordinates in the first image where to place the upper-left corner of the specified rectangle of the second image.