-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00023_source.html
133 lines (131 loc) · 44 KB
/
a00023_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /usr/src/tesseract-ocr.master/src/api/renderer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">tesseract
 <span id="projectnumber">4.0.0-1-g2a2b</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00023_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">renderer.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00023.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// File: renderer.h</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// Description: Rendering interface to inject into TessBaseAPI</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// (C) Copyright 2011, Google Inc.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">//</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"></span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef TESSERACT_API_RENDERER_H_</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define TESSERACT_API_RENDERER_H_</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// To avoid collision with other typenames include the ABSOLUTE MINIMUM</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">// complexity of includes here. Use forward declarations wherever possible</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// and hide includes of complex types in baseapi.cpp.</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <string></span> <span class="comment">// for std::string</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="a00518.html">genericvector.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="a00560.html">platform.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">namespace </span><a class="code" href="a01629.html">tesseract</a> {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">class </span><a class="code" href="a00014.html#a47436d31525552f08492b8dcdfc12755">TessBaseAPI</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="a02190.html"> 45</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">virtual</span> ~<a class="code" href="a02190.html">TessResultRenderer</a>();</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">// Takes ownership of pointer so must be new'd instance.</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">// Renderers aren't ordered, but appends the sequences of next parameter</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="comment">// and existing next(). The renderers should be unique across both lists.</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordtype">void</span> <a class="code" href="a00878.html#a32592fff9af11f3c35bd4c4f57733fd2">insert</a>(<a class="code" href="a02190.html">TessResultRenderer</a>* next);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="comment">// Returns the next renderer or nullptr.</span></div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="a02190.html#a8b986f7eee3c6892faa6f070a102b0b1"> 55</a></span>  <a class="code" href="a02190.html">TessResultRenderer</a>* <a class="code" href="a02190.html#a8b986f7eee3c6892faa6f070a102b0b1">next</a>() { <span class="keywordflow">return</span> next_; }</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordtype">bool</span> BeginDocument(<span class="keyword">const</span> <span class="keywordtype">char</span>* title);</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordtype">bool</span> AddImage(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordtype">bool</span> EndDocument();</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="a02190.html#ae902177e443fa16cd93047dfeb50152b"> 80</a></span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a02190.html#ae902177e443fa16cd93047dfeb50152b">file_extension</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> file_extension_; }</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="a02190.html#a8f231200d397cd24e2d9642f4306a9f0"> 81</a></span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a02190.html#a8f231200d397cd24e2d9642f4306a9f0">title</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> title_.c_str(); }</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">// Is everything fine? Otherwise something went wrong.</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="a02190.html#a7fff8a041ab3a18afa75546e94a6b723"> 84</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a02190.html#a7fff8a041ab3a18afa75546e94a6b723">happy</a>() { <span class="keywordflow">return</span> happy_; }</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="a02190.html#a2682a4f6c8bc6671baa0ca7336178b08"> 95</a></span>  <span class="keywordtype">int</span> <a class="code" href="a02190.html#a2682a4f6c8bc6671baa0ca7336178b08">imagenum</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> imagenum_; }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <a class="code" href="a00014.html#a79b401fe19433464a13b416108deb755">TessResultRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase,</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* extension);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">// Hook for specialized handling in BeginDocument()</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> BeginDocumentHandler();</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">// This must be overridden to render the OCR'd results</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api) = 0;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// Hook for specialized handling in EndDocument()</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> EndDocumentHandler();</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="comment">// Renderers can call this to append '\0' terminated strings into</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment">// the output string returned by GetOutput.</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="comment">// This method will grow the output buffer if needed.</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordtype">void</span> AppendString(<span class="keyword">const</span> <span class="keywordtype">char</span>* s);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="comment">// Renderers can call this to append binary byte sequences into</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="comment">// the output string returned by GetOutput. Note that s is not necessarily</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="comment">// '\0' terminated (and can contain '\0' within it).</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">// This method will grow the output buffer if needed.</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">void</span> AppendData(<span class="keyword">const</span> <span class="keywordtype">char</span>* s, <span class="keywordtype">int</span> len);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* file_extension_; <span class="comment">// standard extension for generated output</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="a02834.html">STRING</a> title_; <span class="comment">// title of document being renderered</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordtype">int</span> imagenum_; <span class="comment">// index of last image added</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  FILE* fout_; <span class="comment">// output file pointer</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <a class="code" href="a02190.html">TessResultRenderer</a>* next_; <span class="comment">// Can link multiple renderers together</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordtype">bool</span> happy_; <span class="comment">// I get grumpy when the disk fills up, etc.</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> };</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="a02194.html"> 144</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02194.html">TessTextRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keyword">explicit</span> <a class="code" href="a00014.html#a872e38dd847848a617d771dd3adce886">TessTextRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> };</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="a02198.html"> 155</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02198.html">TessHOcrRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keyword">explicit</span> <a class="code" href="a00014.html#af1b3b93f62e68981a0be10bf67ce641a">TessHOcrRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase, <span class="keywordtype">bool</span> font_info);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keyword">explicit</span> <a class="code" href="a00014.html#af1b3b93f62e68981a0be10bf67ce641a">TessHOcrRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> BeginDocumentHandler();</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> EndDocumentHandler();</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keywordtype">bool</span> font_info_; <span class="comment">// whether to print font information</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span> };</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="a02202.html"> 172</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02202.html">TessTsvRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keyword">explicit</span> <a class="code" href="a02202.html">TessTsvRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* outputbase, <span class="keywordtype">bool</span> font_info);</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keyword">explicit</span> <a class="code" href="a02202.html">TessTsvRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* outputbase);</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> BeginDocumentHandler();</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> EndDocumentHandler();</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordtype">bool</span> font_info_; <span class="comment">// whether to print font information</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> };</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="a02206.html"> 189</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02206.html">TessPDFRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="comment">// datadir is the location of the TESSDATA. We need it because</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// we load a custom PDF font from this location.</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="a00014.html#a31717883a37a7332c296efcd04a08963">TessPDFRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* outputbase, <span class="keyword">const</span> <span class="keywordtype">char</span>* datadir, <span class="keywordtype">bool</span> textonly = <span class="keyword">false</span>);</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> BeginDocumentHandler();</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> EndDocumentHandler();</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> </div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="comment">// We don't want to have every image in memory at once,</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">// so we store some metadata as we go along producing</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="comment">// PDFs one page at a time. At the end, that metadata is</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// used to make everything that isn't easily handled in a</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="comment">// streaming fashion.</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordtype">long</span> <span class="keywordtype">int</span> obj_; <span class="comment">// counter for PDF objects</span></div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="code" href="a02182.html">GenericVector<long int></a> offsets_; <span class="comment">// offset of every PDF object in bytes</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <a class="code" href="a02182.html">GenericVector<long int></a> pages_; <span class="comment">// object number for every /Page object</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  std::string datadir_; <span class="comment">// where to find the custom font</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordtype">bool</span> textonly_; <span class="comment">// skip images if set</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="comment">// Bookkeeping only. DIY = Do It Yourself.</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordtype">void</span> AppendPDFObjectDIY(<span class="keywordtype">size_t</span> objectsize);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="comment">// Bookkeeping + emit data.</span></div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordtype">void</span> AppendPDFObject(<span class="keyword">const</span> <span class="keywordtype">char</span> *data);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">// Create the /Contents object for an entire page.</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keywordtype">char</span>* GetPDFTextObjects(<a class="code" href="a02186.html">TessBaseAPI</a>* api, <span class="keywordtype">double</span> width, <span class="keywordtype">double</span> height);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="comment">// Turn an image into a PDF object. Only transcode if we have to.</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> imageToPDFObj(Pix* pix, <span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <span class="keywordtype">long</span> <span class="keywordtype">int</span> objnum,</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordtype">char</span>** pdf_object, <span class="keywordtype">long</span> <span class="keywordtype">int</span>* pdf_object_size, <span class="keyword">const</span> <span class="keywordtype">int</span> jpg_quality);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span> };</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span> </div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> </div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="a02210.html"> 226</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02210.html">TessUnlvRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keyword">explicit</span> <a class="code" href="a00014.html#ac9242125c22e99e11c97021e7d68cc38">TessUnlvRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase);</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> </div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span> };</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> </div><div class="line"><a name="l00237"></a><span class="lineno"><a class="line" href="a02214.html"> 237</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02214.html">TessBoxTextRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keyword">explicit</span> <a class="code" href="a00014.html#ac1e76e08a467d79ae8d359ba56906d5c">TessBoxTextRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *outputbase);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> </div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> };</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> </div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="a02218.html"> 250</a></span> <span class="keyword">class </span><a class="code" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <a class="code" href="a02218.html">TessOsdRenderer</a> : <span class="keyword">public</span> <a class="code" href="a02190.html">TessResultRenderer</a> {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keyword">explicit</span> <a class="code" href="a02218.html">TessOsdRenderer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* outputbase);</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AddImageHandler(<a class="code" href="a02186.html">TessBaseAPI</a>* api);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span> };</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> } <span class="comment">// namespace tesseract.</span></div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> </div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> <span class="preprocessor">#endif // TESSERACT_API_RENDERER_H_</span></div><div class="ttc" id="a02190_html_a7fff8a041ab3a18afa75546e94a6b723"><div class="ttname"><a href="a02190.html#a7fff8a041ab3a18afa75546e94a6b723">tesseract::TessResultRenderer::happy</a></div><div class="ttdeci">bool happy()</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00084">renderer.h:84</a></div></div>
