MeshLib C Docs
Loading...
Searching...
No Matches
MRScalarConvert.h File Reference
#include <MRCMesh/MRBox.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_std_function_float_from_const_char_ptr MR_std_function_float_from_const_char_ptr
typedef enum MR_ScalarType MR_ScalarType
 scalar value's binary format type

Enumerations

enum  MR_ScalarType {
  MR_ScalarType_UInt8 = 0 , MR_ScalarType_Int8 = 1 , MR_ScalarType_UInt16 = 2 , MR_ScalarType_Int16 = 3 ,
  MR_ScalarType_UInt32 = 4 , MR_ScalarType_Int32 = 5 , MR_ScalarType_UInt64 = 6 , MR_ScalarType_Int64 = 7 ,
  MR_ScalarType_Float32 = 8 , MR_ScalarType_Float64 = 9 , MR_ScalarType_Float32_4 = 10 , MR_ScalarType_Unknown = 11 ,
  MR_ScalarType_Count = 12
}
 scalar value's binary format type More...

Functions

MRC_API size_t MR_getScalarTypeSize (MR_ScalarType scalarType)
MRC_API MR_Box1d MR_getScalarTypeMinMax (MR_ScalarType scalarType)
MRC_API MR_std_function_float_from_const_char_ptr * MR_getTypeConverter (MR_ScalarType scalarType, const MR_Box1d *range)

Typedef Documentation

◆ MR_ScalarType

scalar value's binary format type

◆ MR_std_function_float_from_const_char_ptr

Stores a functor of type: float(const char *). Possibly stateful. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

Enumeration Type Documentation

◆ MR_ScalarType

scalar value's binary format type

Enumerator
MR_ScalarType_UInt8 
MR_ScalarType_Int8 
MR_ScalarType_UInt16 
MR_ScalarType_Int16 
MR_ScalarType_UInt32 
MR_ScalarType_Int32 
MR_ScalarType_UInt64 
MR_ScalarType_Int64 
MR_ScalarType_Float32 
MR_ScalarType_Float64 

the last value from float[4]

MR_ScalarType_Float32_4 
MR_ScalarType_Unknown 
MR_ScalarType_Count 

Function Documentation

◆ MR_getScalarTypeMinMax()

MRC_API MR_Box1d MR_getScalarTypeMinMax ( MR_ScalarType scalarType)

returns the minimal and the maximal values of given type, or zeros for ScalarType::Unknown Generated from function MR::getScalarTypeMinMax.

◆ MR_getScalarTypeSize()

MRC_API size_t MR_getScalarTypeSize ( MR_ScalarType scalarType)

returns the size in bytes of a value of given type, or 0 for ScalarType::Unknown Generated from function MR::getScalarTypeSize.

◆ MR_getTypeConverter()

MRC_API MR_std_function_float_from_const_char_ptr * MR_getTypeConverter ( MR_ScalarType scalarType,
const MR_Box1d * range )

get a function to convert binary data of specified format type to a scalar value: integer values are mapped from given range to [0, 1], floating-point values are returned as they are

Parameters
scalarType- binary format type
range- (for integer types only) the range of possible values, e.g. getScalarTypeMinMax( scalarType ) Generated from function MR::getTypeConverter. Parameter range can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_function_float_from_const_char_ptr_Destroy() to free it when you're done using it.