eLynx SDK v3.3.0
C++ image processing API reference
Classes | Typedefs | Enumerations | Functions

eLynx::Math Namespace Reference

Deals with all basic math helpers and vectorial tools classes. More...

Classes

class  AbstractTransformation
 Abstract predecessor for all geometrical 2D plane-to-2D plane transformations. More...
class  BellCurve
 Implementation of gaussian curve using IFunctionNL interface. More...
class  BellSurface
 Implementation of gaussian surface using IFunctionNL interface. More...
struct  BezierTriangle3
class  BSpline1
 1D spline interface. More...
class  BSpline2
 2D spline interface. More...
struct  ConvolutionKernel
 Convolution kernel in W x H dimension, used with float and double resolution. More...
class  GaussNewton
 Non-linear iterative function fitter, implemented using Gauss-Newton method. More...
class  Point2
class  Point3
class  Segment2
class  Segment3
class  Rectangle2
class  AOBBox2
class  Triangle2
class  Triangle3
class  TriangleIdx
struct  TriangulationData
struct  BarycentricCoordinates2
class  IFunctionNL
 Interface to function of n-variables and m-parameters, which is non-linear in the meaning of parameters, and thus can't be directly used for least squares fitting. More...
class  IMatrix
 M x N matrix interface. More...
class  IResampleFilter
class  ISpline1D
 1D spline interface. More...
class  ISpline2D
 2D spline interface. More...
class  IVector
 N-size vector interface. More...
class  KDTree
 2D binary tree. More...
struct  KDNode
class  LeastSquares
 Least squares problems solver. More...
class  LinearTransformation
 Class implementing 2D linear transformation. More...
class  Matrix
 Basic M x N matrix implementation as rectangular array of doubles. More...
class  MatrixColVector
 Adapter, that provides vector-like read/write access to the column of the matrix. More...
class  MatrixRowVector
 Adapter, that provides vector-like read/write access to the row of the matrix. More...
class  Ramp
 Ramp is a look-up table for uint8 and uint16 types only. More...
class  ResampleHelper
class  SingleColMatrix
 Adapter, that provides matrix-like read/write access to the vector. More...
class  SingleRowMatrix
 Adapter, that provides matrix-like read/write access to the vector. More...
class  SubMatrix
 Adapter, that allows to work with part of the matrix as a separate matrix. More...
class  IMapTransform
class  CopyTransform
class  MidtoneTransform
class  ITransfertFunction
class  AbstractTransfertFunction
class  TransfertFunctionCopy
class  TransfertFunctionMidtone
class  TransposedMatrix
 Adapter, that provides transposed interface to given matrix. More...
class  Vector
 Basic N-size vector implementation as array of doubles. More...

Typedefs

typedef ConvolutionKernel< int32 > ConvolutionKerneli
 Definition of a convolution kernel in 32-bit integer type.
typedef ConvolutionKernel< float > ConvolutionKernelf
 Definition of a convolution kernel in float type.
typedef ConvolutionKernel< double > ConvolutionKerneld
 Definition of a convolution kernel in double type.
typedef std::vector< Point2iPoint2iList
 List of 2d points with 32bit integer resolution.
typedef std::vector< Point2lPoint2lList
 List of 2d points with 64bit integer resolution.
typedef std::vector< Point2fPoint2fList
 List of 2d points with 32bit float resolution.
typedef std::vector< Point2dPoint2dList
 List of 2d points with 64bit float resolution.
typedef std::vector< AOBBox2iAOBBox2iList
 List of 2d Axis Oriented Bouding Box in 32bit integer resolution.
typedef std::vector< AOBBox2lAOBBox2lList
 List of 2d Axis Oriented Bouding Box in 64bit integer resolution.
typedef std::vector< AOBBox2fAOBBox2fList
 List of 2d Axis Oriented Bouding Box in 32bit float resolution.
typedef std::vector< AOBBox2dAOBBox2dList
 List of 2d Axis Oriented Bouding Box in 64bit float resolution.
typedef std::vector< TriangleIdxTriangleIdxList
 List of triangle index of points.
1d BSpline specializations
typedef BSpline1< int32 > BSpline1i
typedef BSpline1< int64 > BSpline1l
typedef BSpline1< float > BSpline1f
typedef BSpline1< double > BSpline1d
2d BSpline specializations
typedef BSpline2< int32 > BSpline2i
typedef BSpline2< int64 > BSpline2l
typedef BSpline2< float > BSpline2f
typedef BSpline2< double > BSpline2d
Point specializations
typedef Point2< int32 > Point2i
 2d Point with 32bit integer resolution.
typedef Point2< int64 > Point2l
 2d Point with 64bit integer resolution.
typedef Point2< float > Point2f
 2d Point with 32bit float resolution.
typedef Point2< double > Point2d
 2d Point with 64bit float resolution.
typedef Point3< int32 > Point3i
 2d Point with 32bit integer resolution.
typedef Point3< int64 > Point3l
 3d Point with 64bit integer resolution.
typedef Point3< float > Point3f
 3d Point with 32bit float resolution.
typedef Point3< double > Point3d
 3d Point with 64bit float resolution.
Segment specializations
typedef Segment2< int32 > Segment2i
typedef Segment2< int64 > Segment2l
typedef Segment2< float > Segment2f
typedef Segment2< double > Segment2d
typedef Segment3< int32 > Segment3i
typedef Segment3< int64 > Segment3l
typedef Segment3< float > Segment3f
typedef Segment3< double > Segment3d
typedef AOBBox2< int32 > AOBBox2i
 2d Axis Oriented Bouding Box in 32bit integer resolution.
typedef AOBBox2< int64 > AOBBox2l
 2d Axis Oriented Bouding Box in 64bit integer resolution.
