tesseract
5.0.0-alpha-619-ge9db
|
#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 49 of file stringrenderer.h.
tesseract::StringRenderer::StringRenderer | ( | const std::string & | font_desc, |
int | page_width, | ||
int | page_height | ||
) |
Definition at line 107 of file stringrenderer.cpp.
tesseract::StringRenderer::~StringRenderer | ( | ) |
Definition at line 161 of file stringrenderer.cpp.
void tesseract::StringRenderer::ClearBoxes | ( | ) |
Definition at line 354 of file stringrenderer.cpp.
|
protected |
Definition at line 477 of file stringrenderer.cpp.
|
static |
Definition at line 711 of file stringrenderer.cpp.
|
static |
Definition at line 731 of file stringrenderer.cpp.
|
protected |
Definition at line 619 of file stringrenderer.cpp.
|
protected |
Definition at line 296 of file stringrenderer.cpp.
|
inline |
Definition at line 130 of file stringrenderer.h.
|
protected |
Definition at line 235 of file stringrenderer.cpp.
const std::vector< BoxChar * > & tesseract::StringRenderer::GetBoxes | ( | ) | const |
Definition at line 340 of file stringrenderer.cpp.
std::string tesseract::StringRenderer::GetBoxesStr | ( | ) |
Definition at line 360 of file stringrenderer.cpp.
|
protected |
Definition at line 371 of file stringrenderer.cpp.
Boxa * tesseract::StringRenderer::GetPageBoxes | ( | ) | const |
Definition at line 344 of file stringrenderer.cpp.
|
inline |
Definition at line 133 of file stringrenderer.h.
|
protected |
Definition at line 167 of file stringrenderer.cpp.
|
static |
Definition at line 688 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 851 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToBinaryImage | ( | const char * | text, |
int | text_length, | ||
int | threshold, | ||
Pix ** | pix | ||
) |
Definition at line 670 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToGrayscaleImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 659 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 750 of file stringrenderer.cpp.
void tesseract::StringRenderer::RotatePageBoxes | ( | float | rotation | ) |
Definition at line 348 of file stringrenderer.cpp.
|
inline |
Definition at line 115 of file stringrenderer.h.
|
inline |
Definition at line 100 of file stringrenderer.h.
|
inline |
Definition at line 69 of file stringrenderer.h.
|
inline |
Definition at line 103 of file stringrenderer.h.
|
inline |
Definition at line 93 of file stringrenderer.h.
bool tesseract::StringRenderer::set_font | ( | const std::string & | desc | ) |
Definition at line 142 of file stringrenderer.cpp.
|
inline |
Definition at line 77 of file stringrenderer.h.
|
inline |
Definition at line 124 of file stringrenderer.h.
|
inline |
Definition at line 70 of file stringrenderer.h.
|
inline |
Definition at line 109 of file stringrenderer.h.
|
inline |
Definition at line 97 of file stringrenderer.h.
|
inline |
Definition at line 119 of file stringrenderer.h.
|
inline |
Definition at line 80 of file stringrenderer.h.
void tesseract::StringRenderer::set_resolution | ( | const int | resolution | ) |
Definition at line 148 of file stringrenderer.cpp.
|
inline |
Definition at line 106 of file stringrenderer.h.
void tesseract::StringRenderer::set_underline_continuation_prob | ( | const double | frac | ) |
Definition at line 157 of file stringrenderer.cpp.
void tesseract::StringRenderer::set_underline_start_prob | ( | const double | frac | ) |
Definition at line 153 of file stringrenderer.cpp.
|
inline |
Definition at line 90 of file stringrenderer.h.
|
inline |
Definition at line 127 of file stringrenderer.h.
|
inline |
Definition at line 74 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.cpp.
|
protected |
Definition at line 250 of file stringrenderer.cpp.
int tesseract::StringRenderer::StripUnrenderableWords | ( | std::string * | utf8_text | ) | const |
Definition at line 632 of file stringrenderer.cpp.
|
inline |
Definition at line 134 of file stringrenderer.h.
void tesseract::StringRenderer::WriteAllBoxes | ( | const std::string & | filename | ) |
Definition at line 365 of file stringrenderer.cpp.
|
protected |
Definition at line 195 of file stringrenderer.h.
|
protected |
Definition at line 208 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 199 of file stringrenderer.h.
|
protected |
Definition at line 193 of file stringrenderer.h.
|
protected |
Definition at line 191 of file stringrenderer.h.
|
protected |
Definition at line 178 of file stringrenderer.h.
|
protected |
Definition at line 215 of file stringrenderer.h.
|
protected |
Definition at line 186 of file stringrenderer.h.
|
protected |
Definition at line 180 of file stringrenderer.h.
|
protected |
Definition at line 216 of file stringrenderer.h.
|
protected |
Definition at line 200 of file stringrenderer.h.
|
protected |
Definition at line 184 of file stringrenderer.h.
|
protected |
Definition at line 196 of file stringrenderer.h.
|
protected |
Definition at line 204 of file stringrenderer.h.
|
protected |
Definition at line 210 of file stringrenderer.h.
|
protected |
Definition at line 180 of file stringrenderer.h.
|
protected |
Definition at line 180 of file stringrenderer.h.
|
protected |
Definition at line 182 of file stringrenderer.h.
|
protected |
Definition at line 187 of file stringrenderer.h.
|
protected |
Definition at line 184 of file stringrenderer.h.
|
protected |
Definition at line 203 of file stringrenderer.h.
|
protected |
Definition at line 194 of file stringrenderer.h.
|
protected |
Definition at line 198 of file stringrenderer.h.
|
protected |
Definition at line 214 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.h.
|
protected |
Definition at line 188 of file stringrenderer.h.
|
protected |
Definition at line 190 of file stringrenderer.h.
|
protected |
Definition at line 180 of file stringrenderer.h.
|
protected |
Definition at line 185 of file stringrenderer.h.