tesseract  4.0.0-1-g2a2b
INT_FEATURE_STRUCT Struct Reference

#include <intproto.h>

Public Member Functions

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

Public Attributes

uint8_t X
 
uint8_t Y
 
uint8_t Theta
 
int8_t CP_misses
 

Detailed Description

Definition at line 132 of file intproto.h.

Constructor & Destructor Documentation

◆ INT_FEATURE_STRUCT() [1/3]

INT_FEATURE_STRUCT::INT_FEATURE_STRUCT ( )
inline

Definition at line 133 of file intproto.h.

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

◆ INT_FEATURE_STRUCT() [2/3]

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

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

Definition at line 207 of file intproto.cpp.

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

◆ 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 214 of file intproto.cpp.

215  : X(static_cast<uint8_t>(ClipToRange<int>(x, 0, UINT8_MAX))),
216  Y(static_cast<uint8_t>(ClipToRange<int>(y, 0, UINT8_MAX))),
217  Theta(static_cast<uint8_t>(ClipToRange<int>(theta, 0, UINT8_MAX))),
218  CP_misses(0) {
219 }

Member Function Documentation

◆ print()

void INT_FEATURE_STRUCT::print ( ) const
inline

Definition at line 145 of file intproto.h.

145 { tprintf("(%d,%d):%d\n", X, Y, Theta); }
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:37

Member Data Documentation

◆ CP_misses

int8_t INT_FEATURE_STRUCT::CP_misses

Definition at line 143 of file intproto.h.

◆ Theta

uint8_t INT_FEATURE_STRUCT::Theta

Definition at line 142 of file intproto.h.

◆ X

uint8_t INT_FEATURE_STRUCT::X

Definition at line 140 of file intproto.h.

◆ Y

uint8_t INT_FEATURE_STRUCT::Y

Definition at line 141 of file intproto.h.


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