typedef AOBBox2< float > AOBBox2f
 2d Axis Oriented Bouding Box in 32bit float resolution.
typedef AOBBox2< double > AOBBox2d
 2d Axis Oriented Bouding Box in 64bit float resolution.
Rectangle specializations
typedef Rectangle2< int32 > Rectangle2i
typedef Rectangle2< int64 > Rectangle2l
typedef Rectangle2< float > Rectangle2f
typedef Rectangle2< double > Rectangle2d
Triangle specializations
typedef Triangle2< int32 > Triangle2i
typedef Triangle2< int64 > Triangle2l
typedef Triangle2< float > Triangle2f
typedef Triangle2< double > Triangle2d
typedef Triangle3< int32 > Triangle3i
typedef Triangle3< int64 > Triangle3l
typedef Triangle3< float > Triangle3f
typedef Triangle3< double > Triangle3d

Enumerations

enum  ECompassDirection {
  CD_North = 0, CD_NorthEast, CD_East, CD_SouthEast,
  CD_South, CD_SouthWest, CD_West, CD_NorthWest
}
 

Orientation CD_NorthWest CD_North CD_NorthEast CD_West CD_East CD_SouthWest CD_South CD_SouthEast.


enum  EResampleFilter {
  RF_Box, RF_Triangle, RF_Hermite, RF_Bell,
  RF_CubicBSpline, RF_Lanczos3, RF_Mitchell, RF_Cosine,
  RF_CatmullRom, RF_Quadratic, RF_CubicConvolution, RF_Lanczos5,
  RF_Lanczos8, RF_BlackmanHarris, RF_Sync, RF_Hanning,
  RF_Hamming, RF_Blackman, RF_Gaussian, RF_Undefined
}
 

Implemented resample filter collection.

More...

Functions

ExportedByMath bool elxFFT (float *ioprComplexMap, uint32 iDimArray[], uint32 iDimension, bool ibForward)
 Computes an in-place complex-to-complex FFT in 32bit float resolution.
ExportedByMath bool elxFFT (double *ioprComplexMap, uint32 iDimArray[], uint32 iDimension, bool ibForward)
 Computes an in-place complex-to-complex FFT in 64bit float resolution.
template<typename T >
double elxGetDistance (const Point2< T > &iP0, const Point2< T > &iP1)
template<typename T >
Point2< T > elxGetMiddle (const Point2< T > &iP0, const Point2< T > &iP1)
template<class T >
Point2< T > elxGetMiddle (const Point2< T > &iP0, const Point2< T > &iP1, const Point2< T > &iP2)
template<typename T >
bool elxComparePoints (const Point2< T > &iP0, const Point2< T > &iP1)
template<typename T >
bool elxEqualPoints (const Point2< T > &iP0, const Point2< T > &iP1)
template<class T >
Point2< T > elxNormalizePoint (const Point2< T > &iP)
template<class T >
elxDotProduct (const Point2< T > &iP0, const Point2< T > &iP1)
template<class T >
Point2< T > elxSubstructPoints (const Point2< T > &iP0, const Point2< T > &iP1)
template<class T >
Point2< T > elxAddPoints (const Point2< T > &iP0, const Point2< T > &iP1)
template<typename T >
double elxGetDistance (const Point3< T > &iP0, const Point3< T > &iP1)
template<typename T >
Point3< T > elxGetMiddle (const Point3< T > &iP0, const Point3< T > &iP1)
template<class T >
Point3< T > elxGetMiddle (const Point3< T > &iP0, const Point3< T > &iP1, const Point3< T > &iP2)
template<typename T >
bool elxComparePoints (const Point3< T > &iP0, const Point3< T > &iP1)
template<typename T >
bool elxEqualPoints (const Point3< T > &iP0, const Point3< T > &iP1)
template<class T >
Point3< T > elxNormalizePoint (const Point3< T > &iP)
template<class T >
Point3< T > elxCrossProduct (const Point3< T > &iP0, const Point3< T > &iP1)
template<class T >
elxDotProduct (const Point3< T > &iP0, const Point3< T > &iP1)
template<class T >
Point3< T > elxSubstructPoints (const Point3< T > &iP0, const Point3< T > &iP1)
template<class T >
Point3< T > elxAddPoints (const Point3< T > &iP0, const Point3< T > &iP1)
bool ExportedByMath elxTriangulate (const Point2iList &iPoints, TriangleIdxList &oTriangles)
bool ExportedByMath elxTriangulate (const Point2iList &iPoints, TriangulationData &oTriangles)
template<class Operator >
void ExportedByMath elxProcessLine2i (int32 iX1, int32 iY1, int32 iX2, int32 iY2, int32 iW, int32 iH, Operator &iOperator)
template<class Operator >
void ExportedByMath elxProcessLine2i (const Math::Point2i &iP1, const Math::Point2i &iP2, int32 iW, int32 iH, Operator &iOperator)
void ExportedByMath elxComputeLinePoints (const Point2i &iP1, const Point2i &iP2, int32 iW, int32 iH, Point2iList &iPoints)
template<typename T >
bool ExportedByMath elxIntersectLineLine (const Point2< T > &iPoint11, const Point2< T > &iPoint12, const Point2< T > &iPoint21, const Point2< T > &iPoint22, Point2< T > &oPoint)
template<typename T >
bool ExportedByMath elxIntersectLineLine (const T iX11, const T iY11, const T iX12, const T iY12, const T iX21, const T iY21, const T iX22, const T iY22, T &X, T &Y)
template<typename T , typename U >
bool ExportedByMath elxIntersectLineLine (const Point2< T > &iPoint11, const Point2< T > &iPoint12, const Point2< T > &iPoint21, const Point2< T > &iPoint22, Point2< U > &oPoint)
template<typename T , typename U >
bool ExportedByMath elxIntersectLineLine (const T iX11, const T iY11, const T iX12, const T iY12, const T iX21, const T iY21, const T iX22, const T iY22, U &X, U &Y)
template<typename T >
bool ExportedByMath elxIntersectLineSegment (const Point2< T > &iPoint1, const Point2< T > &iPoint2, const Segment2< T > &iSegment, Point2< T > &oPoint)
bool ExportedByMath elxIntersectLineRectangle (const Point2< int32 > &iPoint1, const Point2< int32 > &iPoint2, const Rectangle2< int32 > &iRectangle, Segment2< int32 > &oSegment)
template<typename T >
bool ExportedByMath elxIntersectCircleRectangle (const Rectangle2< T > &iRectangle, const Point2< T > &iPoint, T iRadius)
ExportedByMath uint32 elxGetKernelSize (double iRadius)
 Get the length of a square surrounding a circle with a given radius.
ExportedByMath ConvolutionKerneld elxMakeGaussianSeparableKernel (uint32 iWidth, double iVariance, bool ibHorizontal)
 Make 2D Gaussian separable kernel.
ExportedByMath ConvolutionKerneld elxMakeGaussianKernel (uint32 iWidth, uint32 iHeight, double iVariance)
 Make 2D Gaussian kernel.
ExportedByMath ConvolutionKerneld elxMakeGaussianKernel (uint32 iRadius, double iVariance)
 Make 2D Gaussian kernel.
ExportedByMath ConvolutionKerneld elxMakeMeanKernel (uint32 iWidth, uint32 iHeight)
 Make 2D mean kernel, this have a smoothing effect.
ExportedByMath ConvolutionKerneld elxMakeMeanRadiusKernel (double iRadius, bool ibCircular=true)
 Make 2D mean kernel, square or circle mask kernel.
ExportedByMath ConvolutionKerneld elxMakeCircleKernel (double iRadius, bool ibNormalize=false)
 Make circle mask kernel.
ExportedByMath ConvolutionKerneld elxMakeMarrHildreth3x3d ()
 Make a Marr Hildreth 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeKirsch3x3d ()
 Make a Kirsch 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeKirsch5x5d ()
 Make a Kirsch 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeEmboss3x3d (double iDegrees=0.0)
 Make a emboss 3x3 kernel.
ExportedByMath const char * elxChannelMaskToString (uint32 iChannelMask)
 Return channel mask as a string.
ExportedByMath uint32 elxToChannelMask (const char *iprChannelMask)
 Return channel mask from a string.
template<typename T >
bool elxApplyRamp (const Ramp< T > &iRamp, T *iprSrc, size_t iSize, uint32 iChannelCount, uint32 iChannelMask)
 Apply one ramp on a buffer with one thread.
template<typename T >
bool elxApplyRamp (const Ramp< T > &iRamp0, const Ramp< T > &iRamp1, T *iprSrc, size_t iSize, uint32 iChannelMask)
 Apply two ramps on a buffer with one thread.
template<typename T >
bool elxApplyRamp (const Ramp< T > &iRamp0, const Ramp< T > &iRamp1, const Ramp< T > &iRamp2, T *iprSrc, size_t iSize, uint32 iChannelMask)
 Apply three ramps on a buffer with one thread.
template<typename T >
bool elxApplyRampFast (const Ramp< T > &iRamp, T *iprSrc, size_t iSize, uint32 iChannelCount, uint32 iChannelMask)
 Apply one ramp on a buffer using the multicore optimisation.
template<typename T >
bool elxApplyRampFast (const Ramp< T > &iRamp0, const Ramp< T > &iRamp1, T *iprSrc, size_t iSize, uint32 iChannelMask)
 Apply two ramps on a buffer using the multicore optimisation.
template<typename T >
bool elxApplyRampFast (const Ramp< T > &iRamp0, const Ramp< T > &iRamp1, const Ramp< T > &iRamp2, T *iprSrc, size_t iSize, uint32 iChannelMask)
 Apply three ramps on a buffer using the multicore optimisation.
 DEFINE_RESAMPLE_FILTER (Box)
 Box filter: pulse, Fourier window, 1st order (constant) b-spline.
 DEFINE_RESAMPLE_FILTER (Triangle)
 Triangle filter: Bartlett window, 2nd order (linear) b-spline.
 DEFINE_RESAMPLE_FILTER (Hermite)
 Hermite filter: 2t3 − 3t2 + 1.
 DEFINE_RESAMPLE_FILTER (Bell)
 Bell filter:
 DEFINE_RESAMPLE_FILTER (CubicBSpline)
 Cubic B spline filter:
 DEFINE_RESAMPLE_FILTER (Lanczos3)
 Lanczos 3 filter:
 DEFINE_RESAMPLE_FILTER (Mitchell)
 Mitchell filter:
 DEFINE_RESAMPLE_FILTER (Cosine)
 Cosine filter:
 DEFINE_RESAMPLE_FILTER (CatmullRom)
 Catmull Rom filter:
 DEFINE_RESAMPLE_FILTER (Quadratic)
 Quadratic filter:
 DEFINE_RESAMPLE_FILTER (CubicConvolution)
 Cubic convolution filter:
 DEFINE_RESAMPLE_FILTER (Lanczos5)
 Lanczos 5 filter:
 DEFINE_RESAMPLE_FILTER (Lanczos8)
 Lanczos 8 filter:
 DEFINE_RESAMPLE_FILTER (BlackmanHarris)
 Blackman Harris filter:
 DEFINE_RESAMPLE_FILTER (Sinc)
 Sinc filter:
 DEFINE_RESAMPLE_FILTER (Hanning)
 Hanning filter:
 DEFINE_RESAMPLE_FILTER (Hamming)
 Hamming filter:
 DEFINE_RESAMPLE_FILTER (Blackman)
 Blackman filter:
 DEFINE_RESAMPLE_FILTER (Gaussian)
 Gaussian filter:
ExportedByMath const char * elxToString (EResampleFilter iFilter)
 Return the string name of the resample filter function.
ExportedByMath EResampleFilter elxToEResampleFilter (const char *iprFilter)
 Converts string to EResampleFilter.
ExportedByMath const
IResampleFilter
elxGetResampleFilter (EResampleFilter iFilter)
 Get resample filter from enum.
Blur filters
ExportedByMath ConvolutionKerneld elxMakeSmooth3x3d ()
 Make smooth 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeCone5x5d ()
 Make cone 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakePyramidal5x5d ()
 Make pyramidal 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeLowpass3x3d (double iAlpha)
 Make lowpass 3x3 kernel.
Sharpen filters
ExportedByMath ConvolutionKerneld elxMakeSharpen (double iRadius=3.0)
 Make a sharpen kernel.
ExportedByMath ConvolutionKerneld elxMakeSharpen3x3d (double iAmount=5.0)
 Make a sharpen 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeSharpenSoft3x3d ()
 Make a soft sharpen 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeSharpenSoft5x5d ()
 Make a soft sharpen 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeSharpenSmooth3x3d (double iAlpha)
 Make a smooth sharpen 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeSharpenMore3x3d (double iAlpha=1.0)
 Make a sharpen more 3x3 kernel.
Gradient edge detectors filters
ExportedByMath ConvolutionKerneld elxMakePixelDifference3x3d ()
 Make a pixel difference 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeSeparatedPixelDifference3x3d ()
 Make a separated pixel difference 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeRoberts3x3d ()
 Make a Roberts 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakePrewitt3x3d ()
 Make a Prewitt 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakePrewitt5x5d ()
 Make a Prewitt 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeFreiChen3x3d ()
 Make a Frei Chen 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeSobel3x3d ()
 Make a Sobel 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeSobel5x5d ()
 Make a Sobel 5x5 kernel.
ExportedByMath ConvolutionKerneld elxMakeSobelNxNd (uint32 iSize=3)
 Make a Sobel NxN kernel.
ExportedByMath ConvolutionKerneld elxMakeRobinson5x5d ()
 Make a Robinson 5x5 kernel.
Laplacian edge detectors filters
ExportedByMath ConvolutionKerneld elxMakeLaplacian3x3d ()
 Make a Laplacian 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeLaplacian3x3d (double iAlpha)
 Make a Laplacian 3x3 kernel.
ExportedByMath ConvolutionKerneld elxMakeLaplacian (double iRadius)
 Make a Laplacian kernel.
ExportedByMath ConvolutionKerneld elxMakeLoG (double iRadius, double iVariance)
 Make a Laplacian of Gaussian kernel.
Sort function helpers.
template<typename T >
const T & elxMin (const T &iA, const T &iB)
 Minimum of two T values.
template<typename T >
const T & elxMin (const T &iA, const T &iB, const T &iC)
 Minimum of tree T values.
template<typename T >
const T & elxMin (const T &iA, const T &iB, const T &iC, const T &iD)
 Minimum of for T values.
template<typename T >
const T & elxMin (const T &iA, const T &iB, const T &iC, const T &iD, const T &iE)
 Minimum of for T values.
template<typename T >
const T & elxMin (const T &iA, const T &iB, const T &iC, const T &iD, const T &iE, const T &iF)
 Minimum of for T values.
template<typename T >
bool elxMin (const T *iprSrc, uint32 iSize, T &oMin)
template<typename T >
bool elxMin (const T *iprSrc, uint32 iSize, uint32 iStep, T *oprMin)
template<typename T >
elxMin (T iV0, T iV1, T iV2, T iV3, T iV4, T iV5, T iV6, T iV7, T iV8)
template<typename T >
const T & elxMax (const T &iA, const T &iB)
 Maximum of two T values.
template<typename T >
const T & elxMax (const T &iA, const T &iB, const T &iC)
 Maximum of two T values.
template<typename T >
const T & elxMax (const T &iA, const T &iB, const T &iC, const T &iD)
 Maximum of two T values.
template<typename T >
const T & elxMax (const T &iA, const T &iB, const T &iC, const T &iD, const T &iE)
 Maximum of two T values.
template<typename T >
const T & elxMax (const T &iA, const T &iB, const T &iC, const T &iD, const T &iE, const T &iF)
 Maximum of two T values.
template<typename T >
bool elxMax (const T *iprSrc, uint32 iSize, T &oMin)
template<typename T >
bool elxMax (const T *iprSrc, uint32 iSize, uint32 iStep, T *oprMax)
template<typename T >
elxMax (T iV0, T iV1, T iV2, T iV3, T iV4, T iV5, T iV6, T iV7, T iV8)
template<typename T >
bool elxMinMax (const T *iprSrc, uint32 iSize, T &oMin, T &oMax)
template<typename T >
bool elxMinMax (const T *iprSrc, uint32 iSize, uint32 iStep, T *oprMin, T *oprMax)
template<typename T >
elxNeg (const T iValue)
 negative
template<typename T >
elxMedian (T iV0, T iV1, T iV2)
 Median of 3 values.
template<typename T >
elxMedian (T iV0, T iV1, T iV2, T iV3)
 Median of 4 values.
template<typename T >
elxMedian (T iV0, T iV1, T iV2, T iV3, T iV4, T iV5, T iV6, T iV7, T iV8)
 Median of 9 values.
