tesseract  4.00.00dev
INT_FEATURE_STRUCT Struct Reference

#include <intproto.h>

Public Member Functions

 INT_FEATURE_STRUCT ()
 
 INT_FEATURE_STRUCT (const FCOORD &pos, uinT8 theta)
 
 INT_FEATURE_STRUCT (int x, int y, int theta)
 
void print () const
 

Public Attributes

uinT8 X
 
uinT8 Y
 
uinT8 Theta
 
inT8 CP_misses
 

Detailed Description

Definition at line 135 of file intproto.h.

Constructor & Destructor Documentation

◆ INT_FEATURE_STRUCT() [1/3]

INT_FEATURE_STRUCT::INT_FEATURE_STRUCT ( )
inline

Definition at line 136 of file intproto.h.

136 : X(0), Y(0), Theta(0), CP_misses(0) { }

◆ INT_FEATURE_STRUCT() [2/3]

INT_FEATURE_STRUCT::INT_FEATURE_STRUCT ( const FCOORD pos,
uinT8  theta 
)

Builds a feature from an FCOORD for position with all the necessary clipping and rounding.

Definition at line 210 of file intproto.cpp.

211  : X(ClipToRange<inT16>(static_cast<inT16>(pos.x() + 0.5), 0, 255)),
212  Y(ClipToRange<inT16>(static_cast<inT16>(pos.y() + 0.5), 0, 255)),
213  Theta(theta),
214  CP_misses(0) {
215 }
float y() const
Definition: points.h:212
float x() const
Definition: points.h:209

◆ INT_FEATURE_STRUCT() [3/3]

INT_FEATURE_STRUCT::INT_FEATURE_STRUCT ( int  x,
int  y,
int  theta 
)

Builds a feature from ints with all the necessary clipping and casting.

Definition at line 217 of file intproto.cpp.

218  : X(static_cast<uinT8>(ClipToRange(x, 0, MAX_UINT8))),
219  Y(static_cast<uinT8>(ClipToRange(y, 0, MAX_UINT8))),
220  Theta(static_cast<uinT8>(ClipToRange(theta, 0, MAX_UINT8))),
221  CP_misses(0) {
222 }
#define MAX_UINT8
Definition: host.h:63
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
Definition: helpers.h:122

Member Function Documentation

◆ print()

void INT_FEATURE_STRUCT::print ( ) const
inline

Definition at line 148 of file intproto.h.

148  {
149  tprintf("(%d,%d):%d\n", X, Y, Theta);
150  }
#define tprintf(...)
Definition: tprintf.h:31

Member Data Documentation

◆ CP_misses

inT8 INT_FEATURE_STRUCT::CP_misses

Definition at line 146 of file intproto.h.

◆ Theta

uinT8 INT_FEATURE_STRUCT::Theta

Definition at line 145 of file intproto.h.

◆ X

uinT8 INT_FEATURE_STRUCT::X

Definition at line 143 of file intproto.h.

◆ Y

uinT8 INT_FEATURE_STRUCT::Y

Definition at line 144 of file intproto.h.


The documentation for this struct was generated from the following files: