|
tesseract v5.3.3.20231005
|
#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, Image *pix) |
| int | RenderToGrayscaleImage (const char *text, int text_length, Image *pix) |
| int | RenderToBinaryImage (const char *text, int text_length, int threshold, Image *pix) |
| int | RenderAllFontsToImage (double min_coverage, const char *text, int text_length, std::string *font_used, Image *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_ |
| std::string | 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 50 of file stringrenderer.h.
| tesseract::StringRenderer::StringRenderer | ( | const std::string & | font_desc, |
| int | page_width, | ||
| int | page_height | ||
| ) |
Definition at line 95 of file stringrenderer.cpp.
| tesseract::StringRenderer::~StringRenderer | ( | ) |
Definition at line 147 of file stringrenderer.cpp.
| void tesseract::StringRenderer::ClearBoxes | ( | ) |
Definition at line 341 of file stringrenderer.cpp.
|
protected |
Definition at line 461 of file stringrenderer.cpp.
|
static |
Definition at line 690 of file stringrenderer.cpp.
|
static |
Definition at line 708 of file stringrenderer.cpp.
|
protected |
Definition at line 598 of file stringrenderer.cpp.
|
protected |
Definition at line 281 of file stringrenderer.cpp.
|
inline |
Definition at line 131 of file stringrenderer.h.
|
protected |
| const std::vector< BoxChar * > & tesseract::StringRenderer::GetBoxes | ( | ) | const |
Definition at line 328 of file stringrenderer.cpp.
| std::string tesseract::StringRenderer::GetBoxesStr | ( | ) |
Definition at line 349 of file stringrenderer.cpp.
|
protected |
Definition at line 360 of file stringrenderer.cpp.
| Boxa * tesseract::StringRenderer::GetPageBoxes | ( | ) | const |
Definition at line 332 of file stringrenderer.cpp.
|
inline |
Definition at line 134 of file stringrenderer.h.
|
protected |
Definition at line 152 of file stringrenderer.cpp.
|
static |
Definition at line 670 of file stringrenderer.cpp.
| int tesseract::StringRenderer::RenderAllFontsToImage | ( | double | min_coverage, |
| const char * | text, | ||
| int | text_length, | ||
| std::string * | font_used, | ||
| Image * | pix | ||
| ) |
Definition at line 826 of file stringrenderer.cpp.
| int tesseract::StringRenderer::RenderToBinaryImage | ( | const char * | text, |
| int | text_length, | ||
| int | threshold, | ||
| Image * | pix | ||
| ) |
Definition at line 652 of file stringrenderer.cpp.
| int tesseract::StringRenderer::RenderToGrayscaleImage | ( | const char * | text, |
| int | text_length, | ||
| Image * | pix | ||
| ) |
Definition at line 642 of file stringrenderer.cpp.
| int tesseract::StringRenderer::RenderToImage | ( | const char * | text, |
| int | text_length, | ||
| Image * | pix | ||
| ) |
Definition at line 725 of file stringrenderer.cpp.
| void tesseract::StringRenderer::RotatePageBoxes | ( | float | rotation | ) |
Definition at line 336 of file stringrenderer.cpp.
|
inline |
Definition at line 116 of file stringrenderer.h.
|
inline |
Definition at line 101 of file stringrenderer.h.
|
inline |
Definition at line 69 of file stringrenderer.h.
|
inline |
Definition at line 104 of file stringrenderer.h.
|
inline |
Definition at line 95 of file stringrenderer.h.
| bool tesseract::StringRenderer::set_font | ( | const std::string & | desc | ) |
Definition at line 128 of file stringrenderer.cpp.
|
inline |
Definition at line 79 of file stringrenderer.h.
|
inline |
Definition at line 125 of file stringrenderer.h.
|
inline |
Definition at line 72 of file stringrenderer.h.
|
inline |
Definition at line 110 of file stringrenderer.h.
|
inline |
Definition at line 98 of file stringrenderer.h.
|
inline |
Definition at line 120 of file stringrenderer.h.
|
inline |
Definition at line 82 of file stringrenderer.h.
| void tesseract::StringRenderer::set_resolution | ( | const int | resolution | ) |
Definition at line 134 of file stringrenderer.cpp.
|
inline |
Definition at line 107 of file stringrenderer.h.
| void tesseract::StringRenderer::set_underline_continuation_prob | ( | const double | frac | ) |
Definition at line 143 of file stringrenderer.cpp.
| void tesseract::StringRenderer::set_underline_start_prob | ( | const double | frac | ) |
Definition at line 139 of file stringrenderer.cpp.
|
inline |
Definition at line 92 of file stringrenderer.h.
|
inline |
Definition at line 128 of file stringrenderer.h.
|
inline |
Definition at line 76 of file stringrenderer.h.
|
protected |
Definition at line 173 of file stringrenderer.cpp.
|
protected |
Definition at line 231 of file stringrenderer.cpp.
| int tesseract::StringRenderer::StripUnrenderableWords | ( | std::string * | utf8_text | ) | const |
Definition at line 610 of file stringrenderer.cpp.
|
inline |
Definition at line 137 of file stringrenderer.h.
| void tesseract::StringRenderer::WriteAllBoxes | ( | const std::string & | filename | ) |
Definition at line 354 of file stringrenderer.cpp.
|
protected |
Definition at line 200 of file stringrenderer.h.
|
protected |
Definition at line 213 of file stringrenderer.h.
|
protected |
Definition at line 212 of file stringrenderer.h.
|
protected |
Definition at line 218 of file stringrenderer.h.
|
protected |
Definition at line 188 of file stringrenderer.h.
|
protected |
Definition at line 204 of file stringrenderer.h.
|
protected |
Definition at line 198 of file stringrenderer.h.
|
protected |
Definition at line 196 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 220 of file stringrenderer.h.
|
protected |
Definition at line 191 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.
|
protected |
Definition at line 221 of file stringrenderer.h.
|
protected |
Definition at line 205 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.h.
|
protected |
Definition at line 201 of file stringrenderer.h.
|
protected |
Definition at line 209 of file stringrenderer.h.
|
protected |
Definition at line 215 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.
|
protected |
Definition at line 187 of file stringrenderer.h.
|
protected |
Definition at line 192 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.h.
|
protected |
Definition at line 208 of file stringrenderer.h.
|
protected |
Definition at line 199 of file stringrenderer.h.
|
protected |
Definition at line 203 of file stringrenderer.h.
|
protected |
Definition at line 219 of file stringrenderer.h.
|
protected |
Definition at line 194 of file stringrenderer.h.
|
protected |
Definition at line 193 of file stringrenderer.h.
|
protected |
Definition at line 195 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.
|
protected |
Definition at line 190 of file stringrenderer.h.