#include "HxImageRep.h"
Go to the source code of this file.
| Functions | |
| HxImageRep L_HXIMAGEREP | HxImageAsComplex (HxImageRep img) | 
| Convert the pixel representation to HxComplex. More... | |
| 
 | 
| Convert the pixel representation to HxComplex. Conversion is done via a cast. 
 00015 {
00016     HxString fname("HxImageAsComplex");
00017 
00018     if (img.isNull())
00019     {
00020         HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID);
00021         return HxImageRep();
00022     }
00023     if ((img.pixelDimensionality() != 1) && (img.pixelDimensionality() != 2))
00024     {
00025         HxGlobalError::instance()->reportError(fname, "operation only valid on scalar and vec2 image", HxGlobalError::HX_GE_INVALID);
00026         return HxImageRep();
00027     }
00028 
00029     HxImageSignature signature(HXIMAGESIG2DCOMPLEX);
00030     signature.setImageDimensionality(img.dimensionality());
00031     return img.signature() == signature ?
00032             img : HxImageFactory::instance().fromImage(signature, img);
00033 }
 | 
 1.2.12 written by Dimitri van Heesch,
 © 1997-2001
1.2.12 written by Dimitri van Heesch,
 © 1997-2001