#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxImageAsVec2Double (HxImageRep img) |
Convert the pixel representation to HxVec2Double. More... |
|
Convert the pixel representation to HxVec2Double. Conversion is done via a cast.
00014 { 00015 HxString fname("HxImageAsVec2Double"); 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(HXIMAGESIG2DVEC2DOUBLE); 00029 signature.setImageDimensionality(img.dimensionality()); 00030 return img.signature() == signature ? 00031 img : HxImageFactory::instance().fromImage(signature, img); 00032 } |