00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef mrpt_utils_types_H
00030 #define mrpt_utils_types_H
00031
00032 #include <vector>
00033 #include <string>
00034
00035
00036 #include "pstdint.h"
00037
00038 #define __STDC_FORMAT_MACROS
00039 #if HAVE_INTTYPES_H
00040 # include <inttypes.h>
00041 #elif defined(_MSC_VER)
00042 # include <mrpt/utils/msvc_inttypes.h>
00043 #endif
00044
00045
00046 namespace mrpt
00047 {
00048
00051 typedef std::vector<int64_t> vector_long;
00052
00055 typedef std::vector<int32_t> vector_int;
00056
00059 typedef std::vector<float> vector_float;
00060
00063 typedef std::vector<double> vector_double;
00064
00067 typedef std::vector<uint16_t> vector_word;
00068
00071 typedef std::vector<uint32_t> vector_uint;
00072
00075 typedef std::vector<std::string> vector_string;
00076
00079 typedef std::vector<bool> vector_bool;
00080
00083 typedef std::vector<uint8_t> vector_byte;
00084
00087 typedef std::vector<size_t> vector_size_t;
00088
00089
00090
00091 namespace utils
00092 {
00093
00094
00095
00096
00097
00100 typedef void (*TFunctor_noRet_1inputs)(const void *);
00101
00104 typedef void (*TFunctor_noRet_2inputs)(const void *,const void *);
00105
00108 typedef void (*TFunctor_noRet_3inputs)(const void *,const void *,const void *);
00109
00110
00111
00112
00113
00114
00117 typedef double (*TFunctor_retDouble_1inputs)(const void *);
00118
00121 typedef double (*TFunctor_retDouble_2inputs)(const void *,const void *);
00122
00125 typedef double (*TFunctor_retDouble_3inputs)(const void *,const void *,const void *);
00126
00127
00128
00129
00130
00131
00134 typedef void (*TFunctor_retVecDbl_inpVecDbl)(const vector_double &in, vector_double &out);
00135
00138 typedef void (*TFunctor_retVecFlt_inpVecFlt)(const vector_float &in, vector_float &out);
00139
00142 typedef void (*TFunctor_retVecInt_inpVecInt)(const vector_int &in, vector_int &out);
00143
00144
00145
00146
00147
00148
00151 typedef void (*TFunctor_retVecDbl_inp2VecDbl)(const vector_double &x,const vector_double &y, vector_double &out);
00152
00155 typedef void (*TFunctor_retVecFlt_inp2VecFlt)(const vector_float &x,const vector_float &y, vector_float &out);
00156
00159 typedef void (*TFunctor_retVecInt_inp2VecInt)(const vector_int &x,const vector_int &y, vector_int &out);
00160
00161
00162
00163
00164
00165
00168 typedef double (*TFunctor_retDbl_inp1VecDbl)(const vector_double &in1);
00169
00172 typedef double (*TFunctor_retDbl_inp2VecDbl)(const vector_double &in1,const vector_double &in2);
00173
00176 typedef double (*TFunctor_retDbl_inp3VecDbl)(const vector_double &in1,const vector_double &in2,const vector_double &in3);
00177
00178
00181 #if defined(_MSC_VER) && (_MSC_VER>=1300)
00182 typedef unsigned long long POINTER_TYPE;
00183 #else
00184 typedef unsigned long POINTER_TYPE;
00185 #endif
00186
00187
00189 struct TColor
00190 {
00191 TColor(uint8_t r,uint8_t g,uint8_t b, uint8_t alpha=255) : R(r),G(g),B(b),A(alpha) { }
00192 uint8_t R,G,B,A;
00193 };
00194
00196 struct TColorf
00197 {
00198 TColorf(float r,float g,float b, float alpha=1.0f) : R(r),G(g),B(b),A(alpha) { }
00199 float R,G,B,A;
00200 };
00201
00202 }
00203
00204
00205
00206 }
00207
00208 #endif
00209