cc [ flag... ] file... –lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageInvert(mlib_image *dst, const mlib_image *src);
The mlib_ImageInvert() function performs the inversion of an image such that white becomes black, light gray becomes dark gray, and so on.
It uses the following equation:
dst[x][y][i] = (Gwhite + Gblack) - src[x][y][i]
The values of Gwhite and Gblack for different types of images are:
Given that integer data are in the two's complement representation, mlib_ImageInvert() is the same as mlib_ImageNot(), while mlib_ImageInvert_Inp() is the same as mlib_ImageNot_Inp().
The function takes the following arguments:
Pointer to destination image.
Pointer to source image.
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
See attributes(5) for descriptions of the following attributes: