tesseract  3.05.02
host.h File Reference
#include "platform.h"
#include <cstdint>

Go to the source code of this file.

Macros

#define INT32FORMAT   "%d"
 
#define INT64FORMAT   "%lld"
 
#define MAX_INT8   0x7f
 
#define MAX_INT16   0x7fff
 
#define MAX_INT32   0x7fffffff
 
#define MAX_UINT8   0xff
 
#define MAX_UINT16   0xffff
 
#define MAX_UINT32   0xffffffff
 
#define MAX_FLOAT32   ((float)3.40282347e+38)
 
#define MIN_INT8   0x80
 
#define MIN_INT16   0x8000
 
#define MIN_INT32   static_cast<int>(0x80000000)
 
#define MIN_UINT8   0x00
 
#define MIN_UINT16   0x0000
 
#define MIN_UINT32   0x00000000
 
#define MIN_FLOAT32   ((float)1.17549435e-38)
 
#define TRUE   1
 
#define FALSE   0
 

Typedefs

typedef SIGNED char inT8
 
typedef unsigned char uinT8
 
typedef short inT16
 
typedef unsigned short uinT16
 
typedef int inT32
 
typedef unsigned int uinT32
 
typedef long long int inT64
 
typedef unsigned long long int uinT64
 
typedef float FLOAT32
 
typedef double FLOAT64
 
typedef unsigned char BOOL8
 

Functions

template<class T >
bool NearlyEqual (T x, T y, T tolerance)
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Definition at line 73 of file host.h.

◆ INT32FORMAT

#define INT32FORMAT   "%d"

Definition at line 48 of file host.h.

◆ INT64FORMAT

#define INT64FORMAT   "%lld"

Definition at line 49 of file host.h.

◆ MAX_FLOAT32

#define MAX_FLOAT32   ((float)3.40282347e+38)

Definition at line 57 of file host.h.

◆ MAX_INT16

#define MAX_INT16   0x7fff

Definition at line 52 of file host.h.

◆ MAX_INT32

#define MAX_INT32   0x7fffffff

Definition at line 53 of file host.h.

◆ MAX_INT8

#define MAX_INT8   0x7f

Definition at line 51 of file host.h.

◆ MAX_UINT16

#define MAX_UINT16   0xffff

Definition at line 55 of file host.h.

◆ MAX_UINT32

#define MAX_UINT32   0xffffffff

Definition at line 56 of file host.h.

◆ MAX_UINT8

#define MAX_UINT8   0xff

Definition at line 54 of file host.h.

◆ MIN_FLOAT32

#define MIN_FLOAT32   ((float)1.17549435e-38)

Definition at line 65 of file host.h.

◆ MIN_INT16

#define MIN_INT16   0x8000

Definition at line 60 of file host.h.

◆ MIN_INT32

#define MIN_INT32   static_cast<int>(0x80000000)

Definition at line 61 of file host.h.

◆ MIN_INT8

#define MIN_INT8   0x80

Definition at line 59 of file host.h.

◆ MIN_UINT16

#define MIN_UINT16   0x0000

Definition at line 63 of file host.h.

◆ MIN_UINT32

#define MIN_UINT32   0x00000000

Definition at line 64 of file host.h.

◆ MIN_UINT8

#define MIN_UINT8   0x00

Definition at line 62 of file host.h.

◆ TRUE

#define TRUE   1

Definition at line 69 of file host.h.

Typedef Documentation

◆ BOOL8

typedef unsigned char BOOL8

Definition at line 46 of file host.h.

◆ FLOAT32

typedef float FLOAT32

Definition at line 44 of file host.h.

◆ FLOAT64

typedef double FLOAT64

Definition at line 45 of file host.h.

◆ inT16

typedef short inT16

Definition at line 33 of file host.h.

◆ inT32

typedef int inT32

Definition at line 35 of file host.h.

◆ inT64

typedef long long int inT64

Definition at line 41 of file host.h.

◆ inT8

typedef SIGNED char inT8

Definition at line 31 of file host.h.

◆ uinT16

typedef unsigned short uinT16

Definition at line 34 of file host.h.

◆ uinT32

typedef unsigned int uinT32

Definition at line 36 of file host.h.

◆ uinT64

typedef unsigned long long int uinT64

Definition at line 42 of file host.h.

◆ uinT8

typedef unsigned char uinT8

Definition at line 32 of file host.h.

Function Documentation

◆ NearlyEqual()

template<class T >
bool NearlyEqual ( x,
y,
tolerance 
)

Definition at line 77 of file host.h.

77  {
78  T diff = x - y;
79  return diff <= tolerance && -diff <= tolerance;
80 }