tesseract  4.0.0-beta.1-59-g2cc4
host.h File Reference
#include <limits>
#include "platform.h"
#include <cinttypes>
#include <cstdint>

Go to the source code of this file.

Macros

#define MAX_FLOAT32   std::numeric_limits<float>::max()
 
#define MIN_FLOAT32   std::numeric_limits<float>::min()
 
#define TRUE   1
 
#define FALSE   0
 

Typedefs

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 63 of file host.h.

◆ MAX_FLOAT32

#define MAX_FLOAT32   std::numeric_limits<float>::max()

Definition at line 52 of file host.h.

◆ MIN_FLOAT32

#define MIN_FLOAT32   std::numeric_limits<float>::min()

Definition at line 55 of file host.h.

◆ TRUE

#define TRUE   1

Definition at line 59 of file host.h.

Typedef Documentation

◆ BOOL8

typedef unsigned char BOOL8

Definition at line 36 of file host.h.

◆ FLOAT32

typedef float FLOAT32

Definition at line 34 of file host.h.

◆ FLOAT64

typedef double FLOAT64

Definition at line 35 of file host.h.

Function Documentation

◆ NearlyEqual()

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

Definition at line 67 of file host.h.

67  {
68  T diff = x - y;
69  return diff <= tolerance && -diff <= tolerance;
70 }