#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
| HxImageRep L_HXIMAGEREP | HxLessEqual (HxImageRep im1, HxImageRep im2) |
| Less equal. More... | |
|
||||||||||||
|
Less equal. The function performs less equal (see Pixels) on all pixels in the input images via a binary pixel operation (see Images). Implementation specifics : The pixel functor : HxBpoLessEqual. The image functor instantiator : HxInstantiatorLessEqual.
00013 {
00014 HxString fname("HxLessEqual");
00015
00016 if (im1.isNull())
00017 {
00018 HxGlobalError::instance()->reportError(fname, im1.name(), "null image", HxGlobalError::HX_GE_INVALID);
00019 return HxImageRep();
00020 }
00021 if (im2.isNull())
00022 {
00023 HxGlobalError::instance()->reportError(fname, im2.name(), "null image", HxGlobalError::HX_GE_INVALID);
00024 return HxImageRep();
00025 }
00026
00027 if (im1.dimensionality() != im2.dimensionality())
00028 {
00029 HxGlobalError::instance()->reportError(fname, "unequal image dimensionalities", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00030 return HxImageRep();
00031 }
00032 if ((im1.pixelDimensionality() != 1) || (im2.pixelDimensionality() != 1))
00033 {
00034 HxGlobalError::instance()->reportError(fname, "operation only valid on scalar types", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00035 return HxImageRep();
00036 }
00037
00038 if (im1.sizes().x() != im2.sizes().x())
00039 {
00040 HxGlobalError::instance()->reportError(fname, "unequal image widths", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00041 return HxImageRep();
00042 }
00043 if (im1.sizes().y() != im2.sizes().y())
00044 {
00045 HxGlobalError::instance()->reportError(fname, "unequal image heights", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00046 return HxImageRep();
00047 }
00048 if (im1.dimensionality() > 2)
00049 {
00050 if (im1.sizes().z() != im2.sizes().z())
00051 {
00052 HxGlobalError::instance()->reportError(fname, "unequal image depths", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00053 return HxImageRep();
00054 }
00055 }
00056
00057 return im1.binaryPixOp(im2, "lessEqual");
00058 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001