coastline 0.0.4
Loading...
Searching...
No Matches
packedvalue.h
Go to the documentation of this file.
1#ifndef COASTLINE_PLATFORM_WIN_PACKEDVALUE_H
2#define COASTLINE_PLATFORM_WIN_PACKEDVALUE_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
16int FloatToSignedByteIndex(float fValue);
17
26int ConvertFloatToFixedAngle(float fValue);
27
37
47int FloatToByteIndex(float fValue);
48
57int FloatToEngineRpmIndex(float fValue);
58
67int ConvertFloatToFixed24(float fValue);
68
78
87int FloatToSignedShortIndex(float fValue);
88
97int ConvertFloatToSignedByte(float fValue);
98
107unsigned char QuantizeFloatToLightIndex(float fScale);
108
117int ConvertDoubleToSignedByte(double dValue);
118
127float SignedByteToFloat(unsigned char bValue);
128
137float EngineRpmIndexToFloat(unsigned char bIndex);
138
147float GetLightLevelScale(char nLightLevel);
148
157float ConvertUintToScaledFloat(unsigned dwValue);
158
167float Signed24BitToFloat(int nValue);
168
177float ConvertFixedAngleToFloat(short nValue);
178
187float ByteToFloat(unsigned char bValue);
188
197float FixedToRadians(short nValue);
198
207float SignedShortToFloat(short nValue);
208
217float ConvertCharToScaledFloat(signed char bValue);
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif /* COASTLINE_PLATFORM_WIN_PACKEDVALUE_H */
float ConvertCharToScaledFloat(signed char bValue)
Scale a field of a packet of one signed byte by 1/8.
float ConvertUintToScaledFloat(unsigned dwValue)
Scale a field by 1/8192.
float SignedByteToFloat(unsigned char bValue)
Scale a signed field of six bits by -1/128.
int ConvertFloatToFixedAngle16B(float fValue)
Round 128 times a value to the nearest integer, limited to the range of a short.
unsigned char QuantizeFloatToLightIndex(float fScale)
Get the light level of a brightness, the inverse of GetLightLevelScale().
int ConvertFloatToFixed24(float fValue)
Round twice a value to the nearest integer, limited to the range of a field of 24 bits.
int FloatToSignedShortIndex(float fValue)
Round 256 times a value to the nearest integer, limited to the range of a short.
float GetLightLevelScale(char nLightLevel)
Get the brightness of a light level.
float FixedToRadians(short nValue)
Scale a field of a packet of two bytes by 1/128.
int ConvertFloatToFixedAngle(float fValue)
Round -32768 times a value to the nearest integer, limited to the range of a short.
float EngineRpmIndexToFloat(unsigned char bIndex)
Map one of 64 steps to engine speed from 400 to 8000 RPM.
int FloatToEngineRpmIndex(float fValue)
Map engine speed from 400 to 8000 RPM to the nearest of 64 steps.
int ConvertFloatToFixedAngleNoClamp(float fValue)
Quantise a coordinate in steps of 1/8192 within the unsigned 24-bit range.
float ByteToFloat(unsigned char bValue)
Scale a field of a packet of one unsigned byte by 1.41015625.
int ConvertDoubleToSignedByte(double dValue)
Round 128 times a value to the nearest integer, limited to the range of a signed byte.
int ConvertFloatToSignedByte(float fValue)
Round 8 times a value to the nearest integer, limited to the range of a signed byte.
int FloatToSignedByteIndex(float fValue)
Round -128 times a value to the nearest integer, limited to the range of a field of six bits.
float Signed24BitToFloat(int nValue)
Scale a signed field of 24 bits by 1/2.
float SignedShortToFloat(short nValue)
Scale a field of a packet of two bytes by 1/256.
float ConvertFixedAngleToFloat(short nValue)
Scale a field of a packet of two bytes by -1/32768.
int FloatToByteIndex(float fValue)
Round a value divided by 1.41015625 to the nearest integer, limited to the range of an unsigned byte.