Classes | Macros | Typedefs | Functions
mydefs.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  U32I32F32
 
union  U64I64F64
 

Macros

#define ENDIANSWAP16(n)
 
#define ENDIANSWAP32(n)
 
#define F32_MAX   +2.0e+37f
 
#define F32_MIN   -2.0e+37f
 
#define FALSE   0
 
#define I16_CEIL(n)   ((((I16)(n)) < (n)) ? (((I16)(n))+1) : ((I16)(n)))
 
#define I16_CLAMP(n)   (((n) <= I16_MIN) ? I16_MIN : (((n) >= I16_MAX) ? I16_MAX : ((I16)(n))))
 
#define I16_FITS_IN_RANGE(n)   (((n) >= I16_MIN) || ((n) <= I16_MAX) ? TRUE : FALSE)
 
#define I16_FLOOR(n)   ((((I16)(n)) > (n)) ? (((I16)(n))-1) : ((I16)(n)))
 
#define I16_MAX   ((I16)0x7FFF)
 
#define I16_MIN   ((I16)0x8000)
 
#define I16_QUANTIZE(n)   (((n) >= 0) ? (I16)((n)+0.5f) : (I16)((n)-0.5f))
 
#define I32_CEIL(n)   ((((I32)(n)) < (n)) ? (((I32)(n))+1) : ((I32)(n)))
 
#define I32_CLAMP(n)   (((n) <= I32_MIN) ? I32_MIN : (((n) >= I32_MAX) ? I32_MAX : ((I32)(n))))
 
#define I32_FLOOR(n)   ((((I32)(n)) > (n)) ? (((I32)(n))-1) : ((I32)(n)))
 
#define I32_MAX   ((I32)0x7FFFFFFF)
 
#define I32_MIN   ((I32)0x80000000)
 
#define I32_QUANTIZE(n)   (((n) >= 0) ? (I32)((n)+0.5f) : (I32)((n)-0.5f))
 
#define I64_CEIL(n)   ((((I64)(n)) < (n)) ? (((I64)(n))+1) : ((I64)(n)))
 
#define I64_FLOOR(n)   ((((I64)(n)) > (n)) ? (((I64)(n))-1) : ((I64)(n)))
 
#define I64_MAX   ((I64)0x7FFFFFFFFFFFFFFF)
 
#define I64_MIN   ((I64)0x8000000000000000)
 
#define I64_QUANTIZE(n)   (((n) >= 0) ? (I64)((n)+0.5f) : (I64)((n)-0.5f))
 
#define I8_CLAMP(n)   (((n) <= I8_MIN) ? I8_MIN : (((n) >= I8_MAX) ? I8_MAX : ((I8)(n))))
 
#define I8_FITS_IN_RANGE(n)   (((n) >= I8_MIN) || ((n) <= I8_MAX) ? TRUE : FALSE)
 
#define I8_MAX   ((I8)0x7F)
 
#define I8_MIN   ((I8)0x80)
 
#define I8_QUANTIZE(n)   (((n) >= 0) ? (I8)((n)+0.5f) : (I8)((n)-0.5f))
 
#define NULL   0
 
#define TRUE   1
 
#define U16_CLAMP(n)   (((n) <= U16_MIN) ? U16_MIN : (((n) >= U16_MAX) ? U16_MAX : ((U16)(n))))
 
#define U16_FITS_IN_RANGE(n)   (((n) >= U16_MIN) || ((n) <= U16_MAX) ? TRUE : FALSE)
 
#define U16_MAX   ((U16)0xFFFF)
 
#define U16_MAX_PLUS_ONE   0x00010000
 
#define U16_MIN   ((U16)0x0)
 
#define U16_QUANTIZE(n)   (((n) >= 0) ? (U16)((n)+0.5f) : (U16)(0))
 
#define U32_CLAMP(n)   (((n) <= U32_MIN) ? U32_MIN : (((n) >= U32_MAX) ? U32_MAX : ((U32)(n))))
 
#define U32_MAX   ((U32)0xFFFFFFFF)
 
#define U32_MAX_PLUS_ONE   0x0000000100000000ull
 
#define U32_MIN   ((U32)0x0)
 
#define U32_QUANTIZE(n)   (((n) >= 0) ? (U32)((n)+0.5f) : (U32)(0))
 
#define U32_ZERO_BIT_0(n)   (((n)&(U32)0xFFFFFFFE))
 
#define U64_QUANTIZE(n)   (((n) >= 0) ? (U64)((n)+0.5f) : (U64)(0))
 
