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

HxMulVal.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxMulVal (HxImageRep im, HxValue val)
 Multiplication. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxMulVal HxImageRep    im,
HxValue    val
 

Multiplication.

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

Implementation specifics : The pixel functor : HxBpoMul. The image functor instantiator : HxInstantiatorMulV.

00013 {
00014     HxString fname("HxMulVal");
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     int valdim;
00023     if ((val.tag() == HxValue::SI) || (val.tag() == HxValue::SD))
00024     {
00025         valdim = 1;
00026     }
00027     else if ((val.tag() == HxValue::V2I) || (val.tag() == HxValue::V2D))
00028     {
00029         valdim = 2;
00030     }
00031     else 
00032     {
00033         valdim = 3;
00034     }
00035     if ((valdim != 1) && (im.signature().pixelDimensionality() != valdim))
00036     {
00037         HxGlobalError::instance()->reportError(fname, "pixel dimensionality differs from value dimensionality", 
00038                         HxGlobalError::HX_GE_UNEQUAL_DIMS);
00039         return HxImageRep();
00040     }
00041 
00042     return im.binaryPixOp(val, "mul");
00043 }


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