tesseract  4.0.0-1-g2a2b
werd.h File Reference
#include "params.h"
#include "bits16.h"
#include "elst2.h"
#include "strngs.h"
#include "stepblob.h"
#include "ocrrow.h"

Go to the source code of this file.

Classes

class  WERD
 

Enumerations

enum  WERD_FLAGS {
  W_SEGMENTED, W_ITALIC, W_BOLD, W_BOL,
  W_EOL, W_NORMALIZED, W_SCRIPT_HAS_XHEIGHT, W_SCRIPT_IS_LATIN,
  W_DONT_CHOP, W_REP_CHAR, W_FUZZY_SP, W_FUZZY_NON,
  W_INVERSE
}
 
enum  DISPLAY_FLAGS {
  DF_BOX, DF_TEXT, DF_POLYGONAL, DF_EDGE_STEP,
  DF_BN_POLYGONAL, DF_BLAMER
}
 

Functions

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

Enumeration Type Documentation

◆ DISPLAY_FLAGS

Enumerator
DF_BOX 
DF_TEXT 
DF_POLYGONAL 
DF_EDGE_STEP 
DF_BN_POLYGONAL 
DF_BLAMER 

Definition at line 46 of file werd.h.

47 {
48  /* Display flags bit number allocations */
49  DF_BOX, //< Bounding box
50  DF_TEXT, //< Correct ascii
51  DF_POLYGONAL, //< Polyg approx
52  DF_EDGE_STEP, //< Edge steps
53  DF_BN_POLYGONAL, //< BL normalisd polyapx
54  DF_BLAMER //< Blamer information
55 };
Definition: werd.h:54
Definition: werd.h:49
Definition: werd.h:50

◆ WERD_FLAGS

enum WERD_FLAGS
Enumerator
W_SEGMENTED 
W_ITALIC 
W_BOLD 
W_BOL 
W_EOL 
W_NORMALIZED 
W_SCRIPT_HAS_XHEIGHT 
W_SCRIPT_IS_LATIN 
W_DONT_CHOP 
W_REP_CHAR 
W_FUZZY_SP 
W_FUZZY_NON 
W_INVERSE 

Definition at line 29 of file werd.h.

30 {
31  W_SEGMENTED, //< correctly segmented
32  W_ITALIC, //< italic text
33  W_BOLD, //< bold text
34  W_BOL, //< start of line
35  W_EOL, //< end of line
36  W_NORMALIZED, //< flags
37  W_SCRIPT_HAS_XHEIGHT, //< x-height concept makes sense.
38  W_SCRIPT_IS_LATIN, //< Special case latin for y. splitting.
39  W_DONT_CHOP, //< fixed pitch chopped
40  W_REP_CHAR, //< repeated character
41  W_FUZZY_SP, //< fuzzy space
42  W_FUZZY_NON, //< fuzzy nonspace
43  W_INVERSE //< white on black
44 };
Definition: werd.h:43
Definition: werd.h:35
Definition: werd.h:32
Definition: werd.h:33
Definition: werd.h:34

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 393 of file werd.cpp.

393  {
394  const WERD *word1 = *reinterpret_cast<const WERD* const*>(word1p);
395  const WERD *word2 = *reinterpret_cast<const WERD* const*>(word2p);
396  return word1->bounding_box().left() - word2->bounding_box().left();
397 }
TBOX bounding_box() const
Definition: werd.cpp:159
int16_t left() const
Definition: rect.h:72
Definition: werd.h:59