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

HxImageAsVec2Float.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxImageAsVec2Float (HxImageRep img)
 Convert the pixel representation to HxVec2Float. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxImageAsVec2Float HxImageRep    img
 

Convert the pixel representation to HxVec2Float.

Conversion is done via a cast.

00014 {
00015     HxString fname("HxImageAsVec2Float");
00016 
00017     if (img.isNull())
00018     {
00019         HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID);
00020         return HxImageRep();
00021     }
00022     if ((img.pixelDimensionality() != 1) && (img.pixelDimensionality() != 2))
00023     {
00024         HxGlobalError::instance()->reportError(fname, "operation only valid on scalar and vec2 image", HxGlobalError::HX_GE_INVALID);
00025         return HxImageRep();
00026     }
00027 
00028     HxImageSignature signature(HXIMAGESIG2DVEC2FLOAT);
00029     signature.setImageDimensionality(img.dimensionality());
00030     return img.signature() == signature ?
00031             img : HxImageFactory::instance().fromImage(signature, img);
00032 }


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