Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxOrVal.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxOrVal (HxImageRep im, HxValue val)
 Or. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxOrVal HxImageRep    im,
HxValue    val
 

Or.

The function performs or (see Pixels) on all pixels in the input image via a binary pixel operation (see Images).

Implementation specifics : The pixel functor : HxBpoOr. The image functor instantiator : HxInstantiatorOrV.

00013 {
00014     HxString fname("HxOrVal");
00015 
00016     if (im.isNull())
00017     {
00018         HxGlobalError::instance()->reportError(fname, im.name(), "null image", HxGlobalError::HX_GE_INVALID);
00019         return HxImageRep();
00020     }
00021 
00022     if (im.signature().pixelDimensionality() != 1)
00023     {
00024         HxGlobalError::instance()->reportError(fname, "logical operators are only valid for scalar images", HxGlobalError::HX_GE_INVALID);
00025         return HxImageRep();
00026     }
00027 
00028     if (im.signature().pixelType() != INT_VALUE)
00029     {
00030         HxGlobalError::instance()->reportError(fname, "logical operators are only valid on integer images", HxGlobalError::HX_GE_INVALID);
00031         return HxImageRep();
00032     }
00033 
00034     if (val.tag() != HxValue::SI)
00035     {
00036         HxGlobalError::instance()->reportError(fname, "only scalar integer value supported", HxGlobalError::HX_GE_INVALID);
00037         return HxImageRep();
00038     }
00039 
00040 
00041     return im.binaryPixOp(val, "or");
00042 }


Generated on Mon Jan 27 15:48:55 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001