Tesseract  3.02
tesseract-ocr/ccstruct/vecfuncs.cpp File Reference
#include "mfcpch.h"
#include "vecfuncs.h"

Go to the source code of this file.

Functions

int direction (EDGEPT *point)

Function Documentation

int direction ( EDGEPT point)

direction to return

prev point

next point

Definition at line 43 of file vecfuncs.cpp.

                             {
  int dir;                       
  EDGEPT *prev;                  
  EDGEPT *next;                  
  dir = 0;
  prev = point->prev;
  next = point->next;

  if (((prev->pos.x <= point->pos.x) &&
    (point->pos.x < next->pos.x)) ||
    ((prev->pos.x < point->pos.x) && (point->pos.x <= next->pos.x)))
    dir = 1;

  if (((prev->pos.x >= point->pos.x) &&
    (point->pos.x > next->pos.x)) ||
    ((prev->pos.x > point->pos.x) && (point->pos.x >= next->pos.x)))
    dir = -1;

  return dir;
}