tesseract
4.0.0-1-g2a2b
|
#include <stringrenderer.h>
Public Member Functions | |
StringRenderer (const std::string &font_desc, int page_width, int page_height) | |
~StringRenderer () | |
int | RenderToImage (const char *text, int text_length, Pix **pix) |
int | RenderToGrayscaleImage (const char *text, int text_length, Pix **pix) |
int | RenderToBinaryImage (const char *text, int text_length, int threshold, Pix **pix) |
int | RenderAllFontsToImage (double min_coverage, const char *text, int text_length, std::string *font_used, Pix **pix) |
bool | set_font (const std::string &desc) |
void | set_char_spacing (int char_spacing) |
void | set_leading (int leading) |
void | set_resolution (const int resolution) |
void | set_vertical_text (bool vertical_text) |
void | set_gravity_hint_strong (bool gravity_hint_strong) |
void | set_render_fullwidth_latin (bool render_fullwidth_latin) |
void | set_underline_start_prob (const double frac) |
void | set_underline_continuation_prob (const double frac) |
void | set_underline_style (const PangoUnderline style) |
void | set_features (const char *features) |
void | set_page (int page) |
void | set_box_padding (int val) |
void | set_drop_uncovered_chars (bool val) |
void | set_strip_unrenderable_words (bool val) |
void | set_output_word_boxes (bool val) |
void | set_add_ligatures (bool add_ligatures) |
void | set_pen_color (double r, double g, double b) |
void | set_h_margin (const int h_margin) |
void | set_v_margin (const int v_margin) |
const PangoFontInfo & | font () const |
int | h_margin () const |
int | v_margin () const |
const std::vector< BoxChar * > & | GetBoxes () const |
Boxa * | GetPageBoxes () const |
void | RotatePageBoxes (float rotation) |
void | ClearBoxes () |
std::string | GetBoxesStr () |
void | WriteAllBoxes (const std::string &filename) |
int | StripUnrenderableWords (std::string *utf8_text) const |
Static Public Member Functions | |
static std::string | InsertWordJoiners (const std::string &text) |
static std::string | ConvertBasicLatinToFullwidthLatin (const std::string &text) |
static std::string | ConvertFullwidthLatinToBasicLatin (const std::string &text) |
Protected Member Functions | |
void | InitPangoCairo () |
void | FreePangoCairo () |
void | SetLayoutProperties () |
void | SetWordUnderlineAttributes (const std::string &page_text) |
void | ComputeClusterBoxes () |
void | CorrectBoxPositionsToLayout (std::vector< BoxChar *> *boxchars) |
bool | GetClusterStrings (std::vector< std::string > *cluster_text) |
int | FindFirstPageBreakOffset (const char *text, int text_length) |
Protected Attributes | |
PangoFontInfo | font_ |
int | page_width_ |
int | page_height_ |
int | h_margin_ |
int | v_margin_ |
double | pen_color_ [3] |
int | char_spacing_ |
int | leading_ |
int | resolution_ |
bool | vertical_text_ |
bool | gravity_hint_strong_ |
bool | render_fullwidth_latin_ |
double | underline_start_prob_ |
double | underline_continuation_prob_ |
PangoUnderline | underline_style_ |
char * | features_ |
bool | drop_uncovered_chars_ |
bool | strip_unrenderable_words_ |
bool | add_ligatures_ |
bool | output_word_boxes_ |
cairo_surface_t * | surface_ |
cairo_t * | cr_ |
PangoLayout * | layout_ |
int | start_box_ |
int | page_ |
std::vector< BoxChar * > | boxchars_ |
int | box_padding_ |
Boxa * | page_boxes_ |
std::unordered_map< char32, int64_t > | char_map_ |
int | total_chars_ |
unsigned int | font_index_ |
int | last_offset_ |
Definition at line 52 of file stringrenderer.h.
tesseract::StringRenderer::StringRenderer | ( | const std::string & | font_desc, |
int | page_width, | ||
int | page_height | ||
) |
Definition at line 90 of file stringrenderer.cpp.
tesseract::StringRenderer::~StringRenderer | ( | ) |
Definition at line 144 of file stringrenderer.cpp.
void tesseract::StringRenderer::ClearBoxes | ( | ) |
Definition at line 337 of file stringrenderer.cpp.
|
protected |
Definition at line 460 of file stringrenderer.cpp.
|
static |
Definition at line 694 of file stringrenderer.cpp.
|
static |
Definition at line 714 of file stringrenderer.cpp.
|
protected |
Definition at line 602 of file stringrenderer.cpp.
|
protected |
Definition at line 279 of file stringrenderer.cpp.
|
inline |
Definition at line 133 of file stringrenderer.h.
|
protected |
Definition at line 218 of file stringrenderer.cpp.
const std::vector< BoxChar * > & tesseract::StringRenderer::GetBoxes | ( | ) | const |
Definition at line 323 of file stringrenderer.cpp.
std::string tesseract::StringRenderer::GetBoxesStr | ( | ) |
Definition at line 343 of file stringrenderer.cpp.
|
protected |
Definition at line 354 of file stringrenderer.cpp.
Boxa * tesseract::StringRenderer::GetPageBoxes | ( | ) | const |
Definition at line 327 of file stringrenderer.cpp.
|
inline |
Definition at line 136 of file stringrenderer.h.
|
protected |
Definition at line 150 of file stringrenderer.cpp.
|
static |
Definition at line 671 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderAllFontsToImage | ( | double | min_coverage, |
const char * | text, | ||
int | text_length, | ||
std::string * | font_used, | ||
Pix ** | pix | ||
) |
Definition at line 834 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToBinaryImage | ( | const char * | text, |
int | text_length, | ||
int | threshold, | ||
Pix ** | pix | ||
) |
Definition at line 653 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToGrayscaleImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 642 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 733 of file stringrenderer.cpp.
void tesseract::StringRenderer::RotatePageBoxes | ( | float | rotation | ) |
Definition at line 331 of file stringrenderer.cpp.
|
inline |
Definition at line 118 of file stringrenderer.h.
|
inline |
Definition at line 103 of file stringrenderer.h.
|
inline |
Definition at line 72 of file stringrenderer.h.
|
inline |
Definition at line 106 of file stringrenderer.h.
|
inline |
Definition at line 96 of file stringrenderer.h.
bool tesseract::StringRenderer::set_font | ( | const std::string & | desc | ) |
Definition at line 125 of file stringrenderer.cpp.
|
inline |
Definition at line 80 of file stringrenderer.h.
|
inline |
Definition at line 127 of file stringrenderer.h.
|
inline |
Definition at line 73 of file stringrenderer.h.
|
inline |
Definition at line 112 of file stringrenderer.h.
|
inline |
Definition at line 100 of file stringrenderer.h.
|
inline |
Definition at line 122 of file stringrenderer.h.
|
inline |
Definition at line 83 of file stringrenderer.h.
void tesseract::StringRenderer::set_resolution | ( | const int | resolution | ) |
Definition at line 131 of file stringrenderer.cpp.
|
inline |
Definition at line 109 of file stringrenderer.h.
void tesseract::StringRenderer::set_underline_continuation_prob | ( | const double | frac | ) |
Definition at line 140 of file stringrenderer.cpp.
void tesseract::StringRenderer::set_underline_start_prob | ( | const double | frac | ) |
Definition at line 136 of file stringrenderer.cpp.
|
inline |
Definition at line 93 of file stringrenderer.h.
|
inline |
Definition at line 130 of file stringrenderer.h.
|
inline |
Definition at line 77 of file stringrenderer.h.
|
protected |
Definition at line 172 of file stringrenderer.cpp.
|
protected |
Definition at line 233 of file stringrenderer.cpp.
int tesseract::StringRenderer::StripUnrenderableWords | ( | std::string * | utf8_text | ) | const |
Definition at line 615 of file stringrenderer.cpp.
|
inline |
Definition at line 137 of file stringrenderer.h.
void tesseract::StringRenderer::WriteAllBoxes | ( | const std::string & | filename | ) |
Definition at line 348 of file stringrenderer.cpp.
|
protected |
Definition at line 198 of file stringrenderer.h.
|
protected |
Definition at line 211 of file stringrenderer.h.
|
protected |
Definition at line 210 of file stringrenderer.h.
|
protected |
Definition at line 216 of file stringrenderer.h.
|
protected |
Definition at line 186 of file stringrenderer.h.
|
protected |
Definition at line 202 of file stringrenderer.h.
|
protected |
Definition at line 196 of file stringrenderer.h.
|
protected |
Definition at line 194 of file stringrenderer.h.
|
protected |
Definition at line 181 of file stringrenderer.h.
|
protected |
Definition at line 218 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 219 of file stringrenderer.h.
|
protected |
Definition at line 203 of file stringrenderer.h.
|
protected |
Definition at line 187 of file stringrenderer.h.
|
protected |
Definition at line 199 of file stringrenderer.h.
|
protected |
Definition at line 207 of file stringrenderer.h.
|
protected |
Definition at line 213 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.
|
protected |
Definition at line 190 of file stringrenderer.h.
|
protected |
Definition at line 187 of file stringrenderer.h.
|
protected |
Definition at line 206 of file stringrenderer.h.
|
protected |
Definition at line 197 of file stringrenderer.h.
|
protected |
Definition at line 201 of file stringrenderer.h.
|
protected |
Definition at line 217 of file stringrenderer.h.
|
protected |
Definition at line 192 of file stringrenderer.h.
|
protected |
Definition at line 191 of file stringrenderer.h.
|
protected |
Definition at line 193 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 188 of file stringrenderer.h.