13#ifndef ML_DATA_TYPES_H
14#define ML_DATA_TYPES_H
162 double rangeMin,
double rangeMax);
166 double rangeMin,
double rangeMax);
170 double rangeMin,
double rangeMax);
174 double rangeMin,
double rangeMax);
282 int suppressML64BitInts,
283 int suppressMLldouble);
300 int suppressML64BitInts,
301 int suppressMLldouble);
511 const char *typeStructInfo,
515 void **componentAddresses,
516 size_t numGoodCastTos,
517 const char **goodCastTos);
546 size_t numInstances);
558 size_t numInstances);
570 size_t numInstances);
745 void *stdiStr,
void *stdiStrStream,
MLEXPORT MLDataType MLGetDataTypeForUncorrectedRange(MLdouble min, MLdouble max, MLint32 preferUnsigned)
MLEXPORT size_t MLSizeOf(MLDataType dataType)
MLEXPORT MLint32 MLIsValidType(MLDataType dataType)
MLEXPORT MLDataType MLTypeGetBestScalarTypeForTypeComponentChars(const char *charCodes, int suppressML64BitInts, int suppressMLldouble)
MLEXPORT MLDataType MLGetIntegerDataTypeForRange(double rangeMin, double rangeMax)
MLEXPORT MLTypeGroup MLGetTypeGroup(MLDataType dataType)
MLEXPORT MLint32 MLHolds(MLDataType datatype1, MLDataType datatype2)
MLEXPORT const char * MLTypeGetStructInfoString(MLDataType dataType)
MLEXPORT MLint32 MLRangeOrder(MLDataType dataType)
MLEXPORT MLint32 MLIsStandardType(MLDataType dataType)
MLEXPORT size_t MLSizeOfRegisteredType(MLDataType dataType)
Compatibility function - obsolete, use MLSizeOf instead!
MLEXPORT MLDataType MLGetPromotedPrecision(MLDataType datatype1, MLDataType datatype2)
MLEXPORT MLdouble MLDataTypeMin(MLDataType dataType)
MLEXPORT size_t MLNumDataTypes()
MLEXPORT MLDataType MLGetDataTypeForRange(MLdouble *min, MLdouble *max, MLint32 preferUnsigned)
MLEXPORT MLDataType MLGetPromotedTypeWithRange2Inputs(MLDataType inputType1, MLDataType inputType2, double rangeMin, double rangeMax)
Convenience function for MLGetPromotedTypeWithRange with two inputs.
MLEXPORT MLint32 MLIsDefaultExtendedType(MLDataType dataType)
MLEXPORT MLint32 MLIsIntType(MLDataType dataType)
MLEXPORT MLDataType MLDataTypeFromName(const char *const name)
MLEXPORT MLDataType MLGetPromotedTypeWithRange(const MLDataType *inputTypes, size_t numTypes, double rangeMin, double rangeMax)
MLEXPORT MLint32 MLIsScalarType(MLDataType dataType)
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)
MLEXPORT MLint32 MLIsSigned(MLDataType dataType)
MLEXPORT MLDataType MLTypeGetBestScalarTypeForTypeComponents(MLDataType dataType, int suppressML64BitInts, int suppressMLldouble)
MLEXPORT MLint32 MLIsFloatType(MLDataType dataType)
MLEXPORT const char * MLNameFromDataType(MLDataType dataType)
MLEXPORT MLErrorCode MLClampIntervalToDataTypeRange(double intervalMin, double intervalMax, MLDataType dataType, double *resultIntervalMin, double *resultIntervalMax)
MLEXPORT size_t MLTypeGetNumComponents(MLDataType dataType)
MLEXPORT MLDataType MLGetRangeAndPrecisionEquivalent(MLDataType dataType)
MLEXPORT MLDataType MLGetPromotedType(MLDataType datatype1, MLDataType datatype2)
MLEXPORT const char *const * MLDataTypeNames()
MLint32 MLErrorCode
Type of an ML Error code.
MLEXPORT const MLTypePropertyBits MLTypeHasNormalize
A data type instance can be normalized.
MLEXPORT MLdouble MLGetVoxelValueAsDouble(const void *data, MLDataType dataType, MLErrorCode *errorCode)
MLEXPORT MLint32 MLTypeComponentsFromString(const MLTypeInfos *infos, const char *stringData, const MLTypeData *defaultValue, MLTypeData *data)
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)
MLEXPORT void MLTypeMultWithOtherType(const MLTypeInfos *myInfos, const MLTypeData *myData, const MLTypeInfos *otherInfos, const MLTypeData *otherData, MLTypeData *targetData)
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)
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()
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)
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)
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)
MLEXPORT void MLTypeShiftComponentsLeft(const MLTypeInfos *infos, const MLTypeData *sourceData, MLint shiftLeft, MLTypeData *targetData)
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)
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)
MLEXPORT MLErrorCode MLTypeGetMinMaxRangeOfComponents(const MLTypeInfos *infos, const MLTypeData *srcPtr, MLdouble *retMin, MLdouble *retMax)
MLEXPORT const MLTypePropertyBits MLTypeHasSetStringValue
The function setStringValue is implemented. (Note: This function must be implemented....
MLEXPORT size_t MLTypeComponentSize(char component)
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)
MLEXPORT MLint32 MLRegisterTypeInfos(MLTypeInfos *infos)
MLEXPORT char * MLGetVoxelValueAsString(const MLTypeData *data, MLDataType dataType, MLErrorCode *errorCode)
MLEXPORT const char * MLGetCDataTypeNameForCharCode(char code)
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)
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)
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)
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)
MLEXPORT void MLTypeInfosRemoveBuffer(MLTypeData *buffer)
Removes a buffer created with MLTypeInfosCreateBuffer.
MLEXPORT void MLTypeCastFromBool(const MLTypeInfos *infos, bool boolValue, MLTypeData *data)
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)
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)
MLEXPORT void MLTypeSetAllDoubleComponents(const MLTypeInfos *infos, MLdouble value, MLTypeData *targetPointer)
MLEXPORT const MLTypePropertyBits MLTypeHasCastFromInt
An integer can be cast to a data type instance.
MLEXPORT MLdouble MLTypeGetDoubleComponent(char component, const MLTypeData *targetPointer)
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)
MLEXPORT void MLTypeSetDoubleComponent(char component, MLdouble value, MLTypeData *targetPointer)
MLEXPORT MLint MLTypeGetIntComponent(char component, const MLTypeData *targetPointer)
Like MLTypeGetComponent, only that the components is returned as integer values.
MLEXPORT MLTypeInfos * MLGetTypeInfosForDataType(MLDataType dataType)
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)
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)
MLEXPORT MLTypeInfos * MLGetTypeInfosAtIndex(size_t index)
Returns the index th registered type operation, NULL on invalid index.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
MLuint64 MLTypePropertyBits
Structure to define a bit mask that identifies all implemented functions for a data type.
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.