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

HxOr

Synopsis

HxImageRep HxOr(HxImageRep im1, HxImageRep im2)

Input

HxImageRep im1
The first input image.

HxImageRep im2
The second input image.

Return value

HxImageRep
The logical `or' of the input images.

Description

The function HxOr takes the logical `or' of corresponding pixels in the two images. The `or' of two vectors is taken component wise.

Remarks

Valid input images
The input images should have the same dimensionality, the same size, the same pixel dimensionality and the same pixel type. The numerical values of the pixels, or its components, should be HxShort, HxByte, HxInt .

Examples

Taking the logical `or'

#include "HxImageRepGlobalFuncs.h"
#include "HxImageRep.h"

HxImageRep HxOrExample1(HxImageRep im1, HxImageRep im2) {
   im1 = HxImageAsDouble(im1);
   im2 = HxImageAsDouble(im2);
   im1 = HxContrastStretch(im1, 1.0);
   im2 = HxContrastStretch(im2, 1.0);
   im1 = HxImageAsByte(im1);
   im2 = HxImageAsByte(im2);
   im1 = HxOr(im1, im2);
   im1 = HxContrastStretch(im1, 255);

   return im1;
}

int main(int argc, char* argv[])
{
    HxImageRep im1 = HxMakeFromFile(argv[1]);
    HxImageRep im2 = HxMakeFromFile(argv[2]);
    im1 = HxOrExample1(im1, im2);
    HxWriteFile(im1, argv[3]);

    return 0;
}

exampleImage3.gif

First input image for the HxOr example.

exampleImage4.gif

Second input image for the HxOr example.

HxOrResult1.gif

Output image of the HxOr example.

In this example we take the logical `or' of the two input images.

See also

HxAnd, HxXor, HxOrVal,

Keywords

Binary, Logical,


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