#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
| HxImageRep L_HXIMAGEREP | HxImageAsByte (HxImageRep img) |
| Convert the pixel representation to HxByte. More... | |
|
|
Convert the pixel representation to HxByte. Conversion is done via a cast.
00014 {
00015 HxString fname("HxImageAsByte");
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)
00023 {
00024 HxGlobalError::instance()->reportError(fname, "operation only valid on scalar image", HxGlobalError::HX_GE_INVALID);
00025 return HxImageRep();
00026 }
00027
00028 HxImageSignature signature(HXIMAGESIG2DBYTE);
00029 signature.setImageDimensionality(img.dimensionality());
00030 return img.signature() == signature ?
00031 img : HxImageFactory::instance().fromImage(signature, img);
00032 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001