tesseract  4.0.0-1-g2a2b
tesseract::DebugPixa Class Reference

#include <debugpixa.h>

Public Member Functions

 DebugPixa ()
 
 ~DebugPixa ()
 
void AddPix (const Pix *pix, const char *caption)
 
void WritePDF (const char *filename)
 

Detailed Description

Definition at line 10 of file debugpixa.h.

Constructor & Destructor Documentation

◆ DebugPixa()

tesseract::DebugPixa::DebugPixa ( )
inline

Definition at line 13 of file debugpixa.h.

13  {
14  pixa_ = pixaCreate(0);
15  fonts_ = bmfCreate(nullptr, 14);
16  }

◆ ~DebugPixa()

tesseract::DebugPixa::~DebugPixa ( )
inline

Definition at line 19 of file debugpixa.h.

19  {
20  pixaDestroy(&pixa_);
21  bmfDestroy(&fonts_);
22  }

Member Function Documentation

◆ AddPix()

void tesseract::DebugPixa::AddPix ( const Pix *  pix,
const char *  caption 
)
inline

Definition at line 26 of file debugpixa.h.

26  {
27  int depth = pixGetDepth(const_cast<Pix*>(pix));
28  int color = depth < 8 ? 1 : (depth > 8 ? 0x00ff0000 : 0x80);
29  Pix* pix_debug = pixAddSingleTextblock(
30  const_cast<Pix*>(pix), fonts_, caption, color, L_ADD_BELOW, nullptr);
31  pixaAddPix(pixa_, pix_debug, L_INSERT);
32  }

◆ WritePDF()

void tesseract::DebugPixa::WritePDF ( const char *  filename)
inline

Definition at line 36 of file debugpixa.h.

36  {
37  if (pixaGetCount(pixa_) > 0) {
38  pixaConvertToPdf(pixa_, 300, 1.0f, 0, 0, "AllDebugImages", filename);
39  pixaClear(pixa_);
40  }
41  }

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