Normalization.
template<typename T >
bool elxNormalize (T *ioprSrc, uint32 iSize)
template<typename T >
bool elxNormalize (T *ioprSrc, uint32 iSize, T iMin, T iMax)
template<typename T >
bool elxNormalize (T *ioprSrc, uint32 iSize, uint32 iChannelMask, uint32 iChannelCount)
template<typename T >
bool elxNormalize (T *ioprSrc, uint32 iSize, const T *oprMinRange, const T *oprMaxRange, uint32 iChannelMask, uint32 iChannelCount)
Arithmetic helpers.
template<typename T >
elxSign (T iValue)
 Computes the sign of a value.
template<typename T >
elxAbs (T iX)
 Absolute of value, noted |a|.
template<typename T >
elxFloor (T iValue)
 Returns a value representing the largest integer that is less than or equal to the value.
template<typename T >
elxCeil (T iValue)
 Returns a value representing the smallest integer that is greater than or equal to the value.
template<typename T >
elxRound (T iValue)
 Returns a value representing the whole integer nearest to the value.
template<typename T >
int32 elxRint (T iValue)
 Returns a int32 value representing the whole integer nearest to the value.
template<typename T >
elxMod (T iA, T iB)
 Modulus of values noted m=a [b].
template<typename T >
elxMean (T iV1, T iV2)
 Computes the mean of two values iV1, iV2.
template<typename T >
elxAbsDiff (T iV1, T iV2)
 Computes absolute difference of iV1, iV2, to be used for unsigned type.
template<typename T >
bool elxIsOdd (T iValue)
 Checks if an integer is odd (2n+1).
template<typename T >
bool elxIsEven (T iValue)
 Checks if an integer is even (2n).
ExportedByMath int32 elxHighBit (uint32 iVal)
Exponential, logarithmic and power function helpers.
template<typename T >
elxSqr (T iX)
 Computes the square of iX = iX^2 = iX*iX.
template<typename T >
elxSqrt (T iX)
 Computes the compute the square root of iX.
template<typename T >
elxPow (T iX, T iY)
 Computes computes x raised to the power y.
template<typename T >
elxLog (T iX)
 Computes the value of the natural logarithm of argument iX.
template<typename T >
elxLog10 (T iX)
 Computes computes the value of the logarithm of argument iX to base 10.
template<typename T >
elxExp (T iX)
 Computes the exponent of iX.
template<typename T >
bool elxIsPow2 (T iValue)
 Returns if a number is a power of 2, for value=0 return false.
template<typename T >
elxNextPow2 (T iValue)
 Returns the next power of 2 lower of input value, return value if value is power of two.
Trigonometric and hyperbolic function helpers.

PI constant value

template<typename T >
elxDeg2Rad (T iDegrees)
 Converts a degree angle in radians angle unit.
template<typename T >
elxRad2Deg (T iRadian)
 Converts a radian angle in degrees angle unit.
template<typename T >
elxCos (T iRadian)
 Computes the cosine of iX angle in radians.
template<typename T >
elxSin (T iRadian)
 Computes the sine of iX angle in radians.
template<typename T >
elxTan (T iRadian)
 Computes the tangent of angle in radians.
template<typename T >
elxArccos (T iX)
 Computes the arccosine in radians.
template<typename T >
elxArcsin (T iX)
 Computes the arcsine in radians.
template<typename T >
elxArctan (T iYoX)
 Computes the arctangent in radians.
Gaussian family function helpers.
template<typename T >
elxGetGaussianVariance (T iRadius)
 Get variance from a given radius.
template<typename T >
elxGaussian (T iX, T iSigma)
 1D Gaussian curve.
template<typename T >
elxGaussian (T iX, T iY, T iSigma)
 2D Gaussian curve.
template<typename T >
elxMeanGaussian (T iX, T iSigma)
template<typename T >
elxDoG (T iX, T iSigma)
 First Derivative of Gaussian.
template<typename T >
elxLoG (T iX, T iSigma)
 Laplacian of Gaussian.
template<typename T >
elxLoG (T iX, T iY, T iSigma)
 2D Laplacian of Gaussian curve.
Miscelaneaous function helpers.
template<typename T >
elxSmooth (T iMin, T iMax, T iValue)
 Smoothly interpolate value in range [iMin, iMax] to [0, 1].
ExportedByMath double elxMidtone (double iX, double iMidtone)
Random number generator function helpers.
ExportedByMath void elxRandomReset ()
 Sets the starting point for generating a series of pseudorandom.
ExportedByMath void elxRandomReset (int32 iSeed)
ExportedByMath int32 elxRandomSign ()
 Returns int32 a pseudorandom sign, ie +1 or -1.
ExportedByMath double elxRandom ()
template<typename T >
elxRandom (T iMax)
template<typename T >
elxRandom (T iMin, T iMax)

Operators.

enum  EValueAction { R_NoAction, R_Clamp, R_Cycle }
 

List of possible actions with the returned value.


