tesseract 4.1.1
Loading...
Searching...
No Matches
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 2062 of file tablefind.cpp.

2063 : ELIST_LINK(),
2064 num_table_cells_(0),
2065 num_text_cells_(0),
2066 type_(COL_UNKNOWN) {
2067}
@ COL_UNKNOWN
Definition: tablefind.h:31
ELIST_LINK()
Definition: elst.h:85

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

2070 {
2071 const ScrollView::Color kBoxColors[PT_COUNT] = {
2076 };
2077 return kBoxColors[type_];
2078}
@ PT_COUNT
Definition: capi.h:144

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

2081 {
2082 bounding_box_ = bounding_box_.bounding_union(other);
2083}
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 2087 of file tablefind.cpp.

2087 {
2088 if (num_table_cells_ > kTableColumnThreshold * num_text_cells_)
2089 type_ = COL_TABLE;
2090 else if (num_text_cells_ > num_table_cells_)
2091 type_ = COL_TEXT;
2092 else
2093 type_ = COL_MIXED;
2094}
@ COL_TEXT
Definition: tablefind.h:32
@ COL_MIXED
Definition: tablefind.h:34
@ COL_TABLE
Definition: tablefind.h:33
const double kTableColumnThreshold
Definition: tablefind.cpp:88

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