PARP Research Group University of Murcia, Spain


src/qvcore/qvdefines.h

00001 /*
00002  *      Copyright (C) 2007, 2008. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 #ifndef QVDEFINES_H
00022 #define QVDEFINES_H
00023 
00024 #include <math.h>
00025 
00026 #define POW2(X)                 ((X)*(X))
00027 #define SIGN(X)                 (((X)>=0)?1:-1)
00028 #define ABS(X)                  (((X)>0)?(X):(-(X)))
00029 #define MIN(X,Y)                (((X)<(Y))?(X):(Y))
00030 #define MAX(X,Y)                (((X)>(Y))?(X):(Y))
00031 #define RANDOM(MIN, MAX)        (rand()%((MAX)-(MIN)+1) + (MIN))
00032 
00033 #define PI              (3.14159265358979323846)
00034 #define EPSILON         (10E-6)
00035 
00036 typedef unsigned char   uChar;          // Ipp8u        1 bytes
00037 typedef unsigned short  uShort;         // Ipp16u       2 "
00038 typedef unsigned int    uInt;           // Ipp32u       4 "
00039 typedef signed char     sChar;          // Ipp8s        1 ...
00040 typedef signed short    sShort;         // Ipp16s       2
00041 typedef signed int      sInt;           // Ipp32s       4
00042 //typedef __INT64       sLong;          // Ipp64s       8 (not an estandar type)
00043 //typedef __UINT64      uLong;          // Ipp64u       8 (not an estandar type)
00044 typedef float           sFloat;         // Ipp32f       4
00045 typedef double          sDouble;        // Ipp64f       8
00046 
00047 
00048 // Include a small set of Qt classes, which will be declared as basic types for the metatypes.
00049 #include <QMetaType>
00050 #include <QList>
00051 #include <QVector>
00052 #include <QPoint>
00053 #include <QPointF>
00054 #include <QRect>
00055 
00056 // Qt metatypes definitions: QVision defined types must be metatyped in their respective header files.
00057 // Qt's and C++'s metatypes must be listed below.
00058 Q_DECLARE_METATYPE(QVector<sFloat>);
00059 Q_DECLARE_METATYPE(QVector<sDouble>);
00060 Q_DECLARE_METATYPE(QList<sInt>);
00061 Q_DECLARE_METATYPE(QList<sFloat>);
00062 Q_DECLARE_METATYPE(QList<sDouble>);
00063 Q_DECLARE_METATYPE(QList<QPoint>);
00064 Q_DECLARE_METATYPE(QList<QPointF>);
00065 Q_DECLARE_METATYPE(QList<QRect>);
00066 Q_DECLARE_METATYPE(QList< QList< QPoint > >);
00067 Q_DECLARE_METATYPE(QList< QList< QPointF > >);
00068 
00069 #include <QColor>
00070 const QColor qvColors[] = {
00071                 Qt::red,
00072                 Qt::green,
00073                 Qt::blue,
00074                 Qt::cyan,
00075                 Qt::magenta,
00076                 Qt::darkRed,
00077                 Qt::darkGreen,
00078                 Qt::darkBlue,
00079                 Qt::darkCyan,
00080                 Qt::darkMagenta
00081                 };
00082 
00083 #endif



QVision framework. PARP research group, copyright 2007, 2008.