Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxComplement

Synopsis

HxImageRep HxComplement(HxImageRep img)

Input

HxImageRep img
The image you want to take the complement of.

Return value

HxImageRep
The complement of the input image.

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

Valid input images
Only integer images types are valid as input for this function.

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;
}

exampleImage1.gif

Input image for the HxComplement example.

HxComplementResult1.gif

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

HxNegate,

Keywords

Unary, Arithmetic,


Generated on Mon Jan 27 15:44:59 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001