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

HxLog10.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxLog10 (HxImageRep im)
 Base 10 logarithm. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxLog10 HxImageRep    im
 

Base 10 logarithm.

The function computes the base 10 logarithm (see Pixels) of all pixels in the input image via a unary pixel operation (see Images).

Implementation specifics : The pixel functor : HxUpoLog10. The image functor instantiator : HxInstantiatorLog10.

00013 {
00014     HxString fname("HxLog10");
00015 
00016     if (im.isNull())
00017     {
00018         HxGlobalError::instance()->reportError(fname, im.name(), "null image", HxGlobalError::HX_GE_INVALID);
00019         return HxImageRep();
00020     }
00021     HxValue vinf = HxPixInf(im);
00022 
00023     if (im.signature().pixelDimensionality() == 1)
00024     {
00025         if (((HxScalarDouble) vinf) <= 0.0)
00026         {
00027             HxGlobalError::instance()->reportError(fname, im.name(), "values less than 0", HxGlobalError::HX_GE_OUTOFRANGE);
00028         }
00029     }
00030     else if (im.signature().pixelDimensionality() == 2)
00031     {
00032         HxVec2Double vinf2d = (HxVec2Double) vinf;
00033         if ((vinf2d.x() <= 0.0) || (vinf2d.y() <= 0.0))
00034         {
00035             HxGlobalError::instance()->reportError(fname, im.name(), "2D values are less than 0", HxGlobalError::HX_GE_OUTOFRANGE);
00036         }
00037     }
00038     else if (im.signature().pixelDimensionality() == 3)
00039     {
00040         HxVec3Double vinf3d = (HxVec3Double) vinf;
00041         if ((vinf3d.x() <= 0.0) || (vinf3d.y() <= 0.0) || (vinf3d.z() <= 0.0))
00042         {
00043             HxGlobalError::instance()->reportError(fname, im.name(), "3D values are less than 0", HxGlobalError::HX_GE_OUTOFRANGE);
00044         }
00045     }
00046 
00047     return im.unaryPixOp("log10");
00048 }


Generated on Tue Feb 3 14:18:49 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001