ML Reference
MeVis/Foundation/Sources/MLUtilities/mlTypeDefs.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //--------------------------------------------------------------------------------------
00005 
00010 //--------------------------------------------------------------------------------------
00011 #ifndef __mlTypeDefs_H
00012 #define __mlTypeDefs_H
00013 
00014 #include "mlMacros.h"
00015 
00016 // Include global compiler switches for the ML.
00017 #ifndef __mlConfig_H
00018   #include "mlConfig.h"
00019 #endif
00020 
00021 // We always need stdlib.h for e.g., size_t.
00022 #include "mlSystemWarningsDisable.h"
00023 #include <stdlib.h>
00024 
00025 #if defined(_MSC_VER) && _MSC_VER >= 1600
00026   #include <cstdint>
00027 #endif
00028 
00029 #if !defined(WIN32)
00030 # include <pthread.h>
00031 #endif
00032 #include "mlSystemWarningsRestore.h"
00033 
00034 
00035 //---------------------------------------------------------------------------------------------
00036 //               Check for 64 bit system.
00037 //---------------------------------------------------------------------------------------------
00038 
00039 // WIN64 check. 
00040 #ifdef _WIN64
00041 
00042   #define ML_IS_64_BIT_SYSTEM
00043 #endif
00044 
00045 // Unix check.
00046 #if defined (__GNUC__) && (__GNUC__ >= 3)
00047 
00049   #include <unistd.h>  
00050 
00052   #include <stdint.h>  
00053 
00055   #include <float.h>
00056 
00057   // Check word size definition from standard integer include.
00058   #if defined(__LP64__)
00059 
00060     #define ML_IS_64_BIT_SYSTEM
00061   #endif
00062 #endif
00063 
00064 
00065 
00066 //---------------------------------------------------------------------------------------------
00067 //
00068 //
00069 //                                DEFINES
00070 //
00071 //
00072 //---------------------------------------------------------------------------------------------
00073 
00074 
00075 //------------------------------------------------------------------------------------
00077 
00078 //------------------------------------------------------------------------------------
00079 #ifndef ML_NAMESPACE
00080 
00081 
00082   #define ML_NAMESPACE       ml
00083 #endif
00084 
00085 #ifndef ML_START_NAMESPACE
00086 
00087 
00088 
00089   #define ML_START_NAMESPACE namespace ML_NAMESPACE {
00090 #endif
00091 
00092 #ifndef ML_END_NAMESPACE
00093 
00094 
00095   #define ML_END_NAMESPACE   }
00096 #endif
00097 
00098 
00099 //--------------------------------------------------------------------------------------------
00101 
00102 //--------------------------------------------------------------------------------------------
00103 
00104 //--------------------------------------------------------------------------------------------
00107 //--------------------------------------------------------------------------------------------
00108 #define ML_PREFIX          "ML"
00109 
00110 //--------------------------------------------------------------------------------------------
00113 //--------------------------------------------------------------------------------------------
00114 #define ML_CONSTANT_PREFIX "ML_"
00115 
00116 
00117 
00118 //--------------------------------------------------------------------------------------------
00119 // MLTypes. They define all basic integer data types.
00120 //--------------------------------------------------------------------------------------------
00121 #ifndef _ML_INT8
00122 
00123 
00124   // Should be signed but that causes too many consequences.
00125   typedef /*signed*/ char  MLint8;
00126   typedef /*signed*/ char* MLint8Ptr;
00127   #define ML_INT8_MIN -128
00128   #define ML_INT8_MAX 0x7F
00129 
00130 
00131   #define _ML_INT8 MLint8
00132 #endif
00133 
00134 #ifndef _ML_UINT8
00135 
00136 
00137   typedef unsigned char  MLuint8;
00138   typedef unsigned char* MLuint8Ptr;
00139   #define ML_UINT8_MIN 0x00
00140   #define ML_UINT8_MAX 0xFF
00141 
00142 
00143   #define _ML_UINT8 MLuint8
00144 #endif
00145 
00146 #ifndef _ML_INT16
00147 
00148 
00149   #if (__GNUC__ >= 3)
00150     typedef int16_t       MLint16;
00151     typedef int16_t*      MLint16Ptr;
00152   #else
00153     typedef signed short  MLint16;
00154     typedef signed short* MLint16Ptr;
00155   #endif
00156   #define ML_INT16_MIN -32768
00157   #define ML_INT16_MAX 0x7FFF
00158 
00159 
00160   #define _ML_INT16 MLint16
00161 #endif
00162 
00163 #ifndef _ML_UINT16
00164 
00165 
00166   #if (__GNUC__ >= 3)
00167     typedef uint16_t        MLuint16;
00168     typedef uint16_t*       MLuint16Ptr;
00169   #else
00170     typedef unsigned short  MLuint16;
00171     typedef unsigned short* MLuint16Ptr;
00172   #endif
00173   #define ML_UINT16_MIN 0x0000
00174   #define ML_UINT16_MAX 0xFFFF
00175 
00176 
00177   #define _ML_UINT16 MLuint16
00178 #endif
00179 
00180 
00181 #ifndef _ML_INT32
00182 
00183 
00184 
00185   #if (__GNUC__ >= 3)
00186     typedef int32_t     MLint32;
00187     typedef int32_t*    MLint32Ptr;
00188   #else
00189     typedef signed int  MLint32;
00190     typedef signed int* MLint32Ptr;
00191   #endif
00192 
00193   // Note: Do not use simply 0x80000000L since that 
00194   // might be assigned as positive value to 
00195   // floating point values. Force an explicit cast
00196   // to avoid that error. Cast values to avoid that 
00197   // they are considered as long values.
00198   #define ML_INT32_MIN (static_cast<MLint32>(0x80000000L))
00199   #define ML_INT32_MAX (static_cast<MLint32>(0x7FFFFFFFL))
00200 
00201 
00202   #define _ML_INT32 MLint32
00203 #endif
00204 
00205 
00206 #ifndef _ML_UINT32
00207 
00208 
00209   #if (__GNUC__ >= 3)
00210     typedef uint32_t      MLuint32;
00211     typedef uint32_t*     MLuint32Ptr;
00212   #else
00213     typedef unsigned int  MLuint32;
00214     typedef unsigned int* MLuint32Ptr;
00215   #endif
00216 
00217   // Cast values to avoid that they are considered as long values.
00218   #define ML_UINT32_MIN (static_cast<MLuint32>(0x00000000L))
00219   #define ML_UINT32_MAX (static_cast<MLuint32>(0xFFFFFFFFL))
00220 
00221 
00222   #define _ML_UINT32 MLuint32
00223 #endif
00224 
00225 
00226 #ifndef _ML_FLOAT
00227 
00228 
00229   typedef float  MLfloat;
00230   typedef float* MLfloatPtr;
00231   #define ML_FLOAT_MIN     FLT_MIN
00232   #define ML_FLOAT_MAX     FLT_MAX
00233   #define ML_FLOAT_EPSILON FLT_EPSILON
00234   // use more digits in string representation to retain full precision of binary value:
00235   #define ML_FLOAT_DIG     (FLT_DIG+2)
00236 
00237 
00238   #define _ML_FLOAT MLfloat
00239 #endif
00240 
00241 
00242 #ifndef _ML_DOUBLE
00243 
00244 
00245   typedef double  MLdouble;
00246   typedef double* MLdoublePtr;
00247   #define ML_DOUBLE_MIN     DBL_MIN
00248   #define ML_DOUBLE_MAX     DBL_MAX
00249   #define ML_DOUBLE_EPSILON DBL_EPSILON
00250   #define ML_DOUBLE_DIG     DBL_DIG
00251 
00252 
00253   #define _ML_DOUBLE MLdouble
00254 #endif
00255 
00256 
00257 #ifndef _ML_LDOUBLE
00258 
00259 
00260   typedef long double  MLldouble;
00261   typedef long double* MLldoublePtr;
00262   #define ML_LDOUBLE_MIN     LDBL_MIN
00263   #define ML_LDOUBLE_MAX     LDBL_MAX
00264   #define ML_LDOUBLE_EPSILON LDBL_EPSILON
00265   #define ML_LDOUBLE_DIG     LDBL_DIG
00266 
00267 
00268   #define _ML_LDOUBLE MLldouble
00269 #endif
00270 
00271 //--------------------------------------------------------------------------------------------------
00274 //--------------------------------------------------------------------------------------------------
00275 #define ML_NUM_STANDARD_TYPES        10
00276 
00277 //--------------------------------------------------------------------------------------------------
00280 //--------------------------------------------------------------------------------------------------
00281 #define ML_MAX_COMPONENTS_EXTENDED_TYPE 512
00282 
00283 
00284 #ifdef ML_DEPRECATED
00285 //--------------------------------------------------------------------------------------------------
00288 //--------------------------------------------------------------------------------------------------
00289 #define ML_SIZE_OF_MAX_CARRIER_TYPE ML_MAX_COMPONENTS_EXTENDED_TYPE
00290 
00291 #if defined(WIN32) && defined(ML_WARN_DEPRECATED)
00292 #pragma deprecated("ML_SIZE_OF_MAX_CARRIER_TYPE")
00293 #endif
00294 
00295 #endif // ML_DEPRECATED
00296 
00297 
00298 
00299 //--------------------------------------------------------------------------------------------------
00301 
00302 //--------------------------------------------------------------------------------------------------
00304 #define  ML_LUMINANCE        "LUMINANCE"
00305 
00306 #define  ML_NEGATIVE         "NEGATIVE"     
00307 
00308 #define  ML_PALETTE          "PALETTE"      
00309 
00310 // Codes for multiple channel images.
00311 
00313 #define  ML_RED              "RED"          
00314 
00315 #define  ML_GREEN            "GREEN"
00316 
00317 #define  ML_BLUE             "BLUE"
00318 
00319 #define  ML_ALPHA            "ALPHA"
00320 
00322 #define  ML_CYAN             "CYAN"
00323 
00324 #define  ML_MAGENTA          "MAGENTA"
00325 
00326 #define  ML_YELLOW           "YELLOW"
00327 
00328 #define  ML_BLACK            "BLACK"
00329 
00331 #define  ML_HUE              "HUE"          
00332 
00333 #define  ML_SATURATION       "SATURATION"
00334 
00335 #define  ML_VALUE            "VALUE"        
00336 
00337 #define  ML_LIGHTNESS        "LIGHTNESS"    
00338 
00340 #define  ML_YIQ_Y            "YIQ_Y"        
00341 
00342 #define  ML_YIQ_I            "YIQ_I"
00343 
00344 #define  ML_YIQ_Q            "YIQ_Q"
00345 
00349 #define  ML_CIE_X            "CIE_X"
00350 
00351 #define  ML_CIE_Y            "CIE_Y"        
00352 
00353 #define  ML_CIE_Z            "CIE_Z"        
00354 
00355 #define  ML_LUV_L            "LUV_L"
00356 
00357 #define  ML_LUV_U            "LUV_U"
00358 
00359 #define  ML_LUV_V            "LUV_V"
00360 
00362 #define  ML_UNKNOWN          "UNKNOWN"      
00363 
00365 
00366 
00367 //--------------------------------------------------------------------------------------------------
00369 
00370 //--------------------------------------------------------------------------------------------------
00372 #define  ML_REAL             "REAL_PART"    
00373 
00374 #define  ML_IMAG             "IMAG_PART"
00375 
00377 #define  ML_V0               "V0"           
00378 
00379 #define  ML_V1               "V1"
00380 
00381 #define  ML_V2               "V2"
00382 
00383 #define  ML_V3               "V3"
00384 
00385 #define  ML_V4               "V4"
00386 
00387 #define  ML_V5               "V5"
00388 
00390 #define  ML_MAGNITUDE        "MAGNITUDE"    
00391 
00392 #define  ML_ANGLE            "ANGLE"        
00393 
00394 
00395 
00396 
00397 //------------------------------------------------------------------------------------
00398 //
00400 
00401 //
00402 //------------------------------------------------------------------------------------
00403 #ifndef ML_MIN
00404 
00405 
00406   #define ML_MIN(X, Y)   (((X) < (Y)) ? (X) : (Y))
00407 #endif
00408 
00409 #ifndef ML_MAX
00410 
00411 
00412   #define ML_MAX(X, Y)   (((X) > (Y)) ? (X) : (Y))
00413 #endif
00414 
00415 #ifndef ML_ABS
00416 
00417 
00418   #define ML_ABS(X)   (((X) < (0)) ? ((X) * (-1)) : (X))
00419 #endif
00420 
00422 #ifndef ML_QUOTE
00423 
00424   #define ML_QUOTE(A) #A
00425 #endif
00426 
00428 #ifndef ML_CLAMP
00429 
00430   #define ML_CLAMP(v,l,h)  ((v)<(l) ? (l) : (v) > (h) ? (h) : (v))
00431 #endif
00432 
00434 #ifndef ML_LERP
00435 
00436   #define ML_LERP(a,l,h) ((l)+(((h)-(l))*(a)))
00437 #endif
00438 
00440 
00442 #ifndef ML_M_PI
00443 # define ML_M_PI           3.14159265358979323846  /* pi */
00444 #endif
00445 
00446 #ifndef ML_M_PI_2
00447 # define ML_M_PI_2         1.57079632679489661923  /* pi/2 */
00448 #endif
00449 
00450 //---------------------------------------------------------------------------------------------
00451 //
00452 //
00453 //                                64 BIT SUPPORT
00454 //
00455 //
00456 //---------------------------------------------------------------------------------------------
00457 
00458 //------------------------------------------------------------------------------------
00460 
00461 //------------------------------------------------------------------------------------
00462 #ifndef ML_SYSTEM_HAS_NO_64
00463 
00465   #ifdef WIN32
00466     #include "mlSystemWarningsDisable.h"
00467     #include <basetsd.h>
00468     #include "mlSystemWarningsRestore.h"
00469   #else
00470 
00471     #ifndef __STDC_LIMIT_MACROS
00472       #define __STDC_LIMIT_MACROS
00473     #endif
00474 
00475     #include "mlSystemWarningsDisable.h"
00476     #include <stdint.h>
00477     #include "mlSystemWarningsRestore.h"
00478 
00479     #if !defined(INT64_MIN)
00480       #error "mlTypeDefs.h must be included first or the macro __STDC_LIMIT_MACROS must be defined!"
00481     #endif
00482 
00483   #endif
00484 
00485 
00486   // Defines MLint64 type and its corresponding pointer type.
00487   #if defined(WIN32)
00488 
00490     typedef INT64          MLint64;
00492     typedef INT64*         MLint64Ptr;
00493 
00495     #ifndef INT64_MIN
00496       #define INT64_MIN   0x8000000000000000I64
00497     #endif
00498     #ifndef INT64_MAX
00499       #define INT64_MAX   0x7FFFFFFFFFFFFFFFI64
00500     #endif
00501 
00503     typedef UINT64         MLuint64;
00505     typedef UINT64*        MLuint64Ptr;
00506 
00508     #ifndef UINT64_MIN
00509       #define UINT64_MIN     static_cast<MLuint64>(0)
00510     #endif
00511     #ifndef UINT64_MAX
00512       #define UINT64_MAX     0xFFFFFFFFFFFFFFFFUI64
00513     #endif
00514 
00515   #else
00516 
00517     #if !defined(MEVIS_64BIT)
00518 
00519       typedef int64_t        MLint64;
00521       typedef int64_t*       MLint64Ptr;
00522 
00524       typedef uint64_t       MLuint64;
00526       typedef uint64_t*      MLuint64Ptr;
00527     #else
00528 
00529       typedef long long      MLint64;
00531       typedef MLint64*       MLint64Ptr;
00532 
00534       typedef unsigned long long   MLuint64;
00536       typedef MLuint64*            MLuint64Ptr;
00537     #endif
00538   #endif
00539 
00540 
00541 #else
00542 
00544 
00545   typedef unsigned char    MLint64[8];
00546   typedef MLint64*         MLint64Ptr;
00547   typedef unsigned char    MLuint64[8];
00548   typedef MLuint64*        MLuint64Ptr;
00550 
00551 #endif
00552 
00553 
00554 #ifndef _ML_INT64
00555 
00556 
00557   #define ML_INT64_MIN     INT64_MIN
00558   #define ML_INT64_MAX     INT64_MAX
00559 
00560 
00561   #define _ML_INT64        MLint64
00562 #endif
00563 
00564 #ifndef _ML_UINT64
00565 
00566 
00567   #define ML_UINT64_MIN     static_cast<MLuint64>(0)
00568   #define ML_UINT64_MAX     UINT64_MAX
00569 
00570 
00571   #define _ML_UINT64        MLuint64
00572 #endif
00573 
00574 #ifdef ML_DEPRECATED
00575   #ifndef ML_IS_64_BIT_SYSTEM
00576 
00577     #define ML_USE_64_BIT_ADRESSES
00578   #endif
00579   #if defined(WIN32) && defined(ML_WARN_DEPRECATED)
00580     #pragma deprecated("ML_USE_64_BIT_ADRESSES")
00581   #endif
00582 #endif
00583 
00584 
00585 //--------------------------------------------------------------------------------------------
00587 
00588 //--------------------------------------------------------------------------------------------
00589 
00592 typedef MLint64      MLint;
00593 
00595 typedef MLint64*     MLintPtr;
00596 
00598 #define ML_INT_MIN   ML_INT64_MIN
00599 
00601 #define ML_INT_MAX   ML_INT64_MAX
00602 
00603 
00608 typedef MLuint64     MLuint;
00609 
00611 typedef MLuint64*    MLuintPtr;
00612 
00614 #define ML_UINT_MIN  UINT64_MIN
00615 
00617 #define ML_UINT_MAX  UINT64_MAX
00618 
00619 
00620 
00621 
00622 
00623 //-------------------------------------------------------------------------------------
00625 
00626 // Introduce signed and unsigned size and offset types for pointers which are 32 bit 
00627 // on 32 bit systems and 64 bit on 64 bit systems. This is necessary, because integer 
00628 // is not large enough on 64 bit systems, because it remains 32 bit even on many 64 bit 
00629 // platforms.
00630 // Notes:
00631 // - size   types should be used for memory, file, array and object sizes.
00632 // - offset types should be used as offsets typically added to pointers.
00633 //-------------------------------------------------------------------------------------
00634 #ifndef _ML_USIZE_T
00635 
00636   #define _ML_USIZE_T
00637 
00638   #if defined(ML_IS_64_BIT_SYSTEM)
00639 
00640     typedef MLuint64       MLuoffset;
00641   #else
00642 
00643     typedef unsigned int   MLuoffset;
00644   #endif
00645 
00647   typedef size_t           MLusize_t;
00648 
00650   #define ML_USIZE_T_MIN   ( static_cast<size_t>(0))
00651 
00653   #define ML_USIZE_T_MAX   (~static_cast<size_t>(0))
00654 
00656   #define ML_SIZE_T_MIN   ML_USIZE_T_MIN
00657 
00659   #define ML_SIZE_T_MAX   ML_USIZE_T_MAX
00660   
00661 #endif 
00662 
00663 
00664 #ifndef _ML_SIZE_T
00665 
00666   #define _ML_SIZE_T
00667 
00668   #if defined(ML_IS_64_BIT_SYSTEM)
00669 
00670     typedef MLint          MLsoffset;
00671   #else
00672 
00673     typedef int            MLsoffset;
00674   #endif
00675 
00676   #if defined(WIN32)
00677 
00678     typedef SSIZE_T        MLssize_t;
00679   #else
00680 
00681     typedef ssize_t        MLssize_t;
00682   #endif
00683 
00685   #define ML_SSIZE_T_MIN   (static_cast<MLssize_t>(1) << (sizeof(MLssize_t)*8-1))
00686 
00688   // Take the 
00689   #define ML_SSIZE_T_MAX   (static_cast<MLssize_t>(ML_USIZE_T_MAX ^ ML_SSIZE_T_MIN))
00690 #endif 
00691 
00693 
00694 
00695 
00696 //---------------------------------------------------------------------------------------------
00697 //
00698 //
00699 //                                TYPEDEFS, MOSTLY ENUMS 
00700 //
00701 //
00702 //---------------------------------------------------------------------------------------------
00703 
00704 //--------------------------------------------------------------------------------------------------
00707 //--------------------------------------------------------------------------------------------------
00708 typedef MLint32 MLDataType;
00709 
00710 
00711 #ifdef ML_DEPRECATED
00712 //--------------------------------------------------------------------------------------------------
00715 //--------------------------------------------------------------------------------------------------
00716 typedef MLint32 MLPhysicalDataType;
00717 
00718 #if defined(WIN32) && defined(ML_WARN_DEPRECATED)
00719 #pragma deprecated("MLPhysicalDataType")
00720 #endif
00721 
00722 #endif // ML_DEPRECATED
00723 
00724 //--------------------------------------------------------------------------------------------------
00726 //--------------------------------------------------------------------------------------------------
00727 #define ML_UNDEFINED_THREADID 0
00728 
00729 #ifdef WIN32
00730 typedef MLuint32 MLThreadId;
00731 #else
00732 typedef pthread_t MLThreadId;
00733 #endif
00734 
00735 //--------------------------------------------------------------------------------------------------
00738 //--------------------------------------------------------------------------------------------------
00739 #define ML_INVALID_DATA_TYPE -1
00740 
00741 //--------------------------------------------------------------------------------------------------
00744 //--------------------------------------------------------------------------------------------------
00745 typedef enum {
00746   MLint8Type       =  0,                  
00747   MLuint8Type      =  1,                  
00748   MLint16Type      =  2,                  
00749   MLuint16Type     =  3,                  
00750   MLint32Type      =  4,                  
00751   MLuint32Type     =  5,                  
00752   MLfloatType      =  6,                  
00753   MLdoubleType     =  7,                  
00754   MLint64Type      =  8,                  
00755   MLuint64Type     =  9,                  
00756 
00757   // Type IDs for extended data types:
00758   MLComplexfType,     MLComplexdType,
00759 
00760   MLQuaternionfType,  MLQuaterniondType,
00761 
00762   MLVector2fType,     MLVector2dType,
00763   MLVector3fType,     MLVector3dType,
00764   MLVector4fType,     MLVector4dType,
00765   MLVector5fType,     MLVector5dType,
00766   MLVector6fType,     MLVector6dType,
00767   MLVector7fType,     MLVector7dType,
00768   MLVector8fType,     MLVector8dType,
00769   MLVector9fType,     MLVector9dType,
00770   MLVector10fType,    MLVector10dType,
00771   MLVector16fType,    MLVector16dType,
00772   MLVector32fType,    MLVector32dType,
00773   MLVector64fType,    MLVector64dType,
00774 
00775   MLMatrix2fType,     MLMatrix2dType,
00776   MLMatrix3fType,     MLMatrix3dType,
00777   MLMatrix4fType,     MLMatrix4dType,
00778   MLMatrix5fType,     MLMatrix5dType,
00779   MLMatrix6fType,     MLMatrix6dType,
00780 
00781   MLVector2i8Type,    MLVector2i16Type,   MLVector2i32Type,   MLVector2i64Type,
00782   MLVector3i8Type,    MLVector3i16Type,   MLVector3i32Type,   MLVector3i64Type,
00783   MLVector4i8Type,    MLVector4i16Type,   MLVector4i32Type,   MLVector4i64Type,
00784   MLVector5i8Type,    MLVector5i16Type,   MLVector5i32Type,   MLVector5i64Type,
00785   MLVector6i8Type,    MLVector6i16Type,   MLVector6i32Type,   MLVector6i64Type,
00786   MLVector7i8Type,    MLVector7i16Type,   MLVector7i32Type,   MLVector7i64Type,
00787   MLVector8i8Type,    MLVector8i16Type,   MLVector8i32Type,   MLVector8i64Type,
00788   MLVector9i8Type,    MLVector9i16Type,   MLVector9i32Type,   MLVector9i64Type,
00789   MLVector10i8Type,   MLVector10i16Type,  MLVector10i32Type,  MLVector10i64Type,
00790   MLVector16i8Type,   MLVector16i16Type,  MLVector16i32Type,  MLVector16i64Type,
00791   MLVector32i8Type,   MLVector32i16Type,  MLVector32i32Type,  MLVector32i64Type,
00792   MLVector64i8Type,   MLVector64i16Type,  MLVector64i32Type,  MLVector64i64Type,
00793 
00794   // this type is more or less deprecated
00795   MLldoubleType 
00796 
00797 } MLDataTypeIds;
00798 
00799 //--------------------------------------------------------------------------------------------------
00801 //--------------------------------------------------------------------------------------------------
00802 typedef enum { ML_RETURN_NULL                            = 0x0, 
00803                ML_FATAL_MEMORY_ERROR                     = 0x1, 
00804                ML_THROW_NO_MEMORY                        = 0x2, 
00805                ML_FATAL_MEMORY_ERROR_AND_THROW_NO_MEMORY = 0x3  
00806 } MLMemoryErrorHandling;
00807 
00808 
00809 //--------------------------------------------------------------------------------------------------
00811 //--------------------------------------------------------------------------------------------------
00812 typedef enum { ML_FINAL_RUNTIME_CHECK_BIT                = 0x1, 
00813                // Todo if memory manager knows how much memory is freed/allocated on reallocs:
00814                //ML_FINAL_MEMORY_CHECK_BIT                 = 0x2, //!< Final checks in the Memory class are activated.
00815                ML_NO_CHECKS_BITS                         = 0x0, 
00816                ML_ALL_CHECKS_BITS                        = 0x1  
00817 } MLCheckBits;
00818 
00819 //--------------------------------------------------------------------------------------------------
00821 //--------------------------------------------------------------------------------------------------
00822 typedef enum { ML_WARNING       = 0x01,
00823                ML_ERROR         = 0x02,
00824                ML_FATAL         = 0x04,
00825                ML_DEBUG         = 0x08,
00826                ML_COUT          = 0x10,
00827                ML_CERR          = 0x20,
00828                ML_INFORMATION   = 0x40,
00829                ML_OTHER_MESSAGE = 0x80,
00830 
00831                ML_ALL_MESSAGES  = 0xff } MLMessageType;
00832 
00833 
00834 //-----------------------------------------------------------------------------------
00840 
00842 typedef MLint32 MLErrorCode;
00843 
00844 // Note: Be sure to cast them all to the correct MLErrorCode type.
00845 
00847 #define ML_INVALID_ERROR_CODE                             static_cast<MLErrorCode>(-1)
00848 
00850 #define ML_RESULT_OK                                      static_cast<MLErrorCode>( 0)
00851 
00856 #define ML_UNKNOWN_EXCEPTION                              static_cast<MLErrorCode>( 1)
00857 
00861 #define ML_NO_MEMORY                                      static_cast<MLErrorCode>( 2)
00862 
00864 #define ML_DISCONNECTED_GRAPH                             static_cast<MLErrorCode>( 3)
00865 
00868 #define ML_CYCLIC_GRAPH                                   static_cast<MLErrorCode>( 4)
00869 
00871 #define ML_BAD_OPERATOR_POINTER                           static_cast<MLErrorCode>( 5)
00872 
00874 #define ML_BAD_OPERATOR_OUTPUT_INDEX                      static_cast<MLErrorCode>( 6)
00875 
00877 #define ML_BAD_FIELD                                      static_cast<MLErrorCode>( 7)
00878 
00883 #define ML_IMAGE_DATA_CALCULATION_FAILED                  static_cast<MLErrorCode>( 8)
00884 
00886 #define ML_NO_IMAGE_INPUT_EXTENSION                       static_cast<MLErrorCode>( 9)
00887 
00894 #define ML_NO_IMAGE_PROPS                                 static_cast<MLErrorCode>(10)
00895 
00897 #define ML_BAD_OPERATOR_INPUT_INDEX                       static_cast<MLErrorCode>(11)
00898 
00902 #define ML_BAD_INPUT_IMAGE_POINTER                        static_cast<MLErrorCode>(12)
00903 
00908 #define ML_BAD_DATA_TYPE                                  static_cast<MLErrorCode>(13)
00909 
00914 #define ML_PROGRAMMING_ERROR                              static_cast<MLErrorCode>(14)
00915 
00921 #define ML_EMPTY_MESSAGE                                  static_cast<MLErrorCode>(15)
00922 
00929 #define ML_PAGE_CALCULATION_ERROR_IN_MODULE               static_cast<MLErrorCode>(16)
00930 
00935 #define ML_PROPERTY_CALCULATION_ERROR_IN_MODULE           static_cast<MLErrorCode>(17)
00936 
00942 #define ML_INBOX_CALCULATION_ERROR_IN_MODULE              static_cast<MLErrorCode>(18)
00943 
00949 #define ML_BAD_PARAMETER                                  static_cast<MLErrorCode>(19)
00950 
00958 #define ML_CALCULATION_ERROR                              static_cast<MLErrorCode>(20)
00959 
00961 #define ML_BAD_DIMENSION                                  static_cast<MLErrorCode>(21)
00962 
00975 #define ML_RECURSION_ERROR                                static_cast<MLErrorCode>(22)
00976 
00982 #define ML_LIBRARY_LOAD_ERROR                             static_cast<MLErrorCode>(23)
00983 
00986 #define ML_FILE_IO_ERROR                                  static_cast<MLErrorCode>(24)
00987 
00990 #define ML_AFTER_EFFECT                                   static_cast<MLErrorCode>(25)
00991 
00994 #define ML_BAD_INDEX                                      static_cast<MLErrorCode>(26)
00995 
00998 #define ML_OUT_OF_RANGE                                   static_cast<MLErrorCode>(27)
00999 
01003 #define ML_MISSING_VOXEL_TYPE_OPERATIONS                  static_cast<MLErrorCode>(28)
01004 
01007 #define ML_BAD_FIELD_TYPE                                 static_cast<MLErrorCode>(29)
01008 
01010 #define ML_BAD_FIELD_POINTER_OR_NO_MEMORY                 static_cast<MLErrorCode>(30)
01011 
01015 #define ML_FIELD_CREATION_ERROR_OR_NO_MEMORY              static_cast<MLErrorCode>(31)
01016 
01018 #define ML_TYPE_INITIALIZATION_ERROR                      static_cast<MLErrorCode>(32)
01019 
01021 #define ML_CONSTRUCTOR_EXCEPTION                          static_cast<MLErrorCode>(33)
01022 
01025 #define ML_DESTRUCTOR_EXCEPTION                           static_cast<MLErrorCode>(34)
01026 
01028 #define ML_TABLE_FULL                                     static_cast<MLErrorCode>(35)
01029 
01032 #define ML_EXTERNAL_ERROR                                 static_cast<MLErrorCode>(36)
01033 
01036 #define ML_BAD_BASE_FIELD                                 static_cast<MLErrorCode>(37)
01037 
01040 #define ML_BAD_BASE_FIELD_CONTENT                         static_cast<MLErrorCode>(38)
01041 
01047 #define ML_TYPE_NOT_REGISTERED                            static_cast<MLErrorCode>(39)
01048 
01054 #define ML_LIBRARY_INIT_ERROR                             static_cast<MLErrorCode>(40)
01055 
01059 #define ML_BAD_POINTER_OR_0                               static_cast<MLErrorCode>(41)
01060 
01064 #define ML_BAD_STATE                                      static_cast<MLErrorCode>(42)
01065 
01067 #define ML_TOO_MANY_PUSHES_OR_ADDS                        static_cast<MLErrorCode>(43)
01068 
01070 #define ML_TOO_MANY_POPS_OR_REMOVES                       static_cast<MLErrorCode>(44)
01071 
01073 #define ML_STACK_TABLE_OR_BUFFER_EMPTY                    static_cast<MLErrorCode>(45)
01074 
01076 #define ML_STACK_TABLE_OR_BUFFER_NOT_EMPTY                static_cast<MLErrorCode>(46)
01077 
01079 #define ML_ELEMENT_NOT_FOUND                              static_cast<MLErrorCode>(47)
01080 
01083 #define ML_INVALID_FILE_NAME                              static_cast<MLErrorCode>(48)
01084 
01086 #define ML_INVALID_FILE_DESCRIPTOR                        static_cast<MLErrorCode>(49)
01087 
01089 #define ML_FILE_NOT_OPEN                                  static_cast<MLErrorCode>(50)
01090 
01094 #define ML_NO_OR_INVALID_PERMISSIONS                      static_cast<MLErrorCode>(51)
01095 
01098 #define ML_DISK_OR_RESSOURCE_FULL                         static_cast<MLErrorCode>(52)
01099 
01105 #define ML_FILE_OR_DATA_STRUCTURE_CORRUPTED               static_cast<MLErrorCode>(53)
01106 
01109 #define ML_INVALID_VERSION                                static_cast<MLErrorCode>(54)
01110 
01116 #define ML_UNKNOWN_OR_INVALID_COMPRESSION_SCHEME          static_cast<MLErrorCode>(55)
01117 
01123 #define ML_TYPE_ALREADY_REGISTERED                        static_cast<MLErrorCode>(56)
01124 
01127 #define ML_TYPE_IS_ABSTRACT                               static_cast<MLErrorCode>(57)
01128 
01131 #define ML_TYPE_NOT_DERIVED_FROM_EXPECTED_PARENT_CLASS    static_cast<MLErrorCode>(58)
01132 
01134 #define ML_OPERATION_INTERRUPTED                          static_cast<MLErrorCode>(59)
01135 
01138 #define ML_BAD_PAGE_ID                                    static_cast<MLErrorCode>(60)
01139 
01143 #define ML_OUT_OF_RESSOURCES                              static_cast<MLErrorCode>(61)
01144 
01146 #define ML_OBJECT_OR_FILE_EXISTS                          static_cast<MLErrorCode>(62)
01147 
01149 #define ML_OBJECT_OR_FILE_DOES_NOT_EXIST                  static_cast<MLErrorCode>(63)
01150 
01152 #define ML_DEADLOCK_WOULD_OCCURR                          static_cast<MLErrorCode>(64)
01153 
01157 #define ML_COULD_NOT_OPEN_FILE                            static_cast<MLErrorCode>(65)
01158 
01161 #define ML_COULD_NOT_CREATE_OPEN_OR_MODIFY_FILE           ML_COULD_NOT_OPEN_FILE
01162 
01164 #define ML_LIBRARY_UNLOAD_ERROR                           static_cast<MLErrorCode>(66)
01165 
01167 #define ML_LIBRARY_UNLOAD_EXCEPTION                       static_cast<MLErrorCode>(67)
01168 
01170 #define ML_NOT_SUPPORTED_ON_THIS_SYSTEM                   static_cast<MLErrorCode>(68)
01171 
01173 #define ML_OBJECT_STILL_REFERENCED                        static_cast<MLErrorCode>(69)
01174 
01176 #define MLNumDefaultErrorCodes                            static_cast<MLErrorCode>(70)
01177 
01178 
01179 //--------------------------------------------------------------------------------------------------
01181 //--------------------------------------------------------------------------------------------------
01183 typedef enum { ML_CONTINUE= 0,   
01184                ML_ABORT,         
01185 
01186                ML_EXIT0,         
01187                ML_EXITCODE,      
01188                MLNumTerminators 
01189 } MLTerminator;
01190 
01191 
01192 //--------------------------------------------------------------------------------------------------
01194 
01195 //--------------------------------------------------------------------------------------------------
01197 typedef enum { ML_NOTIFY_NO_OBJECT     = 0x00000000,   
01198                ML_NOTIFY_ERROR_OUTPUT  = 0x00010000,   
01199                ML_NOTIFY_API           = 0x00020000,   
01200                ML_NOTIFY_RUNTIME       = 0x00040000,   
01201                ML_NOTIFY_CACHE         = 0x00080000,   
01202                ML_NOTIFY_HOST          = 0x00100000,   
01203                ML_NOTIFY_MODULE        = 0x00200000,    
01204   
01205 #ifdef ML_DEPRECATED
01206 
01207 
01208                ML_NOTIFY_BASEOP        = ML_NOTIFY_MODULE,
01209 #endif // ML_DEPRECATED  
01210   
01211 
01212                ML_NOTIFY_LAST_CLASS    = 0x00400000
01213 } MLNotifyChangedClassType;
01214 
01220 typedef enum { ML_NOTIFY_NO_OBJECT_TYPE                 = 0x0000 | ML_NOTIFY_NO_OBJECT,
01221 
01222                ML_NOTIFY_ERROR_OUTPUT_ERROR_OUTPUT_CB   = 0x0001 | ML_NOTIFY_ERROR_OUTPUT,
01223                ML_NOTIFY_ERROR_OUTPUT_FULL_DEBUGGING    = 0x0002 | ML_NOTIFY_ERROR_OUTPUT,
01224                ML_NOTIFY_ERROR_OUTPUT_TERMINATION_TYPE  = 0x0004 | ML_NOTIFY_ERROR_OUTPUT,
01225                ML_NOTIFY_ERROR_OUTPUT_MESSAGE_FILTER    = 0x0008 | ML_NOTIFY_ERROR_OUTPUT,
01226                ML_NOTIFY_ERROR_OUTPUT_DEBUG_ENV_NAMES   = 0x0010 | ML_NOTIFY_ERROR_OUTPUT,
01227                ML_NOTIFY_ERROR_OUTPUT_OTHER_CHANGES     = 0x0020 | ML_NOTIFY_ERROR_OUTPUT,
01228 
01229                ML_NOTIFY_API_EXCEPTIONS                 = 0x0001 | ML_NOTIFY_API,
01230                ML_NOTIFY_API_CHECKS_BITS                = 0x0002 | ML_NOTIFY_API,
01231 
01232                ML_NOTIFY_RUNTIME_TYPE_ADDED             = 0x0001 | ML_NOTIFY_RUNTIME,
01233                ML_NOTIFY_RUNTIME_TYPE_REMOVED           = 0x0002 | ML_NOTIFY_RUNTIME,
01234 
01235                ML_NOTIFY_CACHE_CLEAR                    = 0x0001 | ML_NOTIFY_CACHE,
01236                ML_NOTIFY_CACHE_MEM_OPT_LEVEL            = 0x0002 | ML_NOTIFY_CACHE,
01237                ML_NOTIFY_CACHE_FLUSH                    = 0x0004 | ML_NOTIFY_CACHE,
01238                ML_NOTIFY_CACHE_MAX_SIZE                 = 0x0008 | ML_NOTIFY_CACHE,
01239                ML_NOTIFY_CACHE_MONITORING_LEVEL         = 0x0010 | ML_NOTIFY_CACHE,
01240 
01241                ML_NOTIFY_HOST_MAX_NUM_THREADS           = 0x0001 | ML_NOTIFY_HOST,
01242                ML_NOTIFY_HOST_BREAK_CHECK_CB            = 0x0002 | ML_NOTIFY_HOST,
01243                ML_NOTIFY_HOST_PROGRESS_CB               = 0x0004 | ML_NOTIFY_HOST,
01244 
01245                ML_NOTIFY_FIELD_HANDLED                  = 0x0001 | ML_NOTIFY_MODULE,
01246                ML_NOTIFY_MODULE_INSTANTIATED            = 0x0002 | ML_NOTIFY_MODULE,
01247                ML_NOTIFY_MODULE_DELETED                 = 0x0004 | ML_NOTIFY_MODULE
01248 #ifdef ML_DEPRECATED       
01249               ,ML_NOTIFY_BASEOP_INSTANTIATED            = ML_NOTIFY_MODULE_INSTANTIATED, 
01250                ML_NOTIFY_BASEOP_DELETED                 = ML_NOTIFY_MODULE_DELETED       
01251 #endif // ML_DEPRECATED
01252   
01253   
01254   
01255 } MLNotifyChangedObjectType;
01257 
01258 
01259 
01260 //--------------------------------------------------------------------------------------------------
01263 //--------------------------------------------------------------------------------------------------
01264 typedef enum {
01265   ML_EVENTFILTER_ADD_CB=0,
01266   ML_EVENTFILTER_REMOVE_CB
01267 } MLEventFilterApplicationMessage;
01268 
01269 
01270 //--------------------------------------------------------------------------------------------------
01272 //--------------------------------------------------------------------------------------------------
01273 typedef enum { 
01274   ML_ZERO_SIGN = 0,             
01275   ML_NEGATIVE_SIGN,             
01276   ML_POSITIVE_SIGN              
01277 } MLSign;
01278 
01279 
01281 typedef enum { 
01282   ML_VX = 0,     
01283   ML_VY = 1,     
01284   ML_VZ = 2,     
01285   ML_VW = 3,     
01286   ML_VC = 3,     
01287   ML_VT = 4,     
01288   ML_VU = 5      
01289 } MLArrayIndex;
01290 
01291 
01292 //---------------------------------------------------------------------------------------------
01293 //
01294 //
01295 //                                FUNCTION TYPEDEFS
01296 //
01297 //
01298 //---------------------------------------------------------------------------------------------
01299 
01301 typedef double (*MLDblFuncPtr)(double);
01302 
01303 
01304 //-----------------------------------------------------------------------------------
01306 //-----------------------------------------------------------------------------------
01308 typedef void  MLMessageCB(void*         usrData,
01309                           MLErrorCode   errCode,
01310                           MLMessageType messageType,
01311                           const char*   messStr,
01312                           int           line,
01313                           const char**  infos);
01314 
01315 
01316 //---------------------------------------------------------------------------------------------
01325 //---------------------------------------------------------------------------------------------
01326 typedef void  MLNotifyCB(MLuint32 objType,
01327                          void*    usrData, 
01328                          void* objectData1, void* objData2);
01329 
01330 //--------------------------------------------------------------------------------------------------
01332 
01333 //--------------------------------------------------------------------------------------------------
01334 typedef void    MLSensorCB         (void* usrData, void* sensor);
01335 typedef void    MLHostProgressCB   (void* usrData, const char* info1, const char* info2);
01336 typedef MLint32 MLHostBreakCheckCB (void* usrData, void** hitField);
01338 
01339 
01340 //-----------------------------------------------------------------------------------
01341 //
01343 
01344 //
01345 //-----------------------------------------------------------------------------------
01346 
01349 typedef const char* MLApplicationGetStringPropertyCB(void* applicationUsrData, const char* propertyName, MLint16* found);
01350 
01352 typedef MLint32     MLApplicationGetInt32PropertyCB (void* applicationUsrData, const char* propertyName, MLint16* found);
01353 
01355 typedef double      MLApplicationGetDoublePropertyCB(void* applicationUsrData, const char* propertyName, MLint16* found);
01356 
01359 typedef MLint32     MLApplicationGetBoolPropertyCB  (void* applicationUsrData, const char* propertyName, MLint16* found);
01360 
01361 
01362 //--------------------------------------------------------------------------------------------------
01369 //--------------------------------------------------------------------------------------------------
01370 typedef MLint32     MLEventFilterCB                 (void* usrData, void* event);
01371 
01372 
01373 //--------------------------------------------------------------------------------------------------
01375 //--------------------------------------------------------------------------------------------------
01376 typedef struct 
01377 {
01379   MLApplicationGetStringPropertyCB* _getStringCB;
01380 
01382   MLApplicationGetInt32PropertyCB*  _getInt32CB;
01383 
01385   MLApplicationGetDoublePropertyCB* _getDoubleCB;
01386 
01388   MLApplicationGetBoolPropertyCB*   _getBoolCB;
01389 
01391   void* _applicationUsrData;
01392 
01393 } MLApplicationPropertyCallbacks;
01394 
01395 
01396 //--------------------------------------------------------------------------------------------------
01406 //--------------------------------------------------------------------------------------------------
01407 typedef void  MLEventFilterApplicationHookCB(void*                           applicationUsrData,
01408                                              MLEventFilterApplicationMessage type,
01409                                              MLEventFilterCB*                cb, 
01410                                              void *                          usrData,
01411                                              MLuint32                        fromMessageId,
01412                                              MLuint32                        toMessageId);
01413 
01414 
01415 
01416 
01417 
01418 //---------------------------------------------------------------------------------------------
01419 //
01420 //
01421 //                                REGISTERED TYPE SUPPORT
01422 //
01423 //
01424 //---------------------------------------------------------------------------------------------
01425 
01426 //--------------------------------------------------------------------------------------------------
01428 //--------------------------------------------------------------------------------------------------
01429 typedef MLuint64 MLTypePropertyBits;
01430 
01431 #ifdef ML_DEPRECATED
01432 //--------------------------------------------------------------------------------------------------
01434 //--------------------------------------------------------------------------------------------------
01436 
01437 
01438 ML_DEPRECATED typedef MLTypePropertyBits MLTypePropBits;
01441 ML_DEPRECATED typedef bool MLCTBool;
01444 ML_DEPRECATED typedef MLint MLCTInt;
01447 ML_DEPRECATED typedef MLuint64 MLCTUInt;
01449 #endif // ML_DEPRECATED
01450 
01451 //--------------------------------------------------------------------------------------------------
01453 //--------------------------------------------------------------------------------------------------
01454 typedef unsigned char MLTypeData;
01455 
01456 //--------------------------------------------------------------------------------------------------
01458 //--------------------------------------------------------------------------------------------------
01459 struct MLTypeInfos;
01460 
01461 //--------------------------------------------------------------------------------------------------
01463 
01464 //--------------------------------------------------------------------------------------------------
01465 typedef void        (*MLVoid_Data_Func                               ) (MLTypeData* q      );
01466 typedef bool        (*MLBool_ConstData_Func                          ) (const MLTypeData* p);
01467 typedef MLint       (*MLInt_ConstData_Func                           ) (const MLTypeData* p);
01468 typedef MLdouble    (*MLDouble_ConstData_Func                        ) (const MLTypeData* p);
01469 typedef char*       (*MLString_ConstData_Func                        ) (const MLTypeData* p);
01470 typedef void        (*MLVoid_Int_Data_Func                           ) (MLint             p,  MLTypeData* q      );
01471 typedef void        (*MLVoid_Double_Data_Func                        ) (MLdouble          p,  MLTypeData* q      );
01472 typedef void        (*MLVoid_ConstString_Data_Func                   ) (const char*       s,  MLTypeData* r      );
01473 typedef void        (*MLVoid_ConstData_Data_Func                     ) (const MLTypeData* p,  MLTypeData* q      );
01474 typedef bool        (*MLBool_ConstData_ConstData_Func                ) (const MLTypeData* p,  const MLTypeData* q);
01475 typedef bool        (*MLBool_ConstData_ConstData_Double_Func         ) (const MLTypeData* p,  const MLTypeData* q, MLdouble d);
01476 typedef void        (*MLVoid_ConstData_Int_Data_Func                 ) (const MLTypeData* p,  MLint q,              MLTypeData* r              );
01477 typedef void        (*MLVoid_ConstData_Double_Data_Func              ) (const MLTypeData* p,  MLdouble q,           MLTypeData* r              );
01478 typedef void        (*MLVoid_ConstData_ConstData_Data_Func           ) (const MLTypeData* p,  const MLTypeData* q,  MLTypeData* result         );
01479 typedef void        (*MLVoid_ConstData_Double_Double_Data_Func       ) (const MLTypeData* p,  MLdouble scale,       MLdouble shift, MLTypeData*s);
01480 typedef void        (*MLVoid_ConstData_ConstInfos_Data_Func          ) (const MLTypeData* myData,         const struct MLTypeInfos* otherInfos, MLTypeData* otherData);
01481 typedef void        (*MLVoid_ConstInfos_ConstData_Data_Func          ) (const struct MLTypeInfos* myInfos, const MLTypeData* myData, MLTypeData* otherData);
01482 typedef void        (*MLVoid_ConstInfos_ConstData_ConstData_Data_Func) (const struct MLTypeInfos* myInfos, const MLTypeData* myData, const MLTypeData* otherData, MLTypeData* result);
01483 
01484 typedef void        (*MLVoid_ConstData_Data_SizeT_Func               ) (const MLTypeData* p, MLTypeData* q, size_t n);
01485 typedef void        (*MLVoid_ConstData_SSizeT_Data_SSizeT_SizeT_Func ) (const MLTypeData* p, MLssize_t ps, MLTypeData* q, MLssize_t qs, size_t n);
01486 typedef void        (*MLVoid_ConstData_ConstData_Double_Data_Func    ) (const MLTypeData* p, const MLTypeData* q, MLdouble r, MLTypeData* t);
01487 typedef void        (*MLVoid_ConstData_Double_ConstData_Data_SizeT_Func) (const MLTypeData* p, MLdouble q, const MLTypeData* r, MLTypeData* t, size_t s);
01488 typedef bool        (*MLBool_ConstData_ConstData_SizeT_Func          ) (const MLTypeData* p, const MLTypeData* q, size_t s);
01489 typedef void        (*MLVoid_ConstData_SizeT_DoubleRef_DoubleRef_Func) (const MLTypeData* p, size_t s, MLdouble& q, MLdouble& r);
01490 typedef MLdouble    (*MLDouble_ConstData_SizeT_Func                  ) (const MLTypeData* p, size_t q);
01491 typedef void        (*MLVoid_Data_SizeT_Double_Func                  ) (MLTypeData* p, size_t q, MLdouble r);
01493 
01494 
01495 //--------------------------------------------------------------------------------------------------
01498 //--------------------------------------------------------------------------------------------------
01499 typedef MLint32 MLTypeGroup;
01500 
01501 //--------------------------------------------------------------------------------------------------
01503 //--------------------------------------------------------------------------------------------------
01504 typedef enum {
01505   MLNoTypeGroup = -1,
01506   MLScalarTypeGroup,
01507   MLVectorTypeGroup,
01508   MLMatrixTypeGroup
01509 } MLTypeGroupIds;
01510 
01511 //--------------------------------------------------------------------------------------------------
01517 //--------------------------------------------------------------------------------------------------
01518 typedef struct MLTypeInfos {
01519 
01521 
01522 
01524 #ifdef ML_DEPRECATED
01525   union {
01526     size_t               numComponents;
01527     size_t               numComps;
01528   };
01529 #else
01530   size_t               numComponents;
01531 #endif
01532 
01534   size_t               typeSize;
01535 
01537   const char*          name;
01538 
01540   MLDataType           rangeAndPrecisionEquivalent;
01541 
01543   MLdouble             dblMin;
01544 
01546   MLdouble             dblMax;
01547 
01549   const MLTypeData*    typeMinPtr;
01550 
01552   const MLTypeData*    typeMaxPtr;
01553 
01555   const MLTypeData*    typeDefaultPtr;
01556 
01558   size_t               numGoodCastTos;
01559 
01561   const char**         goodCastTos;
01562 
01564 #ifdef ML_DEPRECATED
01565   union {
01566     size_t             componentOffsets[ML_MAX_COMPONENTS_EXTENDED_TYPE];
01567     size_t             compOffsets[ML_MAX_COMPONENTS_EXTENDED_TYPE];
01568   };
01569 #else
01570   size_t               componentOffsets[ML_MAX_COMPONENTS_EXTENDED_TYPE];
01571 #endif
01572 
01587   const char*          structInfoString;
01588 
01590   MLint32              dataTypeId;
01591 
01593   MLTypeGroup          typeGroup;
01594 
01596   MLTypePropertyBits   propertyBits;
01598 
01599 
01600 
01602 
01603 
01607   MLString_ConstData_Func                                    getStringValue;
01610   MLVoid_ConstString_Data_Func                               setStringValue;
01611 
01613   MLVoid_Data_Func                                           setToMinimum;
01615   MLVoid_Data_Func                                           setToMaximum;
01617   MLVoid_Data_Func                                           setToDefault;
01619   MLDouble_ConstData_SizeT_Func                              getComponent;
01621   MLVoid_Data_SizeT_Double_Func                              setComponent;
01623   MLVoid_ConstData_Data_Func                                 copy;
01625   MLVoid_ConstData_Data_SizeT_Func                           arrayCopy;
01627   MLVoid_ConstData_SSizeT_Data_SSizeT_SizeT_Func             arrayCopyWithStrides;
01629   MLVoid_ConstData_Data_SizeT_Func                           arrayFill;
01630 
01632   MLBool_ConstData_Func                                      castToBool;
01634   MLInt_ConstData_Func                                       castToInt;
01636   MLDouble_ConstData_Func                                    castToDouble;
01638   MLVoid_ConstData_ConstInfos_Data_Func                      castToOtherType;
01639 
01641   MLVoid_Int_Data_Func                                       castFromInt;
01643   MLVoid_Double_Data_Func                                    castFromDouble;
01645   MLVoid_ConstInfos_ConstData_Data_Func                      castFromOtherType;
01646 
01648   MLBool_ConstData_ConstData_Func                            isEqualToType;
01649 
01651   MLBool_ConstData_ConstData_Double_Func                     isEqualToTypeWithEpsilon;
01652 
01654   MLVoid_ConstData_Data_Func                                 negate;
01656   MLVoid_ConstData_Data_Func                                 normalize;
01657 
01661   MLVoid_ConstData_Double_ConstData_Data_SizeT_Func          arrayRescale;
01662 
01666   MLBool_ConstData_ConstData_SizeT_Func                      arrayEqualsValue;
01667 
01671   MLVoid_ConstData_SizeT_DoubleRef_DoubleRef_Func            arrayGetMinMax;
01672 
01676   MLVoid_ConstData_ConstData_Double_Data_Func                interpolate;
01677 
01679   MLVoid_ConstData_Int_Data_Func                             multWithInt;
01681   MLVoid_ConstData_Double_Data_Func                          multWithDouble;
01683   MLVoid_ConstData_ConstData_Data_Func                       multWithType;
01685   MLVoid_ConstInfos_ConstData_ConstData_Data_Func            multWithOtherType;
01686 
01688   MLVoid_ConstData_Int_Data_Func                             plusInt;
01690   MLVoid_ConstData_Double_Data_Func                          plusDouble;
01692   MLVoid_ConstData_ConstData_Data_Func                       plusType;
01694 } MLTypeInfos;
01695 
01696 
01697 
01698 //--------------------------------------------------------------------------------------------------
01702 //--------------------------------------------------------------------------------------------------
01703 #define ML_CALC_FTYPE MLdouble
01704 
01705 //--------------------------------------------------------------------------------------------------
01709 //--------------------------------------------------------------------------------------------------
01710 #define ML_CALC_ITYPE MLint
01711 
01712 
01713 //--------------------------------------------------------------------------------------------------
01715 
01716 //--------------------------------------------------------------------------------------------------
01717 #define ML_TYPE_ASSIGN_FUNCTION_POINTERS()                    \
01718     getStringValue          = MLTYPE_getStringValue;          \
01719     setStringValue          = MLTYPE_setStringValue;          \
01720     setToMinimum            = MLTYPE_setToMinimum;            \
01721     setToMaximum            = MLTYPE_setToMaximum;            \
01722     setToDefault            = MLTYPE_setToDefault;            \
01723     getComponent            = MLTYPE_getComponent;            \
01724     setComponent            = MLTYPE_setComponent;            \
01725     copy                    = MLTYPE_copy;                    \
01726     arrayCopy               = MLTYPE_arrayCopy;               \
01727     arrayCopyWithStrides    = MLTYPE_arrayCopyWithStrides;    \
01728     arrayFill               = MLTYPE_arrayFill;               \
01729                                                               \
01730     castToBool              = MLTYPE_castToBool;              \
01731     castToInt               = MLTYPE_castToInt;               \
01732     castToDouble            = MLTYPE_castToDouble;            \
01733     castToOtherType         = MLTYPE_castToOtherType;         \
01734     castFromInt             = MLTYPE_castFromInt;             \
01735     castFromDouble          = MLTYPE_castFromDouble;          \
01736     castFromOtherType       = MLTYPE_castFromOtherType;       \
01737                                                               \
01738     isEqualToType           = MLTYPE_isEqualToType;           \
01739     isEqualToTypeWithEpsilon= MLTYPE_isEqualToTypeWithEpsilon;\
01740                                                               \
01741     negate                  = MLTYPE_negate;                  \
01742     normalize               = MLTYPE_normalize;               \
01743                                                               \
01744     arrayRescale            = MLTYPE_arrayRescale;            \
01745     interpolate             = MLTYPE_interpolate;             \
01746     arrayEqualsValue        = MLTYPE_arrayEqualsValue;        \
01747     arrayGetMinMax          = MLTYPE_arrayGetMinMax;          \
01748                                                               \
01749     multWithInt             = MLTYPE_multWithInt;             \
01750     multWithDouble          = MLTYPE_multWithDouble;          \
01751     multWithType            = MLTYPE_multWithType;            \
01752     multWithOtherType       = MLTYPE_multWithOtherType;       \
01753                                                               \
01754     plusInt                 = MLTYPE_plusInt;                 \
01755     plusDouble              = MLTYPE_plusDouble;              \
01756     plusType                = MLTYPE_plusType;
01757 
01758 
01759 
01760 #endif // __mlTypeDefs_H
01761 
01762 
01763