1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6
<title>tesseract: tesseract::ColPartition Class Reference</title>
8
<link href="tabs.css" rel="stylesheet" type="text/css"/>
9
<link href="doxygen.css" rel="stylesheet" type="text/css" />
10
<link href="navtree.css" rel="stylesheet" type="text/css"/>
11
<script type="text/javascript" src="jquery.js"></script>
12
<script type="text/javascript" src="resize.js"></script>
13
<script type="text/javascript" src="navtree.js"></script>
14
<script type="text/javascript">
15
$(document).ready(initResizable);
17
<link href="search/search.css" rel="stylesheet" type="text/css"/>
18
<script type="text/javascript" src="search/search.js"></script>
19
<script type="text/javascript">
20
$(document).ready(function() { searchBox.OnSelectItem(0); });
25
<div id="top"><!-- do not remove this div! -->
29
<table cellspacing="0" cellpadding="0">
31
<tr style="height: 56px;">
34
<td style="padding-left: 0.5em;">
35
<div id="projectname">tesseract
36
 <span id="projectnumber">3.03</span>
48
<!-- Generated by Doxygen 1.7.6.1 -->
49
<script type="text/javascript">
50
var searchBox = new SearchBox("searchBox", "search",false,'Search');
52
<div id="navrow1" class="tabs">
54
<li><a href="index.html"><span>Main Page</span></a></li>
55
<li><a href="pages.html"><span>Related Pages</span></a></li>
56
<li><a href="modules.html"><span>Modules</span></a></li>
57
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
58
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
59
<li><a href="files.html"><span>Files</span></a></li>
61
<div id="MSearchBox" class="MSearchBoxInactive">
63
<img id="MSearchSelect" src="search/mag_sel.png"
64
onmouseover="return searchBox.OnSearchSelectShow()"
65
onmouseout="return searchBox.OnSearchSelectHide()"
67
<input type="text" id="MSearchField" value="Search" accesskey="S"
68
onfocus="searchBox.OnSearchFieldFocus(true)"
69
onblur="searchBox.OnSearchFieldFocus(false)"
70
onkeyup="searchBox.OnSearchFieldChange(event)"/>
71
</span><span class="right">
72
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
78
<div id="navrow2" class="tabs2">
80
<li><a href="annotated.html"><span>Class List</span></a></li>
81
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
82
<li><a href="functions.html"><span>Class Members</span></a></li>
86
<div id="side-nav" class="ui-resizable side-nav-resizable">
88
<div id="nav-tree-contents">
91
<div id="splitbar" style="-moz-user-select:none;"
92
class="ui-resizable-handle">
95
<script type="text/javascript">
96
initNavTree('a00323.html','');
98
<div id="doc-content">
100
<div class="summary">
101
<a href="#pub-methods">Public Member Functions</a> |
102
<a href="#pub-static-methods">Static Public Member Functions</a> </div>
103
<div class="headertitle">
104
<div class="title">tesseract::ColPartition Class Reference</div> </div>
106
<div class="contents">
107
<!-- doxytag: class="tesseract::ColPartition" --><!-- doxytag: inherits="ELIST2_LINK" -->
108
<p><code>#include <<a class="el" href="a01101_source.html">colpartition.h</a>></code></p>
109
<div class="dynheader">
110
Inheritance diagram for tesseract::ColPartition:</div>
111
<div class="dyncontent">
113
<img src="a00323.png" usemap="#tesseract::ColPartition_map" alt=""/>
114
<map id="tesseract::ColPartition_map" name="tesseract::ColPartition_map">
115
<area href="a00367.html" alt="ELIST2_LINK" shape="rect" coords="0,0,134,24"/>
119
<p><a href="a01888.html">List of all members.</a></p>
120
<table class="memberdecls">
121
<tr><td colspan="2"><h2><a name="pub-methods"></a>
122
Public Member Functions</h2></td></tr>
123
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a> ()</td></tr>
124
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a9d28f4df6819fb146c1cddcd8c8491ae">ColPartition</a> (<a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> <a class="el" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>, const <a class="el" href="a00409.html">ICOORD</a> &vertical)</td></tr>
125
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aaf6b839117d261e594cc3418117cf64c">~ColPartition</a> ()</td></tr>
126
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00592.html">TBOX</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aeb52b4505d6766abfd0a2a3ce92a6596">bounding_box</a> () const </td></tr>
127
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a9890069a7855a61403f315444d2cd917">left_margin</a> () const </td></tr>
128
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4e520240723057ceeeb6c58972cca743">set_left_margin</a> (int margin)</td></tr>
129
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a07fd7ed32fdb14f773374d45c4ef8a90">right_margin</a> () const </td></tr>
130
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a34751cfa30b22b7bc405334843682cf4">set_right_margin</a> (int margin)</td></tr>
131
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a3d4e0280ce16c899b22ecb5741c7f4db">median_top</a> () const </td></tr>
132
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a9f0978c738e29da8c7474beb0024a62f">median_bottom</a> () const </td></tr>
133
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a74ee9a13d1b383a8550bfdfbc2c58eab">median_left</a> () const </td></tr>
134
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a61a0716cd755a616b0d967ae51c02251">median_right</a> () const </td></tr>
135
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a2ede8f204ed66939a0c4352657da6c94">median_size</a> () const </td></tr>
136
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ae0e571d982e596e62bf19e69d2442d52">set_median_size</a> (int size)</td></tr>
137
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ae6dbcc0f37246998a114bbe2432d1969">median_width</a> () const </td></tr>
138
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a69f66c8d14ded7a4893b7c99cb4c87c2">set_median_width</a> (int width)</td></tr>
139
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a> () const </td></tr>
140
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a67554d4553f198980b504091557442c7">set_blob_type</a> (<a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> t)</td></tr>
141
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a> () const </td></tr>
142
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aff449be10b9bb6e480b65cd1042e38e4">set_flow</a> (<a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> f)</td></tr>
143
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acaadf59a14518e62356f27786d63ae42">good_blob_score</a> () const </td></tr>
144
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0bd194403074c23e54e840c6a5d7214b">good_width</a> () const </td></tr>
145
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0ddb453820cf0860bef4a27ed649e2b0">good_column</a> () const </td></tr>
146
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abd6ba69b1f29c267933378d801477857">left_key_tab</a> () const </td></tr>
147
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a05a26aa4023ea05c8d243cb66561ea89">left_key</a> () const </td></tr>
148
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a46af5fe18c2f7142ae9e900a62b1a3d2">right_key_tab</a> () const </td></tr>
149
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#af8dc1730e816c82cf3007943dc70a363">right_key</a> () const </td></tr>
150
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> () const </td></tr>
151
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a9fcf07be83840289187d6358ee752a46">set_type</a> (<a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> t)</td></tr>
152
<tr><td class="memItemLeft" align="right" valign="top">BLOBNBOX_CLIST * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a3fc2dd797ede7a62546b2565811e9ce0">boxes</a> ()</td></tr>
153
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a5632ec24bcc7483eb943a325a73c47dc">boxes_count</a> () const </td></tr>
154
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a8a60c7f2c817055b9331028495cb25b1">set_vertical</a> (const <a class="el" href="a00409.html">ICOORD</a> &v)</td></tr>
155
<tr><td class="memItemLeft" align="right" valign="top">ColPartition_CLIST * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a30fcadc2cf28369bb4634988ace3fd5a">upper_partners</a> ()</td></tr>
156
<tr><td class="memItemLeft" align="right" valign="top">ColPartition_CLIST * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abe20d8e0d6b3a347f3b9d4e43023fec4">lower_partners</a> ()</td></tr>
157
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a45dd9aed3c27b47c64dd01dd35b81b95">set_working_set</a> (<a class="el" href="a00658.html">WorkingPartSet</a> *working_set)</td></tr>
158
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abe3352de42a4d2f39a5edac9a2105403">block_owned</a> () const </td></tr>
159
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ae8aad6eec822b60c3387627910989270">set_block_owned</a> (bool owned)</td></tr>
160
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa5e088aff13b0c427a9b984b3be7a4b5">desperately_merged</a> () const </td></tr>
161
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00325.html">ColPartitionSet</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a933e3f4465500ce46002ddaeab29a37c">column_set</a> () const </td></tr>
162
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a2d324bc11a9d4a3bf1449dc8005cd7d4">set_side_step</a> (int step)</td></tr>
163
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a01e366848d0b2f4ee921124f32cc63b3">bottom_spacing</a> () const </td></tr>
164
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acb549b8ad0b5015282257086daa89b3f">set_bottom_spacing</a> (int spacing)</td></tr>
165
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aaa8e68fc867682b5e496103fdfea55bf">top_spacing</a> () const </td></tr>
166
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#adfd69195728ae38f067ad536c4290e9c">set_top_spacing</a> (int spacing)</td></tr>
167
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abc55e0535959583318b4ce0271c85da2">set_table_type</a> ()</td></tr>
168
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a548b8797ceca6d820370cabe0711c808">clear_table_type</a> ()</td></tr>
169
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a40132dd64a9e916ca809b9494e1a5cdd">inside_table_column</a> ()</td></tr>
170
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a99763d5dc4eee42bb6142ffc2ddae1de">set_inside_table_column</a> (bool val)</td></tr>
171
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4df588400a880c9ac54eea8d1d7c28fb">nearest_neighbor_above</a> () const </td></tr>
172
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a5b00935a33d05ca217802b4d7591b1a2">set_nearest_neighbor_above</a> (<a class="el" href="a00323.html">ColPartition</a> *part)</td></tr>
173
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4eac60eb833ebb548ff2409c5999753f">nearest_neighbor_below</a> () const </td></tr>
174
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a6bb36d2ee748af0b77c8b2742ef5741a">set_nearest_neighbor_below</a> (<a class="el" href="a00323.html">ColPartition</a> *part)</td></tr>
175
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0ec12f1a3ec7b885749c16a798b3c794">space_above</a> () const </td></tr>
176
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a83c96bfabcdbf1d17a676a614a43337f">set_space_above</a> (int space)</td></tr>
177
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a46abe5ef4b5224d671c50d1de5ac985b">space_below</a> () const </td></tr>
178
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ad2083c18299f4e6850ca4d5d6ba9c83d">set_space_below</a> (int space)</td></tr>
179
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4c55a12d96d51a9710edc292c1946ca1">space_to_left</a> () const </td></tr>
180
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0de8ea9569a2b819639e3c69654fbe1d">set_space_to_left</a> (int space)</td></tr>
181
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a2e061b11b010ed6ee0382300f423735c">space_to_right</a> () const </td></tr>
182
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa6bbfdc1a1f7c0384225c8691e27613a">set_space_to_right</a> (int space)</td></tr>
183
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00831.html#a458fe97f82495945f8071bb3c18d1783">uinT8</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a944cdc529d0028111080627854c8bbc0">color1</a> ()</td></tr>
184
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00831.html#a458fe97f82495945f8071bb3c18d1783">uinT8</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4b52103bab1483c16849f0ac8666a9fe">color2</a> ()</td></tr>
185
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a> () const </td></tr>
186
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a9d675a150a71185ddf17c23ae52c568a">set_owns_blobs</a> (bool <a class="el" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>)</td></tr>
187
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a> () const </td></tr>
188
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4c635a35332c62bcc9c62b0f46e403cd">MedianY</a> () const </td></tr>
189
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#add960a03f31697fffec9449db86a825d">MidX</a> () const </td></tr>
190
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac48d211f853e26daced218323544b393">SortKey</a> (int x, int y) const </td></tr>
191
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">XAtY</a> (int sort_key, int y) const </td></tr>
192
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac45a47a9427bf943acba1c0ae7d8ed0b">KeyWidth</a> (int <a class="el" href="a00323.html#a05a26aa4023ea05c8d243cb66561ea89">left_key</a>, int <a class="el" href="a00323.html#af8dc1730e816c82cf3007943dc70a363">right_key</a>) const </td></tr>
193
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a74b26d9aa211f39f58fe9b6c60f324eb">ColumnWidth</a> () const </td></tr>
194
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a> () const </td></tr>
195
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a> () const </td></tr>
196
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">LeftAtY</a> (int y) const </td></tr>
197
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">RightAtY</a> (int y) const </td></tr>
198
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac851e3fbb5932b448969ce4e3bd7f471">IsLeftOf</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
199
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac7729e02ee4765d7612a0ec045681512">ColumnContains</a> (int x, int y) const </td></tr>
200
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa1c839940b58f4e6c3dbfa71294fff47">IsEmpty</a> () const </td></tr>
201
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac34862007d633ee3d726492150e8c672">IsSingleton</a> () const </td></tr>
202
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a43b5ff6a41c8f72876ca2d2c9683a2e6">HOverlaps</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
203
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#af57cf2b0dd0f197b1d48ad670eb0c8fc">VOverlaps</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
204
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4f7962f226fc6e687a5dfff0f9e40e94">VCoreOverlap</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
205
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#adbe1f191ede26132fc0437dfd969f2b2">HCoreOverlap</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
206
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa1eda3b89ee0c745279bbb8911db00b6">VSignificantCoreOverlap</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
207
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a975eb2892ed042fcfe94dc506d5f4c5b">WithinSameMargins</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
208
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a774f9c6444621a78264fa2a2a401cf9a">TypesMatch</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
209
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">IsLineType</a> () const </td></tr>
210
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0ae19652d302dcc8bfd9cab1bed18770">IsImageType</a> () const </td></tr>
211
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aaeb1d34b6b937a9d028f06562c985bd5">IsTextType</a> () const </td></tr>
212
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a13f2518ad00152d63cce288bbbe66d10">IsPulloutType</a> () const </td></tr>
213
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a> () const </td></tr>
214
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4d59387e0ab7f94339b438954d5f1492">IsHorizontalType</a> () const </td></tr>
215
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a186886f273a6120362badb64ae4d79ce">IsUnMergeableType</a> () const </td></tr>
216
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a75d609470c2e72b7ff7163d29dd5e8ec">IsVerticalLine</a> () const </td></tr>
217
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a052bafacd4995721da746930d2df0dd2">IsHorizontalLine</a> () const </td></tr>
218
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a636e7965ba55518f4e54a75a4a6ee1fd">AddBox</a> (<a class="el" href="a00279.html">BLOBNBOX</a> *box)</td></tr>
219
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aef96e5e328fbc0a20e267f820b6376c0">RemoveBox</a> (<a class="el" href="a00279.html">BLOBNBOX</a> *box)</td></tr>
220
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00279.html">BLOBNBOX</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0c2b7eaa5daff22412a5931534e8c804">BiggestBox</a> ()</td></tr>
221
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00592.html">TBOX</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a27b24bf50ade80dcd1b25f6630f3a298">BoundsWithoutBox</a> (<a class="el" href="a00279.html">BLOBNBOX</a> *box)</td></tr>
222
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa6dd9388e18a33fc48e6410e214e1d17">ClaimBoxes</a> ()</td></tr>
223
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a00ada2372a982efadbd4fb6da128bbb3">DisownBoxes</a> ()</td></tr>
224
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a7601c6b9fa22be42ca11e815c46a541a">DisownBoxesNoAssert</a> ()</td></tr>
225
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a7d58daab4baf2cd8166b1e931e1ffad4">DeleteBoxes</a> ()</td></tr>
226
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a77e212fc8da6ee21a817291c2180e2ad">ReflectInYAxis</a> ()</td></tr>
227
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#affa76b0b726f75d996a9e5dbe8b3e408">IsLegal</a> ()</td></tr>
228
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a75d8f8d4384f5bdb51c2c9e58f6677d3">MatchingColumns</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
229
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a43bbac4acbcc68b1998f0c92ca17be26">MatchingTextColor</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
230
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a5da7ad2aed53f88b06f60f044796d426">MatchingSizes</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
231
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acd5a7e99cb64ca351d6defeb0b650979">ConfirmNoTabViolation</a> (const <a class="el" href="a00323.html">ColPartition</a> &other) const </td></tr>
232
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a254db121f880ac20406f454045dc9780">MatchingStrokeWidth</a> (const <a class="el" href="a00323.html">ColPartition</a> &other, double fractional_tolerance, double constant_tolerance) const </td></tr>
233
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a050a14aa4fa9b11f90e058ca242c4fcf">OKDiacriticMerge</a> (const <a class="el" href="a00323.html">ColPartition</a> &candidate, bool debug) const </td></tr>
234
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a770d020fe98100499e1a1bedfca9b1fc">SetLeftTab</a> (const <a class="el" href="a00590.html">TabVector</a> *tab_vector)</td></tr>
235
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a426461a98a3feccd03ba68894dc8d4d2">SetRightTab</a> (const <a class="el" href="a00590.html">TabVector</a> *tab_vector)</td></tr>
236
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aff9a74526321b24bbafcdbc359f9d161">CopyLeftTab</a> (const <a class="el" href="a00323.html">ColPartition</a> &src, bool take_box)</td></tr>
237
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ab4ec7202d19f98517fd32bce150ebbb0">CopyRightTab</a> (const <a class="el" href="a00323.html">ColPartition</a> &src, bool take_box)</td></tr>
238
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a206e0152232376b343553af9cdbd8ad4">LeftBlobRule</a> () const </td></tr>
239
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a50177ba646b8b4b4a73ddc43d3b7a18a">RightBlobRule</a> () const </td></tr>
240
<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa92a42d781e779aac8cd593f8fd7d498">SpecialBlobsDensity</a> (const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> <a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>) const </td></tr>
241
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a2a9ba24fa7f6735045a09857d664136f">SpecialBlobsCount</a> (const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> <a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>)</td></tr>
242
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0b0967771316dc653ecc9af44c56dbd4">SetSpecialBlobsDensity</a> (const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> <a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>, const float density)</td></tr>
243
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa348155cfa970382ea67c69ac2a95376">ComputeSpecialBlobsDensity</a> ()</td></tr>
244
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aefd307b4da338376d4cadc4a2f424b60">AddPartner</a> (bool upper, <a class="el" href="a00323.html">ColPartition</a> *partner)</td></tr>
245
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa53b48378daeaaec5ca59388a18cbfe5">RemovePartner</a> (bool upper, <a class="el" href="a00323.html">ColPartition</a> *partner)</td></tr>
246
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a> (bool upper)</td></tr>
247
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aedb906fb73709c79d702f0f95a85b300">Absorb</a> (<a class="el" href="a00323.html">ColPartition</a> *other, <a class="el" href="a01265.html#add06f170e88dcbac90a80ff20c42cc0a">WidthCallback</a> *cb)</td></tr>
248
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a8ea7f1476b335624a5e11985491dc589">OKMergeOverlap</a> (const <a class="el" href="a00323.html">ColPartition</a> &merge1, const <a class="el" href="a00323.html">ColPartition</a> &merge2, int ok_box_overlap, bool debug)</td></tr>
249
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00279.html">BLOBNBOX</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a665821774d2bfdd59db589683a4cf87b">OverlapSplitBlob</a> (const <a class="el" href="a00592.html">TBOX</a> &box)</td></tr>
250
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ab629b53eb1420cf5947f3c003d2d4761">SplitAtBlob</a> (<a class="el" href="a00279.html">BLOBNBOX</a> *split_blob)</td></tr>
251
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a33427fb9a563253c69e0806115fb2a4b">SplitAt</a> (int split_x)</td></tr>
252
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a> ()</td></tr>
253
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a85049818069c9a89322235b286b9915d">CountOverlappingBoxes</a> (const <a class="el" href="a00592.html">TBOX</a> &box)</td></tr>
254
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#acf8233abc2eb9a0b9cc6f258ddd1d04d">SetPartitionType</a> (int resolution, <a class="el" href="a00325.html">ColPartitionSet</a> *columns)</td></tr>
255
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a5a46de5acb31b0aec90ab89933c69bc9">PartitionType</a> (<a class="el" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06a">ColumnSpanningType</a> <a class="el" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a>) const </td></tr>
256
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a609bdd544b011d0b4fd46609843a9088">ColumnRange</a> (int resolution, <a class="el" href="a00325.html">ColPartitionSet</a> *columns, int *first_col, int *last_col)</td></tr>
257
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a8ea991fccc4013feadaa1cc2b8f35051">SetColumnGoodness</a> (<a class="el" href="a01265.html#add06f170e88dcbac90a80ff20c42cc0a">WidthCallback</a> *cb)</td></tr>
258
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac793c818de7d472b7d45b4c2a6b9c11e">MarkAsLeaderIfMonospaced</a> ()</td></tr>
259
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a4ce776ccc6a6222ccc7abeece8e1c7d5">SetRegionAndFlowTypesFromProjectionValue</a> (int value)</td></tr>
260
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#abfa13ecb273fa29166a663daf82a2254">SetBlobTypes</a> ()</td></tr>
261
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a65b2878a089ecff1dc1e221ed3189ddc">HasGoodBaseline</a> ()</td></tr>
262
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a36da7f621853cc3f769c581ad5997965">AddToWorkingSet</a> (const <a class="el" href="a00409.html">ICOORD</a> &bleft, const <a class="el" href="a00409.html">ICOORD</a> &tright, int resolution, ColPartition_LIST *used_parts, WorkingPartSet_LIST *working_set)</td></tr>
263
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00628.html">TO_ROW</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a6ce139019daba1e444a3be681425cf9a">MakeToRow</a> ()</td></tr>
264
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a70116af39898d43ca19ecb189faccfa1">ShallowCopy</a> () const </td></tr>
265
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a3077eb7392f7d2ab1de2f93579fda55d">CopyButDontOwnBlobs</a> ()</td></tr>
266
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00532.html#a100504544a5423a94222149ee9ed0fe8">ScrollView::Color</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a17666474219e537a71727f818e6b7c88">BoxColor</a> () const </td></tr>
267
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a> () const </td></tr>
268
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#af07ad7867464972ce64aa421af34dada">PrintColors</a> ()</td></tr>
269
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a63928eac4e3026c21296da8c29eee854">SmoothPartnerRun</a> (int working_set_count)</td></tr>
270
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a008e1c29b009f6d8f24ebf022bcc63b3">RefinePartners</a> (<a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> <a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>, bool get_desparate, <a class="el" href="a00324.html">ColPartitionGrid</a> *grid)</td></tr>
271
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa05fd8e272964b349436a729acf3fc64">IsInSameColumnAs</a> (const <a class="el" href="a00323.html">ColPartition</a> &part) const </td></tr>
272
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#adeffeaa147be84acfa0165e923f7b591">set_first_column</a> (int column)</td></tr>
273
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#ac3a311afb64d7c68f6f7a00a706d58d0">set_last_column</a> (int column)</td></tr>
274
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
275
Static Public Member Functions</h2></td></tr>
276
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a446ed1c0731f3fb8d7199b45750c6c5c">MakeLinePartition</a> (<a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> <a class="el" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>, const <a class="el" href="a00409.html">ICOORD</a> &vertical, int left, int bottom, int right, int top)</td></tr>
277
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a1ed526e850e85fba36bd2dcf2168982a">FakePartition</a> (const <a class="el" href="a00592.html">TBOX</a> &box, <a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> block_type, <a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> <a class="el" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>, <a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> <a class="el" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a>)</td></tr>
278
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00323.html">ColPartition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a2baab68bca77728c6b50521131dc9b1a">MakeBigPartition</a> (<a class="el" href="a00279.html">BLOBNBOX</a> *box, ColPartition_LIST *big_part_list)</td></tr>
279
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a1310c3b034870bdd2eabff87adbb702f">TypesMatch</a> (<a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> type1, <a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> type2)</td></tr>
280
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#aa7be118d2184949aa30f824932f04586">TypesSimilar</a> (<a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> type1, <a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> type2)</td></tr>
281
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a0f9db819e6d23fda5fe1af0e2e84b2d3">LineSpacingBlocks</a> (const <a class="el" href="a00409.html">ICOORD</a> &bleft, const <a class="el" href="a00409.html">ICOORD</a> &tright, int resolution, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts, BLOCK_LIST *completed_blocks, TO_BLOCK_LIST *to_blocks)</td></tr>
282
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00627.html">TO_BLOCK</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a275ef8548fa5a0af39e84d05dd383ab8">MakeBlock</a> (const <a class="el" href="a00409.html">ICOORD</a> &bleft, const <a class="el" href="a00409.html">ICOORD</a> &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts)</td></tr>
283
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00627.html">TO_BLOCK</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00323.html#a703b722077cd4fb5fc8c1c1212824b31">MakeVerticalTextBlock</a> (const <a class="el" href="a00409.html">ICOORD</a> &bleft, const <a class="el" href="a00409.html">ICOORD</a> &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts)</td></tr>
285
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
286
<div class="textblock"><p><a class="el" href="a00323.html">ColPartition</a> is a partition of a horizontal slice of the page. It starts out as a collection of blobs at a particular y-coord in the grid, but ends up (after merging and uniquing) as an approximate text line. ColPartitions are also used to hold a partitioning of the page into columns, each representing one column. Although a <a class="el" href="a00323.html">ColPartition</a> applies to a given y-coordinate range, eventually, a <a class="el" href="a00325.html">ColPartitionSet</a> of ColPartitions emerges, which represents the columns over a wide y-coordinate range. </p>
288
<p>Definition at line <a class="el" href="a01101_source.html#l00067">67</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
289
</div><hr/><h2>Constructor & Destructor Documentation</h2>
290
<a class="anchor" id="ac9838a760a9e246080953da4af85091d"></a><!-- doxytag: member="tesseract::ColPartition::ColPartition" ref="ac9838a760a9e246080953da4af85091d" args="()" -->
291
<div class="memitem">
292
<div class="memproto">
293
<table class="memname">
295
<td class="memname"><a class="el" href="a00323.html#ac9838a760a9e246080953da4af85091d">tesseract::ColPartition::ColPartition</a> </td>
297
<td class="paramname"></td><td>)</td>
298
<td><code> [inline]</code></td>
304
<p>Definition at line <a class="el" href="a01101_source.html#l00069">69</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
305
<div class="fragment"><pre class="fragment"> {
306
<span class="comment">// This empty constructor is here only so that the class can be ELISTIZED.</span>
307
<span class="comment">// TODO(rays) change deep_copy in elst.h line 955 to take a callback copier</span>
308
<span class="comment">// and eliminate CLASSNAME##_copier.</span>
313
<a class="anchor" id="a9d28f4df6819fb146c1cddcd8c8491ae"></a><!-- doxytag: member="tesseract::ColPartition::ColPartition" ref="a9d28f4df6819fb146c1cddcd8c8491ae" args="(BlobRegionType blob_type, const ICOORD &vertical)" -->
314
<div class="memitem">
315
<div class="memproto">
316
<table class="memname">
318
<td class="memname"><a class="el" href="a00323.html#ac9838a760a9e246080953da4af85091d">tesseract::ColPartition::ColPartition</a> </td>
320
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
321
<td class="paramname"><em>blob_type</em>, </td>
324
<td class="paramkey"></td>
326
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
327
<td class="paramname"><em>vertical</em> </td>
337
<dl class="params"><dt><b>Parameters:</b></dt><dd>
338
<table class="params">
339
<tr><td class="paramname">blob_type</td><td>is the blob_region_type_ of the blobs in this partition. </td></tr>
340
<tr><td class="paramname">vertical</td><td>is the direction of logical vertical on the possibly skewed image. </td></tr>
345
<p>Definition at line <a class="el" href="a01100_source.html#l00088">88</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
346
<div class="fragment"><pre class="fragment"> : left_margin_(-<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>), right_margin_(<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>),
347
median_bottom_(<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>), median_top_(-<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>), median_size_(0),
348
median_left_(<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>), median_right_(-<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>), median_width_(0),
349
blob_type_(<a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>), flow_(<a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a745b15b1c990fa88c0712c50c5cd2202">BTFT_NONE</a>), good_blob_score_(0),
350
good_width_(<span class="keyword">false</span>), good_column_(<span class="keyword">false</span>),
351
left_key_tab_(<span class="keyword">false</span>), right_key_tab_(<span class="keyword">false</span>),
352
left_key_(0), right_key_(0), type_(<a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fac0b3cd1b4592e1a3c609ff4273fb505b">PT_UNKNOWN</a>), vertical_(vertical),
353
working_set_(NULL), last_add_was_vertical_(<span class="keyword">false</span>), block_owned_(<span class="keyword">false</span>),
354
desperately_merged_(<span class="keyword">false</span>),
355
first_column_(-1), last_column_(-1), column_set_(NULL),
356
side_step_(0), top_spacing_(0), bottom_spacing_(0),
357
type_before_table_(<a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fac0b3cd1b4592e1a3c609ff4273fb505b">PT_UNKNOWN</a>), inside_table_column_(<span class="keyword">false</span>),
358
nearest_neighbor_above_(NULL), nearest_neighbor_below_(NULL),
359
space_above_(0), space_below_(0), space_to_left_(0), space_to_right_(0),
360
owns_blobs_(<span class="keyword">true</span>) {
361
memset(special_blobs_densities_, 0, <span class="keyword">sizeof</span>(special_blobs_densities_));
366
<a class="anchor" id="aaf6b839117d261e594cc3418117cf64c"></a><!-- doxytag: member="tesseract::ColPartition::~ColPartition" ref="aaf6b839117d261e594cc3418117cf64c" args="()" -->
367
<div class="memitem">
368
<div class="memproto">
369
<table class="memname">
371
<td class="memname"><a class="el" href="a00323.html#aaf6b839117d261e594cc3418117cf64c">tesseract::ColPartition::~ColPartition</a> </td>
373
<td class="paramname"></td><td>)</td>
380
<p>Definition at line <a class="el" href="a01100_source.html#l00150">150</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
381
<div class="fragment"><pre class="fragment"> {
382
<span class="comment">// Remove this as a partner of all partners, as we don't want them</span>
383
<span class="comment">// referring to a deleted object.</span>
384
ColPartition_C_IT it(&upper_partners_);
385
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
386
it.data()->RemovePartner(<span class="keyword">false</span>, <span class="keyword">this</span>);
388
it.set_to_list(&lower_partners_);
389
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
390
it.data()->RemovePartner(<span class="keyword">true</span>, <span class="keyword">this</span>);
396
<hr/><h2>Member Function Documentation</h2>
397
<a class="anchor" id="aedb906fb73709c79d702f0f95a85b300"></a><!-- doxytag: member="tesseract::ColPartition::Absorb" ref="aedb906fb73709c79d702f0f95a85b300" args="(ColPartition *other, WidthCallback *cb)" -->
398
<div class="memitem">
399
<div class="memproto">
400
<table class="memname">
402
<td class="memname">void <a class="el" href="a00323.html#aedb906fb73709c79d702f0f95a85b300">tesseract::ColPartition::Absorb</a> </td>
404
<td class="paramtype"><a class="el" href="a00323.html">ColPartition</a> * </td>
405
<td class="paramname"><em>other</em>, </td>
408
<td class="paramkey"></td>
410
<td class="paramtype"><a class="el" href="a01265.html#add06f170e88dcbac90a80ff20c42cc0a">WidthCallback</a> * </td>
411
<td class="paramname"><em>cb</em> </td>
422
<p>Definition at line <a class="el" href="a01100_source.html#l00634">634</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
423
<div class="fragment"><pre class="fragment"> {
424
<span class="comment">// The result has to either own all of the blobs or none of them.</span>
425
<span class="comment">// Verify the flag is consisent.</span>
426
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>() == other->owns_blobs());
427
<span class="comment">// TODO(nbeato): check owns_blobs better. Right now owns_blobs</span>
428
<span class="comment">// should always be true when this is called. So there is no issues.</span>
429
<span class="keywordflow">if</span> (<a class="code" href="a00257.html#a357ff9e1d9bac2b1d88fb0d335fa7f3e">TabFind::WithinTestRegion</a>(2, bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(),
430
bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>()) ||
431
<a class="code" href="a00257.html#a357ff9e1d9bac2b1d88fb0d335fa7f3e">TabFind::WithinTestRegion</a>(2, other->bounding_box_.left(),
432
other->bounding_box_.bottom())) {
433
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Merging:"</span>);
434
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
438
<span class="comment">// Update the special_blobs_densities_.</span>
439
memset(special_blobs_densities_, 0, <span class="keyword">sizeof</span>(special_blobs_densities_));
440
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> = 0; <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> < <a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8caceba184627df3dabc8f3e3f2867c4eff">BSTT_COUNT</a>; ++<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>) {
441
<span class="keywordtype">int</span> w1 = boxes_.length(), w2 = other->boxes_.length();
442
<span class="keywordtype">float</span> new_val = special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>] * w1 +
443
other->special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>] * w2;
444
<span class="keywordflow">if</span> (!w1 || !w2) {
445
special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>] = new_val / (w1 + w2);
449
<span class="comment">// Merge the two sorted lists.</span>
450
BLOBNBOX_C_IT it(&boxes_);
451
BLOBNBOX_C_IT it2(&other->boxes_);
452
<span class="keywordflow">for</span> (; !it2.empty(); it2.forward()) {
453
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox2 = it2.extract();
454
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* prev_owner = bbox2-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>();
455
<span class="keywordflow">if</span> (prev_owner != other && prev_owner != NULL) {
456
<span class="comment">// A blob on other's list is owned by someone else; let them have it.</span>
457
<span class="keywordflow">continue</span>;
459
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(prev_owner == other || prev_owner == NULL);
460
<span class="keywordflow">if</span> (prev_owner == other)
461
bbox2-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(<span class="keyword">this</span>);
462
it.add_to_end(bbox2);
464
left_margin_ = MIN(left_margin_, other->left_margin_);
465
right_margin_ = MAX(right_margin_, other->right_margin_);
466
<span class="keywordflow">if</span> (other->left_key_ < left_key_) {
467
left_key_ = other->left_key_;
468
left_key_tab_ = other->left_key_tab_;
470
<span class="keywordflow">if</span> (other->right_key_ > right_key_) {
471
right_key_ = other->right_key_;
472
right_key_tab_ = other->right_key_tab_;
474
<span class="comment">// Combine the flow and blob_type in a sensible way.</span>
475
<span class="comment">// Dominant flows stay.</span>
476
<span class="keywordflow">if</span> (!<a class="code" href="a00728.html#a8157ecf7fd234474a816126c75012952">DominatesInMerge</a>(flow_, other->flow_)) {
477
flow_ = other->flow_;
478
blob_type_ = other->blob_type_;
480
<a class="code" href="a00323.html#abfa13ecb273fa29166a663daf82a2254">SetBlobTypes</a>();
481
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>()) {
482
boxes_.sort(SortByBoxBottom<BLOBNBOX>);
483
last_add_was_vertical_ = <span class="keyword">true</span>;
484
} <span class="keywordflow">else</span> {
485
boxes_.sort(SortByBoxLeft<BLOBNBOX>);
486
last_add_was_vertical_ = <span class="keyword">false</span>;
488
<a class="code" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a>();
489
<span class="comment">// Fix partner lists. other is going away, so remove it as a</span>
490
<span class="comment">// partner of all its partners and add this in its place.</span>
491
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> upper = 0; upper < 2; ++upper) {
492
ColPartition_CLIST partners;
493
ColPartition_C_IT part_it(&partners);
494
part_it.add_list_after(upper ? &other->upper_partners_
495
: &other->lower_partners_);
496
<span class="keywordflow">for</span> (part_it.move_to_first(); !part_it.empty(); part_it.forward()) {
497
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* partner = part_it.extract();
498
partner->RemovePartner(!upper, other);
499
partner->RemovePartner(!upper, <span class="keyword">this</span>);
500
partner->AddPartner(!upper, <span class="keyword">this</span>);
503
<span class="keyword">delete</span> other;
504
<span class="keywordflow">if</span> (cb != NULL) {
505
<a class="code" href="a00323.html#a8ea991fccc4013feadaa1cc2b8f35051">SetColumnGoodness</a>(cb);
511
<a class="anchor" id="a636e7965ba55518f4e54a75a4a6ee1fd"></a><!-- doxytag: member="tesseract::ColPartition::AddBox" ref="a636e7965ba55518f4e54a75a4a6ee1fd" args="(BLOBNBOX *box)" -->
512
<div class="memitem">
513
<div class="memproto">
514
<table class="memname">
516
<td class="memname">void <a class="el" href="a00323.html#a636e7965ba55518f4e54a75a4a6ee1fd">tesseract::ColPartition::AddBox</a> </td>
518
<td class="paramtype"><a class="el" href="a00279.html">BLOBNBOX</a> * </td>
519
<td class="paramname"><em>box</em></td><td>)</td>
526
<p>Definition at line <a class="el" href="a01100_source.html#l00184">184</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
527
<div class="fragment"><pre class="fragment"> {
528
<a class="code" href="a00592.html">TBOX</a> box = bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
529
<span class="comment">// Update the partition limits.</span>
530
<span class="keywordflow">if</span> (boxes_.length() == 0) {
532
} <span class="keywordflow">else</span> {
533
bounding_box_ += box;
536
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>()) {
537
<span class="keywordflow">if</span> (!last_add_was_vertical_) {
538
boxes_.sort(SortByBoxBottom<BLOBNBOX>);
539
last_add_was_vertical_ = <span class="keyword">true</span>;
541
boxes_.add_sorted(SortByBoxBottom<BLOBNBOX>, <span class="keyword">true</span>, bbox);
542
} <span class="keywordflow">else</span> {
543
<span class="keywordflow">if</span> (last_add_was_vertical_) {
544
boxes_.sort(SortByBoxLeft<BLOBNBOX>);
545
last_add_was_vertical_ = <span class="keyword">false</span>;
547
boxes_.add_sorted(SortByBoxLeft<BLOBNBOX>, <span class="keyword">true</span>, bbox);
549
<span class="keywordflow">if</span> (!left_key_tab_)
550
left_key_ = <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>();
551
<span class="keywordflow">if</span> (!right_key_tab_)
552
right_key_ = <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>();
553
<span class="keywordflow">if</span> (<a class="code" href="a00257.html#a357ff9e1d9bac2b1d88fb0d335fa7f3e">TabFind::WithinTestRegion</a>(2, box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), box.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>()))
554
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Added box (%d,%d)->(%d,%d) left_blob_x_=%d, right_blob_x_ = %d\n"</span>,
555
box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), box.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(), box.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), box.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>(),
556
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>());
561
<a class="anchor" id="aefd307b4da338376d4cadc4a2f424b60"></a><!-- doxytag: member="tesseract::ColPartition::AddPartner" ref="aefd307b4da338376d4cadc4a2f424b60" args="(bool upper, ColPartition *partner)" -->
562
<div class="memitem">
563
<div class="memproto">
564
<table class="memname">
566
<td class="memname">void <a class="el" href="a00323.html#aefd307b4da338376d4cadc4a2f424b60">tesseract::ColPartition::AddPartner</a> </td>
568
<td class="paramtype">bool </td>
569
<td class="paramname"><em>upper</em>, </td>
572
<td class="paramkey"></td>
574
<td class="paramtype"><a class="el" href="a00323.html">ColPartition</a> * </td>
575
<td class="paramname"><em>partner</em> </td>
586
<p>Definition at line <a class="el" href="a01100_source.html#l00599">599</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
587
<div class="fragment"><pre class="fragment"> {
588
<span class="keywordflow">if</span> (upper) {
589
partner->lower_partners_.add_sorted(SortByBoxLeft<ColPartition>,
590
<span class="keyword">true</span>, <span class="keyword">this</span>);
591
upper_partners_.add_sorted(SortByBoxLeft<ColPartition>, <span class="keyword">true</span>, partner);
592
} <span class="keywordflow">else</span> {
593
partner->upper_partners_.add_sorted(SortByBoxLeft<ColPartition>,
594
<span class="keyword">true</span>, <span class="keyword">this</span>);
595
lower_partners_.add_sorted(SortByBoxLeft<ColPartition>, <span class="keyword">true</span>, partner);
601
<a class="anchor" id="a36da7f621853cc3f769c581ad5997965"></a><!-- doxytag: member="tesseract::ColPartition::AddToWorkingSet" ref="a36da7f621853cc3f769c581ad5997965" args="(const ICOORD &bleft, const ICOORD &tright, int resolution, ColPartition_LIST *used_parts, WorkingPartSet_LIST *working_set)" -->
602
<div class="memitem">
603
<div class="memproto">
604
<table class="memname">
606
<td class="memname">void <a class="el" href="a00323.html#a36da7f621853cc3f769c581ad5997965">tesseract::ColPartition::AddToWorkingSet</a> </td>
608
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
609
<td class="paramname"><em>bleft</em>, </td>
612
<td class="paramkey"></td>
614
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
615
<td class="paramname"><em>tright</em>, </td>
618
<td class="paramkey"></td>
620
<td class="paramtype">int </td>
621
<td class="paramname"><em>resolution</em>, </td>
624
<td class="paramkey"></td>
626
<td class="paramtype">ColPartition_LIST * </td>
627
<td class="paramname"><em>used_parts</em>, </td>
630
<td class="paramkey"></td>
632
<td class="paramtype">WorkingPartSet_LIST * </td>
633
<td class="paramname"><em>working_set</em> </td>
644
<p>Definition at line <a class="el" href="a01100_source.html#l01332">1332</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
645
<div class="fragment"><pre class="fragment"> {
646
<span class="keywordflow">if</span> (block_owned_)
647
<span class="keywordflow">return</span>; <span class="comment">// Done it already.</span>
648
block_owned_ = <span class="keyword">true</span>;
649
WorkingPartSet_IT it(working_sets);
650
<span class="comment">// If there is an upper partner use its working_set_ directly.</span>
651
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* partner = <a class="code" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a>(<span class="keyword">true</span>);
652
<span class="keywordflow">if</span> (partner != NULL && partner->working_set_ != NULL) {
653
working_set_ = partner->working_set_;
654
working_set_-><a class="code" href="a00658.html#a75288f5609d5095cee47ac92e3475608">AddPartition</a>(<span class="keyword">this</span>);
655
<span class="keywordflow">return</span>;
657
<span class="keywordflow">if</span> (partner != NULL && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
658
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Partition with partner has no working set!:"</span>);
659
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
662
<span class="comment">// Search for the column that the left edge fits in.</span>
663
WorkingPartSet* work_set = NULL;
665
<span class="keywordtype">int</span> col_index = 0;
666
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list() &&
667
col_index != first_column_;
668
it.forward(), ++col_index);
669
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a> >= 2) {
670
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Match is %s for:"</span>, (col_index & 1) ? <span class="stringliteral">"Real"</span> : <span class="stringliteral">"Between"</span>);
671
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
673
<span class="keywordflow">if</span> (it.cycled_list() && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
674
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Target column=%d, only had %d\n"</span>, first_column_, col_index);
676
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!it.cycled_list());
677
work_set = it.data();
678
<span class="comment">// If last_column_ != first_column, then we need to scoop up all blocks</span>
679
<span class="comment">// between here and the last_column_ and put back in work_set.</span>
680
<span class="keywordflow">if</span> (!it.cycled_list() && last_column_ != first_column_ && !<a class="code" href="a00323.html#a13f2518ad00152d63cce288bbbe66d10">IsPulloutType</a>()) {
681
<span class="comment">// Find the column that the right edge falls in.</span>
682
BLOCK_LIST completed_blocks;
683
TO_BLOCK_LIST to_blocks;
684
<span class="keywordflow">for</span> (; !it.cycled_list() && col_index <= last_column_;
685
it.forward(), ++col_index) {
686
WorkingPartSet* end_set = it.data();
687
end_set->ExtractCompletedBlocks(bleft, tright, resolution, used_parts,
688
&completed_blocks, &to_blocks);
690
work_set->InsertCompletedBlocks(&completed_blocks, &to_blocks);
692
working_set_ = work_set;
693
work_set-><a class="code" href="a00658.html#a75288f5609d5095cee47ac92e3475608">AddPartition</a>(<span class="keyword">this</span>);
698
<a class="anchor" id="a0c2b7eaa5daff22412a5931534e8c804"></a><!-- doxytag: member="tesseract::ColPartition::BiggestBox" ref="a0c2b7eaa5daff22412a5931534e8c804" args="()" -->
699
<div class="memitem">
700
<div class="memproto">
701
<table class="memname">
703
<td class="memname"><a class="el" href="a00279.html">BLOBNBOX</a> * <a class="el" href="a00323.html#a0c2b7eaa5daff22412a5931534e8c804">tesseract::ColPartition::BiggestBox</a> </td>
705
<td class="paramname"></td><td>)</td>
712
<p>Definition at line <a class="el" href="a01100_source.html#l00230">230</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
713
<div class="fragment"><pre class="fragment"> {
714
<a class="code" href="a00279.html">BLOBNBOX</a>* biggest = NULL;
715
BLOBNBOX_C_IT bb_it(&boxes_);
716
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
717
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = bb_it.data();
718
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>()) {
719
<span class="keywordflow">if</span> (biggest == NULL ||
720
bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>() > biggest-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>())
722
} <span class="keywordflow">else</span> {
723
<span class="keywordflow">if</span> (biggest == NULL ||
724
bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>() > biggest-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>())
728
<span class="keywordflow">return</span> biggest;
733
<a class="anchor" id="a644ec0c0a7bf20b9aca71b8413b2a87e"></a><!-- doxytag: member="tesseract::ColPartition::blob_type" ref="a644ec0c0a7bf20b9aca71b8413b2a87e" args="() const " -->
734
<div class="memitem">
735
<div class="memproto">
736
<table class="memname">
738
<td class="memname"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> <a class="el" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">tesseract::ColPartition::blob_type</a> </td>
740
<td class="paramname"></td><td>)</td>
741
<td> const<code> [inline]</code></td>
747
<p>Definition at line <a class="el" href="a01101_source.html#l00148">148</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
748
<div class="fragment"><pre class="fragment"> {
749
<span class="keywordflow">return</span> blob_type_;
754
<a class="anchor" id="abe3352de42a4d2f39a5edac9a2105403"></a><!-- doxytag: member="tesseract::ColPartition::block_owned" ref="abe3352de42a4d2f39a5edac9a2105403" args="() const " -->
755
<div class="memitem">
756
<div class="memproto">
757
<table class="memname">
759
<td class="memname">bool <a class="el" href="a00323.html#abe3352de42a4d2f39a5edac9a2105403">tesseract::ColPartition::block_owned</a> </td>
761
<td class="paramname"></td><td>)</td>
762
<td> const<code> [inline]</code></td>
768
<p>Definition at line <a class="el" href="a01101_source.html#l00205">205</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
769
<div class="fragment"><pre class="fragment"> {
770
<span class="keywordflow">return</span> block_owned_;
775
<a class="anchor" id="a01e366848d0b2f4ee921124f32cc63b3"></a><!-- doxytag: member="tesseract::ColPartition::bottom_spacing" ref="a01e366848d0b2f4ee921124f32cc63b3" args="() const " -->
776
<div class="memitem">
777
<div class="memproto">
778
<table class="memname">
780
<td class="memname">int <a class="el" href="a00323.html#a01e366848d0b2f4ee921124f32cc63b3">tesseract::ColPartition::bottom_spacing</a> </td>
782
<td class="paramname"></td><td>)</td>
783
<td> const<code> [inline]</code></td>
789
<p>Definition at line <a class="el" href="a01101_source.html#l00220">220</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
790
<div class="fragment"><pre class="fragment"> {
791
<span class="keywordflow">return</span> bottom_spacing_;
796
<a class="anchor" id="aeb52b4505d6766abfd0a2a3ce92a6596"></a><!-- doxytag: member="tesseract::ColPartition::bounding_box" ref="aeb52b4505d6766abfd0a2a3ce92a6596" args="() const " -->
797
<div class="memitem">
798
<div class="memproto">
799
<table class="memname">
801
<td class="memname">const <a class="el" href="a00592.html">TBOX</a>& <a class="el" href="a00323.html#aeb52b4505d6766abfd0a2a3ce92a6596">tesseract::ColPartition::bounding_box</a> </td>
803
<td class="paramname"></td><td>)</td>
804
<td> const<code> [inline]</code></td>
810
<p>Definition at line <a class="el" href="a01101_source.html#l00109">109</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
811
<div class="fragment"><pre class="fragment"> {
812
<span class="keywordflow">return</span> bounding_box_;
817
<a class="anchor" id="a27b24bf50ade80dcd1b25f6630f3a298"></a><!-- doxytag: member="tesseract::ColPartition::BoundsWithoutBox" ref="a27b24bf50ade80dcd1b25f6630f3a298" args="(BLOBNBOX *box)" -->
818
<div class="memitem">
819
<div class="memproto">
820
<table class="memname">
822
<td class="memname"><a class="el" href="a00592.html">TBOX</a> <a class="el" href="a00323.html#a27b24bf50ade80dcd1b25f6630f3a298">tesseract::ColPartition::BoundsWithoutBox</a> </td>
824
<td class="paramtype"><a class="el" href="a00279.html">BLOBNBOX</a> * </td>
825
<td class="paramname"><em>box</em></td><td>)</td>
832
<p>Definition at line <a class="el" href="a01100_source.html#l00249">249</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
833
<div class="fragment"><pre class="fragment"> {
834
<a class="code" href="a00592.html">TBOX</a> result;
835
BLOBNBOX_C_IT bb_it(&boxes_);
836
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
837
<span class="keywordflow">if</span> (box != bb_it.data()) {
838
result += bb_it.data()->bounding_box();
841
<span class="keywordflow">return</span> result;
846
<a class="anchor" id="a17666474219e537a71727f818e6b7c88"></a><!-- doxytag: member="tesseract::ColPartition::BoxColor" ref="a17666474219e537a71727f818e6b7c88" args="() const " -->
847
<div class="memitem">
848
<div class="memproto">
849
<table class="memname">
851
<td class="memname"><a class="el" href="a00532.html#a100504544a5423a94222149ee9ed0fe8">ScrollView::Color</a> <a class="el" href="a00323.html#a17666474219e537a71727f818e6b7c88">tesseract::ColPartition::BoxColor</a> </td>
853
<td class="paramname"></td><td>)</td>
860
<p>Definition at line <a class="el" href="a01100_source.html#l01752">1752</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
861
<div class="fragment"><pre class="fragment"> {
862
<span class="keywordflow">if</span> (type_ == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fac0b3cd1b4592e1a3c609ff4273fb505b">PT_UNKNOWN</a>)
863
<span class="keywordflow">return</span> <a class="code" href="a00279.html#a7351d74f423975d676f47e4dc05e267f">BLOBNBOX::TextlineColor</a>(blob_type_, flow_);
864
<span class="keywordflow">return</span> <a class="code" href="a00505.html#aaa733d5e7c20fa495156049537574d5b" title="Returns a color to draw the given type.">POLY_BLOCK::ColorForPolyBlockType</a>(type_);
869
<a class="anchor" id="a3fc2dd797ede7a62546b2565811e9ce0"></a><!-- doxytag: member="tesseract::ColPartition::boxes" ref="a3fc2dd797ede7a62546b2565811e9ce0" args="()" -->
870
<div class="memitem">
871
<div class="memproto">
872
<table class="memname">
874
<td class="memname">BLOBNBOX_CLIST* <a class="el" href="a00323.html#a3fc2dd797ede7a62546b2565811e9ce0">tesseract::ColPartition::boxes</a> </td>
876
<td class="paramname"></td><td>)</td>
877
<td><code> [inline]</code></td>
883
<p>Definition at line <a class="el" href="a01101_source.html#l00187">187</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
884
<div class="fragment"><pre class="fragment"> {
885
<span class="keywordflow">return</span> &boxes_;
890
<a class="anchor" id="a5632ec24bcc7483eb943a325a73c47dc"></a><!-- doxytag: member="tesseract::ColPartition::boxes_count" ref="a5632ec24bcc7483eb943a325a73c47dc" args="() const " -->
891
<div class="memitem">
892
<div class="memproto">
893
<table class="memname">
895
<td class="memname">int <a class="el" href="a00323.html#a5632ec24bcc7483eb943a325a73c47dc">tesseract::ColPartition::boxes_count</a> </td>
897
<td class="paramname"></td><td>)</td>
898
<td> const<code> [inline]</code></td>
904
<p>Definition at line <a class="el" href="a01101_source.html#l00190">190</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
905
<div class="fragment"><pre class="fragment"> {
906
<span class="keywordflow">return</span> boxes_.length();
911
<a class="anchor" id="af8679f5d1f87946bcd821dd2ffe1e80e"></a><!-- doxytag: member="tesseract::ColPartition::BoxLeftKey" ref="af8679f5d1f87946bcd821dd2ffe1e80e" args="() const " -->
912
<div class="memitem">
913
<div class="memproto">
914
<table class="memname">
916
<td class="memname">int <a class="el" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">tesseract::ColPartition::BoxLeftKey</a> </td>
918
<td class="paramname"></td><td>)</td>
919
<td> const<code> [inline]</code></td>
925
<p>Definition at line <a class="el" href="a01101_source.html#l00332">332</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
926
<div class="fragment"><pre class="fragment"> {
927
<span class="keywordflow">return</span> <a class="code" href="a00323.html#ac48d211f853e26daced218323544b393">SortKey</a>(bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>());
932
<a class="anchor" id="a498b82d4970d0c0fe24c59e27d5933e7"></a><!-- doxytag: member="tesseract::ColPartition::BoxRightKey" ref="a498b82d4970d0c0fe24c59e27d5933e7" args="() const " -->
933
<div class="memitem">
934
<div class="memproto">
935
<table class="memname">
937
<td class="memname">int <a class="el" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">tesseract::ColPartition::BoxRightKey</a> </td>
939
<td class="paramname"></td><td>)</td>
940
<td> const<code> [inline]</code></td>
946
<p>Definition at line <a class="el" href="a01101_source.html#l00336">336</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
947
<div class="fragment"><pre class="fragment"> {
948
<span class="keywordflow">return</span> <a class="code" href="a00323.html#ac48d211f853e26daced218323544b393">SortKey</a>(bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>());
953
<a class="anchor" id="aa6dd9388e18a33fc48e6410e214e1d17"></a><!-- doxytag: member="tesseract::ColPartition::ClaimBoxes" ref="aa6dd9388e18a33fc48e6410e214e1d17" args="()" -->
954
<div class="memitem">
955
<div class="memproto">
956
<table class="memname">
958
<td class="memname">void <a class="el" href="a00323.html#aa6dd9388e18a33fc48e6410e214e1d17">tesseract::ColPartition::ClaimBoxes</a> </td>
960
<td class="paramname"></td><td>)</td>
967
<p>Definition at line <a class="el" href="a01100_source.html#l00262">262</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
968
<div class="fragment"><pre class="fragment"> {
969
BLOBNBOX_C_IT bb_it(&boxes_);
970
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
971
<a class="code" href="a00279.html">BLOBNBOX</a>* bblob = bb_it.data();
972
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* other = bblob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>();
973
<span class="keywordflow">if</span> (other == NULL) {
974
<span class="comment">// Normal case: ownership is available.</span>
975
bblob-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(<span class="keyword">this</span>);
976
} <span class="keywordflow">else</span> {
977
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(other == <span class="keyword">this</span>);
984
<a class="anchor" id="a548b8797ceca6d820370cabe0711c808"></a><!-- doxytag: member="tesseract::ColPartition::clear_table_type" ref="a548b8797ceca6d820370cabe0711c808" args="()" -->
985
<div class="memitem">
986
<div class="memproto">
987
<table class="memname">
989
<td class="memname">void <a class="el" href="a00323.html#a548b8797ceca6d820370cabe0711c808">tesseract::ColPartition::clear_table_type</a> </td>
991
<td class="paramname"></td><td>)</td>
992
<td><code> [inline]</code></td>
998
<p>Definition at line <a class="el" href="a01101_source.html#l00239">239</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
999
<div class="fragment"><pre class="fragment"> {
1000
<span class="keywordflow">if</span> (type_ == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa5f41d3730899e22bf30c977bef2bcfa3">PT_TABLE</a>)
1001
type_ = type_before_table_;
1006
<a class="anchor" id="a944cdc529d0028111080627854c8bbc0"></a><!-- doxytag: member="tesseract::ColPartition::color1" ref="a944cdc529d0028111080627854c8bbc0" args="()" -->
1007
<div class="memitem">
1008
<div class="memproto">
1009
<table class="memname">
1011
<td class="memname"><a class="el" href="a00831.html#a458fe97f82495945f8071bb3c18d1783">uinT8</a>* <a class="el" href="a00323.html#a944cdc529d0028111080627854c8bbc0">tesseract::ColPartition::color1</a> </td>
1013
<td class="paramname"></td><td>)</td>
1014
<td><code> [inline]</code></td>
1018
<div class="memdoc">
1020
<p>Definition at line <a class="el" href="a01101_source.html#l00285">285</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1021
<div class="fragment"><pre class="fragment"> {
1022
<span class="keywordflow">return</span> color1_;
1027
<a class="anchor" id="a4b52103bab1483c16849f0ac8666a9fe"></a><!-- doxytag: member="tesseract::ColPartition::color2" ref="a4b52103bab1483c16849f0ac8666a9fe" args="()" -->
1028
<div class="memitem">
1029
<div class="memproto">
1030
<table class="memname">
1032
<td class="memname"><a class="el" href="a00831.html#a458fe97f82495945f8071bb3c18d1783">uinT8</a>* <a class="el" href="a00323.html#a4b52103bab1483c16849f0ac8666a9fe">tesseract::ColPartition::color2</a> </td>
1034
<td class="paramname"></td><td>)</td>
1035
<td><code> [inline]</code></td>
1039
<div class="memdoc">
1041
<p>Definition at line <a class="el" href="a01101_source.html#l00288">288</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1042
<div class="fragment"><pre class="fragment"> {
1043
<span class="keywordflow">return</span> color2_;
1048
<a class="anchor" id="a933e3f4465500ce46002ddaeab29a37c"></a><!-- doxytag: member="tesseract::ColPartition::column_set" ref="a933e3f4465500ce46002ddaeab29a37c" args="() const " -->
1049
<div class="memitem">
1050
<div class="memproto">
1051
<table class="memname">
1053
<td class="memname"><a class="el" href="a00325.html">ColPartitionSet</a>* <a class="el" href="a00323.html#a933e3f4465500ce46002ddaeab29a37c">tesseract::ColPartition::column_set</a> </td>
1055
<td class="paramname"></td><td>)</td>
1056
<td> const<code> [inline]</code></td>
1060
<div class="memdoc">
1062
<p>Definition at line <a class="el" href="a01101_source.html#l00214">214</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1063
<div class="fragment"><pre class="fragment"> {
1064
<span class="keywordflow">return</span> column_set_;
1069
<a class="anchor" id="ac7729e02ee4765d7612a0ec045681512"></a><!-- doxytag: member="tesseract::ColPartition::ColumnContains" ref="ac7729e02ee4765d7612a0ec045681512" args="(int x, int y) const " -->
1070
<div class="memitem">
1071
<div class="memproto">
1072
<table class="memname">
1074
<td class="memname">bool <a class="el" href="a00323.html#ac7729e02ee4765d7612a0ec045681512">tesseract::ColPartition::ColumnContains</a> </td>
1076
<td class="paramtype">int </td>
1077
<td class="paramname"><em>x</em>, </td>
1080
<td class="paramkey"></td>
1082
<td class="paramtype">int </td>
1083
<td class="paramname"><em>y</em> </td>
1088
<td></td><td> const<code> [inline]</code></td>
1092
<div class="memdoc">
1094
<p>Definition at line <a class="el" href="a01101_source.html#l00353">353</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1095
<div class="fragment"><pre class="fragment"> {
1096
<span class="keywordflow">return</span> <a class="code" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">LeftAtY</a>(y) - 1 <= x && x <= <a class="code" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">RightAtY</a>(y) + 1;
1101
<a class="anchor" id="a609bdd544b011d0b4fd46609843a9088"></a><!-- doxytag: member="tesseract::ColPartition::ColumnRange" ref="a609bdd544b011d0b4fd46609843a9088" args="(int resolution, ColPartitionSet *columns, int *first_col, int *last_col)" -->
1102
<div class="memitem">
1103
<div class="memproto">
1104
<table class="memname">
1106
<td class="memname">void <a class="el" href="a00323.html#a609bdd544b011d0b4fd46609843a9088">tesseract::ColPartition::ColumnRange</a> </td>
1108
<td class="paramtype">int </td>
1109
<td class="paramname"><em>resolution</em>, </td>
1112
<td class="paramkey"></td>
1114
<td class="paramtype"><a class="el" href="a00325.html">ColPartitionSet</a> * </td>
1115
<td class="paramname"><em>columns</em>, </td>
1118
<td class="paramkey"></td>
1120
<td class="paramtype">int * </td>
1121
<td class="paramname"><em>first_col</em>, </td>
1124
<td class="paramkey"></td>
1126
<td class="paramtype">int * </td>
1127
<td class="paramname"><em>last_col</em> </td>
1136
<div class="memdoc">
1138
<p>Definition at line <a class="el" href="a01100_source.html#l01046">1046</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1139
<div class="fragment"><pre class="fragment"> {
1140
<span class="keywordtype">int</span> first_spanned_col = -1;
1141
<a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06a">ColumnSpanningType</a> span_type =
1142
columns->SpanningType(resolution,
1143
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(),
1144
MIN(bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>(), bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>()),
1145
<a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>(), left_margin_, right_margin_,
1146
first_col, last_col,
1147
&first_spanned_col);
1148
type_ = <a class="code" href="a00323.html#a5a46de5acb31b0aec90ab89933c69bc9">PartitionType</a>(span_type);
1153
<a class="anchor" id="a74b26d9aa211f39f58fe9b6c60f324eb"></a><!-- doxytag: member="tesseract::ColPartition::ColumnWidth" ref="a74b26d9aa211f39f58fe9b6c60f324eb" args="() const " -->
1154
<div class="memitem">
1155
<div class="memproto">
1156
<table class="memname">
1158
<td class="memname">int <a class="el" href="a00323.html#a74b26d9aa211f39f58fe9b6c60f324eb">tesseract::ColPartition::ColumnWidth</a> </td>
1160
<td class="paramname"></td><td>)</td>
1161
<td> const<code> [inline]</code></td>
1165
<div class="memdoc">
1167
<p>Definition at line <a class="el" href="a01101_source.html#l00328">328</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1168
<div class="fragment"><pre class="fragment"> {
1169
<span class="keywordflow">return</span> <a class="code" href="a00323.html#ac45a47a9427bf943acba1c0ae7d8ed0b">KeyWidth</a>(left_key_, right_key_);
1174
<a class="anchor" id="a18f2c4bd514ea700d7d4f6d0a6541d17"></a><!-- doxytag: member="tesseract::ColPartition::ComputeLimits" ref="a18f2c4bd514ea700d7d4f6d0a6541d17" args="()" -->
1175
<div class="memitem">
1176
<div class="memproto">
1177
<table class="memname">
1179
<td class="memname">void <a class="el" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">tesseract::ColPartition::ComputeLimits</a> </td>
1181
<td class="paramname"></td><td>)</td>
1186
<div class="memdoc">
1188
<p>Definition at line <a class="el" href="a01100_source.html#l00851">851</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1189
<div class="fragment"><pre class="fragment"> {
1190
bounding_box_ = <a class="code" href="a00592.html">TBOX</a>(); <span class="comment">// Clear it</span>
1191
BLOBNBOX_C_IT it(&boxes_);
1192
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = NULL;
1193
<span class="keywordtype">int</span> non_leader_count = 0;
1194
<span class="keywordflow">if</span> (it.empty()) {
1195
bounding_box_.<a class="code" href="a00592.html#ae6151cd794841e100d8a346a0c4a46e6">set_left</a>(left_margin_);
1196
bounding_box_.<a class="code" href="a00592.html#a2246293d3667b28c52a52353a2d5caea">set_right</a>(right_margin_);
1197
bounding_box_.<a class="code" href="a00592.html#a6f803b24b046883cb0f3882dc3d92302">set_bottom</a>(0);
1198
bounding_box_.<a class="code" href="a00592.html#a7f40dfd290a907200bdc98c196f63f45">set_top</a>(0);
1199
} <span class="keywordflow">else</span> {
1200
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1202
bounding_box_ += bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
1203
<span class="keywordflow">if</span> (bbox-><a class="code" href="a00279.html#afafe7113396a8cc27b882d622db46f05">flow</a>() != <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a64e3e70c4fac4d4e3facdb4638307d7f">BTFT_LEADER</a>)
1207
<span class="keywordflow">if</span> (!left_key_tab_)
1208
left_key_ = <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>();
1209
<span class="keywordflow">if</span> (left_key_ > <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>() && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
1210
<span class="comment">// TODO(rays) investigate the causes of these error messages, to find</span>
1211
<span class="comment">// out if they are genuinely harmful, or just indicative of junk input.</span>
1212
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Computed left-illegal partition\n"</span>);
1213
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
1215
<span class="keywordflow">if</span> (!right_key_tab_)
1216
right_key_ = <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>();
1217
<span class="keywordflow">if</span> (right_key_ < <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>() && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
1218
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Computed right-illegal partition\n"</span>);
1219
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
1221
<span class="keywordflow">if</span> (it.empty())
1222
<span class="keywordflow">return</span>;
1223
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#a0ae19652d302dcc8bfd9cab1bed18770">IsImageType</a>() || <a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>() == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a15e526e8dd226bd4d7678da6dcddb49b">BRT_RECTIMAGE</a> ||
1224
<a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>() == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a3b72528ad70da88719f0479bc8c5a190">BRT_POLYIMAGE</a>) {
1225
median_top_ = bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>();
1226
median_bottom_ = bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>();
1227
median_size_ = bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>();
1228
median_left_ = bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>();
1229
median_right_ = bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>();
1230
median_width_ = bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>();
1231
} <span class="keywordflow">else</span> {
1232
<a class="code" href="a00556.html">STATS</a> top_stats(bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(), bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>() + 1);
1233
<a class="code" href="a00556.html">STATS</a> bottom_stats(bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(), bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>() + 1);
1234
<a class="code" href="a00556.html">STATS</a> size_stats(0, bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>() + 1);
1235
<a class="code" href="a00556.html">STATS</a> left_stats(bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() + 1);
1236
<a class="code" href="a00556.html">STATS</a> right_stats(bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() + 1);
1237
<a class="code" href="a00556.html">STATS</a> width_stats(0, bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>() + 1);
1238
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1240
<span class="keywordflow">if</span> (non_leader_count == 0 || bbox-><a class="code" href="a00279.html#afafe7113396a8cc27b882d622db46f05">flow</a>() != <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a64e3e70c4fac4d4e3facdb4638307d7f">BTFT_LEADER</a>) {
1241
<a class="code" href="a00592.html">TBOX</a> box = bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
1242
<span class="keywordtype">int</span> area = box.<a class="code" href="a00592.html#a46fca3df91dc271b30b69531e9d8178a">area</a>();
1243
top_stats.add(box.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>(), area);
1244
bottom_stats.add(box.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(), area);
1245
size_stats.add(box.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>(), area);
1246
left_stats.add(box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), area);
1247
right_stats.add(box.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), area);
1248
width_stats.add(box.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>(), area);
1251
median_top_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(top_stats.median() + 0.5);
1252
median_bottom_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(bottom_stats.median() + 0.5);
1253
median_size_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(size_stats.median() + 0.5);
1254
median_left_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(left_stats.median() + 0.5);
1255
median_right_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(right_stats.median() + 0.5);
1256
median_width_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(width_stats.median() + 0.5);
1259
<span class="keywordflow">if</span> (right_margin_ < bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
1260
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Made partition with bad right coords"</span>);
1261
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
1263
<span class="keywordflow">if</span> (left_margin_ > bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() && <a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
1264
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Made partition with bad left coords"</span>);
1265
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
1267
<span class="comment">// Fix partner lists. The bounding box has changed and partners are stored</span>
1268
<span class="comment">// in bounding box order, so remove and reinsert this as a partner</span>
1269
<span class="comment">// of all its partners.</span>
1270
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> upper = 0; upper < 2; ++upper) {
1271
ColPartition_CLIST partners;
1272
ColPartition_C_IT part_it(&partners);
1273
part_it.add_list_after(upper ? &upper_partners_ : &lower_partners_);
1274
<span class="keywordflow">for</span> (part_it.move_to_first(); !part_it.empty(); part_it.forward()) {
1275
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* partner = part_it.extract();
1276
partner->RemovePartner(!upper, <span class="keyword">this</span>);
1277
partner->AddPartner(!upper, <span class="keyword">this</span>);
1280
<span class="keywordflow">if</span> (<a class="code" href="a00257.html#a357ff9e1d9bac2b1d88fb0d335fa7f3e">TabFind::WithinTestRegion</a>(2, bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(),
1281
bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>())) {
1282
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Recomputed box for partition %p\n"</span>, <span class="keyword">this</span>);
1283
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
1289
<a class="anchor" id="aa348155cfa970382ea67c69ac2a95376"></a><!-- doxytag: member="tesseract::ColPartition::ComputeSpecialBlobsDensity" ref="aa348155cfa970382ea67c69ac2a95376" args="()" -->
1290
<div class="memitem">
1291
<div class="memproto">
1292
<table class="memname">
1294
<td class="memname">void <a class="el" href="a00323.html#aa348155cfa970382ea67c69ac2a95376">tesseract::ColPartition::ComputeSpecialBlobsDensity</a> </td>
1296
<td class="paramname"></td><td>)</td>
1301
<div class="memdoc">
1303
<p>Definition at line <a class="el" href="a01100_source.html#l00578">578</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1304
<div class="fragment"><pre class="fragment"> {
1305
memset(special_blobs_densities_, 0, <span class="keyword">sizeof</span>(special_blobs_densities_));
1306
<span class="keywordflow">if</span> (boxes_.empty()) {
1307
<span class="keywordflow">return</span>;
1310
BLOBNBOX_C_IT blob_it(&boxes_);
1311
<span class="keywordflow">for</span> (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
1312
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = blob_it.data();
1313
<a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> = blob-><a class="code" href="a00279.html#aa33e4d1cf720df979dc50d2b39abb4e9">special_text_type</a>();
1314
special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>]++;
1317
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> type = 0; type < <a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8caceba184627df3dabc8f3e3f2867c4eff">BSTT_COUNT</a>; ++<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>) {
1318
special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>] /= boxes_.length();
1324
<a class="anchor" id="acd5a7e99cb64ca351d6defeb0b650979"></a><!-- doxytag: member="tesseract::ColPartition::ConfirmNoTabViolation" ref="acd5a7e99cb64ca351d6defeb0b650979" args="(const ColPartition &other) const " -->
1325
<div class="memitem">
1326
<div class="memproto">
1327
<table class="memname">
1329
<td class="memname">bool <a class="el" href="a00323.html#acd5a7e99cb64ca351d6defeb0b650979">tesseract::ColPartition::ConfirmNoTabViolation</a> </td>
1331
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1332
<td class="paramname"><em>other</em></td><td>)</td>
1337
<div class="memdoc">
1339
<p>Definition at line <a class="el" href="a01100_source.html#l00409">409</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1340
<div class="fragment"><pre class="fragment"> {
1341
<span class="keywordflow">if</span> (bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() < other.bounding_box_.left() &&
1342
bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() < other.LeftBlobRule())
1343
<span class="keywordflow">return</span> <span class="keyword">false</span>;
1344
<span class="keywordflow">if</span> (other.bounding_box_.right() < bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() &&
1345
other.bounding_box_.right() < <a class="code" href="a00323.html#a206e0152232376b343553af9cdbd8ad4">LeftBlobRule</a>())
1346
<span class="keywordflow">return</span> <span class="keyword">false</span>;
1347
<span class="keywordflow">if</span> (bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() > other.bounding_box_.right() &&
1348
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() > other.RightBlobRule())
1349
<span class="keywordflow">return</span> <span class="keyword">false</span>;
1350
<span class="keywordflow">if</span> (other.bounding_box_.left() > bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() &&
1351
other.bounding_box_.left() > <a class="code" href="a00323.html#a50177ba646b8b4b4a73ddc43d3b7a18a">RightBlobRule</a>())
1352
<span class="keywordflow">return</span> <span class="keyword">false</span>;
1353
<span class="keywordflow">return</span> <span class="keyword">true</span>;
1358
<a class="anchor" id="a3077eb7392f7d2ab1de2f93579fda55d"></a><!-- doxytag: member="tesseract::ColPartition::CopyButDontOwnBlobs" ref="a3077eb7392f7d2ab1de2f93579fda55d" args="()" -->
1359
<div class="memitem">
1360
<div class="memproto">
1361
<table class="memname">
1363
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a3077eb7392f7d2ab1de2f93579fda55d">tesseract::ColPartition::CopyButDontOwnBlobs</a> </td>
1365
<td class="paramname"></td><td>)</td>
1370
<div class="memdoc">
1372
<p>Definition at line <a class="el" href="a01100_source.html#l01739">1739</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1373
<div class="fragment"><pre class="fragment"> {
1374
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* copy = <a class="code" href="a00323.html#a70116af39898d43ca19ecb189faccfa1">ShallowCopy</a>();
1375
copy->set_owns_blobs(<span class="keyword">false</span>);
1376
BLOBNBOX_C_IT inserter(copy->boxes());
1377
BLOBNBOX_C_IT traverser(<a class="code" href="a00323.html#a3fc2dd797ede7a62546b2565811e9ce0">boxes</a>());
1378
<span class="keywordflow">for</span> (traverser.mark_cycle_pt(); !traverser.cycled_list(); traverser.forward())
1379
inserter.add_after_then_move(traverser.data());
1380
<span class="keywordflow">return</span> copy;
1385
<a class="anchor" id="aff9a74526321b24bbafcdbc359f9d161"></a><!-- doxytag: member="tesseract::ColPartition::CopyLeftTab" ref="aff9a74526321b24bbafcdbc359f9d161" args="(const ColPartition &src, bool take_box)" -->
1386
<div class="memitem">
1387
<div class="memproto">
1388
<table class="memname">
1390
<td class="memname">void <a class="el" href="a00323.html#aff9a74526321b24bbafcdbc359f9d161">tesseract::ColPartition::CopyLeftTab</a> </td>
1392
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1393
<td class="paramname"><em>src</em>, </td>
1396
<td class="paramkey"></td>
1398
<td class="paramtype">bool </td>
1399
<td class="paramname"><em>take_box</em> </td>
1408
<div class="memdoc">
1410
<p>Definition at line <a class="el" href="a01100_source.html#l00515">515</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1411
<div class="fragment"><pre class="fragment"> {
1412
left_key_tab_ = take_box ? <span class="keyword">false</span> : src.left_key_tab_;
1413
<span class="keywordflow">if</span> (left_key_tab_) {
1414
left_key_ = src.left_key_;
1415
} <span class="keywordflow">else</span> {
1416
bounding_box_.<a class="code" href="a00592.html#ae6151cd794841e100d8a346a0c4a46e6">set_left</a>(<a class="code" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">XAtY</a>(src.BoxLeftKey(), <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>()));
1417
left_key_ = <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>();
1419
<span class="keywordflow">if</span> (left_margin_ > bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>())
1420
left_margin_ = src.left_margin_;
1425
<a class="anchor" id="ab4ec7202d19f98517fd32bce150ebbb0"></a><!-- doxytag: member="tesseract::ColPartition::CopyRightTab" ref="ab4ec7202d19f98517fd32bce150ebbb0" args="(const ColPartition &src, bool take_box)" -->
1426
<div class="memitem">
1427
<div class="memproto">
1428
<table class="memname">
1430
<td class="memname">void <a class="el" href="a00323.html#ab4ec7202d19f98517fd32bce150ebbb0">tesseract::ColPartition::CopyRightTab</a> </td>
1432
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1433
<td class="paramname"><em>src</em>, </td>
1436
<td class="paramkey"></td>
1438
<td class="paramtype">bool </td>
1439
<td class="paramname"><em>take_box</em> </td>
1448
<div class="memdoc">
1450
<p>Definition at line <a class="el" href="a01100_source.html#l00528">528</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1451
<div class="fragment"><pre class="fragment"> {
1452
right_key_tab_ = take_box ? <span class="keyword">false</span> : src.right_key_tab_;
1453
<span class="keywordflow">if</span> (right_key_tab_) {
1454
right_key_ = src.right_key_;
1455
} <span class="keywordflow">else</span> {
1456
bounding_box_.<a class="code" href="a00592.html#a2246293d3667b28c52a52353a2d5caea">set_right</a>(<a class="code" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">XAtY</a>(src.BoxRightKey(), <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>()));
1457
right_key_ = <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>();
1459
<span class="keywordflow">if</span> (right_margin_ < bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>())
1460
right_margin_ = src.right_margin_;
1465
<a class="anchor" id="a85049818069c9a89322235b286b9915d"></a><!-- doxytag: member="tesseract::ColPartition::CountOverlappingBoxes" ref="a85049818069c9a89322235b286b9915d" args="(const TBOX &box)" -->
1466
<div class="memitem">
1467
<div class="memproto">
1468
<table class="memname">
1470
<td class="memname">int <a class="el" href="a00323.html#a85049818069c9a89322235b286b9915d">tesseract::ColPartition::CountOverlappingBoxes</a> </td>
1472
<td class="paramtype">const <a class="el" href="a00592.html">TBOX</a> & </td>
1473
<td class="paramname"><em>box</em></td><td>)</td>
1478
<div class="memdoc">
1480
<p>Definition at line <a class="el" href="a01100_source.html#l00950">950</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1481
<div class="fragment"><pre class="fragment"> {
1482
BLOBNBOX_C_IT it(&boxes_);
1483
<span class="keywordtype">int</span> overlap_count = 0;
1484
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1485
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = it.data();
1486
<span class="keywordflow">if</span> (box.<a class="code" href="a00592.html#adcc7d2858ccb61cd715dbcff32bd5582">overlap</a>(bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>()))
1489
<span class="keywordflow">return</span> overlap_count;
1494
<a class="anchor" id="a7d58daab4baf2cd8166b1e931e1ffad4"></a><!-- doxytag: member="tesseract::ColPartition::DeleteBoxes" ref="a7d58daab4baf2cd8166b1e931e1ffad4" args="()" -->
1495
<div class="memitem">
1496
<div class="memproto">
1497
<table class="memname">
1499
<td class="memname">void <a class="el" href="a00323.html#a7d58daab4baf2cd8166b1e931e1ffad4">tesseract::ColPartition::DeleteBoxes</a> </td>
1501
<td class="paramname"></td><td>)</td>
1506
<div class="memdoc">
1508
<p>Definition at line <a class="el" href="a01100_source.html#l00301">301</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1509
<div class="fragment"><pre class="fragment"> {
1510
<span class="comment">// Although the boxes_ list is a C_LIST, in some cases it owns the</span>
1511
<span class="comment">// BLOBNBOXes, as the ColPartition takes ownership from the grid,</span>
1512
<span class="comment">// and the BLOBNBOXes own the underlying C_BLOBs.</span>
1513
<span class="keywordflow">for</span> (BLOBNBOX_C_IT bb_it(&boxes_); !bb_it.empty(); bb_it.forward()) {
1514
<a class="code" href="a00279.html">BLOBNBOX</a>* bblob = bb_it.extract();
1515
<span class="keyword">delete</span> bblob-><a class="code" href="a00279.html#a483f44541a4dd818f02225c92f030e07">cblob</a>();
1516
<span class="keyword">delete</span> bblob;
1522
<a class="anchor" id="aa5e088aff13b0c427a9b984b3be7a4b5"></a><!-- doxytag: member="tesseract::ColPartition::desperately_merged" ref="aa5e088aff13b0c427a9b984b3be7a4b5" args="() const " -->
1523
<div class="memitem">
1524
<div class="memproto">
1525
<table class="memname">
1527
<td class="memname">bool <a class="el" href="a00323.html#aa5e088aff13b0c427a9b984b3be7a4b5">tesseract::ColPartition::desperately_merged</a> </td>
1529
<td class="paramname"></td><td>)</td>
1530
<td> const<code> [inline]</code></td>
1534
<div class="memdoc">
1536
<p>Definition at line <a class="el" href="a01101_source.html#l00211">211</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1537
<div class="fragment"><pre class="fragment"> {
1538
<span class="keywordflow">return</span> desperately_merged_;
1543
<a class="anchor" id="a00ada2372a982efadbd4fb6da128bbb3"></a><!-- doxytag: member="tesseract::ColPartition::DisownBoxes" ref="a00ada2372a982efadbd4fb6da128bbb3" args="()" -->
1544
<div class="memitem">
1545
<div class="memproto">
1546
<table class="memname">
1548
<td class="memname">void <a class="el" href="a00323.html#a00ada2372a982efadbd4fb6da128bbb3">tesseract::ColPartition::DisownBoxes</a> </td>
1550
<td class="paramname"></td><td>)</td>
1555
<div class="memdoc">
1557
<p>Definition at line <a class="el" href="a01100_source.html#l00278">278</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1558
<div class="fragment"><pre class="fragment"> {
1559
BLOBNBOX_C_IT bb_it(&boxes_);
1560
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
1561
<a class="code" href="a00279.html">BLOBNBOX</a>* bblob = bb_it.data();
1562
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(bblob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>() == <span class="keyword">this</span> || bblob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>() == NULL);
1563
bblob-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(NULL);
1569
<a class="anchor" id="a7601c6b9fa22be42ca11e815c46a541a"></a><!-- doxytag: member="tesseract::ColPartition::DisownBoxesNoAssert" ref="a7601c6b9fa22be42ca11e815c46a541a" args="()" -->
1570
<div class="memitem">
1571
<div class="memproto">
1572
<table class="memname">
1574
<td class="memname">void <a class="el" href="a00323.html#a7601c6b9fa22be42ca11e815c46a541a">tesseract::ColPartition::DisownBoxesNoAssert</a> </td>
1576
<td class="paramname"></td><td>)</td>
1581
<div class="memdoc">
1583
<p>Definition at line <a class="el" href="a01100_source.html#l00291">291</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1584
<div class="fragment"><pre class="fragment"> {
1585
BLOBNBOX_C_IT bb_it(&boxes_);
1586
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
1587
<a class="code" href="a00279.html">BLOBNBOX</a>* bblob = bb_it.data();
1588
<span class="keywordflow">if</span> (bblob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>() == <span class="keyword">this</span>)
1589
bblob-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(NULL);
1595
<a class="anchor" id="a1ed526e850e85fba36bd2dcf2168982a"></a><!-- doxytag: member="tesseract::ColPartition::FakePartition" ref="a1ed526e850e85fba36bd2dcf2168982a" args="(const TBOX &box, PolyBlockType block_type, BlobRegionType blob_type, BlobTextFlowType flow)" -->
1596
<div class="memitem">
1597
<div class="memproto">
1598
<table class="memname">
1600
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a1ed526e850e85fba36bd2dcf2168982a">tesseract::ColPartition::FakePartition</a> </td>
1602
<td class="paramtype">const <a class="el" href="a00592.html">TBOX</a> & </td>
1603
<td class="paramname"><em>box</em>, </td>
1606
<td class="paramkey"></td>
1608
<td class="paramtype"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td>
1609
<td class="paramname"><em>block_type</em>, </td>
1612
<td class="paramkey"></td>
1614
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
1615
<td class="paramname"><em>blob_type</em>, </td>
1618
<td class="paramkey"></td>
1620
<td class="paramtype"><a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> </td>
1621
<td class="paramname"><em>flow</em> </td>
1626
<td></td><td><code> [static]</code></td>
1630
<div class="memdoc">
1632
<p>Definition at line <a class="el" href="a01100_source.html#l00112">112</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1633
<div class="fragment"><pre class="fragment"> {
1634
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = <span class="keyword">new</span> <a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>(<a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>, <a class="code" href="a00409.html" title="integer coordinate">ICOORD</a>(0, 1));
1635
part->set_type(block_type);
1636
part->set_flow(<a class="code" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a>);
1637
part->AddBox(<span class="keyword">new</span> <a class="code" href="a00279.html">BLOBNBOX</a>(<a class="code" href="a00289.html#a29479d1a44688cc2d277b9e8f3064ade">C_BLOB::FakeBlob</a>(box)));
1638
part->set_left_margin(box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>());
1639
part->set_right_margin(box.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>());
1640
part->SetBlobTypes();
1641
part->ComputeLimits();
1642
part->ClaimBoxes();
1643
<span class="keywordflow">return</span> part;
1648
<a class="anchor" id="a811bd892dfa5eeba0b17b77794d79754"></a><!-- doxytag: member="tesseract::ColPartition::flow" ref="a811bd892dfa5eeba0b17b77794d79754" args="() const " -->
1649
<div class="memitem">
1650
<div class="memproto">
1651
<table class="memname">
1653
<td class="memname"><a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> <a class="el" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">tesseract::ColPartition::flow</a> </td>
1655
<td class="paramname"></td><td>)</td>
1656
<td> const<code> [inline]</code></td>
1660
<div class="memdoc">
1662
<p>Definition at line <a class="el" href="a01101_source.html#l00154">154</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1663
<div class="fragment"><pre class="fragment"> {
1664
<span class="keywordflow">return</span> flow_;
1669
<a class="anchor" id="acaadf59a14518e62356f27786d63ae42"></a><!-- doxytag: member="tesseract::ColPartition::good_blob_score" ref="acaadf59a14518e62356f27786d63ae42" args="() const " -->
1670
<div class="memitem">
1671
<div class="memproto">
1672
<table class="memname">
1674
<td class="memname">int <a class="el" href="a00323.html#acaadf59a14518e62356f27786d63ae42">tesseract::ColPartition::good_blob_score</a> </td>
1676
<td class="paramname"></td><td>)</td>
1677
<td> const<code> [inline]</code></td>
1681
<div class="memdoc">
1683
<p>Definition at line <a class="el" href="a01101_source.html#l00160">160</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1684
<div class="fragment"><pre class="fragment"> {
1685
<span class="keywordflow">return</span> good_blob_score_;
1690
<a class="anchor" id="a0ddb453820cf0860bef4a27ed649e2b0"></a><!-- doxytag: member="tesseract::ColPartition::good_column" ref="a0ddb453820cf0860bef4a27ed649e2b0" args="() const " -->
1691
<div class="memitem">
1692
<div class="memproto">
1693
<table class="memname">
1695
<td class="memname">bool <a class="el" href="a00323.html#a0ddb453820cf0860bef4a27ed649e2b0">tesseract::ColPartition::good_column</a> </td>
1697
<td class="paramname"></td><td>)</td>
1698
<td> const<code> [inline]</code></td>
1702
<div class="memdoc">
1704
<p>Definition at line <a class="el" href="a01101_source.html#l00166">166</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1705
<div class="fragment"><pre class="fragment"> {
1706
<span class="keywordflow">return</span> good_column_;
1711
<a class="anchor" id="a0bd194403074c23e54e840c6a5d7214b"></a><!-- doxytag: member="tesseract::ColPartition::good_width" ref="a0bd194403074c23e54e840c6a5d7214b" args="() const " -->
1712
<div class="memitem">
1713
<div class="memproto">
1714
<table class="memname">
1716
<td class="memname">bool <a class="el" href="a00323.html#a0bd194403074c23e54e840c6a5d7214b">tesseract::ColPartition::good_width</a> </td>
1718
<td class="paramname"></td><td>)</td>
1719
<td> const<code> [inline]</code></td>
1723
<div class="memdoc">
1725
<p>Definition at line <a class="el" href="a01101_source.html#l00163">163</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1726
<div class="fragment"><pre class="fragment"> {
1727
<span class="keywordflow">return</span> good_width_;
1732
<a class="anchor" id="a65b2878a089ecff1dc1e221ed3189ddc"></a><!-- doxytag: member="tesseract::ColPartition::HasGoodBaseline" ref="a65b2878a089ecff1dc1e221ed3189ddc" args="()" -->
1733
<div class="memitem">
1734
<div class="memproto">
1735
<table class="memname">
1737
<td class="memname">bool <a class="el" href="a00323.html#a65b2878a089ecff1dc1e221ed3189ddc">tesseract::ColPartition::HasGoodBaseline</a> </td>
1739
<td class="paramname"></td><td>)</td>
1744
<div class="memdoc">
1746
<p>Definition at line <a class="el" href="a01100_source.html#l01267">1267</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1747
<div class="fragment"><pre class="fragment"> {
1748
<span class="comment">// Approximation of the baseline.</span>
1749
DetLineFit linepoints;
1750
<span class="comment">// Calculation of the mean height on this line segment. Note that these</span>
1751
<span class="comment">// variable names apply to the context of a horizontal line, and work</span>
1752
<span class="comment">// analogously, rather than literally in the case of a vertical line.</span>
1753
<span class="keywordtype">int</span> total_height = 0;
1754
<span class="keywordtype">int</span> coverage = 0;
1755
<span class="keywordtype">int</span> height_count = 0;
1756
<span class="keywordtype">int</span> width = 0;
1757
BLOBNBOX_C_IT it(&boxes_);
1758
<a class="code" href="a00592.html">TBOX</a> box(it.data()->bounding_box());
1759
<span class="comment">// Accumulate points representing the baseline at the middle of each blob,</span>
1760
<span class="comment">// but add an additional point for each end of the line. This makes it</span>
1761
<span class="comment">// harder to fit a severe skew angle, as it is most likely not right.</span>
1762
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>()) {
1763
<span class="comment">// For a vertical line, use the right side as the baseline.</span>
1764
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> first_pt(box.right(), box.bottom());
1765
<span class="comment">// Use the bottom-right of the first (bottom) box, the top-right of the</span>
1766
<span class="comment">// last, and the middle-right of all others.</span>
1767
linepoints.Add(first_pt);
1768
<span class="keywordflow">for</span> (it.forward(); !it.at_last(); it.forward()) {
1769
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
1770
box = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
1771
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> box_pt(box.right(), (box.top() + box.bottom()) / 2);
1772
linepoints.Add(box_pt);
1773
total_height += box.width();
1774
coverage += box.height();
1777
box = it.data()->bounding_box();
1778
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> last_pt(box.right(), box.top());
1779
linepoints.Add(last_pt);
1780
width = last_pt.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>() - first_pt.y();
1782
} <span class="keywordflow">else</span> {
1783
<span class="comment">// Horizontal lines use the bottom as the baseline.</span>
1784
<a class="code" href="a00592.html">TBOX</a> box(it.data()->bounding_box());
1785
<span class="comment">// Use the bottom-left of the first box, the the bottom-right of the last,</span>
1786
<span class="comment">// and the middle of all others.</span>
1787
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> first_pt(box.left(), box.bottom());
1788
linepoints.Add(first_pt);
1789
<span class="keywordflow">for</span> (it.forward(); !it.at_last(); it.forward()) {
1790
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
1791
box = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
1792
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> box_pt((box.left() + box.right()) / 2, box.bottom());
1793
linepoints.Add(box_pt);
1794
total_height += box.height();
1795
coverage += box.width();
1798
box = it.data()->bounding_box();
1799
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> last_pt(box.right(), box.bottom());
1800
linepoints.Add(last_pt);
1801
width = last_pt.<a class="code" href="a00409.html#a59722a47c540007c58a539f0e35b3f33" title="access function">x</a>() - first_pt.x();
1803
<span class="comment">// Maximum median error allowed to be a good text line.</span>
1804
<span class="keywordtype">double</span> max_error = <a class="code" href="a01265.html#a8043339cb79428cd76d41f5432de9712">kMaxBaselineError</a> * total_height / height_count;
1805
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> start_pt, end_pt;
1806
<span class="keywordtype">double</span> error = linepoints.Fit(&start_pt, &end_pt);
1807
<span class="keywordflow">return</span> error < max_error && coverage >= <a class="code" href="a01265.html#a65472193d051a39743ef565bd34bcc64">kMinBaselineCoverage</a> * width;
1812
<a class="anchor" id="adbe1f191ede26132fc0437dfd969f2b2"></a><!-- doxytag: member="tesseract::ColPartition::HCoreOverlap" ref="adbe1f191ede26132fc0437dfd969f2b2" args="(const ColPartition &other) const " -->
1813
<div class="memitem">
1814
<div class="memproto">
1815
<table class="memname">
1817
<td class="memname">int <a class="el" href="a00323.html#adbe1f191ede26132fc0437dfd969f2b2">tesseract::ColPartition::HCoreOverlap</a> </td>
1819
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1820
<td class="paramname"><em>other</em></td><td>)</td>
1821
<td> const<code> [inline]</code></td>
1825
<div class="memdoc">
1827
<p>Definition at line <a class="el" href="a01101_source.html#l00381">381</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1828
<div class="fragment"><pre class="fragment"> {
1829
<span class="keywordflow">return</span> MIN(median_right_, other.median_right_) -
1830
MAX(median_left_, other.median_left_);
1835
<a class="anchor" id="a43b5ff6a41c8f72876ca2d2c9683a2e6"></a><!-- doxytag: member="tesseract::ColPartition::HOverlaps" ref="a43b5ff6a41c8f72876ca2d2c9683a2e6" args="(const ColPartition &other) const " -->
1836
<div class="memitem">
1837
<div class="memproto">
1838
<table class="memname">
1840
<td class="memname">bool <a class="el" href="a00323.html#a43b5ff6a41c8f72876ca2d2c9683a2e6">tesseract::ColPartition::HOverlaps</a> </td>
1842
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1843
<td class="paramname"><em>other</em></td><td>)</td>
1844
<td> const<code> [inline]</code></td>
1848
<div class="memdoc">
1850
<p>Definition at line <a class="el" href="a01101_source.html#l00365">365</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1851
<div class="fragment"><pre class="fragment"> {
1852
<span class="keywordflow">return</span> bounding_box_.<a class="code" href="a00592.html#acc3b9d3b59853635705c39278e560435">x_overlap</a>(other.bounding_box_);
1857
<a class="anchor" id="a40132dd64a9e916ca809b9494e1a5cdd"></a><!-- doxytag: member="tesseract::ColPartition::inside_table_column" ref="a40132dd64a9e916ca809b9494e1a5cdd" args="()" -->
1858
<div class="memitem">
1859
<div class="memproto">
1860
<table class="memname">
1862
<td class="memname">bool <a class="el" href="a00323.html#a40132dd64a9e916ca809b9494e1a5cdd">tesseract::ColPartition::inside_table_column</a> </td>
1864
<td class="paramname"></td><td>)</td>
1865
<td><code> [inline]</code></td>
1869
<div class="memdoc">
1871
<p>Definition at line <a class="el" href="a01101_source.html#l00243">243</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1872
<div class="fragment"><pre class="fragment"> {
1873
<span class="keywordflow">return</span> inside_table_column_;
1878
<a class="anchor" id="aa1c839940b58f4e6c3dbfa71294fff47"></a><!-- doxytag: member="tesseract::ColPartition::IsEmpty" ref="aa1c839940b58f4e6c3dbfa71294fff47" args="() const " -->
1879
<div class="memitem">
1880
<div class="memproto">
1881
<table class="memname">
1883
<td class="memname">bool <a class="el" href="a00323.html#aa1c839940b58f4e6c3dbfa71294fff47">tesseract::ColPartition::IsEmpty</a> </td>
1885
<td class="paramname"></td><td>)</td>
1886
<td> const<code> [inline]</code></td>
1890
<div class="memdoc">
1892
<p>Definition at line <a class="el" href="a01101_source.html#l00357">357</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1893
<div class="fragment"><pre class="fragment"> {
1894
<span class="keywordflow">return</span> boxes_.empty();
1899
<a class="anchor" id="a052bafacd4995721da746930d2df0dd2"></a><!-- doxytag: member="tesseract::ColPartition::IsHorizontalLine" ref="a052bafacd4995721da746930d2df0dd2" args="() const " -->
1900
<div class="memitem">
1901
<div class="memproto">
1902
<table class="memname">
1904
<td class="memname">bool <a class="el" href="a00323.html#a052bafacd4995721da746930d2df0dd2">tesseract::ColPartition::IsHorizontalLine</a> </td>
1906
<td class="paramname"></td><td>)</td>
1907
<td> const<code> [inline]</code></td>
1911
<div class="memdoc">
1913
<p>Definition at line <a class="el" href="a01101_source.html#l00453">453</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1914
<div class="fragment"><pre class="fragment"> {
1915
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a4d59387e0ab7f94339b438954d5f1492">IsHorizontalType</a>() && <a class="code" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">IsLineType</a>();
1920
<a class="anchor" id="a4d59387e0ab7f94339b438954d5f1492"></a><!-- doxytag: member="tesseract::ColPartition::IsHorizontalType" ref="a4d59387e0ab7f94339b438954d5f1492" args="() const " -->
1921
<div class="memitem">
1922
<div class="memproto">
1923
<table class="memname">
1925
<td class="memname">bool <a class="el" href="a00323.html#a4d59387e0ab7f94339b438954d5f1492">tesseract::ColPartition::IsHorizontalType</a> </td>
1927
<td class="paramname"></td><td>)</td>
1928
<td> const<code> [inline]</code></td>
1932
<div class="memdoc">
1934
<p>Definition at line <a class="el" href="a01101_source.html#l00439">439</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1935
<div class="fragment"><pre class="fragment"> {
1936
<span class="keywordflow">return</span> blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a> || blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a56cc149e97b34634dd39babda79ea17d">BRT_HLINE</a>;
1941
<a class="anchor" id="a0ae19652d302dcc8bfd9cab1bed18770"></a><!-- doxytag: member="tesseract::ColPartition::IsImageType" ref="a0ae19652d302dcc8bfd9cab1bed18770" args="() const " -->
1942
<div class="memitem">
1943
<div class="memproto">
1944
<table class="memname">
1946
<td class="memname">bool <a class="el" href="a00323.html#a0ae19652d302dcc8bfd9cab1bed18770">tesseract::ColPartition::IsImageType</a> </td>
1948
<td class="paramname"></td><td>)</td>
1949
<td> const<code> [inline]</code></td>
1953
<div class="memdoc">
1955
<p>Definition at line <a class="el" href="a01101_source.html#l00423">423</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
1956
<div class="fragment"><pre class="fragment"> {
1957
<span class="keywordflow">return</span> <a class="code" href="a00781.html#a92fa403305db196dae658fac2153f2e9">PTIsImageType</a>(type_);
1962
<a class="anchor" id="aa05fd8e272964b349436a729acf3fc64"></a><!-- doxytag: member="tesseract::ColPartition::IsInSameColumnAs" ref="aa05fd8e272964b349436a729acf3fc64" args="(const ColPartition &part) const " -->
1963
<div class="memitem">
1964
<div class="memproto">
1965
<table class="memname">
1967
<td class="memname">bool <a class="el" href="a00323.html#aa05fd8e272964b349436a729acf3fc64">tesseract::ColPartition::IsInSameColumnAs</a> </td>
1969
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1970
<td class="paramname"><em>part</em></td><td>)</td>
1975
<div class="memdoc">
1977
<p>Definition at line <a class="el" href="a01100_source.html#l02156">2156</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
1978
<div class="fragment"><pre class="fragment"> {
1979
<span class="comment">// Overlap does not occur when last < part.first or first > part.last.</span>
1980
<span class="comment">// In other words, one is completely to the side of the other.</span>
1981
<span class="comment">// This is just DeMorgan's law applied to that so the function returns true.</span>
1982
<span class="keywordflow">return</span> (last_column_ >= part.first_column_) &&
1983
(first_column_ <= part.last_column_);
1988
<a class="anchor" id="ac851e3fbb5932b448969ce4e3bd7f471"></a><!-- doxytag: member="tesseract::ColPartition::IsLeftOf" ref="ac851e3fbb5932b448969ce4e3bd7f471" args="(const ColPartition &other) const " -->
1989
<div class="memitem">
1990
<div class="memproto">
1991
<table class="memname">
1993
<td class="memname">bool <a class="el" href="a00323.html#ac851e3fbb5932b448969ce4e3bd7f471">tesseract::ColPartition::IsLeftOf</a> </td>
1995
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
1996
<td class="paramname"><em>other</em></td><td>)</td>
1997
<td> const<code> [inline]</code></td>
2001
<div class="memdoc">
2003
<p>Definition at line <a class="el" href="a01101_source.html#l00349">349</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2004
<div class="fragment"><pre class="fragment"> {
2005
<span class="keywordflow">return</span> bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() < other.bounding_box_.right();
2010
<a class="anchor" id="affa76b0b726f75d996a9e5dbe8b3e408"></a><!-- doxytag: member="tesseract::ColPartition::IsLegal" ref="affa76b0b726f75d996a9e5dbe8b3e408" args="()" -->
2011
<div class="memitem">
2012
<div class="memproto">
2013
<table class="memname">
2015
<td class="memname">bool <a class="el" href="a00323.html#affa76b0b726f75d996a9e5dbe8b3e408">tesseract::ColPartition::IsLegal</a> </td>
2017
<td class="paramname"></td><td>)</td>
2022
<div class="memdoc">
2024
<p>Definition at line <a class="el" href="a01100_source.html#l00338">338</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2025
<div class="fragment"><pre class="fragment"> {
2026
<span class="keywordflow">if</span> (bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() > bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>()) {
2027
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
2028
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Bounding box invalid\n"</span>);
2029
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
2031
<span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Bounding box invalid.</span>
2033
<span class="keywordflow">if</span> (left_margin_ > bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() ||
2034
right_margin_ < bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>()) {
2035
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
2036
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Margins invalid\n"</span>);
2037
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
2039
<span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Margins invalid.</span>
2041
<span class="keywordflow">if</span> (left_key_ > <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>() || right_key_ < <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>()) {
2042
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#a3d35a4bb514fd5c966f5df17196bdb71">textord_debug_bugs</a>) {
2043
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Key inside box: %d v %d or %d v %d\n"</span>,
2044
left_key_, <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>(), right_key_, <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>());
2045
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
2047
<span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Keys inside the box.</span>
2049
<span class="keywordflow">return</span> <span class="keyword">true</span>;
2054
<a class="anchor" id="acf97b6bd6c867bb71f5cd639f19b9994"></a><!-- doxytag: member="tesseract::ColPartition::IsLineType" ref="acf97b6bd6c867bb71f5cd639f19b9994" args="() const " -->
2055
<div class="memitem">
2056
<div class="memproto">
2057
<table class="memname">
2059
<td class="memname">bool <a class="el" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">tesseract::ColPartition::IsLineType</a> </td>
2061
<td class="paramname"></td><td>)</td>
2062
<td> const<code> [inline]</code></td>
2066
<div class="memdoc">
2068
<p>Definition at line <a class="el" href="a01101_source.html#l00419">419</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2069
<div class="fragment"><pre class="fragment"> {
2070
<span class="keywordflow">return</span> <a class="code" href="a00781.html#adaf51915410883cb49ce4b2309528641">PTIsLineType</a>(type_);
2075
<a class="anchor" id="a13f2518ad00152d63cce288bbbe66d10"></a><!-- doxytag: member="tesseract::ColPartition::IsPulloutType" ref="a13f2518ad00152d63cce288bbbe66d10" args="() const " -->
2076
<div class="memitem">
2077
<div class="memproto">
2078
<table class="memname">
2080
<td class="memname">bool <a class="el" href="a00323.html#a13f2518ad00152d63cce288bbbe66d10">tesseract::ColPartition::IsPulloutType</a> </td>
2082
<td class="paramname"></td><td>)</td>
2083
<td> const<code> [inline]</code></td>
2087
<div class="memdoc">
2089
<p>Definition at line <a class="el" href="a01101_source.html#l00431">431</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2090
<div class="fragment"><pre class="fragment"> {
2091
<span class="keywordflow">return</span> <a class="code" href="a00781.html#a3b3b817fc17799383d414c2ea1c3f888">PTIsPulloutType</a>(type_);
2096
<a class="anchor" id="ac34862007d633ee3d726492150e8c672"></a><!-- doxytag: member="tesseract::ColPartition::IsSingleton" ref="ac34862007d633ee3d726492150e8c672" args="() const " -->
2097
<div class="memitem">
2098
<div class="memproto">
2099
<table class="memname">
2101
<td class="memname">bool <a class="el" href="a00323.html#ac34862007d633ee3d726492150e8c672">tesseract::ColPartition::IsSingleton</a> </td>
2103
<td class="paramname"></td><td>)</td>
2104
<td> const<code> [inline]</code></td>
2108
<div class="memdoc">
2110
<p>Definition at line <a class="el" href="a01101_source.html#l00361">361</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2111
<div class="fragment"><pre class="fragment"> {
2112
<span class="keywordflow">return</span> boxes_.singleton();
2117
<a class="anchor" id="aaeb1d34b6b937a9d028f06562c985bd5"></a><!-- doxytag: member="tesseract::ColPartition::IsTextType" ref="aaeb1d34b6b937a9d028f06562c985bd5" args="() const " -->
2118
<div class="memitem">
2119
<div class="memproto">
2120
<table class="memname">
2122
<td class="memname">bool <a class="el" href="a00323.html#aaeb1d34b6b937a9d028f06562c985bd5">tesseract::ColPartition::IsTextType</a> </td>
2124
<td class="paramname"></td><td>)</td>
2125
<td> const<code> [inline]</code></td>
2129
<div class="memdoc">
2131
<p>Definition at line <a class="el" href="a01101_source.html#l00427">427</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2132
<div class="fragment"><pre class="fragment"> {
2133
<span class="keywordflow">return</span> <a class="code" href="a00781.html#a49b7c03fb4e55b82a8fd22b7c6094082">PTIsTextType</a>(type_);
2138
<a class="anchor" id="a186886f273a6120362badb64ae4d79ce"></a><!-- doxytag: member="tesseract::ColPartition::IsUnMergeableType" ref="a186886f273a6120362badb64ae4d79ce" args="() const " -->
2139
<div class="memitem">
2140
<div class="memproto">
2141
<table class="memname">
2143
<td class="memname">bool <a class="el" href="a00323.html#a186886f273a6120362badb64ae4d79ce">tesseract::ColPartition::IsUnMergeableType</a> </td>
2145
<td class="paramname"></td><td>)</td>
2146
<td> const<code> [inline]</code></td>
2150
<div class="memdoc">
2152
<p>Definition at line <a class="el" href="a01101_source.html#l00443">443</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2153
<div class="fragment"><pre class="fragment"> {
2154
<span class="keywordflow">return</span> <a class="code" href="a00279.html#aed57b07f933309970d23490dfc5a5e52">BLOBNBOX::UnMergeableType</a>(blob_type_) || type_ == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa639c79458d7bb60c9d6f26f661dee484">PT_NOISE</a>;
2159
<a class="anchor" id="a75d609470c2e72b7ff7163d29dd5e8ec"></a><!-- doxytag: member="tesseract::ColPartition::IsVerticalLine" ref="a75d609470c2e72b7ff7163d29dd5e8ec" args="() const " -->
2160
<div class="memitem">
2161
<div class="memproto">
2162
<table class="memname">
2164
<td class="memname">bool <a class="el" href="a00323.html#a75d609470c2e72b7ff7163d29dd5e8ec">tesseract::ColPartition::IsVerticalLine</a> </td>
2166
<td class="paramname"></td><td>)</td>
2167
<td> const<code> [inline]</code></td>
2171
<div class="memdoc">
2173
<p>Definition at line <a class="el" href="a01101_source.html#l00448">448</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2174
<div class="fragment"><pre class="fragment"> {
2175
<span class="keywordflow">return</span> <a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>() && <a class="code" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">IsLineType</a>();
2180
<a class="anchor" id="aec438c63bf754474982b2bb4e74148b5"></a><!-- doxytag: member="tesseract::ColPartition::IsVerticalType" ref="aec438c63bf754474982b2bb4e74148b5" args="() const " -->
2181
<div class="memitem">
2182
<div class="memproto">
2183
<table class="memname">
2185
<td class="memname">bool <a class="el" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">tesseract::ColPartition::IsVerticalType</a> </td>
2187
<td class="paramname"></td><td>)</td>
2188
<td> const<code> [inline]</code></td>
2192
<div class="memdoc">
2194
<p>Definition at line <a class="el" href="a01101_source.html#l00435">435</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2195
<div class="fragment"><pre class="fragment"> {
2196
<span class="keywordflow">return</span> blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a> || blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a5d6cbdd0674e727feda3085026646f6a">BRT_VLINE</a>;
2201
<a class="anchor" id="ac45a47a9427bf943acba1c0ae7d8ed0b"></a><!-- doxytag: member="tesseract::ColPartition::KeyWidth" ref="ac45a47a9427bf943acba1c0ae7d8ed0b" args="(int left_key, int right_key) const " -->
2202
<div class="memitem">
2203
<div class="memproto">
2204
<table class="memname">
2206
<td class="memname">int <a class="el" href="a00323.html#ac45a47a9427bf943acba1c0ae7d8ed0b">tesseract::ColPartition::KeyWidth</a> </td>
2208
<td class="paramtype">int </td>
2209
<td class="paramname"><em>left_key</em>, </td>
2212
<td class="paramkey"></td>
2214
<td class="paramtype">int </td>
2215
<td class="paramname"><em>right_key</em> </td>
2220
<td></td><td> const<code> [inline]</code></td>
2224
<div class="memdoc">
2226
<p>Definition at line <a class="el" href="a01101_source.html#l00324">324</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2227
<div class="fragment"><pre class="fragment"> {
2228
<span class="keywordflow">return</span> (<a class="code" href="a00323.html#af8dc1730e816c82cf3007943dc70a363">right_key</a> - <a class="code" href="a00323.html#a05a26aa4023ea05c8d243cb66561ea89">left_key</a>) / vertical_.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>();
2233
<a class="anchor" id="a05a26aa4023ea05c8d243cb66561ea89"></a><!-- doxytag: member="tesseract::ColPartition::left_key" ref="a05a26aa4023ea05c8d243cb66561ea89" args="() const " -->
2234
<div class="memitem">
2235
<div class="memproto">
2236
<table class="memname">
2238
<td class="memname">int <a class="el" href="a00323.html#a05a26aa4023ea05c8d243cb66561ea89">tesseract::ColPartition::left_key</a> </td>
2240
<td class="paramname"></td><td>)</td>
2241
<td> const<code> [inline]</code></td>
2245
<div class="memdoc">
2247
<p>Definition at line <a class="el" href="a01101_source.html#l00172">172</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2248
<div class="fragment"><pre class="fragment"> {
2249
<span class="keywordflow">return</span> left_key_;
2254
<a class="anchor" id="abd6ba69b1f29c267933378d801477857"></a><!-- doxytag: member="tesseract::ColPartition::left_key_tab" ref="abd6ba69b1f29c267933378d801477857" args="() const " -->
2255
<div class="memitem">
2256
<div class="memproto">
2257
<table class="memname">
2259
<td class="memname">bool <a class="el" href="a00323.html#abd6ba69b1f29c267933378d801477857">tesseract::ColPartition::left_key_tab</a> </td>
2261
<td class="paramname"></td><td>)</td>
2262
<td> const<code> [inline]</code></td>
2266
<div class="memdoc">
2268
<p>Definition at line <a class="el" href="a01101_source.html#l00169">169</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2269
<div class="fragment"><pre class="fragment"> {
2270
<span class="keywordflow">return</span> left_key_tab_;
2275
<a class="anchor" id="a9890069a7855a61403f315444d2cd917"></a><!-- doxytag: member="tesseract::ColPartition::left_margin" ref="a9890069a7855a61403f315444d2cd917" args="() const " -->
2276
<div class="memitem">
2277
<div class="memproto">
2278
<table class="memname">
2280
<td class="memname">int <a class="el" href="a00323.html#a9890069a7855a61403f315444d2cd917">tesseract::ColPartition::left_margin</a> </td>
2282
<td class="paramname"></td><td>)</td>
2283
<td> const<code> [inline]</code></td>
2287
<div class="memdoc">
2289
<p>Definition at line <a class="el" href="a01101_source.html#l00112">112</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2290
<div class="fragment"><pre class="fragment"> {
2291
<span class="keywordflow">return</span> left_margin_;
2296
<a class="anchor" id="ab71e3aebabe8a0a9e3cde26f84ec4f46"></a><!-- doxytag: member="tesseract::ColPartition::LeftAtY" ref="ab71e3aebabe8a0a9e3cde26f84ec4f46" args="(int y) const " -->
2297
<div class="memitem">
2298
<div class="memproto">
2299
<table class="memname">
2301
<td class="memname">int <a class="el" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">tesseract::ColPartition::LeftAtY</a> </td>
2303
<td class="paramtype">int </td>
2304
<td class="paramname"><em>y</em></td><td>)</td>
2305
<td> const<code> [inline]</code></td>
2309
<div class="memdoc">
2311
<p>Definition at line <a class="el" href="a01101_source.html#l00340">340</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2312
<div class="fragment"><pre class="fragment"> {
2313
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">XAtY</a>(left_key_, y);
2318
<a class="anchor" id="a206e0152232376b343553af9cdbd8ad4"></a><!-- doxytag: member="tesseract::ColPartition::LeftBlobRule" ref="a206e0152232376b343553af9cdbd8ad4" args="() const " -->
2319
<div class="memitem">
2320
<div class="memproto">
2321
<table class="memname">
2323
<td class="memname">int <a class="el" href="a00323.html#a206e0152232376b343553af9cdbd8ad4">tesseract::ColPartition::LeftBlobRule</a> </td>
2325
<td class="paramname"></td><td>)</td>
2330
<div class="memdoc">
2332
<p>Definition at line <a class="el" href="a01100_source.html#l00541">541</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2333
<div class="fragment"><pre class="fragment"> {
2334
BLOBNBOX_C_IT it(const_cast<BLOBNBOX_CLIST*>(&boxes_));
2335
<span class="keywordflow">return</span> it.data()->left_rule();
2340
<a class="anchor" id="a0f9db819e6d23fda5fe1af0e2e84b2d3"></a><!-- doxytag: member="tesseract::ColPartition::LineSpacingBlocks" ref="a0f9db819e6d23fda5fe1af0e2e84b2d3" args="(const ICOORD &bleft, const ICOORD &tright, int resolution, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts, BLOCK_LIST *completed_blocks, TO_BLOCK_LIST *to_blocks)" -->
2341
<div class="memitem">
2342
<div class="memproto">
2343
<table class="memname">
2345
<td class="memname">void <a class="el" href="a00323.html#a0f9db819e6d23fda5fe1af0e2e84b2d3">tesseract::ColPartition::LineSpacingBlocks</a> </td>
2347
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2348
<td class="paramname"><em>bleft</em>, </td>
2351
<td class="paramkey"></td>
2353
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2354
<td class="paramname"><em>tright</em>, </td>
2357
<td class="paramkey"></td>
2359
<td class="paramtype">int </td>
2360
<td class="paramname"><em>resolution</em>, </td>
2363
<td class="paramkey"></td>
2365
<td class="paramtype">ColPartition_LIST * </td>
2366
<td class="paramname"><em>block_parts</em>, </td>
2369
<td class="paramkey"></td>
2371
<td class="paramtype">ColPartition_LIST * </td>
2372
<td class="paramname"><em>used_parts</em>, </td>
2375
<td class="paramkey"></td>
2377
<td class="paramtype">BLOCK_LIST * </td>
2378
<td class="paramname"><em>completed_blocks</em>, </td>
2381
<td class="paramkey"></td>
2383
<td class="paramtype">TO_BLOCK_LIST * </td>
2384
<td class="paramname"><em>to_blocks</em> </td>
2389
<td></td><td><code> [static]</code></td>
2393
<div class="memdoc">
2395
<p>Definition at line <a class="el" href="a01100_source.html#l01392">1392</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2396
<div class="fragment"><pre class="fragment"> {
2397
<span class="keywordtype">int</span> page_height = tright.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>() - bleft.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>();
2398
<span class="comment">// Compute the initial spacing stats.</span>
2399
ColPartition_IT it(block_parts);
2400
<span class="keywordtype">int</span> part_count = 0;
2401
<span class="keywordtype">int</span> max_line_height = 0;
2403
<span class="comment">// TODO(joeliu): We should add some special logic for PT_INLINE_EQUATION type</span>
2404
<span class="comment">// because their line spacing with their neighbors maybe smaller and their</span>
2405
<span class="comment">// height may be slightly larger.</span>
2407
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
2408
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = it.data();
2409
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!part->boxes()->empty());
2410
<a class="code" href="a00556.html">STATS</a> side_steps(0, part->bounding_box().height());
2411
<span class="keywordflow">if</span> (part->bounding_box().height() > max_line_height)
2412
max_line_height = part->bounding_box().height();
2413
BLOBNBOX_C_IT blob_it(part->boxes());
2414
<span class="keywordtype">int</span> prev_bottom = blob_it.data()->bounding_box().bottom();
2415
<span class="keywordflow">for</span> (blob_it.forward(); !blob_it.at_first(); blob_it.forward()) {
2416
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = blob_it.data();
2417
<span class="keywordtype">int</span> bottom = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>();
2418
<span class="keywordtype">int</span> step = bottom - prev_bottom;
2419
<span class="keywordflow">if</span> (step < 0)
2421
side_steps.add(step, 1);
2422
prev_bottom = bottom;
2424
part->set_side_step(static_cast<int>(side_steps.median() + 0.5));
2425
<span class="keywordflow">if</span> (!it.at_last()) {
2426
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* next_part = it.data_relative(1);
2427
part->set_bottom_spacing(part->median_bottom() -
2428
next_part->median_bottom());
2429
part->set_top_spacing(part->median_top() - next_part->median_top());
2430
} <span class="keywordflow">else</span> {
2431
part->set_bottom_spacing(page_height);
2432
part->set_top_spacing(page_height);
2434
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
2436
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"side step = %.2f, top spacing = %d, bottom spacing=%d\n"</span>,
2437
side_steps.median(), part->top_spacing(), part->bottom_spacing());
2441
<span class="keywordflow">if</span> (part_count == 0)
2442
<span class="keywordflow">return</span>;
2444
SmoothSpacings(resolution, page_height, block_parts);
2446
<span class="comment">// Move the partitions into individual block lists and make the blocks.</span>
2447
BLOCK_IT block_it(completed_blocks);
2448
TO_BLOCK_IT to_block_it(to_blocks);
2449
ColPartition_LIST spacing_parts;
2450
ColPartition_IT sp_block_it(&spacing_parts);
2451
<span class="keywordtype">int</span> same_block_threshold = max_line_height * <a class="code" href="a01265.html#ab896bf3ee331c3dc994d6ca764d523b0">kMaxSameBlockLineSpacing</a>;
2452
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.empty();) {
2453
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = it.extract();
2454
sp_block_it.add_to_end(part);
2456
<span class="keywordflow">if</span> (it.empty() || part->bottom_spacing() > same_block_threshold ||
2457
!part->SpacingsEqual(*it.data(), resolution)) {
2458
<span class="comment">// There is a spacing boundary. Check to see if it.data() belongs</span>
2459
<span class="comment">// better in the current block or the next one.</span>
2460
<span class="keywordflow">if</span> (!it.empty() && part->bottom_spacing() <= same_block_threshold) {
2461
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* next_part = it.data();
2462
<span class="comment">// If there is a size match one-way, then the middle line goes with</span>
2463
<span class="comment">// its matched size, otherwise it goes with the smallest spacing.</span>
2464
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* third_part = it.at_last() ? NULL : it.data_relative(1);
2465
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
2466
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Spacings unequal: upper:%d/%d, lower:%d/%d,"</span>
2467
<span class="stringliteral">" sizes %d %d %d\n"</span>,
2468
part->top_spacing(), part->bottom_spacing(),
2469
next_part->top_spacing(), next_part->bottom_spacing(),
2470
part->median_size(), next_part->median_size(),
2471
third_part != NULL ? third_part->median_size() : 0);
2473
<span class="comment">// We can only consider adding the next line to the block if the sizes</span>
2474
<span class="comment">// match and the lines are close enough for their size.</span>
2475
<span class="keywordflow">if</span> (part->SizesSimilar(*next_part) &&
2476
next_part->median_size() * kMaxSameBlockLineSpacing >
2477
part->bottom_spacing() &&
2478
part->median_size() * kMaxSameBlockLineSpacing >
2479
part->top_spacing()) {
2480
<span class="comment">// Even now, we can only add it as long as the third line doesn't</span>
2481
<span class="comment">// match in the same way and have a smaller bottom spacing.</span>
2482
<span class="keywordflow">if</span> (third_part == NULL ||
2483
!next_part->SizesSimilar(*third_part) ||
2484
third_part->median_size() * kMaxSameBlockLineSpacing <=
2485
next_part->bottom_spacing() ||
2486
next_part->median_size() * kMaxSameBlockLineSpacing <=
2487
next_part->top_spacing() ||
2488
next_part->bottom_spacing() > part->bottom_spacing()) {
2489
<span class="comment">// Add to the current block.</span>
2490
sp_block_it.add_to_end(it.extract());
2492
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
2493
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Added line to current block.\n"</span>);
2498
<a class="code" href="a00627.html">TO_BLOCK</a>* to_block = <a class="code" href="a00323.html#a275ef8548fa5a0af39e84d05dd383ab8">MakeBlock</a>(bleft, tright, &spacing_parts, used_parts);
2499
<span class="keywordflow">if</span> (to_block != NULL) {
2500
to_block_it.add_to_end(to_block);
2501
block_it.add_to_end(to_block-><a class="code" href="a00627.html#a16e698664028b0d6d2193db64560c16b">block</a>);
2503
sp_block_it.set_to_list(&spacing_parts);
2504
} <span class="keywordflow">else</span> {
2505
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a> && !it.empty()) {
2506
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* next_part = it.data();
2507
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Spacings equal: upper:%d/%d, lower:%d/%d\n"</span>,
2508
part->top_spacing(), part->bottom_spacing(),
2509
next_part->top_spacing(), next_part->bottom_spacing(),
2510
part->median_size(), next_part->median_size());
2518
<a class="anchor" id="abe20d8e0d6b3a347f3b9d4e43023fec4"></a><!-- doxytag: member="tesseract::ColPartition::lower_partners" ref="abe20d8e0d6b3a347f3b9d4e43023fec4" args="()" -->
2519
<div class="memitem">
2520
<div class="memproto">
2521
<table class="memname">
2523
<td class="memname">ColPartition_CLIST* <a class="el" href="a00323.html#abe20d8e0d6b3a347f3b9d4e43023fec4">tesseract::ColPartition::lower_partners</a> </td>
2525
<td class="paramname"></td><td>)</td>
2526
<td><code> [inline]</code></td>
2530
<div class="memdoc">
2532
<p>Definition at line <a class="el" href="a01101_source.html#l00199">199</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
2533
<div class="fragment"><pre class="fragment"> {
2534
<span class="keywordflow">return</span> &lower_partners_;
2539
<a class="anchor" id="a2baab68bca77728c6b50521131dc9b1a"></a><!-- doxytag: member="tesseract::ColPartition::MakeBigPartition" ref="a2baab68bca77728c6b50521131dc9b1a" args="(BLOBNBOX *box, ColPartition_LIST *big_part_list)" -->
2540
<div class="memitem">
2541
<div class="memproto">
2542
<table class="memname">
2544
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a2baab68bca77728c6b50521131dc9b1a">tesseract::ColPartition::MakeBigPartition</a> </td>
2546
<td class="paramtype"><a class="el" href="a00279.html">BLOBNBOX</a> * </td>
2547
<td class="paramname"><em>box</em>, </td>
2550
<td class="paramkey"></td>
2552
<td class="paramtype">ColPartition_LIST * </td>
2553
<td class="paramname"><em>big_part_list</em> </td>
2558
<td></td><td><code> [static]</code></td>
2562
<div class="memdoc">
2564
<p>Definition at line <a class="el" href="a01100_source.html#l00133">133</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2565
<div class="fragment"><pre class="fragment"> {
2566
box-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(NULL);
2567
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* single = <span class="keyword">new</span> <a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>(<a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a8a98863f18016aa4ccfd2d07dbb092a4">BRT_UNKNOWN</a>, <a class="code" href="a00409.html" title="integer coordinate">ICOORD</a>(0, 1));
2568
single->set_flow(<a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a745b15b1c990fa88c0712c50c5cd2202">BTFT_NONE</a>);
2569
single->AddBox(box);
2570
single->ComputeLimits();
2571
single->ClaimBoxes();
2572
single->SetBlobTypes();
2573
single->set_block_owned(<span class="keyword">true</span>);
2574
<span class="keywordflow">if</span> (big_part_list != NULL) {
2575
ColPartition_IT part_it(big_part_list);
2576
part_it.add_to_end(single);
2578
<span class="keywordflow">return</span> single;
2583
<a class="anchor" id="a275ef8548fa5a0af39e84d05dd383ab8"></a><!-- doxytag: member="tesseract::ColPartition::MakeBlock" ref="a275ef8548fa5a0af39e84d05dd383ab8" args="(const ICOORD &bleft, const ICOORD &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts)" -->
2584
<div class="memitem">
2585
<div class="memproto">
2586
<table class="memname">
2588
<td class="memname"><a class="el" href="a00627.html">TO_BLOCK</a> * <a class="el" href="a00323.html#a275ef8548fa5a0af39e84d05dd383ab8">tesseract::ColPartition::MakeBlock</a> </td>
2590
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2591
<td class="paramname"><em>bleft</em>, </td>
2594
<td class="paramkey"></td>
2596
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2597
<td class="paramname"><em>tright</em>, </td>
2600
<td class="paramkey"></td>
2602
<td class="paramtype">ColPartition_LIST * </td>
2603
<td class="paramname"><em>block_parts</em>, </td>
2606
<td class="paramkey"></td>
2608
<td class="paramtype">ColPartition_LIST * </td>
2609
<td class="paramname"><em>used_parts</em> </td>
2614
<td></td><td><code> [static]</code></td>
2618
<div class="memdoc">
2620
<p>Definition at line <a class="el" href="a01100_source.html#l01608">1608</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2621
<div class="fragment"><pre class="fragment"> {
2622
<span class="keywordflow">if</span> (block_parts->empty())
2623
<span class="keywordflow">return</span> NULL; <span class="comment">// Nothing to do.</span>
2624
ColPartition_IT it(block_parts);
2625
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = it.data();
2626
<a class="code" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> = part->type();
2627
<span class="keywordflow">if</span> (type == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fadf6b7dd3b8ca94923c3b94dfe53f230e">PT_VERTICAL_TEXT</a>)
2628
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a703b722077cd4fb5fc8c1c1212824b31">MakeVerticalTextBlock</a>(bleft, tright, block_parts, used_parts);
2629
<span class="comment">// LineSpacingBlocks has handed us a collection of evenly spaced lines and</span>
2630
<span class="comment">// put the average spacing in each partition, so we can just take the</span>
2631
<span class="comment">// linespacing from the first partition.</span>
2632
<span class="keywordtype">int</span> line_spacing = part->bottom_spacing();
2633
<span class="keywordflow">if</span> (line_spacing < part-><a class="code" href="a00323.html#a2ede8f204ed66939a0c4352657da6c94">median_size</a>())
2634
line_spacing = part->bounding_box().height();
2635
ICOORDELT_LIST vertices;
2636
ICOORDELT_IT vert_it(&vertices);
2637
<a class="code" href="a00409.html" title="integer coordinate">ICOORD</a> start, end;
2638
<span class="keywordtype">int</span> min_x = <a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
2639
<span class="keywordtype">int</span> max_x = -<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
2640
<span class="keywordtype">int</span> min_y = <a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
2641
<span class="keywordtype">int</span> max_y = -<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
2642
<span class="keywordtype">int</span> iteration = 0;
2643
<span class="keywordflow">do</span> {
2644
<span class="keywordflow">if</span> (iteration == 0)
2645
ColPartition::LeftEdgeRun(&it, &start, &end);
2646
<span class="keywordflow">else</span>
2647
ColPartition::RightEdgeRun(&it, &start, &end);
2648
ClipCoord(bleft, tright, &start);
2649
ClipCoord(bleft, tright, &end);
2650
vert_it.add_after_then_move(<span class="keyword">new</span> <a class="code" href="a00410.html">ICOORDELT</a>(start));
2651
vert_it.add_after_then_move(<span class="keyword">new</span> <a class="code" href="a00410.html">ICOORDELT</a>(end));
2652
<a class="code" href="a00830.html#a6eb00eb9bc5ed195953f334971c462ae">UpdateRange</a>(start.<a class="code" href="a00409.html#a59722a47c540007c58a539f0e35b3f33" title="access function">x</a>(), &min_x, &max_x);
2653
<a class="code" href="a00830.html#a6eb00eb9bc5ed195953f334971c462ae">UpdateRange</a>(end.<a class="code" href="a00409.html#a59722a47c540007c58a539f0e35b3f33" title="access function">x</a>(), &min_x, &max_x);
2654
<a class="code" href="a00830.html#a6eb00eb9bc5ed195953f334971c462ae">UpdateRange</a>(start.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>(), &min_y, &max_y);
2655
<a class="code" href="a00830.html#a6eb00eb9bc5ed195953f334971c462ae">UpdateRange</a>(end.<a class="code" href="a00409.html#a66bba6ff8a5f060775e1c2ca511f7f29" title="access_function">y</a>(), &min_y, &max_y);
2656
<span class="keywordflow">if</span> ((iteration == 0 && it.at_first()) ||
2657
(iteration == 1 && it.at_last())) {
2661
} <span class="keywordflow">while</span> (iteration < 2);
2662
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>)
2663
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Making block at (%d,%d)->(%d,%d)\n"</span>,
2664
min_x, min_y, max_x, max_y);
2665
<a class="code" href="a00280.html">BLOCK</a>* block = <span class="keyword">new</span> <a class="code" href="a00280.html">BLOCK</a>(<span class="stringliteral">""</span>, <span class="keyword">true</span>, 0, 0, min_x, min_y, max_x, max_y);
2666
block-><a class="code" href="a00500.html#a60f8ad7b10ca32e3ece92bb04e3f2793" title="set the poly block">set_poly_block</a>(<span class="keyword">new</span> <a class="code" href="a00505.html">POLY_BLOCK</a>(&vertices, type));
2667
<span class="keywordflow">return</span> MoveBlobsToBlock(<span class="keyword">false</span>, line_spacing, block, block_parts, used_parts);
2672
<a class="anchor" id="a446ed1c0731f3fb8d7199b45750c6c5c"></a><!-- doxytag: member="tesseract::ColPartition::MakeLinePartition" ref="a446ed1c0731f3fb8d7199b45750c6c5c" args="(BlobRegionType blob_type, const ICOORD &vertical, int left, int bottom, int right, int top)" -->
2673
<div class="memitem">
2674
<div class="memproto">
2675
<table class="memname">
2677
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a446ed1c0731f3fb8d7199b45750c6c5c">tesseract::ColPartition::MakeLinePartition</a> </td>
2679
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
2680
<td class="paramname"><em>blob_type</em>, </td>
2683
<td class="paramkey"></td>
2685
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2686
<td class="paramname"><em>vertical</em>, </td>
2689
<td class="paramkey"></td>
2691
<td class="paramtype">int </td>
2692
<td class="paramname"><em>left</em>, </td>
2695
<td class="paramkey"></td>
2697
<td class="paramtype">int </td>
2698
<td class="paramname"><em>bottom</em>, </td>
2701
<td class="paramkey"></td>
2703
<td class="paramtype">int </td>
2704
<td class="paramname"><em>right</em>, </td>
2707
<td class="paramkey"></td>
2709
<td class="paramtype">int </td>
2710
<td class="paramname"><em>top</em> </td>
2715
<td></td><td><code> [static]</code></td>
2719
<div class="memdoc">
2720
<p>Constructs a fake <a class="el" href="a00323.html">ColPartition</a> with no BLOBNBOXes to represent a horizontal or vertical line, given a type and a bounding box. </p>
2722
<p>Definition at line <a class="el" href="a01100_source.html#l00165">165</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2723
<div class="fragment"><pre class="fragment"> {
2724
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = <span class="keyword">new</span> <a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>(<a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a>, vertical);
2725
part->bounding_box_ = <a class="code" href="a00592.html">TBOX</a>(left, bottom, right, top);
2726
part->median_bottom_ = bottom;
2727
part->median_top_ = top;
2728
part->median_size_ = top - bottom;
2729
part->median_width_ = right - left;
2730
part->left_key_ = part->BoxLeftKey();
2731
part->right_key_ = part->BoxRightKey();
2732
<span class="keywordflow">return</span> part;
2737
<a class="anchor" id="a6ce139019daba1e444a3be681425cf9a"></a><!-- doxytag: member="tesseract::ColPartition::MakeToRow" ref="a6ce139019daba1e444a3be681425cf9a" args="()" -->
2738
<div class="memitem">
2739
<div class="memproto">
2740
<table class="memname">
2742
<td class="memname"><a class="el" href="a00628.html">TO_ROW</a> * <a class="el" href="a00323.html#a6ce139019daba1e444a3be681425cf9a">tesseract::ColPartition::MakeToRow</a> </td>
2744
<td class="paramname"></td><td>)</td>
2749
<div class="memdoc">
2751
<p>Definition at line <a class="el" href="a01100_source.html#l01687">1687</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2752
<div class="fragment"><pre class="fragment"> {
2753
BLOBNBOX_C_IT blob_it(&boxes_);
2754
<a class="code" href="a00628.html">TO_ROW</a>* row = NULL;
2755
<span class="keywordtype">int</span> line_size = <a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>() ? median_width_ : median_size_;
2756
<span class="comment">// Add all the blobs to a single TO_ROW.</span>
2757
<span class="keywordflow">for</span> (; !blob_it.empty(); blob_it.forward()) {
2758
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = blob_it.extract();
2759
<span class="comment">// blob->compute_bounding_box();</span>
2760
<span class="keywordtype">int</span> top = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>();
2761
<span class="keywordtype">int</span> bottom = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>();
2762
<span class="keywordflow">if</span> (row == NULL) {
2763
row = <span class="keyword">new</span> <a class="code" href="a00628.html">TO_ROW</a>(blob, static_cast<float>(top),
2764
static_cast<float>(bottom),
2765
static_cast<float>(line_size));
2766
} <span class="keywordflow">else</span> {
2767
row-><a class="code" href="a00628.html#a0173e9da64e4f2d29f01da14c3a053ee">add_blob</a>(blob, static_cast<float>(top),
2768
static_cast<float>(bottom),
2769
static_cast<float>(line_size));
2772
<span class="keywordflow">return</span> row;
2777
<a class="anchor" id="a703b722077cd4fb5fc8c1c1212824b31"></a><!-- doxytag: member="tesseract::ColPartition::MakeVerticalTextBlock" ref="a703b722077cd4fb5fc8c1c1212824b31" args="(const ICOORD &bleft, const ICOORD &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts)" -->
2778
<div class="memitem">
2779
<div class="memproto">
2780
<table class="memname">
2782
<td class="memname"><a class="el" href="a00627.html">TO_BLOCK</a> * <a class="el" href="a00323.html#a703b722077cd4fb5fc8c1c1212824b31">tesseract::ColPartition::MakeVerticalTextBlock</a> </td>
2784
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2785
<td class="paramname"><em>bleft</em>, </td>
2788
<td class="paramkey"></td>
2790
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
2791
<td class="paramname"><em>tright</em>, </td>
2794
<td class="paramkey"></td>
2796
<td class="paramtype">ColPartition_LIST * </td>
2797
<td class="paramname"><em>block_parts</em>, </td>
2800
<td class="paramkey"></td>
2802
<td class="paramtype">ColPartition_LIST * </td>
2803
<td class="paramname"><em>used_parts</em> </td>
2808
<td></td><td><code> [static]</code></td>
2812
<div class="memdoc">
2814
<p>Definition at line <a class="el" href="a01100_source.html#l01661">1661</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2815
<div class="fragment"><pre class="fragment"> {
2816
<span class="keywordflow">if</span> (block_parts->empty())
2817
<span class="keywordflow">return</span> NULL; <span class="comment">// Nothing to do.</span>
2818
ColPartition_IT it(block_parts);
2819
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = it.data();
2820
<a class="code" href="a00592.html">TBOX</a> block_box = part->bounding_box();
2821
<span class="keywordtype">int</span> line_spacing = block_box.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>();
2822
<a class="code" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> = it.data()->type();
2823
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
2824
block_box += it.data()->bounding_box();
2826
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
2827
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Making block at:"</span>);
2828
block_box.<a class="code" href="a00592.html#a2e753aa9943276301d68e9f9cad99620">print</a>();
2830
<a class="code" href="a00280.html">BLOCK</a>* block = <span class="keyword">new</span> <a class="code" href="a00280.html">BLOCK</a>(<span class="stringliteral">""</span>, <span class="keyword">true</span>, 0, 0, block_box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), block_box.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(),
2831
block_box.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), block_box.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>());
2832
block-><a class="code" href="a00500.html#a60f8ad7b10ca32e3ece92bb04e3f2793" title="set the poly block">set_poly_block</a>(<span class="keyword">new</span> <a class="code" href="a00505.html">POLY_BLOCK</a>(block_box, type));
2833
<span class="keywordflow">return</span> MoveBlobsToBlock(<span class="keyword">true</span>, line_spacing, block, block_parts, used_parts);
2838
<a class="anchor" id="ac793c818de7d472b7d45b4c2a6b9c11e"></a><!-- doxytag: member="tesseract::ColPartition::MarkAsLeaderIfMonospaced" ref="ac793c818de7d472b7d45b4c2a6b9c11e" args="()" -->
2839
<div class="memitem">
2840
<div class="memproto">
2841
<table class="memname">
2843
<td class="memname">bool <a class="el" href="a00323.html#ac793c818de7d472b7d45b4c2a6b9c11e">tesseract::ColPartition::MarkAsLeaderIfMonospaced</a> </td>
2845
<td class="paramname"></td><td>)</td>
2850
<div class="memdoc">
2852
<p>Definition at line <a class="el" href="a01100_source.html#l01073">1073</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2853
<div class="fragment"><pre class="fragment"> {
2854
<span class="keywordtype">bool</span> result = <span class="keyword">false</span>;
2855
<span class="comment">// Gather statistics on the gaps between blobs and the widths of the blobs.</span>
2856
<span class="keywordtype">int</span> part_width = bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>();
2857
<a class="code" href="a00556.html">STATS</a> gap_stats(0, part_width);
2858
<a class="code" href="a00556.html">STATS</a> width_stats(0, part_width);
2859
BLOBNBOX_C_IT it(&boxes_);
2860
<a class="code" href="a00279.html">BLOBNBOX</a>* prev_blob = it.data();
2861
prev_blob-><a class="code" href="a00279.html#a75340334988feba52ce36ba596750a35">set_flow</a>(<a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1adac19762bd040a53914be696482c1e53">BTFT_NEIGHBOURS</a>);
2862
width_stats.add(prev_blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>(), 1);
2863
<span class="keywordtype">int</span> blob_count = 1;
2864
<span class="keywordflow">for</span> (it.forward(); !it.at_first(); it.forward()) {
2865
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
2866
<span class="keywordtype">int</span> left = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>();
2867
<span class="keywordtype">int</span> right = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>();
2868
gap_stats.add(left - prev_blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), 1);
2869
width_stats.add(right - left, 1);
2870
blob-><a class="code" href="a00279.html#a75340334988feba52ce36ba596750a35">set_flow</a>(<a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1adac19762bd040a53914be696482c1e53">BTFT_NEIGHBOURS</a>);
2874
<span class="keywordtype">double</span> median_gap = gap_stats.median();
2875
<span class="keywordtype">double</span> <a class="code" href="a00323.html#ae6dbcc0f37246998a114bbe2432d1969">median_width</a> = width_stats.median();
2876
<span class="keywordtype">double</span> max_width = MAX(median_gap, median_width);
2877
<span class="keywordtype">double</span> min_width = MIN(median_gap, median_width);
2878
<span class="keywordtype">double</span> gap_iqr = gap_stats.ile(0.75f) - gap_stats.ile(0.25f);
2879
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a> >= 4) {
2880
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"gap iqr = %g, blob_count=%d, limits=%g,%g\n"</span>,
2881
gap_iqr, blob_count, max_width * <a class="code" href="a01265.html#afa8971bf35c601524286aeb419a061a2">kMaxLeaderGapFractionOfMax</a>,
2882
min_width * <a class="code" href="a01265.html#a06d2e157a317d737547326b3a463326f">kMaxLeaderGapFractionOfMin</a>);
2884
<span class="keywordflow">if</span> (gap_iqr < max_width * <a class="code" href="a01265.html#afa8971bf35c601524286aeb419a061a2">kMaxLeaderGapFractionOfMax</a> &&
2885
gap_iqr < min_width * <a class="code" href="a01265.html#a06d2e157a317d737547326b3a463326f">kMaxLeaderGapFractionOfMin</a> &&
2886
blob_count >= <a class="code" href="a01265.html#a97c300450ada83371da245cda0fdee0e">kMinLeaderCount</a>) {
2887
<span class="comment">// This is stable enough to be called a leader, so check the widths.</span>
2888
<span class="comment">// Since leader dashes can join, run a dp cutting algorithm and go</span>
2889
<span class="comment">// on the cost.</span>
2890
<span class="keywordtype">int</span> offset = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(ceil(gap_iqr * 2));
2891
<span class="keywordtype">int</span> min_step = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(median_gap + median_width + 0.5);
2892
<span class="keywordtype">int</span> max_step = min_step + offset;
2894
<span class="comment">// Pad the buffer with min_step/2 on each end.</span>
2895
<span class="keywordtype">int</span> part_left = bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() - min_step / 2;
2896
part_width += min_step;
2897
DPPoint* projection = <span class="keyword">new</span> DPPoint[part_width];
2898
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
2899
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
2900
<span class="keywordtype">int</span> left = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>();
2901
<span class="keywordtype">int</span> right = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>();
2902
<span class="keywordtype">int</span> height = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>();
2903
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> x = left; x < right; ++x) {
2904
projection[left - part_left].AddLocalCost(height);
2907
DPPoint* best_end = <a class="code" href="a00879.html#a8098e057438e6f07276dd005f28ef13c">DPPoint::Solve</a>(min_step, max_step, <span class="keyword">false</span>,
2908
&<a class="code" href="a00359.html#a4d01fa4702020ea2e3cbd89f754fc9e5">DPPoint::CostWithVariance</a>,
2909
part_width, projection);
2910
<span class="keywordflow">if</span> (best_end != NULL && best_end->total_cost() < blob_count) {
2911
<span class="comment">// Good enough. Call it a leader.</span>
2912
result = <span class="keyword">true</span>;
2913
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
2914
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
2915
<a class="code" href="a00592.html">TBOX</a> box = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
2916
<span class="comment">// If the first or last blob is spaced too much, don't mark it.</span>
2917
<span class="keywordflow">if</span> (it.at_first()) {
2918
<span class="keywordtype">int</span> gap = it.data_relative(1)->bounding_box().<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() -
2919
blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>();
2920
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>() + gap > max_step) {
2922
<span class="keywordflow">continue</span>;
2925
<span class="keywordflow">if</span> (it.at_last()) {
2926
<span class="keywordtype">int</span> gap = blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() -
2927
it.data_relative(-1)->bounding_box().right();
2928
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>() + gap > max_step) {
2930
<span class="keywordflow">break</span>;
2933
blob-><a class="code" href="a00279.html#a9b58644d9ad4f0d01193f47f55dd884f">set_region_type</a>(<a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a>);
2934
blob-><a class="code" href="a00279.html#a75340334988feba52ce36ba596750a35">set_flow</a>(<a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a64e3e70c4fac4d4e3facdb4638307d7f">BTFT_LEADER</a>);
2936
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a>;
2937
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a64e3e70c4fac4d4e3facdb4638307d7f">BTFT_LEADER</a>;
2938
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
2939
<span class="keywordflow">if</span> (best_end == NULL) {
2940
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"No path\n"</span>);
2941
} <span class="keywordflow">else</span> {
2942
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Total cost = %d vs allowed %d\n"</span>,
2943
best_end->total_cost() < blob_count);
2946
<span class="keyword">delete</span> [] projection;
2948
<span class="keywordflow">return</span> result;
2953
<a class="anchor" id="a75d8f8d4384f5bdb51c2c9e58f6677d3"></a><!-- doxytag: member="tesseract::ColPartition::MatchingColumns" ref="a75d8f8d4384f5bdb51c2c9e58f6677d3" args="(const ColPartition &other) const " -->
2954
<div class="memitem">
2955
<div class="memproto">
2956
<table class="memname">
2958
<td class="memname">bool <a class="el" href="a00323.html#a75d8f8d4384f5bdb51c2c9e58f6677d3">tesseract::ColPartition::MatchingColumns</a> </td>
2960
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
2961
<td class="paramname"><em>other</em></td><td>)</td>
2966
<div class="memdoc">
2968
<p>Definition at line <a class="el" href="a01100_source.html#l00366">366</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2969
<div class="fragment"><pre class="fragment"> {
2970
<span class="keywordtype">int</span> y = (<a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>() + other.MidY()) / 2;
2971
<span class="keywordflow">if</span> (!<a class="code" href="a00831.html#a80998b3d098c50b53b1f275adeafe267">NearlyEqual</a>(other.LeftAtY(y) / <a class="code" href="a01265.html#a09df286c02619a6b22c2cd6f89e42267">kColumnWidthFactor</a>,
2972
<a class="code" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">LeftAtY</a>(y) / <a class="code" href="a01265.html#a09df286c02619a6b22c2cd6f89e42267">kColumnWidthFactor</a>, 1))
2973
<span class="keywordflow">return</span> <span class="keyword">false</span>;
2974
<span class="keywordflow">if</span> (!<a class="code" href="a00831.html#a80998b3d098c50b53b1f275adeafe267">NearlyEqual</a>(other.RightAtY(y) / <a class="code" href="a01265.html#a09df286c02619a6b22c2cd6f89e42267">kColumnWidthFactor</a>,
2975
<a class="code" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">RightAtY</a>(y) / <a class="code" href="a01265.html#a09df286c02619a6b22c2cd6f89e42267">kColumnWidthFactor</a>, 1))
2976
<span class="keywordflow">return</span> <span class="keyword">false</span>;
2977
<span class="keywordflow">return</span> <span class="keyword">true</span>;
2982
<a class="anchor" id="a5da7ad2aed53f88b06f60f044796d426"></a><!-- doxytag: member="tesseract::ColPartition::MatchingSizes" ref="a5da7ad2aed53f88b06f60f044796d426" args="(const ColPartition &other) const " -->
2983
<div class="memitem">
2984
<div class="memproto">
2985
<table class="memname">
2987
<td class="memname">bool <a class="el" href="a00323.html#a5da7ad2aed53f88b06f60f044796d426">tesseract::ColPartition::MatchingSizes</a> </td>
2989
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
2990
<td class="paramname"><em>other</em></td><td>)</td>
2995
<div class="memdoc">
2997
<p>Definition at line <a class="el" href="a01100_source.html#l00401">401</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
2998
<div class="fragment"><pre class="fragment"> {
2999
<span class="keywordflow">if</span> (blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a> || other.blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a>)
3000
<span class="keywordflow">return</span> !<a class="code" href="a00586.html#a386ab5331aecfd3bf73b9dfdc5d23b57">TabFind::DifferentSizes</a>(median_width_, other.median_width_);
3001
<span class="keywordflow">else</span>
3002
<span class="keywordflow">return</span> !<a class="code" href="a00586.html#a386ab5331aecfd3bf73b9dfdc5d23b57">TabFind::DifferentSizes</a>(median_size_, other.median_size_);
3007
<a class="anchor" id="a254db121f880ac20406f454045dc9780"></a><!-- doxytag: member="tesseract::ColPartition::MatchingStrokeWidth" ref="a254db121f880ac20406f454045dc9780" args="(const ColPartition &other, double fractional_tolerance, double constant_tolerance) const " -->
3008
<div class="memitem">
3009
<div class="memproto">
3010
<table class="memname">
3012
<td class="memname">bool <a class="el" href="a00323.html#a254db121f880ac20406f454045dc9780">tesseract::ColPartition::MatchingStrokeWidth</a> </td>
3014
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
3015
<td class="paramname"><em>other</em>, </td>
3018
<td class="paramkey"></td>
3020
<td class="paramtype">double </td>
3021
<td class="paramname"><em>fractional_tolerance</em>, </td>
3024
<td class="paramkey"></td>
3026
<td class="paramtype">double </td>
3027
<td class="paramname"><em>constant_tolerance</em> </td>
3032
<td></td><td> const</td>
3036
<div class="memdoc">
3038
<p>Definition at line <a class="el" href="a01100_source.html#l00426">426</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3039
<div class="fragment"><pre class="fragment"> {
3040
<span class="keywordtype">int</span> match_count = 0;
3041
<span class="keywordtype">int</span> nonmatch_count = 0;
3042
BLOBNBOX_C_IT box_it(const_cast<BLOBNBOX_CLIST*>(&boxes_));
3043
BLOBNBOX_C_IT other_it(const_cast<BLOBNBOX_CLIST*>(&other.boxes_));
3044
box_it.mark_cycle_pt();
3045
other_it.mark_cycle_pt();
3046
<span class="keywordflow">while</span> (!box_it.cycled_list() && !other_it.cycled_list()) {
3047
<span class="keywordflow">if</span> (box_it.data()->MatchingStrokeWidth(*other_it.data(),
3048
fractional_tolerance,
3049
constant_tolerance))
3051
<span class="keywordflow">else</span>
3056
<span class="keywordflow">return</span> match_count > nonmatch_count;
3061
<a class="anchor" id="a43bbac4acbcc68b1998f0c92ca17be26"></a><!-- doxytag: member="tesseract::ColPartition::MatchingTextColor" ref="a43bbac4acbcc68b1998f0c92ca17be26" args="(const ColPartition &other) const " -->
3062
<div class="memitem">
3063
<div class="memproto">
3064
<table class="memname">
3066
<td class="memname">bool <a class="el" href="a00323.html#a43bbac4acbcc68b1998f0c92ca17be26">tesseract::ColPartition::MatchingTextColor</a> </td>
3068
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
3069
<td class="paramname"><em>other</em></td><td>)</td>
3074
<div class="memdoc">
3076
<p>Definition at line <a class="el" href="a01100_source.html#l00378">378</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3077
<div class="fragment"><pre class="fragment"> {
3078
<span class="keywordflow">if</span> (color1_[L_ALPHA_CHANNEL] > <a class="code" href="a01265.html#abf95c90bc0630ea9218c2eb0d70472dd">kMaxRMSColorNoise</a> &&
3079
other.color1_[L_ALPHA_CHANNEL] > <a class="code" href="a01265.html#abf95c90bc0630ea9218c2eb0d70472dd">kMaxRMSColorNoise</a>)
3080
<span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Too noisy.</span>
3082
<span class="comment">// Colors must match for other to count.</span>
3083
<span class="keywordtype">double</span> d_this1_o = <a class="code" href="a00413.html#a2164c90398c78d8343f4bebec81f8341">ImageFind::ColorDistanceFromLine</a>(other.color1_,
3086
<span class="keywordtype">double</span> d_this2_o = <a class="code" href="a00413.html#a2164c90398c78d8343f4bebec81f8341">ImageFind::ColorDistanceFromLine</a>(other.color1_,
3089
<span class="keywordtype">double</span> d_o1_this = <a class="code" href="a00413.html#a2164c90398c78d8343f4bebec81f8341">ImageFind::ColorDistanceFromLine</a>(color1_, color2_,
3091
<span class="keywordtype">double</span> d_o2_this = <a class="code" href="a00413.html#a2164c90398c78d8343f4bebec81f8341">ImageFind::ColorDistanceFromLine</a>(color1_, color2_,
3093
<span class="comment">// All 4 distances must be small enough.</span>
3094
<span class="keywordflow">return</span> d_this1_o < <a class="code" href="a01265.html#a4fb5be2b91cab225fc69bec75ccf96bc">kMaxColorDistance</a> && d_this2_o < <a class="code" href="a01265.html#a4fb5be2b91cab225fc69bec75ccf96bc">kMaxColorDistance</a> &&
3095
d_o1_this < <a class="code" href="a01265.html#a4fb5be2b91cab225fc69bec75ccf96bc">kMaxColorDistance</a> && d_o2_this < <a class="code" href="a01265.html#a4fb5be2b91cab225fc69bec75ccf96bc">kMaxColorDistance</a>;
3100
<a class="anchor" id="a9f0978c738e29da8c7474beb0024a62f"></a><!-- doxytag: member="tesseract::ColPartition::median_bottom" ref="a9f0978c738e29da8c7474beb0024a62f" args="() const " -->
3101
<div class="memitem">
3102
<div class="memproto">
3103
<table class="memname">
3105
<td class="memname">int <a class="el" href="a00323.html#a9f0978c738e29da8c7474beb0024a62f">tesseract::ColPartition::median_bottom</a> </td>
3107
<td class="paramname"></td><td>)</td>
3108
<td> const<code> [inline]</code></td>
3112
<div class="memdoc">
3114
<p>Definition at line <a class="el" href="a01101_source.html#l00127">127</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3115
<div class="fragment"><pre class="fragment"> {
3116
<span class="keywordflow">return</span> median_bottom_;
3121
<a class="anchor" id="a74ee9a13d1b383a8550bfdfbc2c58eab"></a><!-- doxytag: member="tesseract::ColPartition::median_left" ref="a74ee9a13d1b383a8550bfdfbc2c58eab" args="() const " -->
3122
<div class="memitem">
3123
<div class="memproto">
3124
<table class="memname">
3126
<td class="memname">int <a class="el" href="a00323.html#a74ee9a13d1b383a8550bfdfbc2c58eab">tesseract::ColPartition::median_left</a> </td>
3128
<td class="paramname"></td><td>)</td>
3129
<td> const<code> [inline]</code></td>
3133
<div class="memdoc">
3135
<p>Definition at line <a class="el" href="a01101_source.html#l00130">130</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3136
<div class="fragment"><pre class="fragment"> {
3137
<span class="keywordflow">return</span> median_left_;
3142
<a class="anchor" id="a61a0716cd755a616b0d967ae51c02251"></a><!-- doxytag: member="tesseract::ColPartition::median_right" ref="a61a0716cd755a616b0d967ae51c02251" args="() const " -->
3143
<div class="memitem">
3144
<div class="memproto">
3145
<table class="memname">
3147
<td class="memname">int <a class="el" href="a00323.html#a61a0716cd755a616b0d967ae51c02251">tesseract::ColPartition::median_right</a> </td>
3149
<td class="paramname"></td><td>)</td>
3150
<td> const<code> [inline]</code></td>
3154
<div class="memdoc">
3156
<p>Definition at line <a class="el" href="a01101_source.html#l00133">133</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3157
<div class="fragment"><pre class="fragment"> {
3158
<span class="keywordflow">return</span> median_right_;
3163
<a class="anchor" id="a2ede8f204ed66939a0c4352657da6c94"></a><!-- doxytag: member="tesseract::ColPartition::median_size" ref="a2ede8f204ed66939a0c4352657da6c94" args="() const " -->
3164
<div class="memitem">
3165
<div class="memproto">
3166
<table class="memname">
3168
<td class="memname">int <a class="el" href="a00323.html#a2ede8f204ed66939a0c4352657da6c94">tesseract::ColPartition::median_size</a> </td>
3170
<td class="paramname"></td><td>)</td>
3171
<td> const<code> [inline]</code></td>
3175
<div class="memdoc">
3177
<p>Definition at line <a class="el" href="a01101_source.html#l00136">136</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3178
<div class="fragment"><pre class="fragment"> {
3179
<span class="keywordflow">return</span> median_size_;
3184
<a class="anchor" id="a3d4e0280ce16c899b22ecb5741c7f4db"></a><!-- doxytag: member="tesseract::ColPartition::median_top" ref="a3d4e0280ce16c899b22ecb5741c7f4db" args="() const " -->
3185
<div class="memitem">
3186
<div class="memproto">
3187
<table class="memname">
3189
<td class="memname">int <a class="el" href="a00323.html#a3d4e0280ce16c899b22ecb5741c7f4db">tesseract::ColPartition::median_top</a> </td>
3191
<td class="paramname"></td><td>)</td>
3192
<td> const<code> [inline]</code></td>
3196
<div class="memdoc">
3198
<p>Definition at line <a class="el" href="a01101_source.html#l00124">124</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3199
<div class="fragment"><pre class="fragment"> {
3200
<span class="keywordflow">return</span> median_top_;
3205
<a class="anchor" id="ae6dbcc0f37246998a114bbe2432d1969"></a><!-- doxytag: member="tesseract::ColPartition::median_width" ref="ae6dbcc0f37246998a114bbe2432d1969" args="() const " -->
3206
<div class="memitem">
3207
<div class="memproto">
3208
<table class="memname">
3210
<td class="memname">int <a class="el" href="a00323.html#ae6dbcc0f37246998a114bbe2432d1969">tesseract::ColPartition::median_width</a> </td>
3212
<td class="paramname"></td><td>)</td>
3213
<td> const<code> [inline]</code></td>
3217
<div class="memdoc">
3219
<p>Definition at line <a class="el" href="a01101_source.html#l00142">142</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3220
<div class="fragment"><pre class="fragment"> {
3221
<span class="keywordflow">return</span> median_width_;
3226
<a class="anchor" id="a4c635a35332c62bcc9c62b0f46e403cd"></a><!-- doxytag: member="tesseract::ColPartition::MedianY" ref="a4c635a35332c62bcc9c62b0f46e403cd" args="() const " -->
3227
<div class="memitem">
3228
<div class="memproto">
3229
<table class="memname">
3231
<td class="memname">int <a class="el" href="a00323.html#a4c635a35332c62bcc9c62b0f46e403cd">tesseract::ColPartition::MedianY</a> </td>
3233
<td class="paramname"></td><td>)</td>
3234
<td> const<code> [inline]</code></td>
3238
<div class="memdoc">
3240
<p>Definition at line <a class="el" href="a01101_source.html#l00308">308</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3241
<div class="fragment"><pre class="fragment"> {
3242
<span class="keywordflow">return</span> (median_top_ + median_bottom_) / 2;
3247
<a class="anchor" id="add960a03f31697fffec9449db86a825d"></a><!-- doxytag: member="tesseract::ColPartition::MidX" ref="add960a03f31697fffec9449db86a825d" args="() const " -->
3248
<div class="memitem">
3249
<div class="memproto">
3250
<table class="memname">
3252
<td class="memname">int <a class="el" href="a00323.html#add960a03f31697fffec9449db86a825d">tesseract::ColPartition::MidX</a> </td>
3254
<td class="paramname"></td><td>)</td>
3255
<td> const<code> [inline]</code></td>
3259
<div class="memdoc">
3261
<p>Definition at line <a class="el" href="a01101_source.html#l00312">312</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3262
<div class="fragment"><pre class="fragment"> {
3263
<span class="keywordflow">return</span> (bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() + bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>()) / 2;
3268
<a class="anchor" id="acfb9938222780d3957049698e2bde9e6"></a><!-- doxytag: member="tesseract::ColPartition::MidY" ref="acfb9938222780d3957049698e2bde9e6" args="() const " -->
3269
<div class="memitem">
3270
<div class="memproto">
3271
<table class="memname">
3273
<td class="memname">int <a class="el" href="a00323.html#acfb9938222780d3957049698e2bde9e6">tesseract::ColPartition::MidY</a> </td>
3275
<td class="paramname"></td><td>)</td>
3276
<td> const<code> [inline]</code></td>
3280
<div class="memdoc">
3282
<p>Definition at line <a class="el" href="a01101_source.html#l00304">304</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3283
<div class="fragment"><pre class="fragment"> {
3284
<span class="keywordflow">return</span> (bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>() + bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>()) / 2;
3289
<a class="anchor" id="a4df588400a880c9ac54eea8d1d7c28fb"></a><!-- doxytag: member="tesseract::ColPartition::nearest_neighbor_above" ref="a4df588400a880c9ac54eea8d1d7c28fb" args="() const " -->
3290
<div class="memitem">
3291
<div class="memproto">
3292
<table class="memname">
3294
<td class="memname"><a class="el" href="a00323.html">ColPartition</a>* <a class="el" href="a00323.html#a4df588400a880c9ac54eea8d1d7c28fb">tesseract::ColPartition::nearest_neighbor_above</a> </td>
3296
<td class="paramname"></td><td>)</td>
3297
<td> const<code> [inline]</code></td>
3301
<div class="memdoc">
3303
<p>Definition at line <a class="el" href="a01101_source.html#l00249">249</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3304
<div class="fragment"><pre class="fragment"> {
3305
<span class="keywordflow">return</span> nearest_neighbor_above_;
3310
<a class="anchor" id="a4eac60eb833ebb548ff2409c5999753f"></a><!-- doxytag: member="tesseract::ColPartition::nearest_neighbor_below" ref="a4eac60eb833ebb548ff2409c5999753f" args="() const " -->
3311
<div class="memitem">
3312
<div class="memproto">
3313
<table class="memname">
3315
<td class="memname"><a class="el" href="a00323.html">ColPartition</a>* <a class="el" href="a00323.html#a4eac60eb833ebb548ff2409c5999753f">tesseract::ColPartition::nearest_neighbor_below</a> </td>
3317
<td class="paramname"></td><td>)</td>
3318
<td> const<code> [inline]</code></td>
3322
<div class="memdoc">
3324
<p>Definition at line <a class="el" href="a01101_source.html#l00255">255</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3325
<div class="fragment"><pre class="fragment"> {
3326
<span class="keywordflow">return</span> nearest_neighbor_below_;
3331
<a class="anchor" id="a050a14aa4fa9b11f90e058ca242c4fcf"></a><!-- doxytag: member="tesseract::ColPartition::OKDiacriticMerge" ref="a050a14aa4fa9b11f90e058ca242c4fcf" args="(const ColPartition &candidate, bool debug) const " -->
3332
<div class="memitem">
3333
<div class="memproto">
3334
<table class="memname">
3336
<td class="memname">bool <a class="el" href="a00323.html#a050a14aa4fa9b11f90e058ca242c4fcf">tesseract::ColPartition::OKDiacriticMerge</a> </td>
3338
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
3339
<td class="paramname"><em>candidate</em>, </td>
3342
<td class="paramkey"></td>
3344
<td class="paramtype">bool </td>
3345
<td class="paramname"><em>debug</em> </td>
3350
<td></td><td> const</td>
3354
<div class="memdoc">
3356
<p>Definition at line <a class="el" href="a01100_source.html#l00454">454</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3357
<div class="fragment"><pre class="fragment"> {
3358
BLOBNBOX_C_IT it(const_cast<BLOBNBOX_CLIST*>(&boxes_));
3359
<span class="keywordtype">int</span> min_top = <a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
3360
<span class="keywordtype">int</span> max_bottom = -<a class="code" href="a00831.html#aac62d87844689a18b6f5339a89ed6e7f">MAX_INT32</a>;
3361
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
3362
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
3363
<span class="keywordflow">if</span> (!blob-><a class="code" href="a00279.html#a3dc859a710d5a7473489c2f3e1e36326">IsDiacritic</a>()) {
3364
<span class="keywordflow">if</span> (debug) {
3365
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Blob is not a diacritic:"</span>);
3366
blob-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>().<a class="code" href="a00592.html#a2e753aa9943276301d68e9f9cad99620">print</a>();
3368
<span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// All blobs must have diacritic bases.</span>
3370
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#af83ee964739e33a2611a1ba4b21f7a4c">base_char_top</a>() < min_top)
3371
min_top = blob-><a class="code" href="a00279.html#af83ee964739e33a2611a1ba4b21f7a4c">base_char_top</a>();
3372
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#a6fd24eab699bad3b00917fea0a82792b">base_char_bottom</a>() > max_bottom)
3373
max_bottom = blob-><a class="code" href="a00279.html#a6fd24eab699bad3b00917fea0a82792b">base_char_bottom</a>();
3375
<span class="comment">// If the intersection of all vertical ranges of all base characters</span>
3376
<span class="comment">// overlaps the median range of this, then it is OK.</span>
3377
<span class="keywordtype">bool</span> result = min_top > candidate.median_bottom_ &&
3378
max_bottom < candidate.median_top_;
3379
<span class="keywordflow">if</span> (debug) {
3380
<span class="keywordflow">if</span> (result)
3381
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"OKDiacritic!\n"</span>);
3382
<span class="keywordflow">else</span>
3383
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"y ranges don\'t overlap: %d-%d / %d-%d\n"</span>,
3384
max_bottom, min_top, median_bottom_, median_top_);
3386
<span class="keywordflow">return</span> result;
3391
<a class="anchor" id="a8ea7f1476b335624a5e11985491dc589"></a><!-- doxytag: member="tesseract::ColPartition::OKMergeOverlap" ref="a8ea7f1476b335624a5e11985491dc589" args="(const ColPartition &merge1, const ColPartition &merge2, int ok_box_overlap, bool debug)" -->
3392
<div class="memitem">
3393
<div class="memproto">
3394
<table class="memname">
3396
<td class="memname">bool <a class="el" href="a00323.html#a8ea7f1476b335624a5e11985491dc589">tesseract::ColPartition::OKMergeOverlap</a> </td>
3398
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
3399
<td class="paramname"><em>merge1</em>, </td>
3402
<td class="paramkey"></td>
3404
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
3405
<td class="paramname"><em>merge2</em>, </td>
3408
<td class="paramkey"></td>
3410
<td class="paramtype">int </td>
3411
<td class="paramname"><em>ok_box_overlap</em>, </td>
3414
<td class="paramkey"></td>
3416
<td class="paramtype">bool </td>
3417
<td class="paramname"><em>debug</em> </td>
3426
<div class="memdoc">
3428
<p>Definition at line <a class="el" href="a01100_source.html#l00730">730</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3429
<div class="fragment"><pre class="fragment"> {
3430
<span class="comment">// Vertical partitions are not allowed to be involved.</span>
3431
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aec438c63bf754474982b2bb4e74148b5">IsVerticalType</a>() || merge1.IsVerticalType() || merge2.IsVerticalType()) {
3432
<span class="keywordflow">if</span> (debug)
3433
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Vertical partition\n"</span>);
3434
<span class="keywordflow">return</span> <span class="keyword">false</span>;
3436
<span class="comment">// The merging partitions must strongly overlap each other.</span>
3437
<span class="keywordflow">if</span> (!merge1.VSignificantCoreOverlap(merge2)) {
3438
<span class="keywordflow">if</span> (debug)
3439
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Voverlap %d (%d)\n"</span>,
3440
merge1.VCoreOverlap(merge2),
3441
merge1.VSignificantCoreOverlap(merge2));
3442
<span class="keywordflow">return</span> <span class="keyword">false</span>;
3444
<span class="comment">// The merged box must not overlap the median bounds of this.</span>
3445
<a class="code" href="a00592.html">TBOX</a> merged_box(merge1.bounding_box());
3446
merged_box += merge2.bounding_box();
3447
<span class="keywordflow">if</span> (merged_box.bottom() < median_top_ && merged_box.top() > median_bottom_ &&
3448
merged_box.bottom() < bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>() - ok_box_overlap &&
3449
merged_box.top() > bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>() + ok_box_overlap) {
3450
<span class="keywordflow">if</span> (debug)
3451
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Excessive box overlap\n"</span>);
3452
<span class="keywordflow">return</span> <span class="keyword">false</span>;
3454
<span class="comment">// Looks OK!</span>
3455
<span class="keywordflow">return</span> <span class="keyword">true</span>;
3460
<a class="anchor" id="a665821774d2bfdd59db589683a4cf87b"></a><!-- doxytag: member="tesseract::ColPartition::OverlapSplitBlob" ref="a665821774d2bfdd59db589683a4cf87b" args="(const TBOX &box)" -->
3461
<div class="memitem">
3462
<div class="memproto">
3463
<table class="memname">
3465
<td class="memname"><a class="el" href="a00279.html">BLOBNBOX</a> * <a class="el" href="a00323.html#a665821774d2bfdd59db589683a4cf87b">tesseract::ColPartition::OverlapSplitBlob</a> </td>
3467
<td class="paramtype">const <a class="el" href="a00592.html">TBOX</a> & </td>
3468
<td class="paramname"><em>box</em></td><td>)</td>
3473
<div class="memdoc">
3475
<p>Definition at line <a class="el" href="a01100_source.html#l00763">763</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3476
<div class="fragment"><pre class="fragment"> {
3477
<span class="keywordflow">if</span> (boxes_.empty() || boxes_.singleton())
3478
<span class="keywordflow">return</span> NULL;
3479
BLOBNBOX_C_IT it(&boxes_);
3480
<a class="code" href="a00592.html">TBOX</a> left_box(it.data()->bounding_box());
3481
<span class="keywordflow">for</span> (it.forward(); !it.at_first(); it.forward()) {
3482
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = it.data();
3483
left_box += bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
3484
<span class="keywordflow">if</span> (left_box.overlap(box))
3485
<span class="keywordflow">return</span> bbox;
3487
<span class="keywordflow">return</span> NULL;
3492
<a class="anchor" id="adb5b080242a8eacde82dd88186ad2cf3"></a><!-- doxytag: member="tesseract::ColPartition::owns_blobs" ref="adb5b080242a8eacde82dd88186ad2cf3" args="() const " -->
3493
<div class="memitem">
3494
<div class="memproto">
3495
<table class="memname">
3497
<td class="memname">bool <a class="el" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">tesseract::ColPartition::owns_blobs</a> </td>
3499
<td class="paramname"></td><td>)</td>
3500
<td> const<code> [inline]</code></td>
3504
<div class="memdoc">
3506
<p>Definition at line <a class="el" href="a01101_source.html#l00291">291</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3507
<div class="fragment"><pre class="fragment"> {
3508
<span class="keywordflow">return</span> owns_blobs_;
3513
<a class="anchor" id="a5a46de5acb31b0aec90ab89933c69bc9"></a><!-- doxytag: member="tesseract::ColPartition::PartitionType" ref="a5a46de5acb31b0aec90ab89933c69bc9" args="(ColumnSpanningType flow) const " -->
3514
<div class="memitem">
3515
<div class="memproto">
3516
<table class="memname">
3518
<td class="memname"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> <a class="el" href="a00323.html#a5a46de5acb31b0aec90ab89933c69bc9">tesseract::ColPartition::PartitionType</a> </td>
3520
<td class="paramtype"><a class="el" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06a">ColumnSpanningType</a> </td>
3521
<td class="paramname"><em>flow</em></td><td>)</td>
3526
<div class="memdoc">
3528
<p>Definition at line <a class="el" href="a01100_source.html#l00996">996</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3529
<div class="fragment"><pre class="fragment"> {
3530
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a> == <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aad17bb659c6735f37306a6161f4013416">CST_NOISE</a>) {
3531
<span class="keywordflow">if</span> (blob_type_ != <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a56cc149e97b34634dd39babda79ea17d">BRT_HLINE</a> && blob_type_ != <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a5d6cbdd0674e727feda3085026646f6a">BRT_VLINE</a> &&
3532
blob_type_ != <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a15e526e8dd226bd4d7678da6dcddb49b">BRT_RECTIMAGE</a> && blob_type_ != <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a>)
3533
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa639c79458d7bb60c9d6f26f661dee484">PT_NOISE</a>;
3534
<a class="code" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a> = <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa53dd9af51c333b786fe51bd5f01543d6">CST_FLOWING</a>;
3537
<span class="keywordflow">switch</span> (blob_type_) {
3538
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575ae09c6f7e99c3a3885c3469d52d0292d2">BRT_NOISE</a>:
3539
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa639c79458d7bb60c9d6f26f661dee484">PT_NOISE</a>;
3540
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a56cc149e97b34634dd39babda79ea17d">BRT_HLINE</a>:
3541
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fad3f3a03631d09be1ba300cdd2af9a0d5">PT_HORZ_LINE</a>;
3542
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a5d6cbdd0674e727feda3085026646f6a">BRT_VLINE</a>:
3543
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa0cc815637c8f3f7967719c6abd956f0f">PT_VERT_LINE</a>;
3544
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a15e526e8dd226bd4d7678da6dcddb49b">BRT_RECTIMAGE</a>:
3545
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a3b72528ad70da88719f0479bc8c5a190">BRT_POLYIMAGE</a>:
3546
<span class="keywordflow">switch</span> (<a class="code" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a>) {
3547
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa53dd9af51c333b786fe51bd5f01543d6">CST_FLOWING</a>:
3548
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fae4dd1e076e7d8354de8123bbdfb9e6b0">PT_FLOWING_IMAGE</a>;
3549
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aacf3616b52ca15a43ddfd40b9c91c9cd5">CST_HEADING</a>:
3550
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa919711bca6bed2e6a9846e4dc91f3900">PT_HEADING_IMAGE</a>;
3551
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa8c1a2f43d95cbf09416204e1f5e04163">CST_PULLOUT</a>:
3552
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa88dcd7f4800095eb2f18b8a9bd521001">PT_PULLOUT_IMAGE</a>;
3553
<span class="keywordflow">default</span>:
3554
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!<span class="stringliteral">"Undefined flow type for image!"</span>);
3556
<span class="keywordflow">break</span>;
3557
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a>:
3558
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fadf6b7dd3b8ca94923c3b94dfe53f230e">PT_VERTICAL_TEXT</a>;
3559
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a>:
3560
<span class="keywordflow">case</span> <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a8a98863f18016aa4ccfd2d07dbb092a4">BRT_UNKNOWN</a>:
3561
<span class="keywordflow">default</span>:
3562
<span class="keywordflow">switch</span> (<a class="code" href="a00323.html#a811bd892dfa5eeba0b17b77794d79754">flow</a>) {
3563
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa53dd9af51c333b786fe51bd5f01543d6">CST_FLOWING</a>:
3564
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677faaa63d8d8a99ddc2b3957f8e8787b4eca">PT_FLOWING_TEXT</a>;
3565
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aacf3616b52ca15a43ddfd40b9c91c9cd5">CST_HEADING</a>:
3566
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa47f25d4065407dd98db92554ca54468b">PT_HEADING_TEXT</a>;
3567
<span class="keywordflow">case</span> <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa8c1a2f43d95cbf09416204e1f5e04163">CST_PULLOUT</a>:
3568
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa0e758c0b8cd519397b9c94ce6c12858c">PT_PULLOUT_TEXT</a>;
3569
<span class="keywordflow">default</span>:
3570
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!<span class="stringliteral">"Undefined flow type for text!"</span>);
3573
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!<span class="stringliteral">"Should never get here!"</span>);
3574
<span class="keywordflow">return</span> <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa639c79458d7bb60c9d6f26f661dee484">PT_NOISE</a>;
3579
<a class="anchor" id="a156c2af1b74aa05bb4633bbde1e64c22"></a><!-- doxytag: member="tesseract::ColPartition::Print" ref="a156c2af1b74aa05bb4633bbde1e64c22" args="() const " -->
3580
<div class="memitem">
3581
<div class="memproto">
3582
<table class="memname">
3584
<td class="memname">void <a class="el" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">tesseract::ColPartition::Print</a> </td>
3586
<td class="paramname"></td><td>)</td>
3591
<div class="memdoc">
3593
<p>Definition at line <a class="el" href="a01100_source.html#l01763">1763</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3594
<div class="fragment"><pre class="fragment"> {
3595
<span class="keywordtype">int</span> y = <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>();
3596
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"ColPart:%c(M%d-%c%d-B%d/%d,%d/%d)->(%dB-%d%c-%dM/%d,%d/%d)"</span>
3597
<span class="stringliteral">" w-ok=%d, v-ok=%d, type=%d%c%d, fc=%d, lc=%d, boxes=%d"</span>
3598
<span class="stringliteral">" ts=%d bs=%d ls=%d rs=%d\n"</span>,
3599
boxes_.empty() ? <span class="charliteral">'E'</span> : <span class="charliteral">' '</span>,
3600
left_margin_, left_key_tab_ ? <span class="charliteral">'T'</span> : <span class="charliteral">'B'</span>, <a class="code" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">LeftAtY</a>(y),
3601
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), median_left_,
3602
bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>(), median_bottom_,
3603
bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(), <a class="code" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">RightAtY</a>(y), right_key_tab_ ? <span class="charliteral">'T'</span> : <span class="charliteral">'B'</span>,
3604
right_margin_, median_right_, bounding_box_.<a class="code" href="a00592.html#adf92e9fdac1bdf11c10d1c4d1178791a">top</a>(), median_top_,
3605
good_width_, good_column_, type_,
3606
kBlobTypes[blob_type_], flow_,
3607
first_column_, last_column_, boxes_.length(),
3608
space_above_, space_below_, space_to_left_, space_to_right_);
3613
<a class="anchor" id="af07ad7867464972ce64aa421af34dada"></a><!-- doxytag: member="tesseract::ColPartition::PrintColors" ref="af07ad7867464972ce64aa421af34dada" args="()" -->
3614
<div class="memitem">
3615
<div class="memproto">
3616
<table class="memname">
3618
<td class="memname">void <a class="el" href="a00323.html#af07ad7867464972ce64aa421af34dada">tesseract::ColPartition::PrintColors</a> </td>
3620
<td class="paramname"></td><td>)</td>
3625
<div class="memdoc">
3627
<p>Definition at line <a class="el" href="a01100_source.html#l01781">1781</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3628
<div class="fragment"><pre class="fragment"> {
3629
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Colors:(%d, %d, %d)%d -> (%d, %d, %d)\n"</span>,
3630
color1_[COLOR_RED], color1_[COLOR_GREEN], color1_[COLOR_BLUE],
3631
color1_[L_ALPHA_CHANNEL],
3632
color2_[COLOR_RED], color2_[COLOR_GREEN], color2_[COLOR_BLUE]);
3637
<a class="anchor" id="a008e1c29b009f6d8f24ebf022bcc63b3"></a><!-- doxytag: member="tesseract::ColPartition::RefinePartners" ref="a008e1c29b009f6d8f24ebf022bcc63b3" args="(PolyBlockType type, bool get_desparate, ColPartitionGrid *grid)" -->
3638
<div class="memitem">
3639
<div class="memproto">
3640
<table class="memname">
3642
<td class="memname">void <a class="el" href="a00323.html#a008e1c29b009f6d8f24ebf022bcc63b3">tesseract::ColPartition::RefinePartners</a> </td>
3644
<td class="paramtype"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td>
3645
<td class="paramname"><em>type</em>, </td>
3648
<td class="paramkey"></td>
3650
<td class="paramtype">bool </td>
3651
<td class="paramname"><em>get_desparate</em>, </td>
3654
<td class="paramkey"></td>
3656
<td class="paramtype"><a class="el" href="a00324.html">ColPartitionGrid</a> * </td>
3657
<td class="paramname"><em>grid</em> </td>
3666
<div class="memdoc">
3668
<p>Definition at line <a class="el" href="a01100_source.html#l01858">1858</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3669
<div class="fragment"><pre class="fragment"> {
3670
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#aa7be118d2184949aa30f824932f04586">TypesSimilar</a>(type_, <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>)) {
3671
RefinePartnersInternal(<span class="keyword">true</span>, get_desperate, grid);
3672
RefinePartnersInternal(<span class="keyword">false</span>, get_desperate, grid);
3673
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa1cfce41c30bf1aefe403aaa66d271da1">PT_COUNT</a>) {
3674
<span class="comment">// This is the final pass. Make sure only the correctly typed</span>
3675
<span class="comment">// partners surivive, however many there are.</span>
3676
RefinePartnersByType(<span class="keyword">true</span>, &upper_partners_);
3677
RefinePartnersByType(<span class="keyword">false</span>, &lower_partners_);
3678
<span class="comment">// It is possible for a merge to have given a partition multiple</span>
3679
<span class="comment">// partners again, so the last resort is to use overlap which is</span>
3680
<span class="comment">// guaranteed to leave at most one partner left.</span>
3681
<span class="keywordflow">if</span> (!upper_partners_.empty() && !upper_partners_.singleton())
3682
RefinePartnersByOverlap(<span class="keyword">true</span>, &upper_partners_);
3683
<span class="keywordflow">if</span> (!lower_partners_.empty() && !lower_partners_.singleton())
3684
RefinePartnersByOverlap(<span class="keyword">false</span>, &lower_partners_);
3690
<a class="anchor" id="a77e212fc8da6ee21a817291c2180e2ad"></a><!-- doxytag: member="tesseract::ColPartition::ReflectInYAxis" ref="a77e212fc8da6ee21a817291c2180e2ad" args="()" -->
3691
<div class="memitem">
3692
<div class="memproto">
3693
<table class="memname">
3695
<td class="memname">void <a class="el" href="a00323.html#a77e212fc8da6ee21a817291c2180e2ad">tesseract::ColPartition::ReflectInYAxis</a> </td>
3697
<td class="paramname"></td><td>)</td>
3702
<div class="memdoc">
3704
<p>Definition at line <a class="el" href="a01100_source.html#l00316">316</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3705
<div class="fragment"><pre class="fragment"> {
3706
BLOBNBOX_CLIST reversed_boxes;
3707
BLOBNBOX_C_IT reversed_it(&reversed_boxes);
3708
<span class="comment">// Reverse the order of the boxes_.</span>
3709
BLOBNBOX_C_IT bb_it(&boxes_);
3710
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
3711
reversed_it.add_before_then_move(bb_it.extract());
3713
bb_it.add_list_after(&reversed_boxes);
3714
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!left_key_tab_ && !right_key_tab_);
3715
<span class="keywordtype">int</span> tmp = left_margin_;
3716
left_margin_ = -right_margin_;
3717
right_margin_ = -tmp;
3718
<a class="code" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a>();
3723
<a class="anchor" id="aef96e5e328fbc0a20e267f820b6376c0"></a><!-- doxytag: member="tesseract::ColPartition::RemoveBox" ref="aef96e5e328fbc0a20e267f820b6376c0" args="(BLOBNBOX *box)" -->
3724
<div class="memitem">
3725
<div class="memproto">
3726
<table class="memname">
3728
<td class="memname">void <a class="el" href="a00323.html#aef96e5e328fbc0a20e267f820b6376c0">tesseract::ColPartition::RemoveBox</a> </td>
3730
<td class="paramtype"><a class="el" href="a00279.html">BLOBNBOX</a> * </td>
3731
<td class="paramname"><em>box</em></td><td>)</td>
3736
<div class="memdoc">
3738
<p>Definition at line <a class="el" href="a01100_source.html#l00217">217</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3739
<div class="fragment"><pre class="fragment"> {
3740
BLOBNBOX_C_IT bb_it(&boxes_);
3741
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
3742
<span class="keywordflow">if</span> (box == bb_it.data()) {
3744
<a class="code" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a>();
3745
<span class="keywordflow">return</span>;
3752
<a class="anchor" id="aa53b48378daeaaec5ca59388a18cbfe5"></a><!-- doxytag: member="tesseract::ColPartition::RemovePartner" ref="aa53b48378daeaaec5ca59388a18cbfe5" args="(bool upper, ColPartition *partner)" -->
3753
<div class="memitem">
3754
<div class="memproto">
3755
<table class="memname">
3757
<td class="memname">void <a class="el" href="a00323.html#aa53b48378daeaaec5ca59388a18cbfe5">tesseract::ColPartition::RemovePartner</a> </td>
3759
<td class="paramtype">bool </td>
3760
<td class="paramname"><em>upper</em>, </td>
3763
<td class="paramkey"></td>
3765
<td class="paramtype"><a class="el" href="a00323.html">ColPartition</a> * </td>
3766
<td class="paramname"><em>partner</em> </td>
3775
<div class="memdoc">
3777
<p>Definition at line <a class="el" href="a01100_source.html#l00614">614</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3778
<div class="fragment"><pre class="fragment"> {
3779
ColPartition_C_IT it(upper ? &upper_partners_ : &lower_partners_);
3780
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
3781
<span class="keywordflow">if</span> (it.data() == partner) {
3783
<span class="keywordflow">break</span>;
3790
<a class="anchor" id="af8dc1730e816c82cf3007943dc70a363"></a><!-- doxytag: member="tesseract::ColPartition::right_key" ref="af8dc1730e816c82cf3007943dc70a363" args="() const " -->
3791
<div class="memitem">
3792
<div class="memproto">
3793
<table class="memname">
3795
<td class="memname">int <a class="el" href="a00323.html#af8dc1730e816c82cf3007943dc70a363">tesseract::ColPartition::right_key</a> </td>
3797
<td class="paramname"></td><td>)</td>
3798
<td> const<code> [inline]</code></td>
3802
<div class="memdoc">
3804
<p>Definition at line <a class="el" href="a01101_source.html#l00178">178</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3805
<div class="fragment"><pre class="fragment"> {
3806
<span class="keywordflow">return</span> right_key_;
3811
<a class="anchor" id="a46af5fe18c2f7142ae9e900a62b1a3d2"></a><!-- doxytag: member="tesseract::ColPartition::right_key_tab" ref="a46af5fe18c2f7142ae9e900a62b1a3d2" args="() const " -->
3812
<div class="memitem">
3813
<div class="memproto">
3814
<table class="memname">
3816
<td class="memname">bool <a class="el" href="a00323.html#a46af5fe18c2f7142ae9e900a62b1a3d2">tesseract::ColPartition::right_key_tab</a> </td>
3818
<td class="paramname"></td><td>)</td>
3819
<td> const<code> [inline]</code></td>
3823
<div class="memdoc">
3825
<p>Definition at line <a class="el" href="a01101_source.html#l00175">175</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3826
<div class="fragment"><pre class="fragment"> {
3827
<span class="keywordflow">return</span> right_key_tab_;
3832
<a class="anchor" id="a07fd7ed32fdb14f773374d45c4ef8a90"></a><!-- doxytag: member="tesseract::ColPartition::right_margin" ref="a07fd7ed32fdb14f773374d45c4ef8a90" args="() const " -->
3833
<div class="memitem">
3834
<div class="memproto">
3835
<table class="memname">
3837
<td class="memname">int <a class="el" href="a00323.html#a07fd7ed32fdb14f773374d45c4ef8a90">tesseract::ColPartition::right_margin</a> </td>
3839
<td class="paramname"></td><td>)</td>
3840
<td> const<code> [inline]</code></td>
3844
<div class="memdoc">
3846
<p>Definition at line <a class="el" href="a01101_source.html#l00118">118</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3847
<div class="fragment"><pre class="fragment"> {
3848
<span class="keywordflow">return</span> right_margin_;
3853
<a class="anchor" id="a3731935e70135384e25904d65c0ca8f7"></a><!-- doxytag: member="tesseract::ColPartition::RightAtY" ref="a3731935e70135384e25904d65c0ca8f7" args="(int y) const " -->
3854
<div class="memitem">
3855
<div class="memproto">
3856
<table class="memname">
3858
<td class="memname">int <a class="el" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">tesseract::ColPartition::RightAtY</a> </td>
3860
<td class="paramtype">int </td>
3861
<td class="paramname"><em>y</em></td><td>)</td>
3862
<td> const<code> [inline]</code></td>
3866
<div class="memdoc">
3868
<p>Definition at line <a class="el" href="a01101_source.html#l00344">344</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3869
<div class="fragment"><pre class="fragment"> {
3870
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">XAtY</a>(right_key_, y);
3875
<a class="anchor" id="a50177ba646b8b4b4a73ddc43d3b7a18a"></a><!-- doxytag: member="tesseract::ColPartition::RightBlobRule" ref="a50177ba646b8b4b4a73ddc43d3b7a18a" args="() const " -->
3876
<div class="memitem">
3877
<div class="memproto">
3878
<table class="memname">
3880
<td class="memname">int <a class="el" href="a00323.html#a50177ba646b8b4b4a73ddc43d3b7a18a">tesseract::ColPartition::RightBlobRule</a> </td>
3882
<td class="paramname"></td><td>)</td>
3887
<div class="memdoc">
3889
<p>Definition at line <a class="el" href="a01100_source.html#l00546">546</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
3890
<div class="fragment"><pre class="fragment"> {
3891
BLOBNBOX_C_IT it(const_cast<BLOBNBOX_CLIST*>(&boxes_));
3893
<span class="keywordflow">return</span> it.data()->right_rule();
3898
<a class="anchor" id="a67554d4553f198980b504091557442c7"></a><!-- doxytag: member="tesseract::ColPartition::set_blob_type" ref="a67554d4553f198980b504091557442c7" args="(BlobRegionType t)" -->
3899
<div class="memitem">
3900
<div class="memproto">
3901
<table class="memname">
3903
<td class="memname">void <a class="el" href="a00323.html#a67554d4553f198980b504091557442c7">tesseract::ColPartition::set_blob_type</a> </td>
3905
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
3906
<td class="paramname"><em>t</em></td><td>)</td>
3907
<td><code> [inline]</code></td>
3911
<div class="memdoc">
3913
<p>Definition at line <a class="el" href="a01101_source.html#l00151">151</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3914
<div class="fragment"><pre class="fragment"> {
3920
<a class="anchor" id="ae8aad6eec822b60c3387627910989270"></a><!-- doxytag: member="tesseract::ColPartition::set_block_owned" ref="ae8aad6eec822b60c3387627910989270" args="(bool owned)" -->
3921
<div class="memitem">
3922
<div class="memproto">
3923
<table class="memname">
3925
<td class="memname">void <a class="el" href="a00323.html#ae8aad6eec822b60c3387627910989270">tesseract::ColPartition::set_block_owned</a> </td>
3927
<td class="paramtype">bool </td>
3928
<td class="paramname"><em>owned</em></td><td>)</td>
3929
<td><code> [inline]</code></td>
3933
<div class="memdoc">
3935
<p>Definition at line <a class="el" href="a01101_source.html#l00208">208</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3936
<div class="fragment"><pre class="fragment"> {
3937
block_owned_ = owned;
3942
<a class="anchor" id="acb549b8ad0b5015282257086daa89b3f"></a><!-- doxytag: member="tesseract::ColPartition::set_bottom_spacing" ref="acb549b8ad0b5015282257086daa89b3f" args="(int spacing)" -->
3943
<div class="memitem">
3944
<div class="memproto">
3945
<table class="memname">
3947
<td class="memname">void <a class="el" href="a00323.html#acb549b8ad0b5015282257086daa89b3f">tesseract::ColPartition::set_bottom_spacing</a> </td>
3949
<td class="paramtype">int </td>
3950
<td class="paramname"><em>spacing</em></td><td>)</td>
3951
<td><code> [inline]</code></td>
3955
<div class="memdoc">
3957
<p>Definition at line <a class="el" href="a01101_source.html#l00223">223</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3958
<div class="fragment"><pre class="fragment"> {
3959
bottom_spacing_ = spacing;
3964
<a class="anchor" id="adeffeaa147be84acfa0165e923f7b591"></a><!-- doxytag: member="tesseract::ColPartition::set_first_column" ref="adeffeaa147be84acfa0165e923f7b591" args="(int column)" -->
3965
<div class="memitem">
3966
<div class="memproto">
3967
<table class="memname">
3969
<td class="memname">void <a class="el" href="a00323.html#adeffeaa147be84acfa0165e923f7b591">tesseract::ColPartition::set_first_column</a> </td>
3971
<td class="paramtype">int </td>
3972
<td class="paramname"><em>column</em></td><td>)</td>
3973
<td><code> [inline]</code></td>
3977
<div class="memdoc">
3979
<p>Definition at line <a class="el" href="a01101_source.html#l00703">703</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
3980
<div class="fragment"><pre class="fragment"> {
3981
first_column_ = column;
3986
<a class="anchor" id="aff449be10b9bb6e480b65cd1042e38e4"></a><!-- doxytag: member="tesseract::ColPartition::set_flow" ref="aff449be10b9bb6e480b65cd1042e38e4" args="(BlobTextFlowType f)" -->
3987
<div class="memitem">
3988
<div class="memproto">
3989
<table class="memname">
3991
<td class="memname">void <a class="el" href="a00323.html#aff449be10b9bb6e480b65cd1042e38e4">tesseract::ColPartition::set_flow</a> </td>
3993
<td class="paramtype"><a class="el" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1">BlobTextFlowType</a> </td>
3994
<td class="paramname"><em>f</em></td><td>)</td>
3995
<td><code> [inline]</code></td>
3999
<div class="memdoc">
4001
<p>Definition at line <a class="el" href="a01101_source.html#l00157">157</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4002
<div class="fragment"><pre class="fragment"> {
4008
<a class="anchor" id="a99763d5dc4eee42bb6142ffc2ddae1de"></a><!-- doxytag: member="tesseract::ColPartition::set_inside_table_column" ref="a99763d5dc4eee42bb6142ffc2ddae1de" args="(bool val)" -->
4009
<div class="memitem">
4010
<div class="memproto">
4011
<table class="memname">
4013
<td class="memname">void <a class="el" href="a00323.html#a99763d5dc4eee42bb6142ffc2ddae1de">tesseract::ColPartition::set_inside_table_column</a> </td>
4015
<td class="paramtype">bool </td>
4016
<td class="paramname"><em>val</em></td><td>)</td>
4017
<td><code> [inline]</code></td>
4021
<div class="memdoc">
4023
<p>Definition at line <a class="el" href="a01101_source.html#l00246">246</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4024
<div class="fragment"><pre class="fragment"> {
4025
inside_table_column_ = val;
4030
<a class="anchor" id="ac3a311afb64d7c68f6f7a00a706d58d0"></a><!-- doxytag: member="tesseract::ColPartition::set_last_column" ref="ac3a311afb64d7c68f6f7a00a706d58d0" args="(int column)" -->
4031
<div class="memitem">
4032
<div class="memproto">
4033
<table class="memname">
4035
<td class="memname">void <a class="el" href="a00323.html#ac3a311afb64d7c68f6f7a00a706d58d0">tesseract::ColPartition::set_last_column</a> </td>
4037
<td class="paramtype">int </td>
4038
<td class="paramname"><em>column</em></td><td>)</td>
4039
<td><code> [inline]</code></td>
4043
<div class="memdoc">
4045
<p>Definition at line <a class="el" href="a01101_source.html#l00706">706</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4046
<div class="fragment"><pre class="fragment"> {
4047
last_column_ = column;
4052
<a class="anchor" id="a4e520240723057ceeeb6c58972cca743"></a><!-- doxytag: member="tesseract::ColPartition::set_left_margin" ref="a4e520240723057ceeeb6c58972cca743" args="(int margin)" -->
4053
<div class="memitem">
4054
<div class="memproto">
4055
<table class="memname">
4057
<td class="memname">void <a class="el" href="a00323.html#a4e520240723057ceeeb6c58972cca743">tesseract::ColPartition::set_left_margin</a> </td>
4059
<td class="paramtype">int </td>
4060
<td class="paramname"><em>margin</em></td><td>)</td>
4061
<td><code> [inline]</code></td>
4065
<div class="memdoc">
4067
<p>Definition at line <a class="el" href="a01101_source.html#l00115">115</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4068
<div class="fragment"><pre class="fragment"> {
4069
left_margin_ = margin;
4074
<a class="anchor" id="ae0e571d982e596e62bf19e69d2442d52"></a><!-- doxytag: member="tesseract::ColPartition::set_median_size" ref="ae0e571d982e596e62bf19e69d2442d52" args="(int size)" -->
4075
<div class="memitem">
4076
<div class="memproto">
4077
<table class="memname">
4079
<td class="memname">void <a class="el" href="a00323.html#ae0e571d982e596e62bf19e69d2442d52">tesseract::ColPartition::set_median_size</a> </td>
4081
<td class="paramtype">int </td>
4082
<td class="paramname"><em>size</em></td><td>)</td>
4083
<td><code> [inline]</code></td>
4087
<div class="memdoc">
4089
<p>Definition at line <a class="el" href="a01101_source.html#l00139">139</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4090
<div class="fragment"><pre class="fragment"> {
4091
median_size_ = size;
4096
<a class="anchor" id="a69f66c8d14ded7a4893b7c99cb4c87c2"></a><!-- doxytag: member="tesseract::ColPartition::set_median_width" ref="a69f66c8d14ded7a4893b7c99cb4c87c2" args="(int width)" -->
4097
<div class="memitem">
4098
<div class="memproto">
4099
<table class="memname">
4101
<td class="memname">void <a class="el" href="a00323.html#a69f66c8d14ded7a4893b7c99cb4c87c2">tesseract::ColPartition::set_median_width</a> </td>
4103
<td class="paramtype">int </td>
4104
<td class="paramname"><em>width</em></td><td>)</td>
4105
<td><code> [inline]</code></td>
4109
<div class="memdoc">
4111
<p>Definition at line <a class="el" href="a01101_source.html#l00145">145</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4112
<div class="fragment"><pre class="fragment"> {
4113
median_width_ = width;
4118
<a class="anchor" id="a5b00935a33d05ca217802b4d7591b1a2"></a><!-- doxytag: member="tesseract::ColPartition::set_nearest_neighbor_above" ref="a5b00935a33d05ca217802b4d7591b1a2" args="(ColPartition *part)" -->
4119
<div class="memitem">
4120
<div class="memproto">
4121
<table class="memname">
4123
<td class="memname">void <a class="el" href="a00323.html#a5b00935a33d05ca217802b4d7591b1a2">tesseract::ColPartition::set_nearest_neighbor_above</a> </td>
4125
<td class="paramtype"><a class="el" href="a00323.html">ColPartition</a> * </td>
4126
<td class="paramname"><em>part</em></td><td>)</td>
4127
<td><code> [inline]</code></td>
4131
<div class="memdoc">
4133
<p>Definition at line <a class="el" href="a01101_source.html#l00252">252</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4134
<div class="fragment"><pre class="fragment"> {
4135
nearest_neighbor_above_ = part;
4140
<a class="anchor" id="a6bb36d2ee748af0b77c8b2742ef5741a"></a><!-- doxytag: member="tesseract::ColPartition::set_nearest_neighbor_below" ref="a6bb36d2ee748af0b77c8b2742ef5741a" args="(ColPartition *part)" -->
4141
<div class="memitem">
4142
<div class="memproto">
4143
<table class="memname">
4145
<td class="memname">void <a class="el" href="a00323.html#a6bb36d2ee748af0b77c8b2742ef5741a">tesseract::ColPartition::set_nearest_neighbor_below</a> </td>
4147
<td class="paramtype"><a class="el" href="a00323.html">ColPartition</a> * </td>
4148
<td class="paramname"><em>part</em></td><td>)</td>
4149
<td><code> [inline]</code></td>
4153
<div class="memdoc">
4155
<p>Definition at line <a class="el" href="a01101_source.html#l00258">258</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4156
<div class="fragment"><pre class="fragment"> {
4157
nearest_neighbor_below_ = part;
4162
<a class="anchor" id="a9d675a150a71185ddf17c23ae52c568a"></a><!-- doxytag: member="tesseract::ColPartition::set_owns_blobs" ref="a9d675a150a71185ddf17c23ae52c568a" args="(bool owns_blobs)" -->
4163
<div class="memitem">
4164
<div class="memproto">
4165
<table class="memname">
4167
<td class="memname">void <a class="el" href="a00323.html#a9d675a150a71185ddf17c23ae52c568a">tesseract::ColPartition::set_owns_blobs</a> </td>
4169
<td class="paramtype">bool </td>
4170
<td class="paramname"><em>owns_blobs</em></td><td>)</td>
4171
<td><code> [inline]</code></td>
4175
<div class="memdoc">
4177
<p>Definition at line <a class="el" href="a01101_source.html#l00294">294</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4178
<div class="fragment"><pre class="fragment"> {
4179
<span class="comment">// Do NOT change ownership flag when there are blobs in the list.</span>
4180
<span class="comment">// Immediately set the ownership flag when creating copies.</span>
4181
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(boxes_.empty());
4182
owns_blobs_ = <a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>;
4187
<a class="anchor" id="a34751cfa30b22b7bc405334843682cf4"></a><!-- doxytag: member="tesseract::ColPartition::set_right_margin" ref="a34751cfa30b22b7bc405334843682cf4" args="(int margin)" -->
4188
<div class="memitem">
4189
<div class="memproto">
4190
<table class="memname">
4192
<td class="memname">void <a class="el" href="a00323.html#a34751cfa30b22b7bc405334843682cf4">tesseract::ColPartition::set_right_margin</a> </td>
4194
<td class="paramtype">int </td>
4195
<td class="paramname"><em>margin</em></td><td>)</td>
4196
<td><code> [inline]</code></td>
4200
<div class="memdoc">
4202
<p>Definition at line <a class="el" href="a01101_source.html#l00121">121</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4203
<div class="fragment"><pre class="fragment"> {
4204
right_margin_ = margin;
4209
<a class="anchor" id="a2d324bc11a9d4a3bf1449dc8005cd7d4"></a><!-- doxytag: member="tesseract::ColPartition::set_side_step" ref="a2d324bc11a9d4a3bf1449dc8005cd7d4" args="(int step)" -->
4210
<div class="memitem">
4211
<div class="memproto">
4212
<table class="memname">
4214
<td class="memname">void <a class="el" href="a00323.html#a2d324bc11a9d4a3bf1449dc8005cd7d4">tesseract::ColPartition::set_side_step</a> </td>
4216
<td class="paramtype">int </td>
4217
<td class="paramname"><em>step</em></td><td>)</td>
4218
<td><code> [inline]</code></td>
4222
<div class="memdoc">
4224
<p>Definition at line <a class="el" href="a01101_source.html#l00217">217</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4225
<div class="fragment"><pre class="fragment"> {
4231
<a class="anchor" id="a83c96bfabcdbf1d17a676a614a43337f"></a><!-- doxytag: member="tesseract::ColPartition::set_space_above" ref="a83c96bfabcdbf1d17a676a614a43337f" args="(int space)" -->
4232
<div class="memitem">
4233
<div class="memproto">
4234
<table class="memname">
4236
<td class="memname">void <a class="el" href="a00323.html#a83c96bfabcdbf1d17a676a614a43337f">tesseract::ColPartition::set_space_above</a> </td>
4238
<td class="paramtype">int </td>
4239
<td class="paramname"><em>space</em></td><td>)</td>
4240
<td><code> [inline]</code></td>
4244
<div class="memdoc">
4246
<p>Definition at line <a class="el" href="a01101_source.html#l00264">264</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4247
<div class="fragment"><pre class="fragment"> {
4248
space_above_ = space;
4253
<a class="anchor" id="ad2083c18299f4e6850ca4d5d6ba9c83d"></a><!-- doxytag: member="tesseract::ColPartition::set_space_below" ref="ad2083c18299f4e6850ca4d5d6ba9c83d" args="(int space)" -->
4254
<div class="memitem">
4255
<div class="memproto">
4256
<table class="memname">
4258
<td class="memname">void <a class="el" href="a00323.html#ad2083c18299f4e6850ca4d5d6ba9c83d">tesseract::ColPartition::set_space_below</a> </td>
4260
<td class="paramtype">int </td>
4261
<td class="paramname"><em>space</em></td><td>)</td>
4262
<td><code> [inline]</code></td>
4266
<div class="memdoc">
4268
<p>Definition at line <a class="el" href="a01101_source.html#l00270">270</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4269
<div class="fragment"><pre class="fragment"> {
4270
space_below_ = space;
4275
<a class="anchor" id="a0de8ea9569a2b819639e3c69654fbe1d"></a><!-- doxytag: member="tesseract::ColPartition::set_space_to_left" ref="a0de8ea9569a2b819639e3c69654fbe1d" args="(int space)" -->
4276
<div class="memitem">
4277
<div class="memproto">
4278
<table class="memname">
4280
<td class="memname">void <a class="el" href="a00323.html#a0de8ea9569a2b819639e3c69654fbe1d">tesseract::ColPartition::set_space_to_left</a> </td>
4282
<td class="paramtype">int </td>
4283
<td class="paramname"><em>space</em></td><td>)</td>
4284
<td><code> [inline]</code></td>
4288
<div class="memdoc">
4290
<p>Definition at line <a class="el" href="a01101_source.html#l00276">276</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4291
<div class="fragment"><pre class="fragment"> {
4292
space_to_left_ = space;
4297
<a class="anchor" id="aa6bbfdc1a1f7c0384225c8691e27613a"></a><!-- doxytag: member="tesseract::ColPartition::set_space_to_right" ref="aa6bbfdc1a1f7c0384225c8691e27613a" args="(int space)" -->
4298
<div class="memitem">
4299
<div class="memproto">
4300
<table class="memname">
4302
<td class="memname">void <a class="el" href="a00323.html#aa6bbfdc1a1f7c0384225c8691e27613a">tesseract::ColPartition::set_space_to_right</a> </td>
4304
<td class="paramtype">int </td>
4305
<td class="paramname"><em>space</em></td><td>)</td>
4306
<td><code> [inline]</code></td>
4310
<div class="memdoc">
4312
<p>Definition at line <a class="el" href="a01101_source.html#l00282">282</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4313
<div class="fragment"><pre class="fragment"> {
4314
space_to_right_ = space;
4319
<a class="anchor" id="abc55e0535959583318b4ce0271c85da2"></a><!-- doxytag: member="tesseract::ColPartition::set_table_type" ref="abc55e0535959583318b4ce0271c85da2" args="()" -->
4320
<div class="memitem">
4321
<div class="memproto">
4322
<table class="memname">
4324
<td class="memname">void <a class="el" href="a00323.html#abc55e0535959583318b4ce0271c85da2">tesseract::ColPartition::set_table_type</a> </td>
4326
<td class="paramname"></td><td>)</td>
4327
<td><code> [inline]</code></td>
4331
<div class="memdoc">
4333
<p>Definition at line <a class="el" href="a01101_source.html#l00233">233</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4334
<div class="fragment"><pre class="fragment"> {
4335
<span class="keywordflow">if</span> (type_ != <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa5f41d3730899e22bf30c977bef2bcfa3">PT_TABLE</a>) {
4336
type_before_table_ = type_;
4337
type_ = <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677fa5f41d3730899e22bf30c977bef2bcfa3">PT_TABLE</a>;
4343
<a class="anchor" id="adfd69195728ae38f067ad536c4290e9c"></a><!-- doxytag: member="tesseract::ColPartition::set_top_spacing" ref="adfd69195728ae38f067ad536c4290e9c" args="(int spacing)" -->
4344
<div class="memitem">
4345
<div class="memproto">
4346
<table class="memname">
4348
<td class="memname">void <a class="el" href="a00323.html#adfd69195728ae38f067ad536c4290e9c">tesseract::ColPartition::set_top_spacing</a> </td>
4350
<td class="paramtype">int </td>
4351
<td class="paramname"><em>spacing</em></td><td>)</td>
4352
<td><code> [inline]</code></td>
4356
<div class="memdoc">
4358
<p>Definition at line <a class="el" href="a01101_source.html#l00229">229</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4359
<div class="fragment"><pre class="fragment"> {
4360
top_spacing_ = spacing;
4365
<a class="anchor" id="a9fcf07be83840289187d6358ee752a46"></a><!-- doxytag: member="tesseract::ColPartition::set_type" ref="a9fcf07be83840289187d6358ee752a46" args="(PolyBlockType t)" -->
4366
<div class="memitem">
4367
<div class="memproto">
4368
<table class="memname">
4370
<td class="memname">void <a class="el" href="a00323.html#a9fcf07be83840289187d6358ee752a46">tesseract::ColPartition::set_type</a> </td>
4372
<td class="paramtype"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td>
4373
<td class="paramname"><em>t</em></td><td>)</td>
4374
<td><code> [inline]</code></td>
4378
<div class="memdoc">
4380
<p>Definition at line <a class="el" href="a01101_source.html#l00184">184</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4381
<div class="fragment"><pre class="fragment"> {
4387
<a class="anchor" id="a8a60c7f2c817055b9331028495cb25b1"></a><!-- doxytag: member="tesseract::ColPartition::set_vertical" ref="a8a60c7f2c817055b9331028495cb25b1" args="(const ICOORD &v)" -->
4388
<div class="memitem">
4389
<div class="memproto">
4390
<table class="memname">
4392
<td class="memname">void <a class="el" href="a00323.html#a8a60c7f2c817055b9331028495cb25b1">tesseract::ColPartition::set_vertical</a> </td>
4394
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
4395
<td class="paramname"><em>v</em></td><td>)</td>
4396
<td><code> [inline]</code></td>
4400
<div class="memdoc">
4402
<p>Definition at line <a class="el" href="a01101_source.html#l00193">193</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4403
<div class="fragment"><pre class="fragment"> {
4409
<a class="anchor" id="a45dd9aed3c27b47c64dd01dd35b81b95"></a><!-- doxytag: member="tesseract::ColPartition::set_working_set" ref="a45dd9aed3c27b47c64dd01dd35b81b95" args="(WorkingPartSet *working_set)" -->
4410
<div class="memitem">
4411
<div class="memproto">
4412
<table class="memname">
4414
<td class="memname">void <a class="el" href="a00323.html#a45dd9aed3c27b47c64dd01dd35b81b95">tesseract::ColPartition::set_working_set</a> </td>
4416
<td class="paramtype"><a class="el" href="a00658.html">WorkingPartSet</a> * </td>
4417
<td class="paramname"><em>working_set</em></td><td>)</td>
4418
<td><code> [inline]</code></td>
4422
<div class="memdoc">
4424
<p>Definition at line <a class="el" href="a01101_source.html#l00202">202</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4425
<div class="fragment"><pre class="fragment"> {
4426
working_set_ = working_set;
4431
<a class="anchor" id="abfa13ecb273fa29166a663daf82a2254"></a><!-- doxytag: member="tesseract::ColPartition::SetBlobTypes" ref="abfa13ecb273fa29166a663daf82a2254" args="()" -->
4432
<div class="memitem">
4433
<div class="memproto">
4434
<table class="memname">
4436
<td class="memname">void <a class="el" href="a00323.html#abfa13ecb273fa29166a663daf82a2254">tesseract::ColPartition::SetBlobTypes</a> </td>
4438
<td class="paramname"></td><td>)</td>
4443
<div class="memdoc">
4445
<p>Definition at line <a class="el" href="a01100_source.html#l01252">1252</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4446
<div class="fragment"><pre class="fragment"> {
4447
<span class="keywordflow">if</span> (!<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>())
4448
<span class="keywordflow">return</span>;
4449
BLOBNBOX_C_IT it(&boxes_);
4450
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
4451
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
4452
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#afafe7113396a8cc27b882d622db46f05">flow</a>() != <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a64e3e70c4fac4d4e3facdb4638307d7f">BTFT_LEADER</a>)
4453
blob-><a class="code" href="a00279.html#a75340334988feba52ce36ba596750a35">set_flow</a>(flow_);
4454
blob-><a class="code" href="a00279.html#a9b58644d9ad4f0d01193f47f55dd884f">set_region_type</a>(blob_type_);
4455
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(blob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>() == NULL || blob-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>() == <span class="keyword">this</span>);
4461
<a class="anchor" id="a8ea991fccc4013feadaa1cc2b8f35051"></a><!-- doxytag: member="tesseract::ColPartition::SetColumnGoodness" ref="a8ea991fccc4013feadaa1cc2b8f35051" args="(WidthCallback *cb)" -->
4462
<div class="memitem">
4463
<div class="memproto">
4464
<table class="memname">
4466
<td class="memname">void <a class="el" href="a00323.html#a8ea991fccc4013feadaa1cc2b8f35051">tesseract::ColPartition::SetColumnGoodness</a> </td>
4468
<td class="paramtype"><a class="el" href="a01265.html#add06f170e88dcbac90a80ff20c42cc0a">WidthCallback</a> * </td>
4469
<td class="paramname"><em>cb</em></td><td>)</td>
4474
<div class="memdoc">
4476
<p>Definition at line <a class="el" href="a01100_source.html#l01060">1060</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4477
<div class="fragment"><pre class="fragment"> {
4478
<span class="keywordtype">int</span> y = <a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>();
4479
<span class="keywordtype">int</span> width = <a class="code" href="a00323.html#a3731935e70135384e25904d65c0ca8f7">RightAtY</a>(y) - <a class="code" href="a00323.html#ab71e3aebabe8a0a9e3cde26f84ec4f46">LeftAtY</a>(y);
4480
good_width_ = cb->Run(width);
4481
good_column_ = blob_type_ == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a> && left_key_tab_ && right_key_tab_;
4486
<a class="anchor" id="a770d020fe98100499e1a1bedfca9b1fc"></a><!-- doxytag: member="tesseract::ColPartition::SetLeftTab" ref="a770d020fe98100499e1a1bedfca9b1fc" args="(const TabVector *tab_vector)" -->
4487
<div class="memitem">
4488
<div class="memproto">
4489
<table class="memname">
4491
<td class="memname">void <a class="el" href="a00323.html#a770d020fe98100499e1a1bedfca9b1fc">tesseract::ColPartition::SetLeftTab</a> </td>
4493
<td class="paramtype">const <a class="el" href="a00590.html">TabVector</a> * </td>
4494
<td class="paramname"><em>tab_vector</em></td><td>)</td>
4499
<div class="memdoc">
4501
<p>Definition at line <a class="el" href="a01100_source.html#l00490">490</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4502
<div class="fragment"><pre class="fragment"> {
4503
<span class="keywordflow">if</span> (tab_vector != NULL) {
4504
left_key_ = tab_vector->sort_key();
4505
left_key_tab_ = left_key_ <= <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>();
4506
} <span class="keywordflow">else</span> {
4507
left_key_tab_ = <span class="keyword">false</span>;
4509
<span class="keywordflow">if</span> (!left_key_tab_)
4510
left_key_ = <a class="code" href="a00323.html#af8679f5d1f87946bcd821dd2ffe1e80e">BoxLeftKey</a>();
4515
<a class="anchor" id="acf8233abc2eb9a0b9cc6f258ddd1d04d"></a><!-- doxytag: member="tesseract::ColPartition::SetPartitionType" ref="acf8233abc2eb9a0b9cc6f258ddd1d04d" args="(int resolution, ColPartitionSet *columns)" -->
4516
<div class="memitem">
4517
<div class="memproto">
4518
<table class="memname">
4520
<td class="memname">void <a class="el" href="a00323.html#acf8233abc2eb9a0b9cc6f258ddd1d04d">tesseract::ColPartition::SetPartitionType</a> </td>
4522
<td class="paramtype">int </td>
4523
<td class="paramname"><em>resolution</em>, </td>
4526
<td class="paramkey"></td>
4528
<td class="paramtype"><a class="el" href="a00325.html">ColPartitionSet</a> * </td>
4529
<td class="paramname"><em>columns</em> </td>
4538
<div class="memdoc">
4540
<p>Definition at line <a class="el" href="a01100_source.html#l00963">963</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4541
<div class="fragment"><pre class="fragment"> {
4542
<span class="keywordtype">int</span> first_spanned_col = -1;
4543
<a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06a">ColumnSpanningType</a> span_type =
4544
columns->SpanningType(resolution,
4545
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(), bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>(),
4546
MIN(bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>(), bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>()),
4547
<a class="code" href="a00323.html#acfb9938222780d3957049698e2bde9e6">MidY</a>(), left_margin_, right_margin_,
4548
&first_column_, &last_column_,
4549
&first_spanned_col);
4550
column_set_ = columns;
4551
<span class="keywordflow">if</span> (first_column_ < last_column_ && span_type == <a class="code" href="a01265.html#a1c442f32007891bd4ea6e885b34cc06aa8c1a2f43d95cbf09416204e1f5e04163">CST_PULLOUT</a> &&
4552
!<a class="code" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">IsLineType</a>()) {
4553
<span class="comment">// Unequal columns may indicate that the pullout spans one of the columns</span>
4554
<span class="comment">// it lies in, so force it to be allocated to just that column.</span>
4555
<span class="keywordflow">if</span> (first_spanned_col >= 0) {
4556
first_column_ = first_spanned_col;
4557
last_column_ = first_spanned_col;
4558
} <span class="keywordflow">else</span> {
4559
<span class="keywordflow">if</span> ((first_column_ & 1) == 0)
4560
last_column_ = first_column_;
4561
<span class="keywordflow">else</span> <span class="keywordflow">if</span> ((last_column_ & 1) == 0)
4562
first_column_ = last_column_;
4563
<span class="keywordflow">else</span>
4564
first_column_ = last_column_ = (first_column_ + last_column_) / 2;
4567
type_ = <a class="code" href="a00323.html#a5a46de5acb31b0aec90ab89933c69bc9">PartitionType</a>(span_type);
4572
<a class="anchor" id="a4ce776ccc6a6222ccc7abeece8e1c7d5"></a><!-- doxytag: member="tesseract::ColPartition::SetRegionAndFlowTypesFromProjectionValue" ref="a4ce776ccc6a6222ccc7abeece8e1c7d5" args="(int value)" -->
4573
<div class="memitem">
4574
<div class="memproto">
4575
<table class="memname">
4577
<td class="memname">void <a class="el" href="a00323.html#a4ce776ccc6a6222ccc7abeece8e1c7d5">tesseract::ColPartition::SetRegionAndFlowTypesFromProjectionValue</a> </td>
4579
<td class="paramtype">int </td>
4580
<td class="paramname"><em>value</em></td><td>)</td>
4585
<div class="memdoc">
4587
<p>Definition at line <a class="el" href="a01100_source.html#l01178">1178</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4588
<div class="fragment"><pre class="fragment"> {
4589
<span class="keywordtype">int</span> blob_count = 0; <span class="comment">// Total # blobs.</span>
4590
<span class="keywordtype">int</span> good_blob_score_ = 0; <span class="comment">// Total # good strokewidth neighbours.</span>
4591
<span class="keywordtype">int</span> noisy_count = 0; <span class="comment">// Total # neighbours marked as noise.</span>
4592
<span class="keywordtype">int</span> hline_count = 0;
4593
<span class="keywordtype">int</span> vline_count = 0;
4594
BLOBNBOX_C_IT it(&boxes_);
4595
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
4596
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = it.data();
4598
noisy_count += blob-><a class="code" href="a00279.html#a33a55d6d0da2ae6f24a5b6e95b9d10cf">NoisyNeighbours</a>();
4599
good_blob_score_ += blob-><a class="code" href="a00279.html#a17600c15bdfd57f24bb7ec5b2765a48f">GoodTextBlob</a>();
4600
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#a9e7100e6d08c78cca5f9c0453e11565d">region_type</a>() == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a56cc149e97b34634dd39babda79ea17d">BRT_HLINE</a>) ++hline_count;
4601
<span class="keywordflow">if</span> (blob-><a class="code" href="a00279.html#a9e7100e6d08c78cca5f9c0453e11565d">region_type</a>() == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a5d6cbdd0674e727feda3085026646f6a">BRT_VLINE</a>) ++vline_count;
4603
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1adac19762bd040a53914be696482c1e53">BTFT_NEIGHBOURS</a>;
4604
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a8a98863f18016aa4ccfd2d07dbb092a4">BRT_UNKNOWN</a>;
4605
<span class="keywordflow">if</span> (hline_count > vline_count) {
4606
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a745b15b1c990fa88c0712c50c5cd2202">BTFT_NONE</a>;
4607
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a56cc149e97b34634dd39babda79ea17d">BRT_HLINE</a>;
4608
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vline_count > hline_count) {
4609
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a745b15b1c990fa88c0712c50c5cd2202">BTFT_NONE</a>;
4610
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a5d6cbdd0674e727feda3085026646f6a">BRT_VLINE</a>;
4611
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value < -1 || 1 < value) {
4612
<span class="keywordtype">int</span> long_side;
4613
<span class="keywordtype">int</span> short_side;
4614
<span class="keywordflow">if</span> (value > 0) {
4615
long_side = bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>();
4616
short_side = bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>();
4617
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a4f0b1431532d0e838187df32f2e822d7">BRT_TEXT</a>;
4618
} <span class="keywordflow">else</span> {
4619
long_side = bounding_box_.<a class="code" href="a00592.html#a8379d4bbc72bdbb1f069fc14790e632d">height</a>();
4620
short_side = bounding_box_.<a class="code" href="a00592.html#af95494a2ccacc70cc2b83820b2948619">width</a>();
4621
blob_type_ = <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575aea2da025a50db20db8213f96495dd4a6">BRT_VERT_TEXT</a>;
4623
<span class="comment">// We will combine the old metrics using aspect ratio and blob counts</span>
4624
<span class="comment">// with the input value by allowing a strong indication to flip the</span>
4625
<span class="comment">// STRONG_CHAIN/CHAIN flow values.</span>
4626
<span class="keywordtype">int</span> strong_score = blob_count >= <a class="code" href="a01265.html#a32f2825c55e218c93202c88eb0a9e9cd">kHorzStrongTextlineCount</a> ? 1 : 0;
4627
<span class="keywordflow">if</span> (short_side > <a class="code" href="a01265.html#a5f972eef50e9dbc6cf11d791a877ad6e">kHorzStrongTextlineHeight</a>) ++strong_score;
4628
<span class="keywordflow">if</span> (short_side * <a class="code" href="a01265.html#a8bb43436a786b376902309db2f0b5699">kHorzStrongTextlineAspect</a> < long_side) ++strong_score;
4629
<span class="keywordflow">if</span> (abs(value) >= <a class="code" href="a01265.html#ac940a7cfcc7b1a0ecab3e6c0af788175">kMinStrongTextValue</a>)
4630
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1ac6822a7999424340562c785a3fd95daa">BTFT_STRONG_CHAIN</a>;
4631
<span class="keywordflow">else</span> <span class="keywordflow">if</span> (abs(value) >= <a class="code" href="a01265.html#a22d76064f02915e8be7a835f2ea05038">kMinChainTextValue</a>)
4632
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a8fa903eb3c633ef681659563769a8007">BTFT_CHAIN</a>;
4633
<span class="keywordflow">else</span>
4634
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1adac19762bd040a53914be696482c1e53">BTFT_NEIGHBOURS</a>;
4635
<span class="comment">// Upgrade chain to strong chain if the other indicators are good</span>
4636
<span class="keywordflow">if</span> (flow_ == <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a8fa903eb3c633ef681659563769a8007">BTFT_CHAIN</a> && strong_score == 3)
4637
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1ac6822a7999424340562c785a3fd95daa">BTFT_STRONG_CHAIN</a>;
4638
<span class="comment">// Downgrade strong vertical text to chain if the indicators are bad.</span>
4639
<span class="keywordflow">if</span> (flow_ == <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1ac6822a7999424340562c785a3fd95daa">BTFT_STRONG_CHAIN</a> && value < 0 && strong_score < 2)
4640
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1a8fa903eb3c633ef681659563769a8007">BTFT_CHAIN</a>;
4642
<span class="keywordflow">if</span> (flow_ == <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1adac19762bd040a53914be696482c1e53">BTFT_NEIGHBOURS</a>) {
4643
<span class="comment">// Check for noisy neighbours.</span>
4644
<span class="keywordflow">if</span> (noisy_count >= blob_count) {
4645
flow_ = <a class="code" href="a00728.html#aa72f1499398e9694bf46752e1cc895e1af99f0c54b98b6c7a0dd5d5f0b5dc635d">BTFT_NONTEXT</a>;
4646
blob_type_= <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575ae09c6f7e99c3a3885c3469d52d0292d2">BRT_NOISE</a>;
4649
<span class="keywordflow">if</span> (<a class="code" href="a00257.html#a357ff9e1d9bac2b1d88fb0d335fa7f3e">TabFind::WithinTestRegion</a>(2, bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>(),
4650
bounding_box_.<a class="code" href="a00592.html#a4451d237f1cd18c4982d63fe36a11fc3">bottom</a>())) {
4651
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"RegionFlowTypesFromProjectionValue count=%d, noisy=%d, score=%d,"</span>,
4652
blob_count, noisy_count, good_blob_score_);
4653
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">" Projection value=%d, flow=%d, blob_type=%d\n"</span>,
4654
value, flow_, blob_type_);
4655
<a class="code" href="a00323.html#a156c2af1b74aa05bb4633bbde1e64c22">Print</a>();
4657
<a class="code" href="a00323.html#abfa13ecb273fa29166a663daf82a2254">SetBlobTypes</a>();
4662
<a class="anchor" id="a426461a98a3feccd03ba68894dc8d4d2"></a><!-- doxytag: member="tesseract::ColPartition::SetRightTab" ref="a426461a98a3feccd03ba68894dc8d4d2" args="(const TabVector *tab_vector)" -->
4663
<div class="memitem">
4664
<div class="memproto">
4665
<table class="memname">
4667
<td class="memname">void <a class="el" href="a00323.html#a426461a98a3feccd03ba68894dc8d4d2">tesseract::ColPartition::SetRightTab</a> </td>
4669
<td class="paramtype">const <a class="el" href="a00590.html">TabVector</a> * </td>
4670
<td class="paramname"><em>tab_vector</em></td><td>)</td>
4675
<div class="memdoc">
4677
<p>Definition at line <a class="el" href="a01100_source.html#l00502">502</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4678
<div class="fragment"><pre class="fragment"> {
4679
<span class="keywordflow">if</span> (tab_vector != NULL) {
4680
right_key_ = tab_vector->sort_key();
4681
right_key_tab_ = right_key_ >= <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>();
4682
} <span class="keywordflow">else</span> {
4683
right_key_tab_ = <span class="keyword">false</span>;
4685
<span class="keywordflow">if</span> (!right_key_tab_)
4686
right_key_ = <a class="code" href="a00323.html#a498b82d4970d0c0fe24c59e27d5933e7">BoxRightKey</a>();
4691
<a class="anchor" id="a0b0967771316dc653ecc9af44c56dbd4"></a><!-- doxytag: member="tesseract::ColPartition::SetSpecialBlobsDensity" ref="a0b0967771316dc653ecc9af44c56dbd4" args="(const BlobSpecialTextType type, const float density)" -->
4692
<div class="memitem">
4693
<div class="memproto">
4694
<table class="memname">
4696
<td class="memname">void <a class="el" href="a00323.html#a0b0967771316dc653ecc9af44c56dbd4">tesseract::ColPartition::SetSpecialBlobsDensity</a> </td>
4698
<td class="paramtype">const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> </td>
4699
<td class="paramname"><em>type</em>, </td>
4702
<td class="paramkey"></td>
4704
<td class="paramtype">const float </td>
4705
<td class="paramname"><em>density</em> </td>
4714
<div class="memdoc">
4716
<p>Definition at line <a class="el" href="a01100_source.html#l00572">572</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4717
<div class="fragment"><pre class="fragment"> {
4718
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> < <a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8caceba184627df3dabc8f3e3f2867c4eff">BSTT_COUNT</a>);
4719
special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>] = density;
4724
<a class="anchor" id="a70116af39898d43ca19ecb189faccfa1"></a><!-- doxytag: member="tesseract::ColPartition::ShallowCopy" ref="a70116af39898d43ca19ecb189faccfa1" args="() const " -->
4725
<div class="memitem">
4726
<div class="memproto">
4727
<table class="memname">
4729
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a70116af39898d43ca19ecb189faccfa1">tesseract::ColPartition::ShallowCopy</a> </td>
4731
<td class="paramname"></td><td>)</td>
4736
<div class="memdoc">
4738
<p>Definition at line <a class="el" href="a01100_source.html#l01712">1712</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4739
<div class="fragment"><pre class="fragment"> {
4740
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* part = <span class="keyword">new</span> <a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>(blob_type_, vertical_);
4741
part->left_margin_ = left_margin_;
4742
part->right_margin_ = right_margin_;
4743
part->bounding_box_ = bounding_box_;
4744
memcpy(part->special_blobs_densities_, special_blobs_densities_,
4745
<span class="keyword">sizeof</span>(special_blobs_densities_));
4746
part->median_bottom_ = median_bottom_;
4747
part->median_top_ = median_top_;
4748
part->median_size_ = median_size_;
4749
part->median_left_ = median_left_;
4750
part->median_right_ = median_right_;
4751
part->median_width_ = median_width_;
4752
part->good_width_ = good_width_;
4753
part->good_column_ = good_column_;
4754
part->left_key_tab_ = left_key_tab_;
4755
part->right_key_tab_ = right_key_tab_;
4756
part->type_ = type_;
4757
part->flow_ = flow_;
4758
part->left_key_ = left_key_;
4759
part->right_key_ = right_key_;
4760
part->first_column_ = first_column_;
4761
part->last_column_ = last_column_;
4762
part->owns_blobs_ = <span class="keyword">false</span>;
4763
<span class="keywordflow">return</span> part;
4768
<a class="anchor" id="abb824820c4ebf82ee1dfc9c2a30c17ce"></a><!-- doxytag: member="tesseract::ColPartition::SingletonPartner" ref="abb824820c4ebf82ee1dfc9c2a30c17ce" args="(bool upper)" -->
4769
<div class="memitem">
4770
<div class="memproto">
4771
<table class="memname">
4773
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">tesseract::ColPartition::SingletonPartner</a> </td>
4775
<td class="paramtype">bool </td>
4776
<td class="paramname"><em>upper</em></td><td>)</td>
4781
<div class="memdoc">
4783
<p>Definition at line <a class="el" href="a01100_source.html#l00625">625</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4784
<div class="fragment"><pre class="fragment"> {
4785
ColPartition_CLIST* partners = upper ? &upper_partners_ : &lower_partners_;
4786
<span class="keywordflow">if</span> (!partners->singleton())
4787
<span class="keywordflow">return</span> NULL;
4788
ColPartition_C_IT it(partners);
4789
<span class="keywordflow">return</span> it.data();
4794
<a class="anchor" id="a63928eac4e3026c21296da8c29eee854"></a><!-- doxytag: member="tesseract::ColPartition::SmoothPartnerRun" ref="a63928eac4e3026c21296da8c29eee854" args="(int working_set_count)" -->
4795
<div class="memitem">
4796
<div class="memproto">
4797
<table class="memname">
4799
<td class="memname">void <a class="el" href="a00323.html#a63928eac4e3026c21296da8c29eee854">tesseract::ColPartition::SmoothPartnerRun</a> </td>
4801
<td class="paramtype">int </td>
4802
<td class="paramname"><em>working_set_count</em></td><td>)</td>
4807
<div class="memdoc">
4809
<p>Definition at line <a class="el" href="a01100_source.html#l01789">1789</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4810
<div class="fragment"><pre class="fragment"> {
4811
<a class="code" href="a00556.html">STATS</a> left_stats(0, working_set_count);
4812
<a class="code" href="a00556.html">STATS</a> right_stats(0, working_set_count);
4813
<a class="code" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> max_type = type_;
4814
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* partner;
4815
<span class="keywordflow">for</span> (partner = <a class="code" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a>(<span class="keyword">false</span>); partner != NULL;
4816
partner = partner-><a class="code" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a>(<span class="keyword">false</span>)) {
4817
<span class="keywordflow">if</span> (partner->type_ > max_type)
4818
max_type = partner->type_;
4819
<span class="keywordflow">if</span> (column_set_ == partner->column_set_) {
4820
left_stats.add(partner->first_column_, 1);
4821
right_stats.add(partner->last_column_, 1);
4825
<span class="comment">// TODO(rays) Either establish that it isn't necessary to set the columns,</span>
4826
<span class="comment">// or find a way to do it that does not cause an assert failure in</span>
4827
<span class="comment">// AddToWorkingSet.</span>
4828
<span class="preprocessor">#if 0</span>
4829
<span class="preprocessor"></span> first_column_ = left_stats.mode();
4830
last_column_ = right_stats.mode();
4831
<span class="keywordflow">if</span> (last_column_ < first_column_)
4832
last_column_ = first_column_;
4833
<span class="preprocessor">#endif</span>
4834
<span class="preprocessor"></span>
4835
<span class="keywordflow">for</span> (partner = <a class="code" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a>(<span class="keyword">false</span>); partner != NULL;
4836
partner = partner-><a class="code" href="a00323.html#abb824820c4ebf82ee1dfc9c2a30c17ce">SingletonPartner</a>(<span class="keyword">false</span>)) {
4837
partner->type_ = max_type;
4838
<span class="preprocessor">#if 0 // See TODO above</span>
4839
<span class="preprocessor"></span> <span class="keywordflow">if</span> (column_set_ == partner->column_set_) {
4840
partner->first_column_ = first_column_;
4841
partner->last_column_ = last_column_;
4843
<span class="preprocessor">#endif</span>
4844
<span class="preprocessor"></span> }
4849
<a class="anchor" id="ac48d211f853e26daced218323544b393"></a><!-- doxytag: member="tesseract::ColPartition::SortKey" ref="ac48d211f853e26daced218323544b393" args="(int x, int y) const " -->
4850
<div class="memitem">
4851
<div class="memproto">
4852
<table class="memname">
4854
<td class="memname">int <a class="el" href="a00323.html#ac48d211f853e26daced218323544b393">tesseract::ColPartition::SortKey</a> </td>
4856
<td class="paramtype">int </td>
4857
<td class="paramname"><em>x</em>, </td>
4860
<td class="paramkey"></td>
4862
<td class="paramtype">int </td>
4863
<td class="paramname"><em>y</em> </td>
4868
<td></td><td> const<code> [inline]</code></td>
4872
<div class="memdoc">
4874
<p>Definition at line <a class="el" href="a01101_source.html#l00316">316</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4875
<div class="fragment"><pre class="fragment"> {
4876
<span class="keywordflow">return</span> <a class="code" href="a00323.html#ac48d211f853e26daced218323544b393">TabVector::SortKey</a>(vertical_, x, y);
4881
<a class="anchor" id="a0ec12f1a3ec7b885749c16a798b3c794"></a><!-- doxytag: member="tesseract::ColPartition::space_above" ref="a0ec12f1a3ec7b885749c16a798b3c794" args="() const " -->
4882
<div class="memitem">
4883
<div class="memproto">
4884
<table class="memname">
4886
<td class="memname">int <a class="el" href="a00323.html#a0ec12f1a3ec7b885749c16a798b3c794">tesseract::ColPartition::space_above</a> </td>
4888
<td class="paramname"></td><td>)</td>
4889
<td> const<code> [inline]</code></td>
4893
<div class="memdoc">
4895
<p>Definition at line <a class="el" href="a01101_source.html#l00261">261</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4896
<div class="fragment"><pre class="fragment"> {
4897
<span class="keywordflow">return</span> space_above_;
4902
<a class="anchor" id="a46abe5ef4b5224d671c50d1de5ac985b"></a><!-- doxytag: member="tesseract::ColPartition::space_below" ref="a46abe5ef4b5224d671c50d1de5ac985b" args="() const " -->
4903
<div class="memitem">
4904
<div class="memproto">
4905
<table class="memname">
4907
<td class="memname">int <a class="el" href="a00323.html#a46abe5ef4b5224d671c50d1de5ac985b">tesseract::ColPartition::space_below</a> </td>
4909
<td class="paramname"></td><td>)</td>
4910
<td> const<code> [inline]</code></td>
4914
<div class="memdoc">
4916
<p>Definition at line <a class="el" href="a01101_source.html#l00267">267</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4917
<div class="fragment"><pre class="fragment"> {
4918
<span class="keywordflow">return</span> space_below_;
4923
<a class="anchor" id="a4c55a12d96d51a9710edc292c1946ca1"></a><!-- doxytag: member="tesseract::ColPartition::space_to_left" ref="a4c55a12d96d51a9710edc292c1946ca1" args="() const " -->
4924
<div class="memitem">
4925
<div class="memproto">
4926
<table class="memname">
4928
<td class="memname">int <a class="el" href="a00323.html#a4c55a12d96d51a9710edc292c1946ca1">tesseract::ColPartition::space_to_left</a> </td>
4930
<td class="paramname"></td><td>)</td>
4931
<td> const<code> [inline]</code></td>
4935
<div class="memdoc">
4937
<p>Definition at line <a class="el" href="a01101_source.html#l00273">273</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4938
<div class="fragment"><pre class="fragment"> {
4939
<span class="keywordflow">return</span> space_to_left_;
4944
<a class="anchor" id="a2e061b11b010ed6ee0382300f423735c"></a><!-- doxytag: member="tesseract::ColPartition::space_to_right" ref="a2e061b11b010ed6ee0382300f423735c" args="() const " -->
4945
<div class="memitem">
4946
<div class="memproto">
4947
<table class="memname">
4949
<td class="memname">int <a class="el" href="a00323.html#a2e061b11b010ed6ee0382300f423735c">tesseract::ColPartition::space_to_right</a> </td>
4951
<td class="paramname"></td><td>)</td>
4952
<td> const<code> [inline]</code></td>
4956
<div class="memdoc">
4958
<p>Definition at line <a class="el" href="a01101_source.html#l00279">279</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
4959
<div class="fragment"><pre class="fragment"> {
4960
<span class="keywordflow">return</span> space_to_right_;
4965
<a class="anchor" id="a2a9ba24fa7f6735045a09857d664136f"></a><!-- doxytag: member="tesseract::ColPartition::SpecialBlobsCount" ref="a2a9ba24fa7f6735045a09857d664136f" args="(const BlobSpecialTextType type)" -->
4966
<div class="memitem">
4967
<div class="memproto">
4968
<table class="memname">
4970
<td class="memname">int <a class="el" href="a00323.html#a2a9ba24fa7f6735045a09857d664136f">tesseract::ColPartition::SpecialBlobsCount</a> </td>
4972
<td class="paramtype">const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> </td>
4973
<td class="paramname"><em>type</em></td><td>)</td>
4978
<div class="memdoc">
4980
<p>Definition at line <a class="el" href="a01100_source.html#l00557">557</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
4981
<div class="fragment"><pre class="fragment"> {
4982
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> < <a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8caceba184627df3dabc8f3e3f2867c4eff">BSTT_COUNT</a>);
4983
BLOBNBOX_C_IT blob_it(&boxes_);
4984
<span class="keywordtype">int</span> <a class="code" href="a01042.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> = 0;
4985
<span class="keywordflow">for</span> (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
4986
<a class="code" href="a00279.html">BLOBNBOX</a>* blob = blob_it.data();
4987
<a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> <a class="code" href="a00323.html#a644ec0c0a7bf20b9aca71b8413b2a87e">blob_type</a> = blob-><a class="code" href="a00279.html#aa33e4d1cf720df979dc50d2b39abb4e9">special_text_type</a>();
4988
<span class="keywordflow">if</span> (blob_type == <a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>) {
4993
<span class="keywordflow">return</span> <a class="code" href="a01042.html#acd4ea858d7133e40518e0832ff9d94b2">count</a>;
4998
<a class="anchor" id="aa92a42d781e779aac8cd593f8fd7d498"></a><!-- doxytag: member="tesseract::ColPartition::SpecialBlobsDensity" ref="aa92a42d781e779aac8cd593f8fd7d498" args="(const BlobSpecialTextType type) const " -->
4999
<div class="memitem">
5000
<div class="memproto">
5001
<table class="memname">
5003
<td class="memname">float <a class="el" href="a00323.html#aa92a42d781e779aac8cd593f8fd7d498">tesseract::ColPartition::SpecialBlobsDensity</a> </td>
5005
<td class="paramtype">const <a class="el" href="a00728.html#a75b089d27e1df813fed544e0c131df8c">BlobSpecialTextType</a> </td>
5006
<td class="paramname"><em>type</em></td><td>)</td>
5011
<div class="memdoc">
5013
<p>Definition at line <a class="el" href="a01100_source.html#l00552">552</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
5014
<div class="fragment"><pre class="fragment"> {
5015
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a> < <a class="code" href="a00728.html#a75b089d27e1df813fed544e0c131df8caceba184627df3dabc8f3e3f2867c4eff">BSTT_COUNT</a>);
5016
<span class="keywordflow">return</span> special_blobs_densities_[<a class="code" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">type</a>];
5021
<a class="anchor" id="a33427fb9a563253c69e0806115fb2a4b"></a><!-- doxytag: member="tesseract::ColPartition::SplitAt" ref="a33427fb9a563253c69e0806115fb2a4b" args="(int split_x)" -->
5022
<div class="memitem">
5023
<div class="memproto">
5024
<table class="memname">
5026
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#a33427fb9a563253c69e0806115fb2a4b">tesseract::ColPartition::SplitAt</a> </td>
5028
<td class="paramtype">int </td>
5029
<td class="paramname"><em>split_x</em></td><td>)</td>
5034
<div class="memdoc">
5036
<p>Definition at line <a class="el" href="a01100_source.html#l00817">817</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
5037
<div class="fragment"><pre class="fragment"> {
5038
<span class="keywordflow">if</span> (split_x <= bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() || split_x >= bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>())
5039
<span class="keywordflow">return</span> NULL; <span class="comment">// There will be no change.</span>
5040
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* split_part = <a class="code" href="a00323.html#a70116af39898d43ca19ecb189faccfa1">ShallowCopy</a>();
5041
split_part->set_owns_blobs(<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>());
5042
BLOBNBOX_C_IT it(&boxes_);
5043
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
5044
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = it.data();
5045
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* prev_owner = bbox-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>();
5046
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>() || prev_owner == <span class="keyword">this</span> || prev_owner == NULL);
5047
<span class="keyword">const</span> <a class="code" href="a00592.html">TBOX</a>& box = bbox-><a class="code" href="a00279.html#a7b97b8bc16b1473a28f9c44011522f4e">bounding_box</a>();
5048
<span class="keywordflow">if</span> (box.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() >= split_x) {
5049
split_part->AddBox(it.extract());
5050
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>() && prev_owner != NULL)
5051
bbox-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(split_part);
5054
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!it.empty());
5055
<span class="keywordflow">if</span> (split_part->IsEmpty()) {
5056
<span class="comment">// Split part ended up with nothing. Possible if split_x passes</span>
5057
<span class="comment">// through the last blob.</span>
5058
<span class="keyword">delete</span> split_part;
5059
<span class="keywordflow">return</span> NULL;
5061
right_key_tab_ = <span class="keyword">false</span>;
5062
split_part->left_key_tab_ = <span class="keyword">false</span>;
5063
right_margin_ = split_x;
5064
split_part->left_margin_ = split_x;
5065
<a class="code" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a>();
5066
split_part->ComputeLimits();
5067
<span class="keywordflow">return</span> split_part;
5072
<a class="anchor" id="ab629b53eb1420cf5947f3c003d2d4761"></a><!-- doxytag: member="tesseract::ColPartition::SplitAtBlob" ref="ab629b53eb1420cf5947f3c003d2d4761" args="(BLOBNBOX *split_blob)" -->
5073
<div class="memitem">
5074
<div class="memproto">
5075
<table class="memname">
5077
<td class="memname"><a class="el" href="a00323.html">ColPartition</a> * <a class="el" href="a00323.html#ab629b53eb1420cf5947f3c003d2d4761">tesseract::ColPartition::SplitAtBlob</a> </td>
5079
<td class="paramtype"><a class="el" href="a00279.html">BLOBNBOX</a> * </td>
5080
<td class="paramname"><em>split_blob</em></td><td>)</td>
5085
<div class="memdoc">
5087
<p>Definition at line <a class="el" href="a01100_source.html#l00781">781</a> of file <a class="el" href="a01100_source.html">colpartition.cpp</a>.</p>
5088
<div class="fragment"><pre class="fragment"> {
5089
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* split_part = <a class="code" href="a00323.html#a70116af39898d43ca19ecb189faccfa1">ShallowCopy</a>();
5090
split_part->set_owns_blobs(<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>());
5091
BLOBNBOX_C_IT it(&boxes_);
5092
<span class="keywordflow">for</span> (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
5093
<a class="code" href="a00279.html">BLOBNBOX</a>* bbox = it.data();
5094
<a class="code" href="a00323.html#ac9838a760a9e246080953da4af85091d">ColPartition</a>* prev_owner = bbox-><a class="code" href="a00279.html#a3fc9ba48fe9dd66461305697568f867a">owner</a>();
5095
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>() || prev_owner == <span class="keyword">this</span> || prev_owner == NULL);
5096
<span class="keywordflow">if</span> (bbox == split_blob || !split_part->boxes_.empty()) {
5097
split_part->AddBox(it.extract());
5098
<span class="keywordflow">if</span> (<a class="code" href="a00323.html#adb5b080242a8eacde82dd88186ad2cf3">owns_blobs</a>() && prev_owner != NULL)
5099
bbox-><a class="code" href="a00279.html#ad573c3bea7351dd2cbdaaffa2ff11c58">set_owner</a>(split_part);
5102
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!it.empty());
5103
<span class="keywordflow">if</span> (split_part->IsEmpty()) {
5104
<span class="comment">// Split part ended up with nothing. Possible if split_blob is not</span>
5105
<span class="comment">// in the list of blobs.</span>
5106
<span class="keyword">delete</span> split_part;
5107
<span class="keywordflow">return</span> NULL;
5109
right_key_tab_ = <span class="keyword">false</span>;
5110
split_part->left_key_tab_ = <span class="keyword">false</span>;
5111
<a class="code" href="a00323.html#a18f2c4bd514ea700d7d4f6d0a6541d17">ComputeLimits</a>();
5112
<span class="comment">// TODO(nbeato) Merge Ray's CL like this:</span>
5113
<span class="comment">// if (owns_blobs())</span>
5114
<span class="comment">// SetBlobTextlineGoodness();</span>
5115
split_part->ComputeLimits();
5116
<span class="comment">// TODO(nbeato) Merge Ray's CL like this:</span>
5117
<span class="comment">// if (split_part->owns_blobs())</span>
5118
<span class="comment">// split_part->SetBlobTextlineGoodness();</span>
5119
<span class="keywordflow">return</span> split_part;
5124
<a class="anchor" id="aaa8e68fc867682b5e496103fdfea55bf"></a><!-- doxytag: member="tesseract::ColPartition::top_spacing" ref="aaa8e68fc867682b5e496103fdfea55bf" args="() const " -->
5125
<div class="memitem">
5126
<div class="memproto">
5127
<table class="memname">
5129
<td class="memname">int <a class="el" href="a00323.html#aaa8e68fc867682b5e496103fdfea55bf">tesseract::ColPartition::top_spacing</a> </td>
5131
<td class="paramname"></td><td>)</td>
5132
<td> const<code> [inline]</code></td>
5136
<div class="memdoc">
5138
<p>Definition at line <a class="el" href="a01101_source.html#l00226">226</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5139
<div class="fragment"><pre class="fragment"> {
5140
<span class="keywordflow">return</span> top_spacing_;
5145
<a class="anchor" id="a32e3f08af42cf1e5ad99118b6fd66df2"></a><!-- doxytag: member="tesseract::ColPartition::type" ref="a32e3f08af42cf1e5ad99118b6fd66df2" args="() const " -->
5146
<div class="memitem">
5147
<div class="memproto">
5148
<table class="memname">
5150
<td class="memname"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> <a class="el" href="a00323.html#a32e3f08af42cf1e5ad99118b6fd66df2">tesseract::ColPartition::type</a> </td>
5152
<td class="paramname"></td><td>)</td>
5153
<td> const<code> [inline]</code></td>
5157
<div class="memdoc">
5159
<p>Definition at line <a class="el" href="a01101_source.html#l00181">181</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5160
<div class="fragment"><pre class="fragment"> {
5161
<span class="keywordflow">return</span> type_;
5166
<a class="anchor" id="a774f9c6444621a78264fa2a2a401cf9a"></a><!-- doxytag: member="tesseract::ColPartition::TypesMatch" ref="a774f9c6444621a78264fa2a2a401cf9a" args="(const ColPartition &other) const " -->
5167
<div class="memitem">
5168
<div class="memproto">
5169
<table class="memname">
5171
<td class="memname">bool <a class="el" href="a00323.html#a774f9c6444621a78264fa2a2a401cf9a">tesseract::ColPartition::TypesMatch</a> </td>
5173
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
5174
<td class="paramname"><em>other</em></td><td>)</td>
5175
<td> const<code> [inline]</code></td>
5179
<div class="memdoc">
5181
<p>Definition at line <a class="el" href="a01101_source.html#l00403">403</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5182
<div class="fragment"><pre class="fragment"> {
5183
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a774f9c6444621a78264fa2a2a401cf9a">TypesMatch</a>(blob_type_, other.blob_type_);
5188
<a class="anchor" id="a1310c3b034870bdd2eabff87adbb702f"></a><!-- doxytag: member="tesseract::ColPartition::TypesMatch" ref="a1310c3b034870bdd2eabff87adbb702f" args="(BlobRegionType type1, BlobRegionType type2)" -->
5189
<div class="memitem">
5190
<div class="memproto">
5191
<table class="memname">
5193
<td class="memname">static bool <a class="el" href="a00323.html#a774f9c6444621a78264fa2a2a401cf9a">tesseract::ColPartition::TypesMatch</a> </td>
5195
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
5196
<td class="paramname"><em>type1</em>, </td>
5199
<td class="paramkey"></td>
5201
<td class="paramtype"><a class="el" href="a00728.html#aebfaf711760a99b60c297d1d619df575">BlobRegionType</a> </td>
5202
<td class="paramname"><em>type2</em> </td>
5207
<td></td><td><code> [inline, static]</code></td>
5211
<div class="memdoc">
5213
<p>Definition at line <a class="el" href="a01101_source.html#l00406">406</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5214
<div class="fragment"><pre class="fragment"> {
5215
<span class="keywordflow">return</span> (type1 == type2 || type1 == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a8a98863f18016aa4ccfd2d07dbb092a4">BRT_UNKNOWN</a> || type2 == <a class="code" href="a00728.html#aebfaf711760a99b60c297d1d619df575a8a98863f18016aa4ccfd2d07dbb092a4">BRT_UNKNOWN</a>) &&
5216
!<a class="code" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">BLOBNBOX::IsLineType</a>(type1) && !<a class="code" href="a00323.html#acf97b6bd6c867bb71f5cd639f19b9994">BLOBNBOX::IsLineType</a>(type2);
5221
<a class="anchor" id="aa7be118d2184949aa30f824932f04586"></a><!-- doxytag: member="tesseract::ColPartition::TypesSimilar" ref="aa7be118d2184949aa30f824932f04586" args="(PolyBlockType type1, PolyBlockType type2)" -->
5222
<div class="memitem">
5223
<div class="memproto">
5224
<table class="memname">
5226
<td class="memname">static bool <a class="el" href="a00323.html#aa7be118d2184949aa30f824932f04586">tesseract::ColPartition::TypesSimilar</a> </td>
5228
<td class="paramtype"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td>
5229
<td class="paramname"><em>type1</em>, </td>
5232
<td class="paramkey"></td>
5234
<td class="paramtype"><a class="el" href="a00781.html#a03566528a98c079dafeebf00502f2b60">PolyBlockType</a> </td>
5235
<td class="paramname"><em>type2</em> </td>
5240
<td></td><td><code> [inline, static]</code></td>
5244
<div class="memdoc">
5246
<p>Definition at line <a class="el" href="a01101_source.html#l00412">412</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5247
<div class="fragment"><pre class="fragment"> {
5248
<span class="keywordflow">return</span> (type1 == type2 ||
5249
(type1 == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677faaa63d8d8a99ddc2b3957f8e8787b4eca">PT_FLOWING_TEXT</a> && type2 == <a class="code" href="a00781.html#a03566528a98c079dafeebf00502f2b60aa52ce81f771512916e01215965910fc6">PT_INLINE_EQUATION</a>) ||
5250
(type2 == <a class="code" href="a00663.html#a02cfd8369d5ad8c70a8b90c0f40d677faaa63d8d8a99ddc2b3957f8e8787b4eca">PT_FLOWING_TEXT</a> && type1 == <a class="code" href="a00781.html#a03566528a98c079dafeebf00502f2b60aa52ce81f771512916e01215965910fc6">PT_INLINE_EQUATION</a>));
5255
<a class="anchor" id="a30fcadc2cf28369bb4634988ace3fd5a"></a><!-- doxytag: member="tesseract::ColPartition::upper_partners" ref="a30fcadc2cf28369bb4634988ace3fd5a" args="()" -->
5256
<div class="memitem">
5257
<div class="memproto">
5258
<table class="memname">
5260
<td class="memname">ColPartition_CLIST* <a class="el" href="a00323.html#a30fcadc2cf28369bb4634988ace3fd5a">tesseract::ColPartition::upper_partners</a> </td>
5262
<td class="paramname"></td><td>)</td>
5263
<td><code> [inline]</code></td>
5267
<div class="memdoc">
5269
<p>Definition at line <a class="el" href="a01101_source.html#l00196">196</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5270
<div class="fragment"><pre class="fragment"> {
5271
<span class="keywordflow">return</span> &upper_partners_;
5276
<a class="anchor" id="a4f7962f226fc6e687a5dfff0f9e40e94"></a><!-- doxytag: member="tesseract::ColPartition::VCoreOverlap" ref="a4f7962f226fc6e687a5dfff0f9e40e94" args="(const ColPartition &other) const " -->
5277
<div class="memitem">
5278
<div class="memproto">
5279
<table class="memname">
5281
<td class="memname">int <a class="el" href="a00323.html#a4f7962f226fc6e687a5dfff0f9e40e94">tesseract::ColPartition::VCoreOverlap</a> </td>
5283
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
5284
<td class="paramname"><em>other</em></td><td>)</td>
5285
<td> const<code> [inline]</code></td>
5289
<div class="memdoc">
5291
<p>Definition at line <a class="el" href="a01101_source.html#l00375">375</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5292
<div class="fragment"><pre class="fragment"> {
5293
<span class="keywordflow">return</span> MIN(median_top_, other.median_top_) -
5294
MAX(median_bottom_, other.median_bottom_);
5299
<a class="anchor" id="af57cf2b0dd0f197b1d48ad670eb0c8fc"></a><!-- doxytag: member="tesseract::ColPartition::VOverlaps" ref="af57cf2b0dd0f197b1d48ad670eb0c8fc" args="(const ColPartition &other) const " -->
5300
<div class="memitem">
5301
<div class="memproto">
5302
<table class="memname">
5304
<td class="memname">bool <a class="el" href="a00323.html#af57cf2b0dd0f197b1d48ad670eb0c8fc">tesseract::ColPartition::VOverlaps</a> </td>
5306
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
5307
<td class="paramname"><em>other</em></td><td>)</td>
5308
<td> const<code> [inline]</code></td>
5312
<div class="memdoc">
5314
<p>Definition at line <a class="el" href="a01101_source.html#l00370">370</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5315
<div class="fragment"><pre class="fragment"> {
5316
<span class="keywordflow">return</span> bounding_box_.<a class="code" href="a00592.html#a98e0f9a8622eec475ee93b260c57c7ab">y_gap</a>(other.bounding_box_) < 0;
5321
<a class="anchor" id="aa1eda3b89ee0c745279bbb8911db00b6"></a><!-- doxytag: member="tesseract::ColPartition::VSignificantCoreOverlap" ref="aa1eda3b89ee0c745279bbb8911db00b6" args="(const ColPartition &other) const " -->
5322
<div class="memitem">
5323
<div class="memproto">
5324
<table class="memname">
5326
<td class="memname">bool <a class="el" href="a00323.html#aa1eda3b89ee0c745279bbb8911db00b6">tesseract::ColPartition::VSignificantCoreOverlap</a> </td>
5328
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
5329
<td class="paramname"><em>other</em></td><td>)</td>
5330
<td> const<code> [inline]</code></td>
5334
<div class="memdoc">
5336
<p>Definition at line <a class="el" href="a01101_source.html#l00387">387</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5337
<div class="fragment"><pre class="fragment"> {
5338
<span class="keywordtype">int</span> overlap = <a class="code" href="a00323.html#a4f7962f226fc6e687a5dfff0f9e40e94">VCoreOverlap</a>(other);
5339
<span class="keywordtype">int</span> height = MIN(median_top_ - median_bottom_,
5340
other.median_top_ - other.median_bottom_);
5341
<span class="keywordflow">return</span> overlap * 3 > height;
5346
<a class="anchor" id="a975eb2892ed042fcfe94dc506d5f4c5b"></a><!-- doxytag: member="tesseract::ColPartition::WithinSameMargins" ref="a975eb2892ed042fcfe94dc506d5f4c5b" args="(const ColPartition &other) const " -->
5347
<div class="memitem">
5348
<div class="memproto">
5349
<table class="memname">
5351
<td class="memname">bool <a class="el" href="a00323.html#a975eb2892ed042fcfe94dc506d5f4c5b">tesseract::ColPartition::WithinSameMargins</a> </td>
5353
<td class="paramtype">const <a class="el" href="a00323.html">ColPartition</a> & </td>
5354
<td class="paramname"><em>other</em></td><td>)</td>
5355
<td> const<code> [inline]</code></td>
5359
<div class="memdoc">
5361
<p>Definition at line <a class="el" href="a01101_source.html#l00395">395</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5362
<div class="fragment"><pre class="fragment"> {
5363
<span class="keywordflow">return</span> left_margin_ <= other.bounding_box_.left() &&
5364
bounding_box_.<a class="code" href="a00592.html#a724fabf566586b663577dfa944ffbc61">left</a>() >= other.left_margin_ &&
5365
bounding_box_.<a class="code" href="a00592.html#a8703081c1a1c26db3a4dddaca1028e34">right</a>() <= other.right_margin_ &&
5366
right_margin_ >= other.bounding_box_.right();
5371
<a class="anchor" id="a0194fb90361732323fa9c1d0c4b65d9c"></a><!-- doxytag: member="tesseract::ColPartition::XAtY" ref="a0194fb90361732323fa9c1d0c4b65d9c" args="(int sort_key, int y) const " -->
5372
<div class="memitem">
5373
<div class="memproto">
5374
<table class="memname">
5376
<td class="memname">int <a class="el" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">tesseract::ColPartition::XAtY</a> </td>
5378
<td class="paramtype">int </td>
5379
<td class="paramname"><em>sort_key</em>, </td>
5382
<td class="paramkey"></td>
5384
<td class="paramtype">int </td>
5385
<td class="paramname"><em>y</em> </td>
5390
<td></td><td> const<code> [inline]</code></td>
5394
<div class="memdoc">
5396
<p>Definition at line <a class="el" href="a01101_source.html#l00320">320</a> of file <a class="el" href="a01101_source.html">colpartition.h</a>.</p>
5397
<div class="fragment"><pre class="fragment"> {
5398
<span class="keywordflow">return</span> <a class="code" href="a00323.html#a0194fb90361732323fa9c1d0c4b65d9c">TabVector::XAtY</a>(vertical_, sort_key, y);
5403
<hr/>The documentation for this class was generated from the following files:<ul>
5404
<li>/usr/local/google/home/jbreiden/tesseract-ocr-read-only/textord/<a class="el" href="a01101_source.html">colpartition.h</a></li>
5405
<li>/usr/local/google/home/jbreiden/tesseract-ocr-read-only/textord/<a class="el" href="a01100_source.html">colpartition.cpp</a></li>
5407
</div><!-- contents -->
5409
<!-- window showing the filter options -->
5410
<div id="MSearchSelectWindow"
5411
onmouseover="return searchBox.OnSearchSelectShow()"
5412
onmouseout="return searchBox.OnSearchSelectHide()"
5413
onkeydown="return searchBox.OnSearchSelectKey(event)">
5414
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Defines</a></div>
5416
<!-- iframe showing the search results (closed by default) -->
5417
<div id="MSearchResultsWindow">
5418
<iframe src="javascript:void(0)" frameborder="0"
5419
name="MSearchResults" id="MSearchResults">
5423
<div id="nav-path" class="navpath">
5425
<li class="navelem"><a class="el" href="a01265.html">tesseract</a> </li>
5426
<li class="navelem"><a class="el" href="a00323.html">ColPartition</a> </li>
5428
<li class="footer">Generated on Mon Feb 3 2014 10:59:22 for tesseract by
5429
<a href="http://www.doxygen.org/index.html">
5430
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>