<div class="ttc" id="a02194_html"><div class="ttname"><a href="a02194.html">tesseract::TessTextRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00144">renderer.h:144</a></div></div>
<div class="ttc" id="a02190_html_a8b986f7eee3c6892faa6f070a102b0b1"><div class="ttname"><a href="a02190.html#a8b986f7eee3c6892faa6f070a102b0b1">tesseract::TessResultRenderer::next</a></div><div class="ttdeci">TessResultRenderer * next()</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00055">renderer.h:55</a></div></div>
<div class="ttc" id="a00014_html_ac9242125c22e99e11c97021e7d68cc38"><div class="ttname"><a href="a00014.html#ac9242125c22e99e11c97021e7d68cc38">TessUnlvRenderer</a></div><div class="ttdeci">struct TessUnlvRenderer TessUnlvRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00087">capi.h:87</a></div></div>
<div class="ttc" id="a02202_html"><div class="ttname"><a href="a02202.html">tesseract::TessTsvRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00172">renderer.h:172</a></div></div>
<div class="ttc" id="a00560_html_a86e51270628c53ce7e2c23b1c2b4490e"><div class="ttname"><a href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a></div><div class="ttdeci">#define TESS_API</div><div class="ttdef"><b>Definition:</b> <a href="a00560_source.html#l00074">platform.h:74</a></div></div>
<div class="ttc" id="a00014_html_a31717883a37a7332c296efcd04a08963"><div class="ttname"><a href="a00014.html#a31717883a37a7332c296efcd04a08963">TessPDFRenderer</a></div><div class="ttdeci">struct TessPDFRenderer TessPDFRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00086">capi.h:86</a></div></div>
<div class="ttc" id="a00014_html_a47436d31525552f08492b8dcdfc12755"><div class="ttname"><a href="a00014.html#a47436d31525552f08492b8dcdfc12755">TessBaseAPI</a></div><div class="ttdeci">struct TessBaseAPI TessBaseAPI</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00089">capi.h:89</a></div></div>
<div class="ttc" id="a02210_html"><div class="ttname"><a href="a02210.html">tesseract::TessUnlvRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00226">renderer.h:226</a></div></div>
<div class="ttc" id="a00014_html_a872e38dd847848a617d771dd3adce886"><div class="ttname"><a href="a00014.html#a872e38dd847848a617d771dd3adce886">TessTextRenderer</a></div><div class="ttdeci">struct TessTextRenderer TessTextRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00084">capi.h:84</a></div></div>
<div class="ttc" id="a00518_html"><div class="ttname"><a href="a00518.html">genericvector.h</a></div></div>
<div class="ttc" id="a02190_html_ae902177e443fa16cd93047dfeb50152b"><div class="ttname"><a href="a02190.html#ae902177e443fa16cd93047dfeb50152b">tesseract::TessResultRenderer::file_extension</a></div><div class="ttdeci">const char * file_extension() const</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00080">renderer.h:80</a></div></div>
<div class="ttc" id="a02182_html"><div class="ttname"><a href="a02182.html">GenericVector< long int ></a></div></div>
<div class="ttc" id="a02218_html"><div class="ttname"><a href="a02218.html">tesseract::TessOsdRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00250">renderer.h:250</a></div></div>
<div class="ttc" id="a00014_html_af1b3b93f62e68981a0be10bf67ce641a"><div class="ttname"><a href="a00014.html#af1b3b93f62e68981a0be10bf67ce641a">TessHOcrRenderer</a></div><div class="ttdeci">struct TessHOcrRenderer TessHOcrRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00085">capi.h:85</a></div></div>
<div class="ttc" id="a02206_html"><div class="ttname"><a href="a02206.html">tesseract::TessPDFRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00189">renderer.h:189</a></div></div>
<div class="ttc" id="a02190_html_a2682a4f6c8bc6671baa0ca7336178b08"><div class="ttname"><a href="a02190.html#a2682a4f6c8bc6671baa0ca7336178b08">tesseract::TessResultRenderer::imagenum</a></div><div class="ttdeci">int imagenum() const</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00095">renderer.h:95</a></div></div>
<div class="ttc" id="a00878_html_a32592fff9af11f3c35bd4c4f57733fd2"><div class="ttname"><a href="a00878.html#a32592fff9af11f3c35bd4c4f57733fd2">insert</a></div><div class="ttdeci">void insert(LIST list, void *node)</div><div class="ttdef"><b>Definition:</b> <a href="a00878_source.html#l00201">oldlist.cpp:201</a></div></div>
<div class="ttc" id="a02190_html"><div class="ttname"><a href="a02190.html">tesseract::TessResultRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00045">renderer.h:45</a></div></div>
<div class="ttc" id="a02214_html"><div class="ttname"><a href="a02214.html">tesseract::TessBoxTextRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00237">renderer.h:237</a></div></div>
<div class="ttc" id="a02190_html_a8f231200d397cd24e2d9642f4306a9f0"><div class="ttname"><a href="a02190.html#a8f231200d397cd24e2d9642f4306a9f0">tesseract::TessResultRenderer::title</a></div><div class="ttdeci">const char * title() const</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00081">renderer.h:81</a></div></div>
<div class="ttc" id="a01629_html"><div class="ttname"><a href="a01629.html">tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00094">baseapi.cpp:94</a></div></div>
<div class="ttc" id="a02834_html"><div class="ttname"><a href="a02834.html">STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00584_source.html#l00045">strngs.h:45</a></div></div>
<div class="ttc" id="a00014_html_a79b401fe19433464a13b416108deb755"><div class="ttname"><a href="a00014.html#a79b401fe19433464a13b416108deb755">TessResultRenderer</a></div><div class="ttdeci">struct TessResultRenderer TessResultRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00083">capi.h:83</a></div></div>
<div class="ttc" id="a00560_html"><div class="ttname"><a href="a00560.html">platform.h</a></div></div>
<div class="ttc" id="a02198_html"><div class="ttname"><a href="a02198.html">tesseract::TessHOcrRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00155">renderer.h:155</a></div></div>
<div class="ttc" id="a02186_html"><div class="ttname"><a href="a02186.html">tesseract::TessBaseAPI</a></div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00101">baseapi.h:101</a></div></div>
<div class="ttc" id="a00014_html_ac1e76e08a467d79ae8d359ba56906d5c"><div class="ttname"><a href="a00014.html#ac1e76e08a467d79ae8d359ba56906d5c">TessBoxTextRenderer</a></div><div class="ttdeci">struct TessBoxTextRenderer TessBoxTextRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00088">capi.h:88</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_fce9a394c0d2c636e610a0a34fe30580.html">tesseract-ocr.master</a></li><li class="navelem"><a class="el" href="dir_fd2783e80b2d56815818e17a68fc4d98.html">src</a></li><li class="navelem"><a class="el" href="dir_316d7b7f065455dc5a9611f5cda5f609.html">api</a></li><li class="navelem"><a class="el" href="a00023.html">renderer.h</a></li>
<li class="footer">Generated on Mon Oct 29 2018 11:03:42 for tesseract by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>