#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxProjectRange (HxImageRep im, int dimension) |
Projection of the pixel range. More... |
|
Projection of the pixel range. The function computes the projection (see Pixels) of all pixels in the input image via a unary pixel operation (see Images). Dimension starts at 1.
00013 { 00014 HxString fname("HxProjectRange"); 00015 00016 if (im.isNull()) 00017 { 00018 HxGlobalError::instance()->reportError(fname, im.name(), "null image", HxGlobalError::HX_GE_INVALID); 00019 return HxImageRep(); 00020 } 00021 if ((im.pixelDimensionality() != 2) && 00022 (im.pixelDimensionality() != 3)) 00023 { 00024 HxGlobalError::instance()->reportError(fname, "Operation is only valid for Vector images", HxGlobalError::HX_GE_INVALID); 00025 return HxImageRep(); 00026 } 00027 if (dimension < 1) 00028 { 00029 HxGlobalError::instance()->reportError(fname, "Dimension should be greater than zero", HxGlobalError::HX_GE_INVALID); 00030 return HxImageRep(); 00031 } 00032 if (dimension > im.pixelDimensionality()) 00033 { 00034 HxGlobalError::instance()->reportError(fname, "Dimension should be less than pixel dimensionality", HxGlobalError::HX_GE_INVALID); 00035 return HxImageRep(); 00036 } 00037 00038 return im.projectRange(dimension); 00039 } |