tesseract  4.0.0-1-g2a2b
vecfuncs.cpp File Reference
#include "vecfuncs.h"
#include "blobs.h"

Go to the source code of this file.

Functions

int direction (EDGEPT *point)
 

Function Documentation

◆ direction()

int direction ( EDGEPT point)

direction to return

prev point
next point

Definition at line 43 of file vecfuncs.cpp.

43  {
44  int dir;
45  EDGEPT *prev;
46  EDGEPT *next;
48  dir = 0;
49  prev = point->prev;
50  next = point->next;
51 
52  if (((prev->pos.x <= point->pos.x) &&
53  (point->pos.x < next->pos.x)) ||
54  ((prev->pos.x < point->pos.x) && (point->pos.x <= next->pos.x)))
55  dir = 1;
56 
57  if (((prev->pos.x >= point->pos.x) &&
58  (point->pos.x > next->pos.x)) ||
59  ((prev->pos.x > point->pos.x) && (point->pos.x >= next->pos.x)))
60  dir = -1;
61 
62  return dir;
63 }
TPOINT pos
Definition: blobs.h:170
Definition: blobs.h:83
EDGEPT * prev
Definition: blobs.h:177
int16_t x
Definition: blobs.h:78
EDGEPT * next
Definition: blobs.h:176