#define U8_CLAMP(n)   (((n) <= U8_MIN) ? U8_MIN : (((n) >= U8_MAX) ? U8_MAX : ((U8)(n))))
 
#define U8_FITS_IN_RANGE(n)   (((n) >= U8_MIN) || ((n) <= U8_MAX) ? TRUE : FALSE)
 
#define U8_FOLD(n)   (((n) < U8_MIN) ? (n+U8_MAX_PLUS_ONE) : (((n) > U8_MAX) ? (n-U8_MAX_PLUS_ONE) : (n)))
 
#define U8_MAX   ((U8)0xFF)
 
#define U8_MAX_PLUS_ONE   0x0100
 
#define U8_MIN   ((U8)0x0)
 
#define U8_QUANTIZE(n)   (((n) >= 0) ? (U8)((n)+0.5f) : (U8)(0))
 

Typedefs

typedef int BOOL
 
typedef float F32
 
typedef double F64
 
typedef short I16
 
typedef int I32
 
typedef long long I64
 
typedef char I8
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef union U32I32F32 U32I32F32
 
typedef unsigned long long U64
 
typedef union U64I64F64 U64I64F64
 
typedef unsigned char U8
 

Functions

void ENDIAN_SWAP_16 (const U8 *from, U8 *to)
 
void ENDIAN_SWAP_16 (U8 *field)
 
void ENDIAN_SWAP_32 (const U8 *from, U8 *to)
 
void ENDIAN_SWAP_32 (U8 *field)
 
void ENDIAN_SWAP_64 (const U8 *from, U8 *to)
 
void ENDIAN_SWAP_64 (U8 *field)
 
BOOL IS_LITTLE_ENDIAN ()
 

Macro Definition Documentation

◆ ENDIANSWAP16

#define ENDIANSWAP16 (   n)
Value:
( ((((U16) n) << 8) & 0xFF00) | \
((((U16) n) >> 8) & 0x00FF) )

Definition at line 150 of file mydefs.hpp.

◆ ENDIANSWAP32

#define ENDIANSWAP32 (   n)
Value:
( ((((U32) n) << 24) & 0xFF000000) | \
((((U32) n) << 8) & 0x00FF0000) | \
((((U32) n) >> 8) & 0x0000FF00) | \
((((U32) n) >> 24) & 0x000000FF) )

Definition at line 154 of file mydefs.hpp.

◆ F32_MAX

#define F32_MAX   +2.0e+37f

Definition at line 63 of file mydefs.hpp.

◆ F32_MIN

#define F32_MIN   -2.0e+37f

Definition at line 64 of file mydefs.hpp.

◆ FALSE

#define FALSE   0

Definition at line 133 of file mydefs.hpp.

◆ I16_CEIL

#define I16_CEIL (   n)    ((((I16)(n)) < (n)) ? (((I16)(n))+1) : ((I16)(n)))

Definition at line 121 of file mydefs.hpp.

◆ I16_CLAMP

#define I16_CLAMP (   n)    (((n) <= I16_MIN) ? I16_MIN : (((n) >= I16_MAX) ? I16_MAX : ((I16)(n))))

Definition at line 99 of file mydefs.hpp.

◆ I16_FITS_IN_RANGE

#define I16_FITS_IN_RANGE (   n)    (((n) >= I16_MIN) || ((n) <= I16_MAX) ? TRUE : FALSE)

Definition at line 127 of file mydefs.hpp.

◆ I16_FLOOR

#define I16_FLOOR (   n)    ((((I16)(n)) > (n)) ? (((I16)(n))-1) : ((I16)(n)))

Definition at line 117 of file mydefs.hpp.

◆ I16_MAX

#define I16_MAX   ((I16)0x7FFF)

Definition at line 86 of file mydefs.hpp.

◆ I16_MIN

#define I16_MIN   ((I16)0x8000)

Definition at line 85 of file mydefs.hpp.

◆ I16_QUANTIZE

#define I16_QUANTIZE (   n)    (((n) >= 0) ? (I16)((n)+0.5f) : (I16)((n)-0.5f))

Definition at line 108 of file mydefs.hpp.

◆ I32_CEIL

#define I32_CEIL (   n)    ((((I32)(n)) < (n)) ? (((I32)(n))+1) : ((I32)(n)))

Definition at line 122 of file mydefs.hpp.

◆ I32_CLAMP

#define I32_CLAMP (   n)    (((n) <= I32_MIN) ? I32_MIN : (((n) >= I32_MAX) ? I32_MAX : ((I32)(n))))

Definition at line 102 of file mydefs.hpp.

◆ I32_FLOOR

