tesseract  4.00.00dev
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

◆ ColSegment()

tesseract::ColSegment::ColSegment ( )

Definition at line 2066 of file tablefind.cpp.

2067  : ELIST_LINK(),
2068  num_table_cells_(0),
2069  num_text_cells_(0),
2070  type_(COL_UNKNOWN) {
2071 }
ELIST_LINK()
Definition: elst.h:92

◆ ~ColSegment()

tesseract::ColSegment::~ColSegment ( )

Definition at line 2072 of file tablefind.cpp.

2072  {
2073 }

Member Function Documentation

◆ bounding_box()

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

Definition at line 52 of file tablefind.h.

52  {
53  return bounding_box_;
54  }

◆ BoxColor()

ScrollView::Color tesseract::ColSegment::BoxColor ( ) const

Definition at line 2076 of file tablefind.cpp.

2076  {
2077  const ScrollView::Color kBoxColors[PT_COUNT] = {
2082  };
2083  return kBoxColors[type_];
2084 }
Definition: capi.h:95

◆ get_num_table_cells()

int tesseract::ColSegment::get_num_table_cells ( ) const
inline

Definition at line 76 of file tablefind.h.

76  {
77  return num_table_cells_;
78  }

◆ get_num_text_cells()

int tesseract::ColSegment::get_num_text_cells ( ) const
inline

Definition at line 85 of file tablefind.h.

85  {
86  return num_text_cells_;
87  }

◆ InsertBox()

void tesseract::ColSegment::InsertBox ( const TBOX other)

Definition at line 2087 of file tablefind.cpp.

2087  {
2088  bounding_box_ = bounding_box_.bounding_union(other);
2089 }
TBOX bounding_union(const TBOX &box) const
Definition: rect.cpp:129

◆ set_bottom()

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:64

◆ set_bounding_box()

void tesseract::ColSegment::set_bounding_box ( const TBOX other)
inline

Definition at line 72 of file tablefind.h.

72  {
73  bounding_box_ = other;
74  }

◆ set_left()

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:71

◆ set_num_table_cells()

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  }

◆ set_num_text_cells()

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  }

◆ set_right()

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:78

◆ set_top()

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:57

◆ set_type()

void tesseract::ColSegment::set_type ( )

Definition at line 2093 of file tablefind.cpp.

2093  {
2094  if (num_table_cells_ > kTableColumnThreshold * num_text_cells_)
2095  type_ = COL_TABLE;
2096  else if (num_text_cells_ > num_table_cells_)
2097  type_ = COL_TEXT;
2098  else
2099  type_ = COL_MIXED;
2100 }
const double kTableColumnThreshold
Definition: tablefind.cpp:92

◆ type()

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: