tesseract  3.05.02
tesseract::TessTsvRenderer Class Reference

#include <renderer.h>

Inheritance diagram for tesseract::TessTsvRenderer:
tesseract::TessResultRenderer

Public Member Functions

 TessTsvRenderer (const char *outputbase, bool font_info)
 
 TessTsvRenderer (const char *outputbase)
 
- Public Member Functions inherited from tesseract::TessResultRenderer
virtual ~TessResultRenderer ()
 
void insert (TessResultRenderer *next)
 
TessResultRenderernext ()
 
bool BeginDocument (const char *title)
 
bool AddImage (TessBaseAPI *api)
 
bool EndDocument ()
 
const char * file_extension () const
 
const char * title () const
 
int imagenum () const
 

Protected Member Functions

virtual bool BeginDocumentHandler ()
 
virtual bool AddImageHandler (TessBaseAPI *api)
 
virtual bool EndDocumentHandler ()
 
- Protected Member Functions inherited from tesseract::TessResultRenderer
 TessResultRenderer (const char *outputbase, const char *extension)
 
void AppendString (const char *s)
 
void AppendData (const char *s, int len)
 

Detailed Description

Renders Tesseract output into a TSV string

Definition at line 169 of file renderer.h.

Constructor & Destructor Documentation

◆ TessTsvRenderer() [1/2]

tesseract::TessTsvRenderer::TessTsvRenderer ( const char *  outputbase,
bool  font_info 
)
explicit

Definition at line 208 of file renderer.cpp.

209  : TessResultRenderer(outputbase, "tsv") {
210  font_info_ = font_info;
211 }
TessResultRenderer(const char *outputbase, const char *extension)
Definition: renderer.cpp:32

◆ TessTsvRenderer() [2/2]

tesseract::TessTsvRenderer::TessTsvRenderer ( const char *  outputbase)
explicit

Definition at line 203 of file renderer.cpp.

204  : TessResultRenderer(outputbase, "tsv") {
205  font_info_ = false;
206 }
TessResultRenderer(const char *outputbase, const char *extension)
Definition: renderer.cpp:32

Member Function Documentation

◆ AddImageHandler()

bool tesseract::TessTsvRenderer::AddImageHandler ( TessBaseAPI api)
protectedvirtual

Implements tesseract::TessResultRenderer.

Definition at line 223 of file renderer.cpp.

223  {
224  char* tsv = api->GetTSVText(imagenum());
225  if (tsv == NULL) return false;
226 
227  AppendString(tsv);
228  delete[] tsv;
229 
230  return true;
231 }
void AppendString(const char *s)
Definition: renderer.cpp:101

◆ BeginDocumentHandler()

bool tesseract::TessTsvRenderer::BeginDocumentHandler ( )
protectedvirtual

Reimplemented from tesseract::TessResultRenderer.

Definition at line 213 of file renderer.cpp.

213  {
214  // Output TSV column headings
215  AppendString(
216  "level\tpage_num\tblock_num\tpar_num\tline_num\tword_"
217  "num\tleft\ttop\twidth\theight\tconf\ttext\n");
218  return true;
219 }
void AppendString(const char *s)
Definition: renderer.cpp:101

◆ EndDocumentHandler()

bool tesseract::TessTsvRenderer::EndDocumentHandler ( )
protectedvirtual

Reimplemented from tesseract::TessResultRenderer.

Definition at line 221 of file renderer.cpp.

221 { return true; }

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