tesseract v5.3.3.20231005
tesseract::ColSegment Class Reference

#include <tablefind.h>

Inheritance diagram for tesseract::ColSegment:
tesseract::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 tesseract::ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Detailed Description

Definition at line 39 of file tablefind.h.

Constructor & Destructor Documentation

◆ ColSegment()

tesseract::ColSegment::ColSegment ( )

Definition at line 2111 of file tablefind.cpp.

2112 : ELIST_LINK(),
2113 num_table_cells_(0),
2114 num_text_cells_(0),
2115 type_(COL_UNKNOWN) {}
@ COL_UNKNOWN
Definition: tablefind.h:29

◆ ~ColSegment()

tesseract::ColSegment::~ColSegment ( )
default

Member Function Documentation

◆ bounding_box()

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

Definition at line 45 of file tablefind.h.

45 {
46 return bounding_box_;
47 }

◆ BoxColor()

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

Definition at line 2118 of file tablefind.cpp.

2118 {
2119 const ScrollView::Color kBoxColors[PT_COUNT] = {
2124 };
2125 return kBoxColors[type_];
2126}

◆ get_num_table_cells()

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

Definition at line 69 of file tablefind.h.

69 {
70 return num_table_cells_;
71 }

◆ get_num_text_cells()

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

Definition at line 78 of file tablefind.h.

78 {
79 return num_text_cells_;
80 }

◆ InsertBox()

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

Definition at line 2129 of file tablefind.cpp.

2129 {
2130 bounding_box_ = bounding_box_.bounding_union(other);
2131}
TBOX bounding_union(const TBOX &box) const
Definition: rect.cpp:128

◆ set_bottom()

void tesseract::ColSegment::set_bottom ( int  y)
inline

Definition at line 53 of file tablefind.h.

53 {
54 bounding_box_.set_bottom(y);
55 }
const double y
void set_bottom(int y)
Definition: rect.h:78

◆ set_bounding_box()

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

Definition at line 65 of file tablefind.h.

65 {
66 bounding_box_ = other;
67 }

◆ set_left()

void tesseract::ColSegment::set_left ( int  x)
inline

Definition at line 57 of file tablefind.h.

57 {
58 bounding_box_.set_left(x);
59 }
void set_left(int x)
Definition: rect.h:85

◆ set_num_table_cells()

void tesseract::ColSegment::set_num_table_cells ( int  n)
inline

Definition at line 74 of file tablefind.h.

74 {
75 num_table_cells_ = n;
76 }

◆ set_num_text_cells()

void tesseract::ColSegment::set_num_text_cells ( int  n)
inline

Definition at line 83 of file tablefind.h.

83 {
84 num_text_cells_ = n;
85 }

◆ set_right()

void tesseract::ColSegment::set_right ( int  x)
inline

Definition at line 61 of file tablefind.h.

61 {
62 bounding_box_.set_right(x);
63 }
void set_right(int x)
Definition: rect.h:92

◆ set_top()

void tesseract::ColSegment::set_top ( int  y)
inline

Definition at line 49 of file tablefind.h.

49 {
50 bounding_box_.set_top(y);
51 }
void set_top(int y)
Definition: rect.h:71

◆ set_type()

void tesseract::ColSegment::set_type ( )

Definition at line 2135 of file tablefind.cpp.

2135 {
2136 if (num_table_cells_ > kTableColumnThreshold * num_text_cells_) {
2137 type_ = COL_TABLE;
2138 } else if (num_text_cells_ > num_table_cells_) {
2139 type_ = COL_TEXT;
2140 } else {
2141 type_ = COL_MIXED;
2142 }
2143}
@ COL_TEXT
Definition: tablefind.h:29
@ COL_MIXED
Definition: tablefind.h:29
@ COL_TABLE
Definition: tablefind.h:29
const double kTableColumnThreshold
Definition: tablefind.cpp:89

◆ type()

ColSegType tesseract::ColSegment::type ( ) const
inline

Definition at line 87 of file tablefind.h.

87 {
88 return type_;
89 }

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