#define I32_FLOOR (   n)    ((((I32)(n)) > (n)) ? (((I32)(n))-1) : ((I32)(n)))

Definition at line 118 of file mydefs.hpp.

◆ I32_MAX

#define I32_MAX   ((I32)0x7FFFFFFF)

Definition at line 89 of file mydefs.hpp.

◆ I32_MIN

#define I32_MIN   ((I32)0x80000000)

Definition at line 88 of file mydefs.hpp.

◆ I32_QUANTIZE

#define I32_QUANTIZE (   n)    (((n) >= 0) ? (I32)((n)+0.5f) : (I32)((n)-0.5f))

Definition at line 111 of file mydefs.hpp.

◆ I64_CEIL

#define I64_CEIL (   n)    ((((I64)(n)) < (n)) ? (((I64)(n))+1) : ((I64)(n)))

Definition at line 123 of file mydefs.hpp.

◆ I64_FLOOR

#define I64_FLOOR (   n)    ((((I64)(n)) > (n)) ? (((I64)(n))-1) : ((I64)(n)))

Definition at line 119 of file mydefs.hpp.

◆ I64_MAX

#define I64_MAX   ((I64)0x7FFFFFFFFFFFFFFF)

Definition at line 92 of file mydefs.hpp.

◆ I64_MIN

#define I64_MIN   ((I64)0x8000000000000000)

Definition at line 91 of file mydefs.hpp.

◆ I64_QUANTIZE

#define I64_QUANTIZE (   n)    (((n) >= 0) ? (I64)((n)+0.5f) : (I64)((n)-0.5f))

Definition at line 114 of file mydefs.hpp.

◆ I8_CLAMP

#define I8_CLAMP (   n)    (((n) <= I8_MIN) ? I8_MIN : (((n) >= I8_MAX) ? I8_MAX : ((I8)(n))))

Definition at line 96 of file mydefs.hpp.

◆ I8_FITS_IN_RANGE

#define I8_FITS_IN_RANGE (   n)    (((n) >= I8_MIN) || ((n) <= I8_MAX) ? TRUE : FALSE)

Definition at line 125 of file mydefs.hpp.

◆ I8_MAX

#define I8_MAX   ((I8)0x7F)

Definition at line 83 of file mydefs.hpp.

◆ I8_MIN

#define I8_MIN   ((I8)0x80)

Definition at line 82 of file mydefs.hpp.

◆ I8_QUANTIZE

#define I8_QUANTIZE (   n)    (((n) >= 0) ? (I8)((n)+0.5f) : (I8)((n)-0.5f))

Definition at line 105 of file mydefs.hpp.

◆ NULL

#define NULL   0

Definition at line 141 of file mydefs.hpp.

◆ TRUE

#define TRUE   1

Definition at line 137 of file mydefs.hpp.

◆ U16_CLAMP

#define U16_CLAMP (   n)    (((n) <= U16_MIN) ? U16_MIN : (((n) >= U16_MAX) ? U16_MAX : ((U16)(n))))

Definition at line 100 of file mydefs.hpp.

◆ U16_FITS_IN_RANGE

#define U16_FITS_IN_RANGE (   n)    (((n) >= U16_MIN) || ((n) <= U16_MAX) ? TRUE : FALSE)

Definition at line 128 of file mydefs.hpp.

◆ U16_MAX

#define U16_MAX   ((U16)0xFFFF)

Definition at line 71 of file mydefs.hpp.

◆ U16_MAX_PLUS_ONE

#define U16_MAX_PLUS_ONE   0x00010000

Definition at line 72 of file mydefs.hpp.

◆ U16_MIN

#define U16_MIN   ((U16)0x0)

Definition at line 70 of file mydefs.hpp.

◆ U16_QUANTIZE

#define U16_QUANTIZE (   n)    (((n) >= 0) ? (U16)((n)+0.5f) : (U16)(0))

Definition at line 109 of file mydefs.hpp.

◆ U32_CLAMP

#define U32_CLAMP (   n)    (((n) <= U32_MIN) ? U32_MIN : (((n) >= U32_MAX) ? U32_MAX : ((U32)(n))))

Definition at line 103 of file mydefs.hpp.

◆ U32_MAX

#define U32_MAX   ((U32)0xFFFFFFFF)

Definition at line 75 of file mydefs.hpp.

◆ U32_MAX_PLUS_ONE

#define U32_MAX_PLUS_ONE   0x0000000100000000ull

Definition at line 79 of file mydefs.hpp.

◆ U32_MIN

#define U32_MIN   ((U32)0x0)

Definition at line 74 of file mydefs.hpp.

◆ U32_QUANTIZE

#define U32_QUANTIZE (   n)    (((n) >= 0) ? (U32)((n)+0.5f) : (U32)(0))

Definition at line 112 of file mydefs.hpp.

◆ U32_ZERO_BIT_0

#define U32_ZERO_BIT_0 (   n)    (((n)&(U32)0xFFFFFFFE))

Definition at line 130 of file mydefs.hpp.

◆ U64_QUANTIZE

#define U64_QUANTIZE (   n)    (((n) >= 0) ? (U64)((n)+0.5f) : (U64)(0))

Definition at line 115 of file mydefs.hpp.

◆ U8_CLAMP

#define U8_CLAMP (   n)    (((n) <= U8_MIN) ? U8_MIN : (((n) >= U8_MAX) ? U8_MAX : ((U8)(n))))

Definition at line 97 of file mydefs.hpp.

◆ U8_FITS_IN_RANGE

#define U8_FITS_IN_RANGE (   n)    (((n) >= U8_MIN) || ((n) <= U8_MAX) ? TRUE : FALSE)

Definition at line 126 of file mydefs.hpp.

◆ U8_FOLD

#define U8_FOLD (   n)    (((n) < U8_MIN) ? (n+U8_MAX_PLUS_ONE) : (((n) > U8_MAX) ? (n-U8_MAX_PLUS_ONE) : (n)))

Definition at line 94 of file mydefs.hpp.

◆ U8_MAX

#define U8_MAX   ((U8)0xFF)

Definition at line 67 of file mydefs.hpp.

◆ U8_MAX_PLUS_ONE

#define U8_MAX_PLUS_ONE   0x0100

Definition at line 68 of file mydefs.hpp.

◆ U8_MIN

#define U8_MIN   ((U8)0x0)

Definition at line 66 of file mydefs.hpp.

◆ U8_QUANTIZE

#define U8_QUANTIZE (   n)    (((n) >= 0) ? (U8)((n)+0.5f) : (U8)(0))

Definition at line 106 of file mydefs.hpp.

Typedef Documentation

◆ BOOL

typedef int BOOL

Definition at line 57 of file mydefs.hpp.

◆ F32

typedef float F32

Definition at line 51 of file mydefs.hpp.

◆ F64

typedef double F64

Definition at line 52 of file mydefs.hpp.

◆ I16

typedef short I16

Definition at line 36 of file mydefs.hpp.

◆ I32

typedef int I32

Definition at line 35 of file mydefs.hpp.

◆ I64

typedef long long I64

Definition at line 48 of file mydefs.hpp.

◆ I8

typedef char I8

Definition at line 37 of file mydefs.hpp.

◆ U16

typedef unsigned short U16

Definition at line 40 of file mydefs.hpp.

◆ U32

typedef unsigned int U32

Definition at line 39 of file mydefs.hpp.

◆ U32I32F32

typedef union U32I32F32 U32I32F32

◆ U64

typedef unsigned long long U64

Definition at line 47 of file mydefs.hpp.

◆ U64I64F64

typedef union U64I64F64 U64I64F64

◆ U8

typedef unsigned char U8

Definition at line 41 of file mydefs.hpp.

Function Documentation

◆ ENDIAN_SWAP_16() [1/2]

void ENDIAN_SWAP_16 ( const U8 from,
U8 to 
)
inline

Definition at line 195 of file mydefs.hpp.

◆ ENDIAN_SWAP_16() [2/2]

void ENDIAN_SWAP_16 ( U8 field)
inline

Definition at line 160 of file mydefs.hpp.

◆ ENDIAN_SWAP_32() [1/2]

void ENDIAN_SWAP_32 ( const U8 from,
U8 to 
)
inline

Definition at line 201 of file mydefs.hpp.

◆ ENDIAN_SWAP_32() [2/2]

void ENDIAN_SWAP_32 ( U8 field)
inline

Definition at line 167 of file mydefs.hpp.

◆ ENDIAN_SWAP_64() [1/2]

void ENDIAN_SWAP_64 ( const U8 from,
U8 to 
)
inline

Definition at line 209 of file mydefs.hpp.

◆ ENDIAN_SWAP_64() [2/2]

void ENDIAN_SWAP_64 ( U8 field)
inline

Definition at line 178 of file mydefs.hpp.

◆ IS_LITTLE_ENDIAN()

BOOL IS_LITTLE_ENDIAN ( )
inline

Definition at line 144 of file mydefs.hpp.

U16
unsigned short U16
Definition: mydefs.hpp:40
U32
unsigned int U32
Definition: mydefs.hpp:39


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25