template<typename T , typename U >
void elxClamp (T iIn, U &oOut)
template<typename T >
void elxClamp (T iInMin, T iInMax, T &oOut)
template<typename T >
bool elxAdd (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxSub (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxMul (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxDiv (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxDif (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxAddClamp (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxSubClamp (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxMulClamp (T *ioprSrc, uint32 iSize, double iValue)
template<typename T >
bool elxDivClamp (T *ioprSrc, uint32 iSize, double iValue)
template<typename T >
bool elxAddCycle (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxSubCycle (T *ioprSrc, uint32 iSize, T iValue)
template<typename T >
bool elxMulCycle (T *ioprSrc, uint32 iSize, double iValue)
template<typename T >
bool elxDivCycle (T *ioprSrc, uint32 iSize, double iValue)
template<typename T >
bool elxAdd (T *ioprSrc, uint32 iSize, T iValue, EValueAction iAction)
template<typename T >
bool elxSub (T *ioprSrc, uint32 iSize, T iValue, EValueAction iAction)
template<typename T >
bool elxMul (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxDiv (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxAdd (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxSub (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxAddNorm (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxSubNorm (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxMulNorm (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)
template<typename T >
bool elxDivNorm (T *ioprSrc, uint32 iSize, double iValue, EValueAction iAction)

Detailed Description

Deals with all basic math helpers and vectorial tools classes.


Typedef Documentation

typedef AOBBox2<double> eLynx::Math::AOBBox2d

2d Axis Oriented Bouding Box in 64bit float resolution.

typedef Point3<double> eLynx::Math::Point3d

3d Point with 64bit float resolution.


Enumeration Type Documentation

Implemented resample filter collection.

Enumerator:
RF_Box 

pulse, Fourier window, 1st order (constant) b-spline

RF_Triangle 

Bartlett window, 2nd order (linear) b-spline.

RF_Bell 

3rd order (quadratic) b-spline

RF_CubicBSpline 

4th order (cubic) b-spline

RF_Mitchell 

Mitchell & Netravali's two-param cubic.

RF_CatmullRom 

Catmull-Rom spline, Overhauser spline.


Function Documentation

template<typename T >
T eLynx::Math::elxAbs ( iX )

Absolute of value, noted |a|.

Ex: elxAbs(1) = 1, elxAbs(-1) = 1, elxAbs(0) = 0, elxAbs(-2147483648) = -2147483648.

Parameters:
iXvalue.
Returns:
|iX| >= 0.
template<typename T >
T eLynx::Math::elxAbsDiff ( iV1,
iV2 
)

Computes absolute difference of iV1, iV2, to be used for unsigned type.

Parameters:
iV11st value.
iV22nd value.
Returns:
|iV1-iV2|.
template<typename T >
T eLynx::Math::elxArccos ( iX )

Computes the arccosine in radians.

Parameters:
iXValue between 0 and 1 whose arccosine is to be calculated.
Returns:
the arccossine, if argument is less than 1.0 or greater than 1.0, returns an indefinite double_MAX.
template<typename T >
T eLynx::Math::elxArcsin ( iX )

Computes the arcsine in radians.

Parameters:
iXValue between 1.0 and 1.0 whose arcsine is to be calculated.
Returns:
the arcsine, if argument is less than 1.0 or greater than 1.0, returns an indefinite double_MAX.
template<typename T >
T eLynx::Math::elxArctan ( iYoX )

Computes the arctangent in radians.

Parameters:
iYoXValue between 1.0 and 1.0 whose arctangent is to be calculated.
Returns:
the arctangent, if argument is less than 1.0 or greater than 1.0, returns an indefinite double_MAX.
template<typename T >
T eLynx::Math::elxCeil ( iValue )

Returns a value representing the smallest integer that is greater than or equal to the value.

Ex: elxCeil(4.2f) is 5.0f, elxCeil(-4.9) is -4.0;

Parameters:
iValueThe value.
Returns:
The floored value.
ExportedByMath const char* eLynx::Math::elxChannelMaskToString ( uint32  iChannelMask )

Return channel mask as a string.

Parameters:
iChannelMaskThe requested mask.
Returns:
The string representation of the mask.
template<typename T >
T eLynx::Math::elxCos ( iRadian )

Computes the cosine of iX angle in radians.

Parameters:
iRadianangle in radians.
Returns:
the cosine of iRadian.
template<typename T >
T eLynx::Math::elxDeg2Rad ( iDegrees )

Converts a degree angle in radians angle unit.

Parameters:
iDegreesThe degree angle.
Returns:
The radian angle.
template<typename T >
T eLynx::Math::elxExp ( iX )

Computes the exponent of iX.

Parameters:
iXvalue.
Returns:
the exponent of iX, exp(x) = e^x.
ExportedByMath bool eLynx::Math::elxFFT ( double *  ioprComplexMap,
uint32  iDimArray[],
uint32  iDimension,
bool  ibForward 
)

Computes an in-place complex-to-complex FFT in 64bit float resolution.

Parameters:
ioprComplexMapthe map of complex.
iDimArraysize for each dimension, must be a power of 2.
iDimensionnumber of dimensions of complex map.
ibForwardtrue for forward transform, false for inverse transform.
Returns:
false if the dimensions are not powers of 2, true otherwise.
ExportedByMath bool eLynx::Math::elxFFT ( float *  ioprComplexMap,
uint32  iDimArray[],
uint32  iDimension,
bool  ibForward 
)

Computes an in-place complex-to-complex FFT in 32bit float resolution.

Parameters:
ioprComplexMapthe map of complex.
iDimArraysize for each dimension, must be a power of 2.
iDimensionnumber of dimensions of complex map.
ibForwardtrue for forward transform, false for inverse transform.
Returns:
false if the dimensions are not powers of 2, true otherwise.
template<typename T >
T eLynx::Math::elxFloor ( iValue )

Returns a value representing the largest integer that is less than or equal to the value.

Ex: elxFloor(4.9f) = 4.0f, elxFloor(-4.9) = -5.0;

Parameters:
iValueThe value.
Returns:
The floored value.
ExportedByMath uint32 eLynx::Math::elxGetKernelSize ( double  iRadius )

Get the length of a square surrounding a circle with a given radius.

Parameters:
iRadiusthe radius of the circle in pixel.
ExportedByMath const IResampleFilter& eLynx::Math::elxGetResampleFilter ( EResampleFilter  iFilter )

Get resample filter from enum.

Parameters:
iFilterThe requested filter.
Returns:
Implementation of IResampleFilter for the given enum.
template<typename T >
bool eLynx::Math::elxIsEven ( iValue )

Checks if an integer is even (2n).

Ex: elxIsEven(0)=true, elxIsEven(1)=false, elxIsEven(-1)=false.

Parameters:
iValueinteger value.
Returns:
true if integer value is even, false if it's odd.
template<typename T >
bool eLynx::Math::elxIsOdd ( iValue )

Checks if an integer is odd (2n+1).

Ex: elxIsOdd(0)=false, elxIsOdd(1)=true, elxIsOdd(-1)=true.

Parameters:
iValueinteger value.
Returns:
true if integer value is odd, false if it's even.
template<typename T >
bool eLynx::Math::elxIsPow2 ( iValue )

Returns if a number is a power of 2, for value=0 return false.

Parameters:
iValueinteger value.
Returns:
true if value is a power of two, false otherwise.
template<typename T >
T eLynx::Math::elxLog ( iX )

Computes the value of the natural logarithm of argument iX.

Parameters:
iXvalue.
Returns:
the natural logarithm of iX, ln(x).
template<typename T >
T eLynx::Math::elxLog10 ( iX )

Computes computes the value of the logarithm of argument iX to base 10.

Parameters:
iXvalue.
Returns:
the logarithm to base 10 of iX, log10(x).
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeCircleKernel ( double  iRadius,
bool  ibNormalize = false 
)

Make circle mask kernel.

Value inside circle of radius iRadius are valuated with 1.0, outside with 0.0.

Parameters:
iRadiusthe circle radius.
ibNormalizeif true this kernel is equivalent to mean filter, false to use as a mask (mul with another kernel to have impact with radius).
Returns:
A circle mask kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeEmboss3x3d ( double  iDegrees = 0.0 )

Make a emboss 3x3 kernel.

Parameters:
iDegreesthe angle in degrees of the light source.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeGaussianKernel ( uint32  iWidth,
uint32  iHeight,
double  iVariance 
)

Make 2D Gaussian kernel.

Parameters:
iWidththe kernel width.
iHeightthe kernel height.
iVarianceof the Gaussian curve.
Returns:
A normalized Gaussian kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeGaussianKernel ( uint32  iRadius,
double  iVariance 
)

Make 2D Gaussian kernel.

Parameters:
iRadiusthe kernel width and height.
iVarianceof the Gaussian curve.
Returns:
A normalized Gaussian kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeGaussianSeparableKernel ( uint32  iWidth,
double  iVariance,
bool  ibHorizontal 
)

Make 2D Gaussian separable kernel.

Parameters:
iWidththe kernel width.
iVarianceof the Gaussian curve.
ibHorizontaltrue if kernel is Wx1, false for 1xH.
Returns:
A normalized Gaussian kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeLaplacian ( double  iRadius )

Make a Laplacian kernel.

Parameters:
iRadiusthe radius of the kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeLaplacian3x3d ( double  iAlpha )

Make a Laplacian 3x3 kernel.

Parameters:
iAlphathe alpha.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeLoG ( double  iRadius,
double  iVariance 
)

Make a Laplacian of Gaussian kernel.

Parameters:
iRadiusthe radius of the kernel.
iVariancethe variance for the Gaussian.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeLowpass3x3d ( double  iAlpha )

Make lowpass 3x3 kernel.

Parameters:
iAlphathe alpha.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeMeanKernel ( uint32  iWidth,
uint32  iHeight 
)

Make 2D mean kernel, this have a smoothing effect.

Parameters:
iWidththe kernel width.
iHeightthe kernel height.
Returns:
A normalized mean kernel, all elements have value 1/(iWidth*iHeight).
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeMeanRadiusKernel ( double  iRadius,
bool  ibCircular = true 
)

Make 2D mean kernel, square or circle mask kernel.

Parameters:
iRadiusthe square or circle radius.
ibCircularif true this kernel is circle otherwise is square.
Returns:
A normalized mean kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeSharpen ( double  iRadius = 3.0 )

Make a sharpen kernel.

Parameters:
iRadiusthe radius of the kernel.
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeSharpen3x3d ( double  iAmount = 5.0 )

Make a sharpen 3x3 kernel.

Parameters:
iAmountthe amount value in range [0..1].
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeSharpenMore3x3d ( double  iAlpha = 1.0 )

Make a sharpen more 3x3 kernel.

Parameters:
iAlphathe amount value in range [0..1].
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeSharpenSmooth3x3d ( double  iAlpha )

Make a smooth sharpen 3x3 kernel.

Parameters:
iAlphathe amount value in range [0..1].
ExportedByMath ConvolutionKerneld eLynx::Math::elxMakeSobelNxNd ( uint32  iSize = 3 )

Make a Sobel NxN kernel.

Parameters:
iSizethe length of the square.
template<typename T >
const T& eLynx::Math::elxMax ( const T &  iA,
const T &  iB 
)

Maximum of two T values.

Parameters:
iAA T value.
iBA T value.
Returns:
The maximum in list iA,iB.
template<typename T >
const T& eLynx::Math::elxMax ( const T &  iA,
const T &  iB,
const T &  iC 
)

Maximum of two T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
Returns:
The maximum in list iA,iB,iC.
template<typename T >
const T& eLynx::Math::elxMax ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD 
)

Maximum of two T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
Returns:
The maximum in list iA,iB,iC,iD.
template<typename T >
const T& eLynx::Math::elxMax ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD,
const T &  iE,
const T &  iF 
)

Maximum of two T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
iEA T value.
iFA T value.
Returns:
The maximum in list iA,iB,iC,iD,iE,iF.
template<typename T >
const T& eLynx::Math::elxMax ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD,
const T &  iE 
)

Maximum of two T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
iEA T value.
Returns:
The maximum in list iA,iB,iC,iD,iE.
template<typename T >
T eLynx::Math::elxMean ( iV1,
iV2 
)

Computes the mean of two values iV1, iV2.

Parameters:
iV11st value.
iV22nd value.
Returns:
(iV1+iV2)/2.
template<typename T >
const T& eLynx::Math::elxMin ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD,
const T &  iE,
const T &  iF 
)

Minimum of for T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
iEA T value.
iFA T value.
Returns:
The minimum in list iA,iB,iC,iD,iE,iF.
template<typename T >
const T& eLynx::Math::elxMin ( const T &  iA,
const T &  iB 
)

Minimum of two T values.

Parameters:
iAA T value.
iBA T value.
Returns:
The minimum in list iA,iB.
template<typename T >
const T& eLynx::Math::elxMin ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD,
const T &  iE 
)

Minimum of for T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
iEA T value.
Returns:
The minimum in list iA,iB,iC,iD,iE.
template<typename T >
const T& eLynx::Math::elxMin ( const T &  iA,
const T &  iB,
const T &  iC 
)

Minimum of tree T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
Returns:
The minimum in list iA,iB,iC.
template<typename T >
const T& eLynx::Math::elxMin ( const T &  iA,
const T &  iB,
const T &  iC,
const T &  iD 
)

Minimum of for T values.

Parameters:
iAA T value.
iBA T value.
iCA T value.
iDA T value.
Returns:
The minimum in list iA,iB,iC,iD.
template<typename T >
T eLynx::Math::elxMod ( iA,
iB 
)

Modulus of values noted m=a [b].

Returns the remainder of a / b such that a = i * b + f, where i is an integer. f has the same sign as a, and the absolute value of f is less than the absolute value of b.

Ex: elxMod(7, 5) = 2, elxMod(7, -5) = 2, elxMod(-7 ,5) = -2, elxMod(-7, -5) = -2.

Parameters:
iAA value.
iBA value.
Returns:
The value of iA modulus iB.
template<typename T >
T eLynx::Math::elxNextPow2 ( iValue )

Returns the next power of 2 lower of input value, return value if value is power of two.

Parameters:
iValueinteger value.
Returns:
The next power of 2 lower or equal.
template<typename T >
T eLynx::Math::elxPow ( iX,
iY 
)

Computes computes x raised to the power y.

Parameters:
iXthe mantissa.
iYthe exponent.
Returns:
iX^iY.
template<typename T >
T eLynx::Math::elxRad2Deg ( iRadian )

Converts a radian angle in degrees angle unit.

Parameters:
iRadianThe radian angle.
Returns:
The degree angle.
ExportedByMath void eLynx::Math::elxRandomReset (  )

Sets the starting point for generating a series of pseudorandom.

It seeds the pseudorandom-number generator with current time.

ExportedByMath int32 eLynx::Math::elxRandomSign (  )

Returns int32 a pseudorandom sign, ie +1 or -1.

Use the elxRandomReset() function to seed the pseudorandom-number generator before calling.

Returns:
A pseudorandom int32 sign, +1 or -1.
template<typename T >
int32 eLynx::Math::elxRint ( iValue )

Returns a int32 value representing the whole integer nearest to the value.

Ex: elxRint(4.9f) = 5, elxRint(4.2) = 4, elxRint(1.5) = 2.

Parameters:
iValueThe value.
Returns:
The int32 rounded value.
template<typename T >
T eLynx::Math::elxRound ( iValue )

Returns a value representing the whole integer nearest to the value.

Ex: elxRound(4.9f) = 5.0f, elxRound(4.2) = 4.0, elxRound(1.5) is 2.0,
elxRound(-1.5) = -2.0, elxRound(-1.2f) = -1.0f, elxRound(20) = 20.

Parameters:
iValueThe value.
Returns:
The rounded value.
template<typename T >
T eLynx::Math::elxSign ( iValue )

Computes the sign of a value.

Ex: elxSign(3.8f) = 1.0f, elxSign(-2.5) = -1.0, elxSign(-5) = -1 .

Parameters:
iValuethe value to get sign.
Returns:
0 for 0, +1 for positive, -1 for negative.
template<typename T >
T eLynx::Math::elxSin ( iRadian )

Computes the sine of iX angle in radians.

Parameters:
iRadianangle in radians.
Returns:
the sine of iRadian.
template<typename T >
T eLynx::Math::elxSmooth ( iMin,
iMax,
iValue 
)

Smoothly interpolate value in range [iMin, iMax] to [0, 1].

To be used only with float and double resolution.

Parameters:
iMinThe minimum of input range value.
iMaxThe maximum of input range value.
iValuethe input value to smooth between 0 and 1.
Returns:
The smoothed value.
template<typename T >
T eLynx::Math::elxSqr ( iX )

Computes the square of iX = iX^2 = iX*iX.

Parameters:
iXvalue.
Returns:
the squared value.
template<typename T >
T eLynx::Math::elxSqrt ( iX )

Computes the compute the square root of iX.

Parameters:
iXNonnegative value whose root is to be computed.
Returns:
iX^1/2.
template<typename T >
T eLynx::Math::elxTan ( iRadian )

Computes the tangent of angle in radians.

Parameters:
iRadianAngle in radians.
Returns:
The tangent of angle.
ExportedByMath uint32 eLynx::Math::elxToChannelMask ( const char *  iprChannelMask )

Return channel mask from a string.

Parameters:
iprChannelMaskhe string representation of the mask.
Returns:
The mask.
ExportedByMath EResampleFilter eLynx::Math::elxToEResampleFilter ( const char *  iprFilter )

Converts string to EResampleFilter.

Parameters:
iprFilterThe resample filter as a string.
Returns:
filter type as enum.
ExportedByMath const char* eLynx::Math::elxToString ( EResampleFilter  iFilter )

Return the string name of the resample filter function.

Parameters:
iFilterThe requested filter.
Returns:
The string name of the resample filter function.

Generated on Thu Dec 9 2010 by doxygen 1.7.2