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
31extern "C" {
32#endif
33
34#include "mlTypeDefs.h"
35
36//--------------------------------------------------------------------------------------------------
39//--------------------------------------------------------------------------------------------------
41[[nodiscard]]
43
47
51
52
53
54
55//--------------------------------------------------------------------------------------------------
60//--------------------------------------------------------------------------------------------------
64MLEXPORT const char * const * MLDataTypeNames();
65
69
73MLEXPORT const char * MLNameFromDataType(MLDataType dataType);
74
78MLEXPORT MLDataType MLDataTypeFromName(const char* const name);
79
83
87
91MLEXPORT size_t MLSizeOf(MLDataType dataType);
92
95
106
110
114
118
122
129
134
138
161MLEXPORT 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
194MLEXPORT MLDataType MLGetIntegerDataTypeForRange(double rangeMin, double rangeMax);
195
221 MLdouble *max,
222 MLint32 preferUnsigned);
223
230 MLdouble max,
231 MLint32 preferUnsigned);
232
239
247
253MLEXPORT MLErrorCode MLClampIntervalToDataTypeRange(double intervalMin, double intervalMax, MLDataType dataType, double* resultIntervalMin, double* resultIntervalMax);
254
258
263
282 int suppressML64BitInts,
283 int suppressMLldouble);
300 int suppressML64BitInts,
301 int suppressMLldouble);
303
304
305
306
307
308//---------------------------------------------------------------------------------------------
309//
310//
311// REGISTERED TYPE SUPPORT
312//
313//
314//---------------------------------------------------------------------------------------------
315
316
317//--------------------------------------------------------------------------------------------------
320//--------------------------------------------------------------------------------------------------
322
325
331
336
341
345
348
350
355
360
361//--------------------------------------------------------------------------------------------------
364//--------------------------------------------------------------------------------------------------
367
368
369//--------------------------------------------------------------------------------------------------
372//--------------------------------------------------------------------------------------------------
375
378
381
385
386
387//--------------------------------------------------------------------------------------------------
390//--------------------------------------------------------------------------------------------------
397[[nodiscard]]
399
402
405
408
411
416
417
418//--------------------------------------------------------------------------------------------------
421//--------------------------------------------------------------------------------------------------
502//---------------------------------------------------------------------
504 size_t typeSize,
505 const char *name,
506 MLdouble dblMin,
507 MLdouble dblMax,
508 const MLTypeData *typeMinPtr,
509 const MLTypeData *typeMaxPtr,
510 const MLTypeData *typeDefaultPtr,
511 const char *typeStructInfo,
512 MLint32 isScalarType,
513 MLTypeGroup typeGroup,
514 MLDataType rangeAndPrecisionEquiv,
515 void **componentAddresses,
516 size_t numGoodCastTos,
517 const char **goodCastTos);
518
520[[nodiscard]]
522
525
531
535
545 const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
546 size_t numInstances);
547
557 const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
558 size_t numInstances);
559
569 const MLTypeData *sourceBufferPointer, MLTypeData *targetBufferPointer,
570 size_t numInstances);
572
573
574
575
576//--------------------------------------------------------------------------------------------------
579//--------------------------------------------------------------------------------------------------
583
588
592
606 MLint32 *isSigned,
607 MLint32 *isIntegerType,
608 MLint32 *isFloatingPointType,
609 MLint32 *isLongType);
610
617MLEXPORT size_t MLTypeComponentSize(char component);
618
623MLEXPORT void MLTypeSetDoubleComponent(char component, MLdouble value, MLTypeData* targetPointer);
624
626MLEXPORT void MLTypeSetIntComponent (char component, MLint value, MLTypeData* targetPointer);
627
631MLEXPORT void MLTypeSetAllDoubleComponents(const MLTypeInfos* infos, MLdouble value, MLTypeData* targetPointer);
632
634MLEXPORT void MLTypeSetAllIntComponent (const MLTypeInfos *infos, MLint value, MLTypeData* targetPointer);
635
639MLEXPORT MLdouble MLTypeGetDoubleComponent(char component, const MLTypeData* targetPointer);
640
642MLEXPORT MLint MLTypeGetIntComponent (char component, const MLTypeData* targetPointer);
643
655 const MLTypeData *srcPtr,
656 MLdouble *retMin,
657 MLdouble *retMax);
658
660
661
662
663//--------------------------------------------------------------------------------------------------
666//--------------------------------------------------------------------------------------------------
672[[nodiscard]]
673MLEXPORT MLTypeData *MLAllocateVoxelBuffer(MLDataType dataType, size_t numVoxels, const MLTypeData* voxelDefaultValue);
674
681[[nodiscard]]
682MLEXPORT char *MLGetVoxelValueAsString(const MLTypeData* data, MLDataType dataType, MLErrorCode* errorCode);
683
692[[nodiscard]]
693MLEXPORT char *MLGetVoxelValueAsStringLimited(const MLTypeData* data, MLDataType dataType, MLErrorCode* errorCode, int maxPrecision);
694
701[[nodiscard]]
703
712[[nodiscard]]
713MLEXPORT char *MLTypeComponentsToStringLimited(const MLTypeInfos* infos, const MLTypeData* data, int maxPrecision);
714
723[[nodiscard]]
724MLEXPORT MLint32 MLTypeComponentsFromString(const MLTypeInfos* infos, const char* stringData, const MLTypeData* defaultValue, MLTypeData* data);
725
733[[nodiscard]]
734MLEXPORT MLTypeData *MLTypeGetDataValuesFromString(MLDataType dataType, const char* voxelValue, const MLTypeData *defaultValue, size_t numInstances);
735
744MLEXPORT MLint32 MLTypeComponentsFromStream(void *iStr, void *iStrStream,
745 void *stdiStr, void *stdiStrStream,
746 const MLTypeInfos *infos, MLTypeData *data);
747
752MLEXPORT MLdouble MLGetVoxelValueAsDouble(const void* data, MLDataType dataType, MLErrorCode* errorCode);
753
755MLEXPORT bool MLTypeCastToBool (const MLTypeInfos* infos, const MLTypeData* data);
756
759
762
765MLEXPORT void MLTypeCastFromBool (const MLTypeInfos* infos, bool boolValue, MLTypeData* data);
766
768MLEXPORT void MLTypeCastFromInt (const MLTypeInfos *infos, MLint intValue, MLTypeData* data);
769
771MLEXPORT void MLTypeCastFromDouble (const MLTypeInfos* infos, MLdouble doubleValue, MLTypeData* data);
772
778MLEXPORT void MLTypeShiftComponentsLeft(const MLTypeInfos *infos, const MLTypeData* sourceData, MLint shiftLeft, MLTypeData* targetData);
779
780
792MLEXPORT void MLTypeCastToOtherType(const MLTypeInfos* otherInfos, const MLTypeData* otherData,
793 const MLTypeInfos* myInfos, MLTypeData* myData);
794
797MLEXPORT void MLTypeCastFromOtherType(const MLTypeInfos* otherInfos, const MLTypeData* otherData,
798 const MLTypeInfos* myInfos, MLTypeData* myData);
799
804MLEXPORT void MLTypeMultWithOtherType(const MLTypeInfos* myInfos, const MLTypeData* myData,
805 const MLTypeInfos* otherInfos, const MLTypeData* otherData,
806 MLTypeData* targetData);
808
809// C-Link interface off.
810#ifdef __cplusplus
811}
812#endif
813
814#endif //of __mlDataTypes_H
MLEXPORT MLDataType MLGetDataTypeForUncorrectedRange(MLdouble min, MLdouble max, MLint32 preferUnsigned)
Like getMLDataTypeForRange with the following differences:
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 that is able to hold the precisions of each of the type component charac...
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 los...
MLEXPORT const char * MLTypeGetStructInfoString(MLDataType dataType)
Returns the components codes of the data type dataType or "" in case of an invalid data type.
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:595
MLEXPORT MLint32 MLRangeOrder(MLDataType dataType)
Returns the 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 that has higher precision.
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 datatypes.
MLEXPORT MLDataType MLGetDataTypeForRange(MLdouble *min, MLdouble *max, MLint32 preferUnsigned)
Corrects the order of *min and *max and returns an adequate standard data type.
MLEXPORT MLDataType MLGetPromotedTypeWithRange2Inputs(MLDataType inputType1, MLDataType inputType2, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with two 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 th...
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)
Routine for type promotion that takes a list of input types and the target value range to find a resu...
MLEXPORT MLint32 MLIsScalarType(MLDataType dataType)
Alternative name for MLIsStandardType.
MLEXPORT MLDataType MLGetPromotedTypeWithRange1Input(MLDataType inputType1, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with one input.
MLEXPORT MLDataType MLGetPromotedTypeWithRange3Inputs(MLDataType inputType1, MLDataType inputType2, MLDataType inputType3, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with three inputs.
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)
Returns a standard data type that 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 const char * MLNameFromDataType(MLDataType dataType)
Function that returns the NULL-terminated string name for data type dataType or "" in case of error o...
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 whether the interval is com...
MLEXPORT size_t MLTypeGetNumComponents(MLDataType dataType)
Returns the number of components of the data type data type or 0 in case of an invalid data type.
MLEXPORT MLDataType MLGetRangeAndPrecisionEquivalent(MLDataType dataType)
Returns a standard data type for dataType that has comparable precision and range behavior.
MLEXPORT MLDataType MLGetPromotedType(MLDataType datatype1, MLDataType datatype2)
Returns a data type that can hold the value ranges from datatype1 and datatype2 (including both).
MLEXPORT const char *const * MLDataTypeNames()
Function that returns the table of C-strings of all scalar and registered datatypes.
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:715
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., similar to 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 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 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 * MLTypeInfosCreateBuffer(const MLTypeInfos *infos)
Returns a buffer of the size of one data element. NULL is returned on failure.
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithInt
Data type instance can be multiplied with integer.
MLEXPORT const char * MLGetMLDataTypeNameForCharCode(char code)
Returns an ML type name type name compatible to a character representing it.
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 shiftLeft times if it is a...
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 char * MLTypeComponentsToString(const MLTypeInfos *infos, const MLTypeData *data)
Converts a data type instance to a string.
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 that allows to specify a pre-defined data type value.
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 MLErrorCode MLTypeGetMinMaxRangeOfComponents(const MLTypeInfos *infos, const MLTypeData *srcPtr, MLdouble *retMin, MLdouble *retMax)
Returns the minimum/maximum 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 from propertyBits that 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 information to the list of registered datatypes.
MLEXPORT char * MLGetVoxelValueAsString(const MLTypeData *data, MLDataType dataType, MLErrorCode *errorCode)
Interprets the data given by data as a value of type dataType and returns its value as string.
MLEXPORT const char * MLGetCDataTypeNameForCharCode(char code)
Returns the basic C/C++ data type name corresponding to a character representing it.
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 componen...
MLEXPORT MLint MLTypeCastToInt(const MLTypeInfos *infos, const MLTypeData *data)
The first component of the data type is converted to integer and returned.
MLEXPORT void MLTypeCorrectPropertyBits(MLTypeInfos *infos)
Corrects all property bits except for the basic properties [MLTypeIsSignedType, MLTypeIsFloatingPoint...
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 MLTypeData * MLAllocateVoxelBuffer(MLDataType dataType, size_t numVoxels, const MLTypeData *voxelDefaultValue)
Returns a buffer of numVoxels voxels of data type dataType.
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 const MLTypePropertyBits MLTypeHasCopy
Copies parameter one to parameter two. (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 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 MLTypeInfosRemoveBuffer(MLTypeData *buffer)
Removes a buffer created with MLTypeInfosCreateBuffer.
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 the data type is already registered. Otherwise, 0 (=false) is returned.
MLEXPORT char * MLTypeComponentsToStringLimited(const MLTypeInfos *infos, const MLTypeData *data, int maxPrecision)
Converts a data type instance to a string.
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)
Interprets the data referenced by *targetPointer as data of the type component and returns it as doub...
MLEXPORT const MLTypePropertyBits MLTypeHasMultWithOtherType
A data type instances can be multiplied with the one of another type.
MLEXPORT MLTypePropertyBits MLTypePropBitsAnd(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
AND operation 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 MLTypeInfos * MLGetTypeInfosForDataType(MLDataType dataType)
Returns the MLTypeInfos for the data type dataType, or NULL on non-registered or invalid type.
MLEXPORT MLint32 MLTypePropBitsTest(MLTypePropertyBits propertyBits, MLTypePropertyBits mask)
Returns true (=1) if bit mask mask is part of propertyBits; otherwise, it return false (=0).
MLEXPORT const MLTypePropertyBits MLTypeHasCastToOtherType
A data type instance can be cast to another type.
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 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 that perform error handling when called.
MLEXPORT MLTypeInfos * MLGetTypeInfosAtIndex(size_t index)
Returns the index th registered type operation, NULL on invalid index.
#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 that identifies all implemented functions for a data type.
double MLdouble
Definition mlTypeDefs.h:216
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.
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 MLint32
Definition mlTypeDefs.h:160
MLint32 MLTypeGroup
This is an identifier to differentiate types like matrices, vectors, and complex/quaternion types,...
Structure containing all data type features and pointers to all functions needed to implement operati...