ML Reference
mlTypeDefs.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_TYPE_DEFS_H
14#define ML_TYPE_DEFS_H
15
17
18#include "mlMacros.h"
19
20// Include global compiler switches for the ML.
21#include "mlConfig.h"
22#include "mlUtilities.h"
23
24// We always need stdlib.h for, e.g., size_t.
25#include <ThirdPartyWarningsDisable.h>
26#include <cstdlib>
27#include <cstdint>
28#include <cfloat>
29
30#if !defined(WIN32)
31 #include <pthread.h>
32 #include <sys/types.h>
33#endif
34
35#include <ThirdPartyWarningsRestore.h>
36
37//---------------------------------------------------------------------------------------------
38//
39//
40// DEFINES
41//
42//
43//---------------------------------------------------------------------------------------------
44
45
46//------------------------------------------------------------------------------------
49//------------------------------------------------------------------------------------
50#ifndef ML_NAMESPACE
53 #define ML_NAMESPACE ml
54#endif
55
56#ifndef ML_START_NAMESPACE
60 #define ML_START_NAMESPACE namespace ML_NAMESPACE {
61#endif
62
63#ifndef ML_END_NAMESPACE
66 #define ML_END_NAMESPACE }
67#endif
69
70//--------------------------------------------------------------------------------------------
73//--------------------------------------------------------------------------------------------
74
75//--------------------------------------------------------------------------------------------
78//--------------------------------------------------------------------------------------------
79#define ML_PREFIX "ML"
80
81//--------------------------------------------------------------------------------------------
84//--------------------------------------------------------------------------------------------
85#define ML_CONSTANT_PREFIX "ML_"
86
87
88
89//--------------------------------------------------------------------------------------------
90// MLTypes. They define all basic integer datatypes.
91//--------------------------------------------------------------------------------------------
92#ifndef _ML_INT8
95 // Should be signed but that causes too many consequences.
96 typedef /*signed*/ char MLint8;
97 typedef /*signed*/ char* MLint8Ptr;
98 #define ML_INT8_MIN -128
99 #define ML_INT8_MAX 0x7F
102 #define _ML_INT8 MLint8
103#endif
104
105#ifndef _ML_UINT8
108 typedef unsigned char MLuint8;
109 typedef unsigned char* MLuint8Ptr;
110 #define ML_UINT8_MIN 0x00
111 #define ML_UINT8_MAX 0xFF
114 #define _ML_UINT8 MLuint8
115#endif
116
117#ifndef _ML_INT16
120 #if (__GNUC__ >= 3)
121 typedef int16_t MLint16;
122 typedef int16_t* MLint16Ptr;
123 #else
124 typedef signed short MLint16;
125 typedef signed short* MLint16Ptr;
126 #endif
127 #define ML_INT16_MIN -32768
128 #define ML_INT16_MAX 0x7FFF
131 #define _ML_INT16 MLint16
132#endif
133
134#ifndef _ML_UINT16
137 #if (__GNUC__ >= 3)
138 typedef uint16_t MLuint16;
139 typedef uint16_t* MLuint16Ptr;
140 #else
141 typedef unsigned short MLuint16;
142 typedef unsigned short* MLuint16Ptr;
143 #endif
144 #define ML_UINT16_MIN 0x0000
145 #define ML_UINT16_MAX 0xFFFF
148 #define _ML_UINT16 MLuint16
149#endif
150
151
152#ifndef _ML_INT32
155
156 #if (__GNUC__ >= 3)
157 typedef int32_t MLint32;
158 typedef int32_t* MLint32Ptr;
159 #else
160 typedef signed int MLint32;
161 typedef signed int* MLint32Ptr;
162 #endif
163
164 // Note: Do not use simply 0x80000000L since that
165 // might be assigned as positive value to
166 // floating point values. Force an explicit cast
167 // to avoid that error. Cast values to avoid that
168 // they are considered as long values.
169 #define ML_INT32_MIN (static_cast<MLint32>(0x80000000L))
170 #define ML_INT32_MAX (static_cast<MLint32>(0x7FFFFFFFL))
173 #define _ML_INT32 MLint32
174#endif
175
176
177#ifndef _ML_UINT32
180 #if (__GNUC__ >= 3)
181 typedef uint32_t MLuint32;
182 typedef uint32_t* MLuint32Ptr;
183 #else
184 typedef unsigned int MLuint32;
185 typedef unsigned int* MLuint32Ptr;
186 #endif
187
188 // Cast values to avoid that they are considered as long values.
189 #define ML_UINT32_MIN (static_cast<MLuint32>(0x00000000L))
190 #define ML_UINT32_MAX (static_cast<MLuint32>(0xFFFFFFFFL))
193 #define _ML_UINT32 MLuint32
194#endif
195
196
197#ifndef _ML_FLOAT
200 typedef float MLfloat;
201 typedef float* MLfloatPtr;
202 #define ML_FLOAT_MIN FLT_MIN
203 #define ML_FLOAT_MAX FLT_MAX
204 #define ML_FLOAT_EPSILON FLT_EPSILON
205 // Use more digits in string representation to retain full precision of binary value:
206 #define ML_FLOAT_DIG (FLT_DIG+2)
209 #define _ML_FLOAT MLfloat
210#endif
211
212
213#ifndef _ML_DOUBLE
216 typedef double MLdouble;
217 typedef double* MLdoublePtr;
218 #define ML_DOUBLE_MIN DBL_MIN
219 #define ML_DOUBLE_MAX DBL_MAX
220 #define ML_DOUBLE_EPSILON DBL_EPSILON
221 #define ML_DOUBLE_DIG DBL_DIG
224 #define _ML_DOUBLE MLdouble
225#endif
226
227
228#ifndef _ML_LDOUBLE
231 typedef long double MLldouble;
232 typedef long double* MLldoublePtr;
233 #define ML_LDOUBLE_MIN LDBL_MIN
234 #define ML_LDOUBLE_MAX LDBL_MAX
235 #define ML_LDOUBLE_EPSILON LDBL_EPSILON
236 #define ML_LDOUBLE_DIG LDBL_DIG
239 #define _ML_LDOUBLE MLldouble
240#endif
241
242//--------------------------------------------------------------------------------------------------
245//--------------------------------------------------------------------------------------------------
246#define ML_NUM_STANDARD_TYPES 10
247
248//--------------------------------------------------------------------------------------------------
251//--------------------------------------------------------------------------------------------------
252#define ML_MAX_COMPONENTS_EXTENDED_TYPE 512
253
254//--------------------------------------------------------------------------------------------------
257//--------------------------------------------------------------------------------------------------
259#define ML_LUMINANCE "LUMINANCE"
261#define ML_NEGATIVE "NEGATIVE"
263#define ML_PALETTE "PALETTE"
264
265// Codes for multiple channel images.
266
268#define ML_RED "RED"
270#define ML_GREEN "GREEN"
272#define ML_BLUE "BLUE"
274#define ML_ALPHA "ALPHA"
275
277#define ML_CYAN "CYAN"
279#define ML_MAGENTA "MAGENTA"
281#define ML_YELLOW "YELLOW"
283#define ML_BLACK "BLACK"
284
286#define ML_HUE "HUE"
288#define ML_SATURATION "SATURATION"
290#define ML_VALUE "VALUE"
292#define ML_LIGHTNESS "LIGHTNESS"
293
295#define ML_YIQ_Y "YIQ_Y"
297#define ML_YIQ_I "YIQ_I"
299#define ML_YIQ_Q "YIQ_Q"
300
304#define ML_CIE_X "CIE_X"
306#define ML_CIE_Y "CIE_Y"
308#define ML_CIE_Z "CIE_Z"
310#define ML_LUV_L "LUV_L"
312#define ML_LUV_U "LUV_U"
314#define ML_LUV_V "LUV_V"
315
317#define ML_UNKNOWN "UNKNOWN"
318
320
321
322//--------------------------------------------------------------------------------------------------
325//--------------------------------------------------------------------------------------------------
327#define ML_REAL "REAL_PART"
329#define ML_IMAG "IMAG_PART"
330
332#define ML_V0 "V0"
334#define ML_V1 "V1"
336#define ML_V2 "V2"
338#define ML_V3 "V3"
340#define ML_V4 "V4"
342#define ML_V5 "V5"
343
345#define ML_MAGNITUDE "MAGNITUDE"
347#define ML_ANGLE "ANGLE"
349
350
351
352//------------------------------------------------------------------------------------
353//
356//
357//------------------------------------------------------------------------------------
358
359#ifndef ML_QUOTE
362 #define ML_QUOTE_INTERNAL(A) #A
363 #define ML_QUOTE(A) ML_QUOTE_INTERNAL(A)
364#endif
365
366#ifndef ML_LERP
369 #define ML_LERP(a,l,h) ((l)+(((h)-(l))*(a)))
370#endif
371
373
375#ifndef ML_M_PI
376# define ML_M_PI 3.14159265358979323846 /* pi */
377#endif
379#ifndef ML_M_PI_2
380# define ML_M_PI_2 1.57079632679489661923 /* pi/2 */
381#endif
382
383//---------------------------------------------------------------------------------------------
384//
385//
386// 64 BIT SUPPORT
387//
388//
389//---------------------------------------------------------------------------------------------
390
391//------------------------------------------------------------------------------------
394//------------------------------------------------------------------------------------
395#ifndef ML_SYSTEM_HAS_NO_64
396
398 #ifdef WIN32
399 #include <ThirdPartyWarningsDisable.h>
400 #include <basetsd.h>
401 #include <ThirdPartyWarningsRestore.h>
402 #else
403 #include <cstdint>
404 #endif
405
406
407 // Defines MLint64 type and its corresponding pointer type.
408 #if defined(WIN32)
409
411 typedef INT64 MLint64;
413 typedef INT64* MLint64Ptr;
414
416 #ifndef INT64_MIN
417 #define INT64_MIN 0x8000000000000000I64
418 #endif
419 #ifndef INT64_MAX
420 #define INT64_MAX 0x7FFFFFFFFFFFFFFFI64
421 #endif
422
424 typedef UINT64 MLuint64;
426 typedef UINT64* MLuint64Ptr;
427
429 #ifndef UINT64_MIN
430 #define UINT64_MIN static_cast<MLuint64>(0)
431 #endif
432 #ifndef UINT64_MAX
433 #define UINT64_MAX 0xFFFFFFFFFFFFFFFFUI64
434 #endif
435
436 #else
438 typedef long long MLint64;
440 typedef MLint64* MLint64Ptr;
441
443 typedef unsigned long long MLuint64;
445 typedef MLuint64* MLuint64Ptr;
446 #endif
448
449#else
450
453 typedef unsigned char MLint64[8];
454 typedef MLint64* MLint64Ptr;
455 typedef unsigned char MLuint64[8];
456 typedef MLuint64* MLuint64Ptr;
458
459#endif
460
461
462#ifndef _ML_INT64
465 #define ML_INT64_MIN INT64_MIN
466 #define ML_INT64_MAX INT64_MAX
469 #define _ML_INT64 MLint64
470#endif
471
472#ifndef _ML_UINT64
475 #define ML_UINT64_MIN static_cast<MLuint64>(0)
476 #define ML_UINT64_MAX UINT64_MAX
479 #define _ML_UINT64 MLuint64
480#endif
481
482//--------------------------------------------------------------------------------------------
485//--------------------------------------------------------------------------------------------
486
490
493
495#define ML_INT_MIN ML_INT64_MIN
496
498#define ML_INT_MAX ML_INT64_MAX
499
500
506
509
511#define ML_UINT_MIN UINT64_MIN
512
514#define ML_UINT_MAX UINT64_MAX
516
517
518
519
520//-------------------------------------------------------------------------------------
523// Introduce signed and unsigned size and offset types for pointers that are 32-bit
524// on 32-bit systems and 64-bit on 64-bit systems. This is necessary because integer
525// is not large enough on 64-bit systems, as it remains 32-bit even on many 64-bit
526// platforms.
527// Notes:
528// - size types should be used for memory, file, array, and object sizes.
529// - offset types should be used as offsets typically added to pointers.
530//-------------------------------------------------------------------------------------
531#ifndef _ML_USIZE_T
533 #define _ML_USIZE_T
534
537
539 typedef size_t MLusize_t;
540
542 #define ML_USIZE_T_MIN ( static_cast<size_t>(0))
543
545 #define ML_USIZE_T_MAX (~static_cast<size_t>(0))
546
548 #define ML_SIZE_T_MIN ML_USIZE_T_MIN
549
551 #define ML_SIZE_T_MAX ML_USIZE_T_MAX
552
553#endif
554
555
556#ifndef _ML_SIZE_T
558 #define _ML_SIZE_T
559
562
563 #if defined(WIN32)
565 typedef SSIZE_T MLssize_t;
566 #else
568 typedef ssize_t MLssize_t;
569 #endif
570
572 #define ML_SSIZE_T_MIN (static_cast<MLssize_t>(1) << (sizeof(MLssize_t)*8-1))
573
575 // Take the
576 #define ML_SSIZE_T_MAX (static_cast<MLssize_t>(ML_USIZE_T_MAX ^ ML_SSIZE_T_MIN))
577#endif
578
580
581
582
583//---------------------------------------------------------------------------------------------
584//
585//
586// TYPEDEFS, MOSTLY ENUMS
587//
588//
589//---------------------------------------------------------------------------------------------
590
591//--------------------------------------------------------------------------------------------------
594//--------------------------------------------------------------------------------------------------
596
597//--------------------------------------------------------------------------------------------------
599//--------------------------------------------------------------------------------------------------
600#define ML_UNDEFINED_THREADID 0
601
602#ifdef WIN32
604#else
605typedef pthread_t MLThreadId;
606#endif
607
608//--------------------------------------------------------------------------------------------------
611//--------------------------------------------------------------------------------------------------
612#define ML_INVALID_DATA_TYPE -1
613
614//--------------------------------------------------------------------------------------------------
617//--------------------------------------------------------------------------------------------------
618typedef enum {
629
630 // Type ids for extended datatypes:
632
634
647
653
666
667 // this type is more or less deprecated
669
671
672//--------------------------------------------------------------------------------------------------
674//--------------------------------------------------------------------------------------------------
675typedef enum { ML_RETURN_NULL = 0x0,
680
681
682//--------------------------------------------------------------------------------------------------
684//--------------------------------------------------------------------------------------------------
685typedef enum { ML_FINAL_RUNTIME_CHECK_BIT = 0x1,
686 // Todo if memory manager knows how much memory is freed/allocated on reallocs:
687 //ML_FINAL_MEMORY_CHECK_BIT = 0x2, //!< Final checks in the Memory class are activated.
689 ML_ALL_CHECKS_BITS = 0x1
691
692//--------------------------------------------------------------------------------------------------
694//--------------------------------------------------------------------------------------------------
695typedef enum { ML_WARNING = 0x01,
696 ML_ERROR = 0x02,
697 ML_FATAL = 0x04,
698 ML_DEBUG = 0x08,
699 ML_COUT = 0x10,
700 ML_CERR = 0x20,
703
705
706
707//-----------------------------------------------------------------------------------
712
713
716
717// Note: Be sure to cast them all to the correct MLErrorCode type.
718
720#define ML_INVALID_ERROR_CODE static_cast<MLErrorCode>(-1)
721
723#define ML_RESULT_OK static_cast<MLErrorCode>( 0)
724
729#define ML_UNKNOWN_EXCEPTION static_cast<MLErrorCode>( 1)
730
734#define ML_NO_MEMORY static_cast<MLErrorCode>( 2)
735
737#define ML_DISCONNECTED_GRAPH static_cast<MLErrorCode>( 3)
738
741#define ML_CYCLIC_GRAPH static_cast<MLErrorCode>( 4)
742
744#define ML_BAD_OPERATOR_POINTER static_cast<MLErrorCode>( 5)
745
747#define ML_BAD_OPERATOR_OUTPUT_INDEX static_cast<MLErrorCode>( 6)
748
750#define ML_BAD_FIELD static_cast<MLErrorCode>( 7)
751
756#define ML_IMAGE_DATA_CALCULATION_FAILED static_cast<MLErrorCode>( 8)
757
759#define ML_NO_IMAGE_INPUT_EXTENSION static_cast<MLErrorCode>( 9)
760
767#define ML_NO_IMAGE_PROPS static_cast<MLErrorCode>(10)
768
770#define ML_BAD_OPERATOR_INPUT_INDEX static_cast<MLErrorCode>(11)
771
775#define ML_BAD_INPUT_IMAGE_POINTER static_cast<MLErrorCode>(12)
776
781#define ML_BAD_DATA_TYPE static_cast<MLErrorCode>(13)
782
787#define ML_PROGRAMMING_ERROR static_cast<MLErrorCode>(14)
788
794#define ML_EMPTY_MESSAGE static_cast<MLErrorCode>(15)
795
802#define ML_PAGE_CALCULATION_ERROR_IN_MODULE static_cast<MLErrorCode>(16)
803
808#define ML_PROPERTY_CALCULATION_ERROR_IN_MODULE static_cast<MLErrorCode>(17)
809
815#define ML_INBOX_CALCULATION_ERROR_IN_MODULE static_cast<MLErrorCode>(18)
816
822#define ML_BAD_PARAMETER static_cast<MLErrorCode>(19)
823
831#define ML_CALCULATION_ERROR static_cast<MLErrorCode>(20)
832
834#define ML_BAD_DIMENSION static_cast<MLErrorCode>(21)
835
848#define ML_RECURSION_ERROR static_cast<MLErrorCode>(22)
849
855#define ML_LIBRARY_LOAD_ERROR static_cast<MLErrorCode>(23)
856
859#define ML_FILE_IO_ERROR static_cast<MLErrorCode>(24)
860
863#define ML_AFTER_EFFECT static_cast<MLErrorCode>(25)
864
867#define ML_BAD_INDEX static_cast<MLErrorCode>(26)
868
871#define ML_OUT_OF_RANGE static_cast<MLErrorCode>(27)
872
876#define ML_MISSING_VOXEL_TYPE_OPERATIONS static_cast<MLErrorCode>(28)
877
880#define ML_BAD_FIELD_TYPE static_cast<MLErrorCode>(29)
881
883#define ML_BAD_FIELD_POINTER_OR_NO_MEMORY static_cast<MLErrorCode>(30)
884
888#define ML_FIELD_CREATION_ERROR_OR_NO_MEMORY static_cast<MLErrorCode>(31)
889
891#define ML_TYPE_INITIALIZATION_ERROR static_cast<MLErrorCode>(32)
892
894#define ML_CONSTRUCTOR_EXCEPTION static_cast<MLErrorCode>(33)
895
898#define ML_DESTRUCTOR_EXCEPTION static_cast<MLErrorCode>(34)
899
901#define ML_TABLE_FULL static_cast<MLErrorCode>(35)
902
905#define ML_EXTERNAL_ERROR static_cast<MLErrorCode>(36)
906
909#define ML_BAD_BASE_FIELD static_cast<MLErrorCode>(37)
910
913#define ML_BAD_BASE_FIELD_CONTENT static_cast<MLErrorCode>(38)
914
920#define ML_TYPE_NOT_REGISTERED static_cast<MLErrorCode>(39)
921
927#define ML_LIBRARY_INIT_ERROR static_cast<MLErrorCode>(40)
928
932#define ML_BAD_POINTER_OR_0 static_cast<MLErrorCode>(41)
933
937#define ML_BAD_STATE static_cast<MLErrorCode>(42)
938
940#define ML_TOO_MANY_PUSHES_OR_ADDS static_cast<MLErrorCode>(43)
941
943#define ML_TOO_MANY_POPS_OR_REMOVES static_cast<MLErrorCode>(44)
944
946#define ML_STACK_TABLE_OR_BUFFER_EMPTY static_cast<MLErrorCode>(45)
947
949#define ML_STACK_TABLE_OR_BUFFER_NOT_EMPTY static_cast<MLErrorCode>(46)
950
952#define ML_ELEMENT_NOT_FOUND static_cast<MLErrorCode>(47)
953
956#define ML_INVALID_FILE_NAME static_cast<MLErrorCode>(48)
957
959#define ML_INVALID_FILE_DESCRIPTOR static_cast<MLErrorCode>(49)
960
962#define ML_FILE_NOT_OPEN static_cast<MLErrorCode>(50)
963
967#define ML_NO_OR_INVALID_PERMISSIONS static_cast<MLErrorCode>(51)
968
971#define ML_DISK_OR_RESSOURCE_FULL static_cast<MLErrorCode>(52)
972
978#define ML_FILE_OR_DATA_STRUCTURE_CORRUPTED static_cast<MLErrorCode>(53)
979
982#define ML_INVALID_VERSION static_cast<MLErrorCode>(54)
983
989#define ML_UNKNOWN_OR_INVALID_COMPRESSION_SCHEME static_cast<MLErrorCode>(55)
990
996#define ML_TYPE_ALREADY_REGISTERED static_cast<MLErrorCode>(56)
997
1000#define ML_TYPE_IS_ABSTRACT static_cast<MLErrorCode>(57)
1001
1004#define ML_TYPE_NOT_DERIVED_FROM_EXPECTED_PARENT_CLASS static_cast<MLErrorCode>(58)
1005
1007#define ML_OPERATION_INTERRUPTED static_cast<MLErrorCode>(59)
1008
1011#define ML_BAD_PAGE_ID static_cast<MLErrorCode>(60)
1012
1016#define ML_OUT_OF_RESSOURCES static_cast<MLErrorCode>(61)
1017
1019#define ML_OBJECT_OR_FILE_EXISTS static_cast<MLErrorCode>(62)
1020
1022#define ML_OBJECT_OR_FILE_DOES_NOT_EXIST static_cast<MLErrorCode>(63)
1023
1025#define ML_DEADLOCK_WOULD_OCCURR static_cast<MLErrorCode>(64)
1026
1030#define ML_COULD_NOT_OPEN_FILE static_cast<MLErrorCode>(65)
1031
1034#define ML_COULD_NOT_CREATE_OPEN_OR_MODIFY_FILE ML_COULD_NOT_OPEN_FILE
1035
1037#define ML_LIBRARY_UNLOAD_ERROR static_cast<MLErrorCode>(66)
1038
1040#define ML_LIBRARY_UNLOAD_EXCEPTION static_cast<MLErrorCode>(67)
1041
1043#define ML_NOT_SUPPORTED_ON_THIS_SYSTEM static_cast<MLErrorCode>(68)
1044
1046#define ML_OBJECT_STILL_REFERENCED static_cast<MLErrorCode>(69)
1047
1049#define ML_REQUEST_OUTSIDE_OF_IMAGE static_cast<MLErrorCode>(70)
1050
1052#define MLNumDefaultErrorCodes static_cast<MLErrorCode>(71)
1054
1055//--------------------------------------------------------------------------------------------------
1057//--------------------------------------------------------------------------------------------------
1059typedef enum { ML_CONTINUE= 0,
1060 ML_ABORT,
1066
1067
1068//--------------------------------------------------------------------------------------------------
1071//--------------------------------------------------------------------------------------------------
1073typedef enum { ML_NOTIFY_NO_OBJECT = 0x00000000,
1075 ML_NOTIFY_API = 0x00020000,
1076 ML_NOTIFY_RUNTIME = 0x00040000,
1077 ML_NOTIFY_CACHE = 0x00080000,
1078 ML_NOTIFY_HOST = 0x00100000,
1079 ML_NOTIFY_MODULE = 0x00200000,
1080 ML_NOTIFY_LAST_CLASS = 0x00400000
1082
1090
1097
1100
1103
1109
1114
1118
1121
1122
1123
1124//--------------------------------------------------------------------------------------------------
1127//--------------------------------------------------------------------------------------------------
1132
1133
1134//--------------------------------------------------------------------------------------------------
1136//--------------------------------------------------------------------------------------------------
1142
1143
1145typedef enum {
1146 ML_VX = 0,
1147 ML_VY = 1,
1148 ML_VZ = 2,
1149 ML_VW = 3,
1150 ML_VC = 3,
1151 ML_VT = 4,
1152 ML_VU = 5
1154
1155
1156//---------------------------------------------------------------------------------------------
1157//
1158//
1159// FUNCTION TYPEDEFS
1160//
1161//
1162//---------------------------------------------------------------------------------------------
1163
1165typedef double (*MLDblFuncPtr)(double);
1166
1167
1168//-----------------------------------------------------------------------------------
1170//-----------------------------------------------------------------------------------
1172typedef void MLMessageCB(void* usrData,
1173 MLErrorCode errCode,
1174 MLMessageType messageType,
1175 const char* messStr,
1176 int line,
1177 const char** infos);
1178
1179
1180//---------------------------------------------------------------------------------------------
1189//---------------------------------------------------------------------------------------------
1190typedef void MLNotifyCB(MLuint32 objType,
1191 void* usrData,
1192 void* objectData1, void* objData2);
1193
1194//--------------------------------------------------------------------------------------------------
1197//--------------------------------------------------------------------------------------------------
1198typedef void MLSensorCB (void* usrData, void* sensor);
1199typedef void MLHostProgressCB (void* usrData, const char* info1, const char* info2);
1200typedef MLint32 MLHostBreakCheckCB (void* usrData, void** hitField);
1201typedef void MLRequestProgressCB(void* usrData, double progress);
1203
1204
1205//-----------------------------------------------------------------------------------
1206//
1209//
1210//-----------------------------------------------------------------------------------
1211
1214typedef const char* MLApplicationGetStringPropertyCB(void* applicationUsrData, const char* propertyName, MLint16* found);
1215
1217typedef MLint32 MLApplicationGetInt32PropertyCB (void* applicationUsrData, const char* propertyName, MLint16* found);
1218
1220typedef double MLApplicationGetDoublePropertyCB(void* applicationUsrData, const char* propertyName, MLint16* found);
1221
1224typedef MLint32 MLApplicationGetBoolPropertyCB (void* applicationUsrData, const char* propertyName, MLint16* found);
1225
1226
1227//--------------------------------------------------------------------------------------------------
1234//--------------------------------------------------------------------------------------------------
1235typedef MLint32 MLEventFilterCB (void* usrData, void* event);
1236
1237
1238//--------------------------------------------------------------------------------------------------
1240//--------------------------------------------------------------------------------------------------
1259
1260
1261//--------------------------------------------------------------------------------------------------
1271//--------------------------------------------------------------------------------------------------
1272typedef void MLEventFilterApplicationHookCB(void* applicationUsrData,
1274 MLEventFilterCB* cb,
1275 void * usrData,
1276 MLuint32 fromMessageId,
1277 MLuint32 toMessageId);
1278
1279
1280
1281
1282
1283//---------------------------------------------------------------------------------------------
1284//
1285//
1286// REGISTERED TYPE SUPPORT
1287//
1288//
1289//---------------------------------------------------------------------------------------------
1290
1291//--------------------------------------------------------------------------------------------------
1293//--------------------------------------------------------------------------------------------------
1295
1296//--------------------------------------------------------------------------------------------------
1298//--------------------------------------------------------------------------------------------------
1299typedef unsigned char MLTypeData;
1300
1301//--------------------------------------------------------------------------------------------------
1303//--------------------------------------------------------------------------------------------------
1304struct MLTypeInfos;
1305
1306//--------------------------------------------------------------------------------------------------
1309//--------------------------------------------------------------------------------------------------
1311
1312//--------------------------------------------------------------------------------------------------
1314//--------------------------------------------------------------------------------------------------
1321
1322//--------------------------------------------------------------------------------------------------
1328//--------------------------------------------------------------------------------------------------
1330
1333
1336
1338 size_t typeSize;
1339
1341 const char* name;
1342
1345
1348
1351
1354
1357
1360
1363
1365 const char** goodCastTos;
1366
1369
1384 const char* structInfoString;
1385
1388
1391
1395
1396 //--------------------------------------------------------------------------------------------------
1399 //--------------------------------------------------------------------------------------------------
1400 typedef void (*Function_SetTo ) (MLTypeData* dest);
1401 typedef bool (*Function_CastToBool ) (const MLTypeData* p);
1402 typedef MLint (*Function_CastToInt ) (const MLTypeData* p);
1404 typedef char* (*Function_GetStringValue ) (const MLTypeData* p);
1405 typedef void (*Function_CastFromInt ) (MLint value, MLTypeData* result);
1406 typedef void (*Function_CastFromDouble ) (MLdouble value, MLTypeData* result);
1407 typedef void (*Function_SetStringValue ) (const char* str, MLTypeData* result);
1408 typedef void (*Function_CopyValue ) (const MLTypeData* source, MLTypeData* dest);
1409 typedef bool (*Function_IsEqualToType ) (const MLTypeData* source1, const MLTypeData* source2);
1410 typedef bool (*Function_IsEqualToTypeWithEpsilon ) (const MLTypeData* source1, const MLTypeData* source2, MLdouble epsilon);
1411 typedef void (*Function_ApplyIntOperation ) (const MLTypeData* source, MLint value, MLTypeData* result);
1412 typedef void (*Function_ApplyDoubleOperation ) (const MLTypeData* source, MLdouble value, MLTypeData* result);
1413 typedef void (*Function_ApplyOperation ) (const MLTypeData* source1, const MLTypeData* source2, MLTypeData* result);
1414 typedef void (*Function_CastToOtherType ) (const MLTypeData* myData, const MLTypeInfos* otherInfos, MLTypeData* otherData);
1415 typedef void (*Function_CastFromOtherType ) (const MLTypeInfos* myInfos, const MLTypeData* myData, MLTypeData* otherData);
1416 typedef void (*Function_MultWithOtherType ) (const MLTypeInfos* myInfos, const MLTypeData* myData, const MLTypeData* otherData, MLTypeData* result);
1417 typedef void (*Function_ArrayCopy ) (const MLTypeData* source, MLTypeData* dest, size_t size);
1418 typedef void (*Function_ArrayFill ) (const MLTypeData* fillValue, MLTypeData* dest, size_t size);
1419 typedef void (*Function_ArrayCopyWithStrides ) (const MLTypeData* source, MLssize_t sourceStride, MLTypeData* dest, MLssize_t destStride, size_t size);
1420 typedef void (*Function_Interpolate ) (const MLTypeData* source1, const MLTypeData* source2, MLdouble alpha, MLTypeData* result);
1421 typedef void (*Function_ArrayRescale ) (const MLTypeData* source, MLdouble scaleFactor, const MLTypeData* offset, MLTypeData* dest, size_t size);
1422 typedef bool (*Function_ArrayEqualsValue ) (const MLTypeData* value, const MLTypeData* buffer, size_t size);
1423 typedef void (*Function_ArrayGetMinMax ) (const MLTypeData* source, size_t size, MLdouble& min, MLdouble& max);
1424 typedef MLdouble (*Function_GetComponent ) (const MLTypeData* source, size_t componentIndex);
1425 typedef void (*Function_SetComponent ) (MLTypeData* dest, size_t componentIndex, MLdouble value);
1427
1430
1437
1456
1465
1472
1475
1478
1483
1488
1493
1498
1503
1512
1520};
1521
1522ML_START_NAMESPACE
1523
1525
1526ML_END_NAMESPACE
1527
1528
1529//--------------------------------------------------------------------------------------------------
1533//--------------------------------------------------------------------------------------------------
1534#define ML_CALC_FTYPE MLdouble
1535
1536//--------------------------------------------------------------------------------------------------
1540//--------------------------------------------------------------------------------------------------
1541#define ML_CALC_ITYPE MLint
1542
1543
1544//--------------------------------------------------------------------------------------------------
1547//--------------------------------------------------------------------------------------------------
1548#define ML_TYPE_ASSIGN_FUNCTION_POINTERS() \
1549 getStringValue = MLTYPE_getStringValue; \
1550 setStringValue = MLTYPE_setStringValue; \
1551 setToMinimum = MLTYPE_setToMinimum; \
1552 setToMaximum = MLTYPE_setToMaximum; \
1553 setToDefault = MLTYPE_setToDefault; \
1554 getComponent = MLTYPE_getComponent; \
1555 setComponent = MLTYPE_setComponent; \
1556 copy = MLTYPE_copy; \
1557 arrayCopy = MLTYPE_arrayCopy; \
1558 arrayCopyWithStrides = MLTYPE_arrayCopyWithStrides; \
1559 arrayFill = MLTYPE_arrayFill; \
1560 \
1561 castToBool = MLTYPE_castToBool; \
1562 castToInt = MLTYPE_castToInt; \
1563 castToDouble = MLTYPE_castToDouble; \
1564 castToOtherType = MLTYPE_castToOtherType; \
1565 castFromInt = MLTYPE_castFromInt; \
1566 castFromDouble = MLTYPE_castFromDouble; \
1567 castFromOtherType = MLTYPE_castFromOtherType; \
1568 \
1569 isEqualToType = MLTYPE_isEqualToType; \
1570 isEqualToTypeWithEpsilon= MLTYPE_isEqualToTypeWithEpsilon;\
1571 \
1572 negate = MLTYPE_negate; \
1573 normalize = MLTYPE_normalize; \
1574 \
1575 arrayRescale = MLTYPE_arrayRescale; \
1576 interpolate = MLTYPE_interpolate; \
1577 arrayEqualsValue = MLTYPE_arrayEqualsValue; \
1578 arrayGetMinMax = MLTYPE_arrayGetMinMax; \
1579 \
1580 multWithInt = MLTYPE_multWithInt; \
1581 multWithDouble = MLTYPE_multWithDouble; \
1582 multWithType = MLTYPE_multWithType; \
1583 multWithOtherType = MLTYPE_multWithOtherType; \
1584 \
1585 plusInt = MLTYPE_plusInt; \
1586 plusDouble = MLTYPE_plusDouble; \
1587 plusType = MLTYPE_plusType;
1589
1590
1591#endif // __mlTypeDefs_H
1592
1593
1594
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:595
MLDataTypeIds
MLDataType identifiers.
Definition mlTypeDefs.h:618
#define ML_MAX_COMPONENTS_EXTENDED_TYPE
Maximum number of components for extended types.
Definition mlTypeDefs.h:252
@ MLVector8i16Type
Definition mlTypeDefs.h:660
@ MLVector7fType
Definition mlTypeDefs.h:640
@ MLVector2fType
Definition mlTypeDefs.h:635
@ MLMatrix2dType
Definition mlTypeDefs.h:648
@ MLVector8i32Type
Definition mlTypeDefs.h:660
@ MLComplexdType
Definition mlTypeDefs.h:631
@ MLVector64i16Type
Definition mlTypeDefs.h:665
@ MLVector6fType
Definition mlTypeDefs.h:639
@ MLVector6i32Type
Definition mlTypeDefs.h:658
@ MLuint8Type
Enumerator for the unsigned 8-bit ML integer type.
Definition mlTypeDefs.h:620
@ MLVector2i8Type
Definition mlTypeDefs.h:654
@ MLVector5i64Type
Definition mlTypeDefs.h:657
@ MLMatrix6dType
Definition mlTypeDefs.h:652
@ MLVector2i16Type
Definition mlTypeDefs.h:654
@ MLVector10i32Type
Definition mlTypeDefs.h:662
@ MLVector3fType
Definition mlTypeDefs.h:636
@ MLVector3i16Type
Definition mlTypeDefs.h:655
@ MLVector7i64Type
Definition mlTypeDefs.h:659
@ MLQuaternionfType
Definition mlTypeDefs.h:633
@ MLVector5fType
Definition mlTypeDefs.h:638
@ MLVector10fType
Definition mlTypeDefs.h:643
@ MLVector32i8Type
Definition mlTypeDefs.h:664
@ MLuint32Type
Enumerator for the unsigned 32-bit ML integer type.
Definition mlTypeDefs.h:624
@ MLComplexfType
Definition mlTypeDefs.h:631
@ MLMatrix5fType
Definition mlTypeDefs.h:651
@ MLfloatType
Enumerator for the signed 32-bit ML floating point type.
Definition mlTypeDefs.h:625
@ MLuint16Type
Enumerator for the unsigned 16-bit ML integer type.
Definition mlTypeDefs.h:622
@ MLVector9fType
Definition mlTypeDefs.h:642
@ MLVector7i16Type
Definition mlTypeDefs.h:659
@ MLVector16fType
Definition mlTypeDefs.h:644
@ MLVector16i32Type
Definition mlTypeDefs.h:663
@ MLMatrix3dType
Definition mlTypeDefs.h:649
@ MLVector64dType
Definition mlTypeDefs.h:646
@ MLVector4i32Type
Definition mlTypeDefs.h:656
@ MLVector64i64Type
Definition mlTypeDefs.h:665
@ MLint64Type
Enumerator for the signed 64-bit ML integer type.
Definition mlTypeDefs.h:627
@ MLVector32i64Type
Definition mlTypeDefs.h:664
@ MLVector3i32Type
Definition mlTypeDefs.h:655
@ MLVector4i64Type
Definition mlTypeDefs.h:656
@ MLVector16dType
Definition mlTypeDefs.h:644
@ MLVector3i64Type
Definition mlTypeDefs.h:655
@ MLVector7i32Type
Definition mlTypeDefs.h:659
@ MLVector32dType
Definition mlTypeDefs.h:645
@ MLVector3dType
Definition mlTypeDefs.h:636
@ MLVector2i64Type
Definition mlTypeDefs.h:654
@ MLVector32i32Type
Definition mlTypeDefs.h:664
@ MLMatrix4dType
Definition mlTypeDefs.h:650
@ MLVector64i8Type
Definition mlTypeDefs.h:665
@ MLVector5i32Type
Definition mlTypeDefs.h:657
@ MLVector8fType
Definition mlTypeDefs.h:641
@ MLMatrix5dType
Definition mlTypeDefs.h:651
@ MLVector64fType
Definition mlTypeDefs.h:646
@ MLVector6i8Type
Definition mlTypeDefs.h:658
@ MLVector2dType
Definition mlTypeDefs.h:635
@ MLVector5i16Type
Definition mlTypeDefs.h:657
@ MLVector7dType
Definition mlTypeDefs.h:640
@ MLint16Type
Enumerator for the signed 16-bit ML integer type.
Definition mlTypeDefs.h:621
@ MLVector9dType
Definition mlTypeDefs.h:642
@ MLint32Type
Enumerator for the signed 32-bit ML integer type.
Definition mlTypeDefs.h:623
@ MLVector4i16Type
Definition mlTypeDefs.h:656
@ MLVector4fType
Definition mlTypeDefs.h:637
@ MLVector16i16Type
Definition mlTypeDefs.h:663
@ MLVector3i8Type
Definition mlTypeDefs.h:655
@ MLVector4dType
Definition mlTypeDefs.h:637
@ MLMatrix3fType
Definition mlTypeDefs.h:649
@ MLVector6dType
Definition mlTypeDefs.h:639
@ MLMatrix6fType
Definition mlTypeDefs.h:652
@ MLVector5i8Type
Definition mlTypeDefs.h:657
@ MLdoubleType
Enumerator for the signed 64-bit ML floating point type.
Definition mlTypeDefs.h:626
@ MLVector10i8Type
Definition mlTypeDefs.h:662
@ MLVector6i16Type
Definition mlTypeDefs.h:658
@ MLVector9i32Type
Definition mlTypeDefs.h:661
@ MLVector10i16Type
Definition mlTypeDefs.h:662
@ MLVector2i32Type
Definition mlTypeDefs.h:654
@ MLVector32i16Type
Definition mlTypeDefs.h:664
@ MLVector32fType
Definition mlTypeDefs.h:645
@ MLVector6i64Type
Definition mlTypeDefs.h:658
@ MLVector64i32Type
Definition mlTypeDefs.h:665
@ MLQuaterniondType
Definition mlTypeDefs.h:633
@ MLint8Type
Enumerator for the signed 8-bit ML integer type.
Definition mlTypeDefs.h:619
@ MLVector9i8Type
Definition mlTypeDefs.h:661
@ MLVector16i8Type
Definition mlTypeDefs.h:663
@ MLMatrix4fType
Definition mlTypeDefs.h:650
@ MLuint64Type
Enumerator for the unsigned 64-bit ML integer type.
Definition mlTypeDefs.h:628
@ MLMatrix2fType
Definition mlTypeDefs.h:648
@ MLVector4i8Type
Definition mlTypeDefs.h:656
@ MLVector7i8Type
Definition mlTypeDefs.h:659
@ MLVector8i64Type
Definition mlTypeDefs.h:660
@ MLldoubleType
Definition mlTypeDefs.h:668
@ MLVector9i16Type
Definition mlTypeDefs.h:661
@ MLVector10dType
Definition mlTypeDefs.h:643
@ MLVector8i8Type
Definition mlTypeDefs.h:660
@ MLVector10i64Type
Definition mlTypeDefs.h:662
@ MLVector9i64Type
Definition mlTypeDefs.h:661
@ MLVector8dType
Definition mlTypeDefs.h:641
@ MLVector5dType
Definition mlTypeDefs.h:638
@ MLVector16i64Type
Definition mlTypeDefs.h:663
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:715
MLCheckBits
Enumerator describing runtime and final checks in the ML.
Definition mlTypeDefs.h:685
@ ML_FINAL_RUNTIME_CHECK_BIT
Final checks in the RuntimeType system are activated.
Definition mlTypeDefs.h:685
@ ML_ALL_CHECKS_BITS
All available checks are activated.
Definition mlTypeDefs.h:689
@ ML_NO_CHECKS_BITS
All checks are deactivated.
Definition mlTypeDefs.h:688
MLNotifyChangedObjectType
Objects of the ML that call the registered functions when changed.
@ ML_NOTIFY_NO_OBJECT_TYPE
@ ML_NOTIFY_ERROR_OUTPUT_OTHER_CHANGES
@ ML_NOTIFY_ERROR_OUTPUT_TERMINATION_TYPE
@ ML_NOTIFY_CACHE_CLEAR
@ ML_NOTIFY_HOST_MAX_NUM_THREADS
@ ML_NOTIFY_CACHE_MONITORING_LEVEL
@ ML_NOTIFY_ERROR_OUTPUT_MESSAGE_FILTER
@ ML_NOTIFY_ERROR_OUTPUT_FULL_DEBUGGING
@ ML_NOTIFY_MODULE_INSTANTIATED
@ ML_NOTIFY_API_EXCEPTIONS
@ ML_NOTIFY_HOST_USE_CLASSIC_HOST
@ ML_NOTIFY_ERROR_OUTPUT_ERROR_OUTPUT_CB
@ ML_NOTIFY_CACHE_MEM_OPT_LEVEL
@ ML_NOTIFY_RUNTIME_TYPE_ADDED
@ ML_NOTIFY_HOST_BREAK_CHECK_CB
@ ML_NOTIFY_API_CHECKS_BITS
@ ML_NOTIFY_MODULE_DELETED
@ ML_NOTIFY_CACHE_MAX_SIZE
@ ML_NOTIFY_RUNTIME_TYPE_REMOVED
@ ML_NOTIFY_FIELD_HANDLED
@ ML_NOTIFY_ERROR_OUTPUT_DEBUG_ENV_NAMES
@ ML_NOTIFY_CACHE_FLUSH
@ ML_NOTIFY_HOST_PROGRESS_CB
MLuint64 MLTypePropertyBits
Structure to define a bit mask that identifies all implemented functions for a data type.
signed short * MLint16Ptr
Definition mlTypeDefs.h:125
MLTerminator
Termination types for error handling.
@ ML_EXITCODE
Terminates the application with exit(ErrorCode), not recommended for use in normal code.
@ ML_EXIT0
Terminates the application with exit(0), not recommended for use in normal code.
@ ML_ABORT
Uses abort() to terminate the application which supports easily to start the debugger.
@ MLNumTerminators
@ ML_CONTINUE
Tries to ignore the message and to continue.
double(* MLDblFuncPtr)(double)
A function pointer type to a function that returns a double and takes a double as argument.
MLint32 MLApplicationGetInt32PropertyCB(void *applicationUsrData, const char *propertyName, MLint16 *found)
Callback to the hosting application that is used to get an integer value property with the propertyNa...
UINT64 MLuint64
Introduce platform-independent 64-bit unsigned integer type.
Definition mlTypeDefs.h:424
float * MLfloatPtr
Definition mlTypeDefs.h:201
MLMemoryErrorHandling
Enumerator to specify memory error handling.
Definition mlTypeDefs.h:675
@ ML_FATAL_MEMORY_ERROR
On allocation failure, a fatal error print is done and NULL is returned.
Definition mlTypeDefs.h:676
@ ML_THROW_NO_MEMORY
On allocation failure, a throw(ML_NO_MEMORY) is executed.
Definition mlTypeDefs.h:677
@ ML_RETURN_NULL
On allocation failure, NULL is returned without error handling.
Definition mlTypeDefs.h:675
@ ML_FATAL_MEMORY_ERROR_AND_THROW_NO_MEMORY
On allocation failure, a fatal error is posted and ML_NO_MEMORY is thrown.
Definition mlTypeDefs.h:678
long double MLldouble
Definition mlTypeDefs.h:231
MLNotifyChangedClassType
Codes for ML classes that may change:
@ ML_NOTIFY_MODULE
0x0020 = Module
@ ML_NOTIFY_API
0x0002 = API
@ ML_NOTIFY_CACHE
0x0008 = Cache
@ ML_NOTIFY_NO_OBJECT
0x0000 = No object
@ ML_NOTIFY_LAST_CLASS
@ ML_NOTIFY_HOST
0x0010 = Host
@ ML_NOTIFY_RUNTIME
0x0004 = Runtime
@ ML_NOTIFY_ERROR_OUTPUT
0x0001 = ErrorOutput
long double * MLldoublePtr
Definition mlTypeDefs.h:232
MLint MLsoffset
Signed ML offset type that is a 32-bit signed integer on 32-bit platforms and a 64-bit integer on 64-...
Definition mlTypeDefs.h:561
MLint64 * MLintPtr
A pointer to the signed ML integer type MLint.
Definition mlTypeDefs.h:492
char * MLint8Ptr
Definition mlTypeDefs.h:97
UINT64 * MLuint64Ptr
Introduce platform-independent 64-bit unsigned integer pointer type.
Definition mlTypeDefs.h:426
const char * MLApplicationGetStringPropertyCB(void *applicationUsrData, const char *propertyName, MLint16 *found)
Callback to the hosting application that is used to get a string value property with the propertyName...
MLuint32 MLThreadId
Definition mlTypeDefs.h:603
MLint32 MLHostBreakCheckCB(void *usrData, void **hitField)
unsigned int MLuint32
Definition mlTypeDefs.h:184
MLArrayIndex
Indexes for axes, arrays and vectors.
@ ML_VT
Array index for t (time) components (entry 4)
@ ML_VC
Array index for c (color) components (entry 3)
@ ML_VY
Array index for y components (entry 1)
@ ML_VU
Array index for u (unit/user dimension) components (entry 5)
@ ML_VZ
Array index for z components (entry 2)
@ ML_VW
Array index for w (for components of homogeneous vectors, entry 3)
@ ML_VX
Array index for x components (entry 0)
unsigned char MLuint8
Definition mlTypeDefs.h:108
void MLRequestProgressCB(void *usrData, double progress)
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
Definition mlTypeDefs.h:505
double MLdouble
Definition mlTypeDefs.h:216
unsigned char * MLuint8Ptr
Definition mlTypeDefs.h:109
MLEventFilterApplicationMessage
Enum to describe the significance of the call, e.g., whether an 'add' or a 'remove' of a function is ...
@ ML_EVENTFILTER_REMOVE_CB
@ ML_EVENTFILTER_ADD_CB
unsigned int * MLuint32Ptr
Definition mlTypeDefs.h:185
void MLEventFilterApplicationHookCB(void *applicationUsrData, MLEventFilterApplicationMessage type, MLEventFilterCB *cb, void *usrData, MLuint32 fromMessageId, MLuint32 toMessageId)
Internal application event filter callback type.
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.
MLTypeGroupIds
Some predefined type groups.
@ MLNoTypeGroup
@ MLMatrixTypeGroup
@ MLScalarTypeGroup
@ MLVectorTypeGroup
unsigned short MLuint16
Definition mlTypeDefs.h:141
signed short MLint16
Definition mlTypeDefs.h:124
char MLint8
Definition mlTypeDefs.h:96
void MLSensorCB(void *usrData, void *sensor)
INT64 MLint64
Include 64-bit integer support for Windows or Unix.
Definition mlTypeDefs.h:411
unsigned short * MLuint16Ptr
Definition mlTypeDefs.h:142
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489
signed int * MLint32Ptr
Definition mlTypeDefs.h:161
double MLApplicationGetDoublePropertyCB(void *applicationUsrData, const char *propertyName, MLint16 *found)
Callback to the hosting application that is used to get a double value property with the propertyName...
void MLMessageCB(void *usrData, MLErrorCode errCode, MLMessageType messageType, const char *messStr, int line, const char **infos)
Handling/setting/getting of ML messages callbacks.
MLint32 MLApplicationGetBoolPropertyCB(void *applicationUsrData, const char *propertyName, MLint16 *found)
Callback to the hosting application that is used to get a bool value property with the propertyName f...
MLuint64 MLuoffset
Unsigned ML offset type that is a 32-bit unsigned integer on 32-bit platforms and 64-bit one on 64-bi...
Definition mlTypeDefs.h:536
void MLNotifyCB(MLuint32 objType, void *usrData, void *objectData1, void *objData2)
Function type that is registered by the Notify object; it receives a code objType of type MLNotifyCha...
MLint32 MLEventFilterCB(void *usrData, void *event)
Callback function type for events that are passed to the user.
SSIZE_T MLssize_t
The signed ML size type that is a signed 32-bit size_t on 32-bit platforms and 64-bit one on 64-bit p...
Definition mlTypeDefs.h:565
INT64 * MLint64Ptr
Introduce platform-independent 64-bit signed integer pointer type.
Definition mlTypeDefs.h:413
signed int MLint32
Definition mlTypeDefs.h:160
size_t MLusize_t
The unsigned ML size type that is an unsigned 32-bit size_t on 32-bit platforms and 64-bit one on 64-...
Definition mlTypeDefs.h:539
void MLHostProgressCB(void *usrData, const char *info1, const char *info2)
MLuint64 * MLuintPtr
A pointer to the unsigned ML integer type MLuint.
Definition mlTypeDefs.h:508
MLint32 MLTypeGroup
This is an identifier to differentiate types like matrices, vectors, and complex/quaternion types,...
double * MLdoublePtr
Definition mlTypeDefs.h:217
MLMessageType
Message types handled by the ErrorOutput class.
Definition mlTypeDefs.h:695
@ ML_COUT
Definition mlTypeDefs.h:699
@ ML_WARNING
Definition mlTypeDefs.h:695
@ ML_DEBUG
Definition mlTypeDefs.h:698
@ ML_ALL_MESSAGES
Definition mlTypeDefs.h:704
@ ML_CERR
Definition mlTypeDefs.h:700
@ ML_ERROR
Definition mlTypeDefs.h:696
@ ML_FATAL
Definition mlTypeDefs.h:697
@ ML_INFORMATION
Definition mlTypeDefs.h:701
@ ML_OTHER_MESSAGE
Definition mlTypeDefs.h:702
float MLfloat
Definition mlTypeDefs.h:200
MLSign
Definition of possible signs as enumerator.
@ ML_NEGATIVE_SIGN
Negative sign enumerator.
@ ML_ZERO_SIGN
Enumerator for no negative and no positive sign (=0).
@ ML_POSITIVE_SIGN
Positive sign enumerator.
#define ML_UTILS_EXPORT
Definition mlUtilities.h:18
void ML_UTILS_EXPORT logTypeComponentsFromStringError(const char *function)
Defines all callbacks that an application has to support for property access.
MLApplicationGetDoublePropertyCB * _getDoubleCB
Callback to be set by an application to return a double property.
MLApplicationGetBoolPropertyCB * _getBoolCB
Callback to be set by an application to return a boolean property.
MLApplicationGetStringPropertyCB * _getStringCB
Callback to be set by an application to return a string property.
MLApplicationGetInt32PropertyCB * _getInt32CB
Callback to be set by an application to return a int32 property.
void * _applicationUsrData
Defines the user data that is supplied with all callbacks.
Structure containing all data type features and pointers to all functions needed to implement operati...
void(* Function_CastToOtherType)(const MLTypeData *myData, const MLTypeInfos *otherInfos, MLTypeData *otherData)
Function_CastFromDouble castFromDouble
Casts the first (the double) parameter to the data type and returns it into second parameter.
Function_GetStringValue getStringValue
Returns a value as a string.
bool(* Function_CastToBool)(const MLTypeData *p)
void(* Function_ArrayCopyWithStrides)(const MLTypeData *source, MLssize_t sourceStride, MLTypeData *dest, MLssize_t destStride, size_t size)
Function_IsEqualToType isEqualToType
Returns true if both parameters are equal; otherwise, it returns false.
Function_ArrayFill arrayFill
Sets the first parameter to array at the second one.
const MLTypeData * typeDefaultPtr
Data type default specified by derived class.
Function_ArrayCopyWithStrides arrayCopyWithStrides
Same as arrayCopy, but allows to specify stride values for source and destination.
MLint(* Function_CastToInt)(const MLTypeData *p)
void(* Function_CastFromInt)(MLint value, MLTypeData *result)
Function_SetStringValue setStringValue
Try to convert string as far as possible. If string cannot be scanned at all, then use the data type ...
Function_CopyValue normalize
Normalizes the type value from parameter 1 and writes it into parameter 2.
void(* Function_SetStringValue)(const char *str, MLTypeData *result)
bool(* Function_IsEqualToTypeWithEpsilon)(const MLTypeData *source1, const MLTypeData *source2, MLdouble epsilon)
MLTypeGroup typeGroup
Type group to which this type belongs.
void(* Function_ArrayCopy)(const MLTypeData *source, MLTypeData *dest, size_t size)
Function_ApplyIntOperation multWithInt
Implements multiplication with integer. Result is written into parameter three.
size_t componentOffsets[ML_MAX_COMPONENTS_EXTENDED_TYPE]
Array of offsets from the first to other components to address any component directly.
void(* Function_ArrayFill)(const MLTypeData *fillValue, MLTypeData *dest, size_t size)
Function_SetTo setToMaximum
Sets the value to minimum value. Must be implemented.
Function_ArrayCopy arrayCopy
Copies the number of elements of the first parameter to the second one.
char *(* Function_GetStringValue)(const MLTypeData *p)
Function_SetTo setToDefault
Sets the value to default value. Must be implemented.
Function_GetComponent getComponent
Returns the n-th component of the type as double.
Function_CopyValue copy
Copies the first parameter to the second one.
const MLTypeData * typeMinPtr
Data type minimum specified by derived class.
Function_ApplyIntOperation plusInt
Implements integer addition to parameter one. Result is written into parameter three.
void(* Function_SetComponent)(MLTypeData *dest, size_t componentIndex, MLdouble value)
void(* Function_CastFromDouble)(MLdouble value, MLTypeData *result)
void(* Function_SetTo)(MLTypeData *dest)
void(* Function_Interpolate)(const MLTypeData *source1, const MLTypeData *source2, MLdouble alpha, MLTypeData *result)
void(* Function_ApplyDoubleOperation)(const MLTypeData *source, MLdouble value, MLTypeData *result)
const MLTypeData * typeMaxPtr
Data type maximum specified by derived class.
void(* Function_ApplyIntOperation)(const MLTypeData *source, MLint value, MLTypeData *result)
const char * structInfoString
Pointer to a NULL-terminated string describing the type configuration.
Function_ArrayEqualsValue arrayEqualsValue
Checks whether the first argument equals all the values given with the second argument (and the size ...
bool(* Function_IsEqualToType)(const MLTypeData *source1, const MLTypeData *source2)
MLdouble(* Function_GetComponent)(const MLTypeData *source, size_t componentIndex)
Function_CastToDouble castToDouble
Returns a type value cast to double.
void(* Function_MultWithOtherType)(const MLTypeInfos *myInfos, const MLTypeData *myData, const MLTypeData *otherData, MLTypeData *result)
Function_CopyValue negate
Negates the value.
MLint32 dataTypeId
Real MLDataType id of under which these operations are registered as data type.
void(* Function_CopyValue)(const MLTypeData *source, MLTypeData *dest)
void(* Function_CastFromOtherType)(const MLTypeInfos *myInfos, const MLTypeData *myData, MLTypeData *otherData)
Function_ApplyOperation plusType
Implements parameter two addition to parameter one. Result is written into parameter three.
Function_ApplyOperation multWithType
Implements multiplication with its own type. Result is written into parameter three.
size_t numGoodCastTos
Number of datatypes to which this type can be cast without information or functionality loss.
MLDataType rangeAndPrecisionEquivalent
Standard data type which has a comparable range and precision behavior.
Function_ApplyDoubleOperation plusDouble
Implements double addition to parameter one. Result is written into parameter three.
size_t typeSize
sizeof the data type in bytes.
Function_CastToOtherType castToOtherType
Casts data to another registered type.
Function_ArrayRescale arrayRescale
Scales the values from the first parameter with the second parameter and offsets it with the value fr...
MLdouble dblMin
double minimum of data type if it exists.
Function_IsEqualToTypeWithEpsilon isEqualToTypeWithEpsilon
Returns true if both parameters are equal within a static epsilon; otherwise, it returns false.
void(* Function_ApplyOperation)(const MLTypeData *source1, const MLTypeData *source2, MLTypeData *result)
void(* Function_ArrayRescale)(const MLTypeData *source, MLdouble scaleFactor, const MLTypeData *offset, MLTypeData *dest, size_t size)
const char * name
Pointer to the data type name.
Function_ApplyDoubleOperation multWithDouble
Implements multiplication with double. Result is written into parameter three.
Function_ArrayGetMinMax arrayGetMinMax
Returns the minimum and maximum component values from the array in the first argument,...
bool(* Function_ArrayEqualsValue)(const MLTypeData *value, const MLTypeData *buffer, size_t size)
Function_CastFromOtherType castFromOtherType
Casts another registered type to data.
Function_CastToBool castToBool
Returns a type value cast to bool. Usually an equality to 0 should return false, e....
MLdouble dblMax
double maximum of data type if it exists.
Function_SetTo setToMinimum
Sets the value to minimum value. Must be implemented.
Function_CastToInt castToInt
Returns a type value cast to integer.
Function_SetComponent setComponent
Sets the n-th component of the type from double (applying rounding if needed).
void(* Function_ArrayGetMinMax)(const MLTypeData *source, size_t size, MLdouble &min, MLdouble &max)
const char ** goodCastTos
Data types names to which this type can be cast without information or functionality loss.
Function_CastFromInt castFromInt
Casts the first (the integer) parameter to the data type and returns it into second parameter.
MLdouble(* Function_CastToDouble)(const MLTypeData *p)
size_t numComponents
Number of components of this data type. Equals number of characters in *structInfoString.
Function_Interpolate interpolate
Interpolates linearly between the first and the second parameter, at the position given by the third ...
MLTypePropertyBits propertyBits
Variable containing an enabled bit for each defined property.
Function_MultWithOtherType multWithOtherType
Implements multiplication with another type. Result is written into parameter three.