Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tesseract::ColSegment Class Reference

#include <tablefind.h>

Inheritance diagram for tesseract::ColSegment:
ELIST_LINK

Public Member Functions

 ColSegment ()
 
 ~ColSegment ()
 
const TBOXbounding_box () const
 
void set_top (int y)
 
void set_bottom (int y)
 
void set_left (int x)
 
void set_right (int x)
 
void set_bounding_box (const TBOX &other)
 
int get_num_table_cells () const
 
void set_num_table_cells (int n)
 
int get_num_text_cells () const
 
void set_num_text_cells (int n)
 
ColSegType type () const
 
void set_type ()
 
ScrollView::Color BoxColor () const
 
void InsertBox (const TBOX &other)
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Detailed Description

Definition at line 46 of file tablefind.h.

Constructor & Destructor Documentation

tesseract::ColSegment::ColSegment ( )

Definition at line 2135 of file tablefind.cpp.

2136  : ELIST_LINK(),
2137  num_table_cells_(0),
2138  num_text_cells_(0),
2139  type_(COL_UNKNOWN) {
2140 }
ELIST_LINK()
Definition: elst.h:92
tesseract::ColSegment::~ColSegment ( )

Definition at line 2141 of file tablefind.cpp.

2141  {
2142 }

Member Function Documentation

const TBOX& tesseract::ColSegment::bounding_box ( ) const
inline

Definition at line 52 of file tablefind.h.

52  {
53  return bounding_box_;
54  }
ScrollView::Color tesseract::ColSegment::BoxColor ( ) const

Definition at line 2145 of file tablefind.cpp.

2145  {
2146  const ScrollView::Color kBoxColors[PT_COUNT] = {
2151  };
2152  return kBoxColors[type_];
2153 }
Definition: capi.h:64
int tesseract::ColSegment::get_num_table_cells ( ) const
inline

Definition at line 76 of file tablefind.h.

76  {
77  return num_table_cells_;
78  }
int tesseract::ColSegment::get_num_text_cells ( ) const
inline

Definition at line 85 of file tablefind.h.

85  {
86  return num_text_cells_;
87  }
void tesseract::ColSegment::InsertBox ( const TBOX other)

Definition at line 2156 of file tablefind.cpp.

2156  {
2157  bounding_box_ = bounding_box_.bounding_union(other);
2158 }
TBOX bounding_union(const TBOX &box) const
Definition: rect.cpp:130
void tesseract::ColSegment::set_bottom ( int  y)
inline

Definition at line 60 of file tablefind.h.

60  {
61  bounding_box_.set_bottom(y);
62  }
void set_bottom(int y)
Definition: rect.h:63
void tesseract::ColSegment::set_bounding_box ( const TBOX other)
inline

Definition at line 72 of file tablefind.h.

72  {
73  bounding_box_ = other;
74  }
void tesseract::ColSegment::set_left ( int  x)
inline

Definition at line 64 of file tablefind.h.

64  {
65  bounding_box_.set_left(x);
66  }
void set_left(int x)
Definition: rect.h:70
void tesseract::ColSegment::set_num_table_cells ( int  n)
inline

Definition at line 81 of file tablefind.h.

81  {
82  num_table_cells_ = n;
83  }
void tesseract::ColSegment::set_num_text_cells ( int  n)
inline

Definition at line 90 of file tablefind.h.

90  {
91  num_text_cells_ = n;
92  }
void tesseract::ColSegment::set_right ( int  x)
inline

Definition at line 68 of file tablefind.h.

68  {
69  bounding_box_.set_right(x);
70  }
void set_right(int x)
Definition: rect.h:77
void tesseract::ColSegment::set_top ( int  y)
inline

Definition at line 56 of file tablefind.h.

56  {
57  bounding_box_.set_top(y);
58  }
void set_top(int y)
Definition: rect.h:56
void tesseract::ColSegment::set_type ( )

Definition at line 2162 of file tablefind.cpp.

2162  {
2163  if (num_table_cells_ > kTableColumnThreshold * num_text_cells_)
2164  type_ = COL_TABLE;
2165  else if (num_text_cells_ > num_table_cells_)
2166  type_ = COL_TEXT;
2167  else
2168  type_ = COL_MIXED;
2169 }
const double kTableColumnThreshold
Definition: tablefind.cpp:91
ColSegType tesseract::ColSegment::type ( ) const
inline

Definition at line 94 of file tablefind.h.

94  {
95  return type_;
96  }

The documentation for this class was generated from the following files: