tesseract  5.0.0-alpha-619-ge9db
werd.cpp File Reference
#include "werd.h"
#include <tesseract/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 29 of file werd.cpp.

◆ FIRST_COLOUR

#define FIRST_COLOUR   ScrollView::RED

first rainbow colour

Definition at line 27 of file werd.cpp.

◆ LAST_COLOUR

#define LAST_COLOUR   ScrollView::AQUAMARINE

last rainbow colour

Definition at line 28 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 369 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();
WERD::bounding_box
TBOX bounding_box() const
Definition: werd.cpp:147
WERD
Definition: werd.h:55
TBOX::left
int16_t left() const
Definition: rect.h:71