tesseract  4.1.1
werd.cpp File Reference
#include "werd.h"
#include "helpers.h"
#include "linlsq.h"

Go to the source code of this file.

Macros

#define FIRST_COLOUR   ScrollView::RED
 first rainbow colour More...
 
#define LAST_COLOUR   ScrollView::AQUAMARINE
 last rainbow colour More...
 
#define CHILD_COLOUR   ScrollView::BROWN
 colour of children More...
 

Functions

int word_comparator (const void *word1p, const void *word2p)
 

Macro Definition Documentation

◆ CHILD_COLOUR

#define CHILD_COLOUR   ScrollView::BROWN

colour of children

Definition at line 31 of file werd.cpp.

◆ FIRST_COLOUR

#define FIRST_COLOUR   ScrollView::RED

first rainbow colour

Definition at line 29 of file werd.cpp.

◆ LAST_COLOUR

#define LAST_COLOUR   ScrollView::AQUAMARINE

last rainbow colour

Definition at line 30 of file werd.cpp.

Function Documentation

◆ word_comparator()

int word_comparator ( const void *  word1p,
const void *  word2p 
)

word_comparator()

word comparator used to sort a word list so that words are in increasing order of left edge.

Definition at line 370 of file werd.cpp.

370  {
371  const WERD* word1 = *reinterpret_cast<const WERD* const*>(word1p);
372  const WERD* word2 = *reinterpret_cast<const WERD* const*>(word2p);
373  return word1->bounding_box().left() - word2->bounding_box().left();
374 }
WERD
Definition: werd.h:56
TBOX::left
int16_t left() const
Definition: rect.h:72
WERD::bounding_box
TBOX bounding_box() const
Definition: werd.cpp:148