MeVisLab Toolbox Reference
mlDataTypes.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_DATA_TYPES_H
14 #define ML_DATA_TYPES_H
15 
24 
25 #include "mlInitSystemML.h"
26 
27 #include "mlUtilsAPI.h"
28 
29 // Compile with C-Link interface.
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include "mlTypeDefs.h"
35 
36 //--------------------------------------------------------------------------------------------------
39 //--------------------------------------------------------------------------------------------------
41 [[nodiscard]]
43 
47 
51 
52 
53 
54 
55 //--------------------------------------------------------------------------------------------------
60 //--------------------------------------------------------------------------------------------------
64 MLEXPORT const char * const * MLDataTypeNames();
65 
69 
73 MLEXPORT const char * MLNameFromDataType(MLDataType dataType);
74 
78 MLEXPORT MLDataType MLDataTypeFromName(const char* const name);
79 
83 
87 
91 MLEXPORT size_t MLSizeOf(MLDataType dataType);
92 
95 
106 
110 
114 
118 
122 
129 
134 
138 
161 MLEXPORT MLDataType MLGetPromotedTypeWithRange(const MLDataType* inputTypes, size_t numTypes,
162  double rangeMin, double rangeMax);
163 
166  double rangeMin, double rangeMax);
167 
170  double rangeMin, double rangeMax);
171 
174  double rangeMin, double rangeMax);
175 
181 
190 
191 #if ML_DEPRECATED_SINCE(3,5,0)
196 MLEXPORT ML_DEPRECATED MLDataType MLPromotedType(MLDataType datatype1, MLDataType datatype2);
198 #endif
199 
200 
203 MLEXPORT MLDataType MLGetIntegerDataTypeForRange(double rangeMin, double rangeMax);
204 
230  MLdouble *max,
231  MLint32 preferUnsigned);
232 
239  MLdouble max,
240  MLint32 preferUnsigned);
241 
248 
256 
262 MLEXPORT MLErrorCode MLClampIntervalToDataTypeRange(double intervalMin, double intervalMax, MLDataType datatype, double* resultIntervalMin, double* resultIntervalMax);
263 
264 #if ML_DEPRECATED_SINCE(3,5,0)
269 #define MLPromotedPrecision MLGetPromotedPrecision
271 
272 #if defined(WIN32) && !defined(ML_NO_DEPRECATED_WARNINGS)
273 #pragma deprecated("MLPromotedPrecision")
274 #endif
275 
276 #endif
277 
278 
282 
287 
306  int suppressML64BitInts,
307  int suppressMLldouble);
324  int suppressML64BitInts,
325  int suppressMLldouble);
327 
328 
329 
330 
331 
332 //---------------------------------------------------------------------------------------------
333 //
334 //
335 // REGISTERED TYPE SUPPORT
336 //
337 //
338 //---------------------------------------------------------------------------------------------
339 
340 
341 //--------------------------------------------------------------------------------------------------
344 //--------------------------------------------------------------------------------------------------
346 
349 
355 
360 
365 
369 
372 
374 
379 
384 
385 //--------------------------------------------------------------------------------------------------
388 //--------------------------------------------------------------------------------------------------
391 
392 
393 //--------------------------------------------------------------------------------------------------
396 //--------------------------------------------------------------------------------------------------
399 
402 
405 
409 
410 
411 
412 
413 #if ML_DEPRECATED_SINCE(3,5,0)
414 //--------------------------------------------------------------------------------------------------
417 //--------------------------------------------------------------------------------------------------
420 MLEXPORT size_t MLSizeOfPhysicalType(MLDataType physicalDataType);
421 
424 MLEXPORT MLDataType MLGetPhysicalDataType(MLDataType dataType);
426 
427 #if defined(WIN32) && !defined(ML_NO_DEPRECATED_WARNINGS)
428 #pragma deprecated("MLSizeOfPhysicalType")
429 #pragma deprecated("MLGetPhysicalDataType")
430 #endif
431 
432 #endif
433 
434 
435 //--------------------------------------------------------------------------------------------------
438 //--------------------------------------------------------------------------------------------------
445 [[nodiscard]]
447 
450 
453 
456 
459 
460 #if ML_DEPRECATED_SINCE(3,5,0)
465 #define MLTypeInfosAtIdx MLGetTypeInfosAtIndex
467 
468 #if defined(WIN32) && !defined(ML_NO_DEPRECATED_WARNINGS)
469 #pragma deprecated("MLSizeOfRegisteredType")
470 #pragma deprecated("MLSizeOfPhysicalType")
471 #pragma deprecated("MLGetPhysicalDataType")
472 #pragma deprecated("MLTypeInfosAtIdx")
473 #endif
474 
475 
476 #endif
477 
482 
483 
484 //--------------------------------------------------------------------------------------------------
487 //--------------------------------------------------------------------------------------------------
568 //---------------------------------------------------------------------
570  size_t typeSize,
571  const char *name,
572  MLdouble dblMin,
573  MLdouble dblMax,
574  const MLTypeData *typeMinPtr,
575  const MLTypeData *typeMaxPtr,
576  const MLTypeData *typeDefaultPtr,
577  const char *typeStructInfo,
579  MLTypeGroup typeGroup,
580  MLDataType rangeAndPrecisionEquiv,
581  void **componentAddresses,
582  size_t numGoodCastTos,
583  const char **goodCastTos);
584 
586 [[nodiscard]]
588 
591 
597 
601 
611  const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
612  size_t numInstances);
613 
623  const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
624  size_t numInstances);
625 
635  const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
636  size_t numInstances);
638 
639 
640 
641 
642 //--------------------------------------------------------------------------------------------------
645 //--------------------------------------------------------------------------------------------------
649 
654 
658 
674  MLint32 *isSigned,
675  MLint32 *isIntegerType,
676  MLint32 *isFloatingPointType,
677  MLint32 *isLongType);
678 
685 MLEXPORT size_t MLTypeComponentSize(char component);
686 
691 MLEXPORT void MLTypeSetDoubleComponent(char component, MLdouble value, MLTypeData* targetPointer);
692 
694 MLEXPORT void MLTypeSetIntComponent (char component, MLint value, MLTypeData* targetPointer);
695 
699 MLEXPORT void MLTypeSetAllDoubleComponents(const MLTypeInfos* infos, MLdouble value, MLTypeData* targetPointer);
700 
702 MLEXPORT void MLTypeSetAllIntComponent (const MLTypeInfos *infos, MLint value, MLTypeData* targetPointer);
703 
707 MLEXPORT MLdouble MLTypeGetDoubleComponent(char component, const MLTypeData* targetPointer);
708 
710 MLEXPORT MLint MLTypeGetIntComponent (char component, const MLTypeData* targetPointer);
711 
723  const MLTypeData *srcPtr,
724  MLdouble *retMin,
725  MLdouble *retMax);
726 
728 
729 
730 
731 //--------------------------------------------------------------------------------------------------
734 //--------------------------------------------------------------------------------------------------
740 [[nodiscard]]
741 MLEXPORT MLTypeData *MLAllocateVoxelBuffer(MLDataType dataType, size_t numVoxels, const MLTypeData* voxelDefaultValue);
742 
749 [[nodiscard]]
750 MLEXPORT char *MLGetVoxelValueAsString(const MLTypeData* data, MLDataType dataType, MLErrorCode* errorCode);
751 
760 [[nodiscard]]
761 MLEXPORT char *MLGetVoxelValueAsStringLimited(const MLTypeData* data, MLDataType dataType, MLErrorCode* errorCode, int maxPrecision);
762 
769 [[nodiscard]]
770 MLEXPORT char *MLTypeComponentsToString(const MLTypeInfos* infos, const MLTypeData* data);
771 
780 [[nodiscard]]
781 MLEXPORT char *MLTypeComponentsToStringLimited(const MLTypeInfos* infos, const MLTypeData* data, int maxPrecision);
782 
791 [[nodiscard]]
792 MLEXPORT MLint32 MLTypeComponentsFromString(const MLTypeInfos* infos, const char* stringData, const MLTypeData* defaultValue, MLTypeData* data);
793 
801 [[nodiscard]]
802 MLEXPORT MLTypeData *MLTypeGetDataValuesFromString(MLDataType dataType, const char* voxelValue, const MLTypeData *defaultValue, size_t numInstances);
803 
812 MLEXPORT MLint32 MLTypeComponentsFromStream(void *iStr, void *iStrStream,
813  void *stdiStr, void *stdiStrStream,
814  const MLTypeInfos *infos, MLTypeData *data);
815 
820 MLEXPORT MLdouble MLGetVoxelValueAsDouble(const void* data, MLDataType dataType, MLErrorCode* errorCode);
821 
823 MLEXPORT bool MLTypeCastToBool (const MLTypeInfos* infos, const MLTypeData* data);
824 
827 
830 
833 MLEXPORT void MLTypeCastFromBool (const MLTypeInfos* infos, bool boolValue, MLTypeData* data);
834 
836 MLEXPORT void MLTypeCastFromInt (const MLTypeInfos *infos, MLint intValue, MLTypeData* data);
837 
839 MLEXPORT void MLTypeCastFromDouble (const MLTypeInfos* infos, MLdouble doubleValue, MLTypeData* data);
840 
846 MLEXPORT void MLTypeShiftComponentsLeft(const MLTypeInfos *infos, const MLTypeData* sourceData, MLint shiftLeft, MLTypeData* targetData);
847 
848 
860 MLEXPORT void MLTypeCastToOtherType(const MLTypeInfos* otherInfos, const MLTypeData* otherData,
861  const MLTypeInfos* myInfos, MLTypeData* myData);
862 
865 MLEXPORT void MLTypeCastFromOtherType(const MLTypeInfos* otherInfos, const MLTypeData* otherData,
866  const MLTypeInfos* myInfos, MLTypeData* myData);
867 
872 MLEXPORT void MLTypeMultWithOtherType(const MLTypeInfos* myInfos, const MLTypeData* myData,
873  const MLTypeInfos* otherInfos, const MLTypeData* otherData,
874  MLTypeData* targetData);
876 
877 // C-Link interface off.
878 #ifdef __cplusplus
879 }
880 #endif
881 
882 #endif //of __mlDataTypes_H
#define ML_DEPRECATED
Definition: CSOGroup.h:371
MLEXPORT MLDataType MLGetDataTypeForUncorrectedRange(MLdouble min, MLdouble max, MLint32 preferUnsigned)
Like getMLDataTypeForRange with the following differences:
MLEXPORT const char *const * MLDataTypeNames()
Function which returns the table of c-strings of all scalar and registered data types.
MLEXPORT size_t MLSizeOf(MLDataType dataType)
Returns the size of the data type dataType in bytes.
MLEXPORT MLint32 MLIsValidType(MLDataType dataType)
Returns true(=1) if data type dataType seems to be valid, otherwise 0(=false).
MLEXPORT MLDataType MLTypeGetBestScalarTypeForTypeComponentChars(const char *charCodes, int suppressML64BitInts, int suppressMLldouble)
Returns a standard data type which is able to hold the precisions of each of the type component chara...
MLEXPORT MLDataType MLGetIntegerDataTypeForRange(double rangeMin, double rangeMax)
Returns the minimal integer type that can hold the given range.
MLEXPORT MLTypeGroup MLGetTypeGroup(MLDataType dataType)
Get the type group to which the given type belongs.
MLEXPORT MLint32 MLHolds(MLDataType datatype1, MLDataType datatype2)
Returns true(=1) if data type \ datatype1 can hold data type datatype2 without precision or sign loss...
MLEXPORT const char * MLNameFromDataType(MLDataType dataType)
Function which returns the null-terminated string name for data type dataType or "" in case of error ...
MLint32 MLDataType
MLDataType.
Definition: mlTypeDefs.h:684
MLEXPORT MLint32 MLRangeOrder(MLDataType dataType)
Returns order value for a data type ranges.
MLEXPORT MLint32 MLIsStandardType(MLDataType dataType)
Returns true(=1) if data type dataType is a standard (scalar) type, otherwise return false(=0).
MLEXPORT size_t MLSizeOfRegisteredType(MLDataType dataType)
Compatibility function - obsolete, use MLSizeOf instead!
MLEXPORT MLDataType MLGetPromotedPrecision(MLDataType datatype1, MLDataType datatype2)
Returns one of datatype1 and datatype2 which has a higher precision.
MLEXPORT const char * MLTypeGetStructInfoString(MLDataType dataType)
Returns the components codes of the data type dataType or "" in case of an invalid data type.
MLEXPORT MLdouble MLDataTypeMin(MLDataType dataType)
Returns the minimum value of data type dataType or 0 if dataType is invalid.
MLEXPORT size_t MLNumDataTypes()
Returns the current number of ML data types.
MLEXPORT MLDataType MLGetDataTypeForRange(MLdouble *min, MLdouble *max, MLint32 preferUnsigned)
Corrects order of *min and *max and return adequate standard data type.
MLEXPORT MLDataType MLGetPromotedTypeWithRange2Inputs(MLDataType inputType1, MLDataType inputType2, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with 2 inputs.
MLEXPORT MLint32 MLIsDefaultExtendedType(MLDataType dataType)
Returns true(=1) if data type dataType is one of the extended types that should be support out of the...
MLEXPORT MLint32 MLIsIntType(MLDataType dataType)
Returns true(=1) if data type dataType is an integer data type, otherwise false(=0).
MLEXPORT MLDataType MLDataTypeFromName(const char *const name)
Returns the id of the data type with name name.
MLEXPORT MLDataType MLGetPromotedTypeWithRange(const MLDataType *inputTypes, size_t numTypes, double rangeMin, double rangeMax)
New routine for type promotion that takes a list of input types and the target value range to find a ...
MLEXPORT MLint32 MLIsScalarType(MLDataType dataType)
Alternative name for MLIsStandardType.
MLEXPORT MLDataType MLGetPromotedTypeWithRange1Input(MLDataType inputType1, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with 1 input.
MLEXPORT MLDataType MLGetPromotedTypeWithRange3Inputs(MLDataType inputType1, MLDataType inputType2, MLDataType inputType3, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with 3 inputs.
MLEXPORT MLErrorCode MLClampIntervalToDataTypeRange(double intervalMin, double intervalMax, MLDataType datatype, double *resultIntervalMin, double *resultIntervalMax)
Clamps the given lower/upper interval to the data type's range and checks if the interval is complete...
MLEXPORT MLdouble MLDataTypeMax(MLDataType dataType)
Returns the maximum value of data type dataType or 0 if dataType is invalid.
MLEXPORT MLint32 MLIsSigned(MLDataType dataType)
Returns true(=1) if data type dataType is signed, otherwise 0(=false).
MLEXPORT MLDataType MLTypeGetBestScalarTypeForTypeComponents(MLDataType dataType, int suppressML64BitInts, int suppressMLldouble)
Return a standard data type which is able to hold the precisions of each of the components of the typ...
MLEXPORT MLint32 MLIsFloatType(MLDataType dataType)
Returns true(=1) if data type dataType is a floating point data type, otherwise false(=0).
MLEXPORT size_t MLTypeGetNumComponents(MLDataType dataType)
Returns the number of components of the data type datatype or 0 in case of an invalid data type.
MLEXPORT MLDataType MLGetRangeAndPrecisionEquivalent(MLDataType dataType)
Returns a standard data type for dataType which has a comparable precision and range behavior.
MLEXPORT MLDataType MLGetPromotedType(MLDataType datatype1, MLDataType datatype2)
Returns a data type which can hold the value ranges from datatype1 and datatype2 (including both).
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
MLEXPORT const MLTypePropertyBits MLTypeHasNormalize
A data type instance can be normalized.
MLEXPORT MLdouble MLGetVoxelValueAsDouble(const void *data, MLDataType dataType, MLErrorCode *errorCode)
Interprets the data given by data as a value of type dataType and returns its value cast to double.
MLEXPORT MLint32 MLTypeComponentsFromString(const MLTypeInfos *infos, const char *stringData, const MLTypeData *defaultValue, MLTypeData *data)
Converts a string of a data type instance to instance data, i.e., like an sscanf.
MLEXPORT const MLTypePropertyBits MLTypeHasSetToMinimum
The setToMinimum function is implemented. (Note: This function must be implemented....
MLEXPORT void MLTypeToggleEndianType(const MLTypeInfos *infos, const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer, size_t numInstances)
Converts data type instances from little endian to big endian or vice versa.
MLEXPORT void MLTypeMultWithOtherType(const MLTypeInfos *myInfos, const MLTypeData *myData, const MLTypeInfos *otherInfos, const MLTypeData *otherData, MLTypeData *targetData)
Casts another data element otherData with attributes given by otherInfos to a local buffer of a type ...
MLEXPORT size_t MLGetNumRegisteredTypeInfos()
Returns the number of registered type operations.
MLEXPORT const MLTypePropertyBits MLTypeHasPlusType
Two data type instances can be added.
MLEXPORT void MLTypeCastFromOtherType(const MLTypeInfos *otherInfos, const MLTypeData *otherData, const MLTypeInfos *myInfos, MLTypeData *myData)
Casts another data element otherData with attributes given by otherInfos to myData of a type given by...
MLEXPORT const MLTypePropertyBits MLTypeHasIsEqualToType
An equality relation between two type instances can be calculated. (Note: This function must be imple...
MLEXPORT MLTypeData * MLTypeGetDataValuesFromString(MLDataType dataType, const char *voxelValue, const MLTypeData *defaultValue, size_t numInstances)
Allocates a buffer for numInstances of data type dataType and fills it with the data type value conve...
MLEXPORT void MLTypeCastFromDouble(const MLTypeInfos *infos, MLdouble doubleValue, MLTypeData *data)
The value doubleValue is cast to the types of the components and then written to them.
MLEXPORT MLint32 MLInitializeTypes()
Initialize all ML type management.
MLEXPORT const MLTypePropertyBits MLTypeHasPlusInt
A data type instance and an integer can be added.
MLEXPORT const MLTypePropertyBits MLTypeScalarType
A data type has all standard properties of a scalar type.
MLEXPORT const MLTypePropertyBits MLTypeHasCastToInt
A data type instance can be cast to integer.
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithDouble
Data type instance can be multiplied with double.
MLEXPORT const MLTypePropertyBits MLTypeIsSignedType
The data type is signed.
MLEXPORT MLdouble MLTypeCastToDouble(const MLTypeInfos *infos, const MLTypeData *data)
The first component of the data type is converted to double and returned.
MLEXPORT void MLTypeCastToOtherType(const MLTypeInfos *otherInfos, const MLTypeData *otherData, const MLTypeInfos *myInfos, MLTypeData *myData)
Converts a data instance referenced by otherData of a type specified by otherInfos to another data in...
MLEXPORT char * MLTypeComponentsToStringLimited(const MLTypeInfos *infos, const MLTypeData *data, int maxPrecision)
Converts a data type instance to a string.
MLEXPORT bool MLTypeCastToBool(const MLTypeInfos *infos, const MLTypeData *data)
If data is identical to default element "false" (= 0) is returned, otherwise "true" (= 1).
MLEXPORT MLDataType MLGetMLDataTypeForCharCode(char code)
Returns an ML data type compatible to a character representing it.
MLEXPORT MLTypeData * MLAllocateVoxelBuffer(MLDataType dataType, size_t numVoxels, const MLTypeData *voxelDefaultValue)
Returns a buffer of numVoxels voxels of data type dataType.
MLEXPORT MLTypeInfos * MLGetTypeInfosAtIndex(size_t index)
Returns the index th registered type operation, NULL on invalid index.
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithInt
Data type instance can be multiplied with integer.
MLEXPORT void MLTypeShiftComponentsLeft(const MLTypeInfos *infos, const MLTypeData *sourceData, MLint shiftLeft, MLTypeData *targetData)
Takes one data type component after another and shifts each component left shiftLs times if it is an ...
MLEXPORT const MLTypePropertyBits MLTypeHasSetToDefault
The setToDefault function is implemented. (Note: This function must be implemented....
MLEXPORT void MLTypeSetIntComponent(char component, MLint value, MLTypeData *targetPointer)
Like MLTypeSetDoubleComponent, only components are set to integer values.
MLEXPORT void MLTypeSetAllIntComponent(const MLTypeInfos *infos, MLint value, MLTypeData *targetPointer)
Like MLTypeSetAllDoubleComponents, only components are set to integer values.
MLEXPORT const MLTypePropertyBits MLTypeHasSetToMaximum
The setToMaximum function is implemented. (Note: This function must be implemented....
MLEXPORT const MLTypePropertyBits MLTypeIsIntegerType
The data type is an integer type. False otherwise.
MLEXPORT const MLTypePropertyBits MLTypeHasCastFromDouble
A double can be cast to a data type instance.
MLEXPORT MLint32 MLRegisterStaticTypeInfos(MLTypeInfos *infos, MLDataType dt)
Version of the method which allows to specify a pre-defined data type value.
MLEXPORT MLErrorCode MLTypeGetMinMaxRangeOfComponents(const MLTypeInfos *infos, const MLTypeData *srcPtr, MLdouble *retMin, MLdouble *retMax)
Returns the min/max range of all components of an arbitrary registered voxel.
MLEXPORT const MLTypePropertyBits MLTypeHasSetStringValue
The function setStringValue is implemented. (Note: This function must be implemented....
MLEXPORT size_t MLTypeComponentSize(char component)
Returns the sizeof of a MLTypeComponent component denoted by a character code.
MLEXPORT const MLTypePropertyBits MLTypeHasCastToDouble
A data type instance can be cast to double.
MLEXPORT MLTypePropertyBits MLTypePropBitsXor(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
Inverts all set bits property bits from propertyBits which are set in mask.
MLEXPORT const MLTypePropertyBits MLTypeHasGetStringValue
The function getStringValue is implemented. (Note: This function must be implemented....
MLEXPORT void MLTypeConvertToLittleEndian(const MLTypeInfos *infos, const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer, size_t numInstances)
Converts data type instances from big endian to little endian.
MLEXPORT MLint32 MLRegisterTypeInfos(MLTypeInfos *infos)
Adds the data type class infos to the list of registered data types.
MLEXPORT char * MLTypeComponentsToString(const MLTypeInfos *infos, const MLTypeData *data)
Converts a data type instance to a string.
MLEXPORT void MLTypeCastFromInt(const MLTypeInfos *infos, MLint intValue, MLTypeData *data)
The integer value of intValue is cast to the types of the components and then written to them.
MLEXPORT MLint32 MLTypeGetComponentProperties(char code, MLint32 *isSigned, MLint32 *isIntegerType, MLint32 *isFloatingPointType, MLint32 *isLongType)
Returns true (=1) in *isSigned, *isIntegerType, *isFloatingPointType and *isLongType if the component...
MLEXPORT MLint MLTypeCastToInt(const MLTypeInfos *infos, const MLTypeData *data)
The first component of the data type is converted to integer and returned.
MLEXPORT char * MLGetVoxelValueAsString(const MLTypeData *data, MLDataType dataType, MLErrorCode *errorCode)
Interprets the data given by data as a value of type dataType and return its value as string.
MLEXPORT void MLTypeCorrectPropertyBits(MLTypeInfos *infos)
Corrects all property bits except of the basic properties (MLTypeIsSignedType, MLTypeIsFloatingPointT...
MLEXPORT const MLTypePropertyBits MLTypeIsStandardType
The data type is standard scalar data type(intUL, floatUL, charUL, ...).
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithType
Two data type instances can be multiplied.
MLEXPORT const MLTypePropertyBits MLTypeHasCastFromOtherType
Any data type instance can be cast a data type instance.
MLEXPORT const MLTypePropertyBits MLTypeHasCastToBool
A data type instance can be cast to bool.
MLEXPORT MLTypeData * MLTypeInfosCreateBuffer(const MLTypeInfos *infos)
Returns a buffer of the size of one data element. NULL is returned on failure.
MLEXPORT const MLTypePropertyBits MLTypeHasCopy
Copy parameter one to parameter 2. (Note: This function must be implemented.)
MLEXPORT const MLTypePropertyBits MLTypeHasNegate
The negative value of a data type instance can be calculated.
MLEXPORT const MLTypePropertyBits MLTypeIsFloatingPointType
The data type is a floating point type. False otherwise.
MLEXPORT void MLTypeInfosRemoveBuffer(MLTypeData *buffer)
Removes a buffer created with MLTypeInfosCreateBuffer.
MLEXPORT char * MLGetVoxelValueAsStringLimited(const MLTypeData *data, MLDataType dataType, MLErrorCode *errorCode, int maxPrecision)
Interprets the data given by data as a value of type dataType and returns its value as string.
MLEXPORT void MLTypeCastFromBool(const MLTypeInfos *infos, bool boolValue, MLTypeData *data)
If boolValue == 0, data is set to the type default value given by infos.
MLEXPORT const MLTypePropertyBits MLTypeIsDefaultType
The data type is one of the default types (standard scalar or default extended).
MLEXPORT MLint32 MLAreTypesInitialized()
Returns 1(=true) if type table is initialized, otherwise 0(=false).
MLEXPORT const MLTypePropertyBits MLTypeHasNoProperties
The data type has no standard properties.
MLEXPORT void MLDestroyTypes()
Destroy ML type management.
MLEXPORT void MLTypeConvertToBigEndian(const MLTypeInfos *infos, const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer, size_t numInstances)
Converts data type instances from little endian to big endian.
MLEXPORT MLint32 MLIsRegisteredTypeInfos(const MLTypeInfos *infos)
Returns 1(=true) if data type is already registered. Otherwise 0(=false) is returned.
MLEXPORT void MLTypeSetAllDoubleComponents(const MLTypeInfos *infos, MLdouble value, MLTypeData *targetPointer)
All components of the data referenced by *targetPointer are set to their values cast from the double ...
MLEXPORT const MLTypePropertyBits MLTypeHasCastFromInt
An integer can be cast to a data type instance.
MLEXPORT MLdouble MLTypeGetDoubleComponent(char component, const MLTypeData *targetPointer)
Interpret the data referenced by *targetPointer as data of the type component and return it as double...
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithOtherType
A data type instances can be multiplied with the one of another type.
MLEXPORT MLTypePropertyBits MLTypePropBitsAnd(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
Ands of all bits in mask and those in propertyBits.
MLEXPORT MLint32 MLTypeInfosInit(MLTypeInfos *infos, size_t typeSize, const char *name, MLdouble dblMin, MLdouble dblMax, const MLTypeData *typeMinPtr, const MLTypeData *typeMaxPtr, const MLTypeData *typeDefaultPtr, const char *typeStructInfo, MLint32 isScalarType, MLTypeGroup typeGroup, MLDataType rangeAndPrecisionEquiv, void **componentAddresses, size_t numGoodCastTos, const char **goodCastTos)
Initialization of the main properties of MLTypeInfos.
MLEXPORT void MLTypeSetDoubleComponent(char component, MLdouble value, MLTypeData *targetPointer)
Interprets the data referenced by *targetPointer as data of the type component and sets its value fro...
MLEXPORT MLint MLTypeGetIntComponent(char component, const MLTypeData *targetPointer)
Like MLTypeGetComponent, only that the components is returned as integer values.
MLEXPORT MLint32 MLTypePropBitsTest(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
Returns true(=1) if bit mask mask is part of propertyBits, otherwise return false(=0).
MLEXPORT const MLTypePropertyBits MLTypeHasCastToOtherType
A data type instance can be cast to another type.
MLEXPORT const char * MLGetCDataTypeNameForCharCode(char code)
Returns the basic C/C++ data type name corresponding to a character representing it.
MLEXPORT MLint32 MLTypeComponentsFromStream(void *iStr, void *iStrStream, void *stdiStr, void *stdiStrStream, const MLTypeInfos *infos, MLTypeData *data)
Reads data type components into different stream versions (istream and istrstream within and outside ...
MLEXPORT MLTypeInfos * MLGetTypeInfosForDataType(MLDataType dataType)
Returns the MLTypeInfos for the data type dataType, or NULL on non registered or invalid type.
MLEXPORT MLTypePropertyBits MLTypePropBitsOr(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
Adds all set bits in mask to those in propertyBits.
MLEXPORT const MLTypePropertyBits MLTypeHasPlusDouble
A data type instance and a double can be added.
MLEXPORT void MLTypeSetDefaultFunctionPointers(MLTypeInfos *infos)
Sets all function pointers to default values which do error handling when called.
MLEXPORT const char * MLGetMLDataTypeNameForCharCode(char code)
Returns an ML type name type name compatible to a character representing it.
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
MLuint64 MLTypePropertyBits
Structure to define a bit mask which identifies all implemented functions for a data type.
Definition: mlTypeDefs.h:1411
double MLdouble
Definition: mlTypeDefs.h:223
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.
Definition: mlTypeDefs.h:1436
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
signed int MLint32
Definition: mlTypeDefs.h:167
MLint32 MLTypeGroup
This is an identifier to differentiate types like matrices, vectors and complex/quaternion types,...
Definition: mlTypeDefs.h:1441
SwitchType< ml::TypeTraits< T >::isStandardType > isScalarType()
The purpose of this function only is to return different result types depending on if T is a scalar t...
Definition: mlTypeTraits.h:341
Structure containing all data type features and pointers to all functions needed to implement operati...
Definition: mlTypeDefs.h:1466