#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxMakeFromSignature (const HxImageSignature &signature, HxSizes sizes) |
Make an uninitialized image with given signature and sizes. More... |
|
Make an uninitialized image with given signature and sizes.
00014 { 00015 HxString fname("HxMakeFromSignature"); 00016 00017 if ((signature.pixelDimensionality() < 1) || (signature.pixelDimensionality() > 3)) 00018 { 00019 HxGlobalError::instance()->reportError(fname, "Illegal pixel dimensionality", HxGlobalError::HX_GE_INVALID); 00020 return HxImageRep(); 00021 } 00022 if ((signature.imageDimensionality() < 2) || (signature.imageDimensionality() > 3)) 00023 { 00024 HxGlobalError::instance()->reportError(fname, "Illegal number of dimensions", HxGlobalError::HX_GE_INVALID); 00025 return HxImageRep(); 00026 } 00027 00028 if (sizes.x() < 1) 00029 { 00030 HxGlobalError::instance()->reportError(fname, "Illegal x size", HxGlobalError::HX_GE_INVALID); 00031 return HxImageRep(); 00032 } 00033 if (sizes.y() < 1) 00034 { 00035 HxGlobalError::instance()->reportError(fname, "Illegal y size", HxGlobalError::HX_GE_INVALID); 00036 return HxImageRep(); 00037 } 00038 if (signature.imageDimensionality() > 2) 00039 { 00040 if (sizes.y() < 1) 00041 { 00042 HxGlobalError::instance()->reportError(fname, "Illegal y size", HxGlobalError::HX_GE_INVALID); 00043 return HxImageRep(); 00044 } 00045 } 00046 // check size of int*, but how? 00047 00048 return HxImageFactory::instance().fromSignature(signature, sizes); 00049 } |