tesseract  4.0.0-1-g2a2b
tesseract::ColSegment Class Reference

#include <tablefind.h>

Inheritance diagram for tesseract::ColSegment:
ELIST_LINK

Public Member Functions

 ColSegment ()
 
 ~ColSegment ()=default
 
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 2063 of file tablefind.cpp.

2064  : ELIST_LINK(),
2065  num_table_cells_(0),
2066  num_text_cells_(0),
2067  type_(COL_UNKNOWN) {
2068 }
ELIST_LINK()
Definition: elst.h:92

◆ ~ColSegment()

tesseract::ColSegment::~ColSegment ( )
default

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 2071 of file tablefind.cpp.

2071  {
2072  const ScrollView::Color kBoxColors[PT_COUNT] = {
2077  };
2078  return kBoxColors[type_];
2079 }
Definition: capi.h:101

◆ 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 2082 of file tablefind.cpp.

2082  {
2083  bounding_box_ = bounding_box_.bounding_union(other);
2084 }
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:68

◆ 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:75

◆ 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:82

◆ 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:61

◆ set_type()

void tesseract::ColSegment::set_type ( )

Definition at line 2088 of file tablefind.cpp.

2088  {
2089  if (num_table_cells_ > kTableColumnThreshold * num_text_cells_)
2090  type_ = COL_TABLE;
2091  else if (num_text_cells_ > num_table_cells_)
2092  type_ = COL_TEXT;
2093  else
2094  type_ = COL_MIXED;
2095 }
const double kTableColumnThreshold
Definition: tablefind.cpp:89

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