#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
| HxImageRep L_HXIMAGEREP | HxAsin (HxImageRep im) |
| Arc sine. More... | |
|
|
Arc sine. The function computes the arc sine (see Pixels) of all pixels in the input image via a unary pixel operation (see Images). Implementation specifics : The pixel functor : HxUpoAsin. The image functor instantiator : HxInstantiatorAsin.
00013 {
00014 HxString fname("HxAsin");
00015
00016 if (im.isNull())
00017 {
00018 HxGlobalError::instance()->reportError(fname, im.name(), "null image", HxGlobalError::HX_GE_INVALID);
00019 return HxImageRep();
00020 }
00021 // value between -1 and 1
00022 // ook voor vector etc.
00023
00024 HxValue vsup = HxPixSup(im);
00025 HxValue vinf = HxPixInf(im);
00026
00027 if (im.signature().pixelDimensionality() == 1)
00028 {
00029 if ((((HxScalarDouble) vinf) < -1.0) || (((HxScalarDouble) vsup) > 1.0))
00030 {
00031 HxGlobalError::instance()->reportError(fname, im.name(), "values not in [-1:1]", HxGlobalError::HX_GE_OUTOFRANGE);
00032 }
00033 }
00034 else if (im.signature().pixelDimensionality() == 2)
00035 {
00036 HxVec2Double vinf2d = (HxVec2Double) vinf;
00037 HxVec2Double vsup2d = (HxVec2Double) vsup;
00038 if ((vinf2d.x() < -1.0) || (vsup2d.x() > 1.0) ||
00039 (vinf2d.y() < -1.0) || (vsup2d.y() > 1.0))
00040 {
00041 HxGlobalError::instance()->reportError(fname, im.name(), "2D values are not in [-1:1]", HxGlobalError::HX_GE_OUTOFRANGE);
00042 }
00043 }
00044 else if (im.signature().pixelDimensionality() == 3)
00045 {
00046 HxVec3Double vinf3d = (HxVec3Double) vinf;
00047 HxVec3Double vsup3d = (HxVec3Double) vsup;
00048 if ((vinf3d.x() < -1.0) || (vsup3d.x() > 1.0) ||
00049 (vinf3d.y() < -1.0) || (vsup3d.y() > 1.0) ||
00050 (vinf3d.z() < -1.0) || (vsup3d.z() > 1.0))
00051 {
00052 HxGlobalError::instance()->reportError(fname, im.name(), "3D values are not in [-1:1]", HxGlobalError::HX_GE_OUTOFRANGE);
00053 }
00054 }
00055
00056 return im.unaryPixOp("asin");
00057 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001