Synopsis
HxImageRep HxComplement(HxImageRep img)
Input
HxImageRep img
Return value
HxImageRep
Description
The function HxComplement takes the complement of every pixel value, where the complement is the bit-wise complement. HxComplement is only defined for integer image types.
Remarks
Examples
Taking the complement of an image
#include "HxImageRepGlobalFuncs.h" #include "HxImageRep.h" HxImageRep HxComplementExample1(HxImageRep img) { img = HxImageAsByte(img); img = HxComplement(img); return img; } int main(int argc, char* argv[]) { HxImageRep im1 = HxMakeFromFile(argv[1]); im1 = HxComplementExample1(im1); HxWriteFile(im1, argv[2]); return 0; }
Input image for the HxComplement example.
Output image of the HxComplement example.
In this example we take the complement of an image. The input image must be of an integer type.
See also
Keywords
Unary, Arithmetic,