Flips the image referenced by hIGear either horizontally or vertically.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_IP_flip( HIGEAR hIGear, AT_MODE nDirection ); |
Name | Type | Description |
---|---|---|
hIGear | HIGEAR | HIGEAR handle of image to flip. |
nDirection | AT_MODE | IG_FLIP_HORIZONTAL or IG_FLIP_VERTICAL, indicating whether to flip horizontally or vertically. |
All pixel formats supported by ImageGear for C and C++.
Image Processing, ArtX, Medical, Timing.
Copy Code
|
|
---|---|
HIGEAR hIGear; // HIGEAR handle of the 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", &hIGear); if(nErrcount == 0) { nErrcount = IG_IP_flip(hIGear, IG_FLIP_VERTICAL); // ... // Destroy the image IG_image_delete(hIGear); } |
Flipping horizontally exchanges the right-most pixel column of the image bitmap with the left-most. Flipping vertically exchanges the topmost pixel row (raster) of the image bitmap with the bottom-most. The dimensions of the image do not change.
If you want to turn the image upside-down (not the same as a vertical flip), use function IG_IP_rotate_multiple_90, with rotation mode set to IG_ROTATE_180.