#include <stringrenderer.h>
Public Member Functions | |
StringRenderer (const 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, string *font_used, Pix **pix) |
bool | set_font (const string &desc) |
void | set_char_spacing (double 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_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 |
const int | h_margin () const |
const int | v_margin () const |
const vector< BoxChar * > & | GetBoxes () const |
Boxa * | GetPageBoxes () const |
void | RotatePageBoxes (float rotation) |
void | ClearBoxes () |
void | WriteAllBoxes (const string &filename) |
int | StripUnrenderableWords (string *utf8_text) const |
Static Public Member Functions | |
static string | InsertWordJoiners (const string &text) |
static string | ConvertBasicLatinToFullwidthLatin (const string &text) |
static string | ConvertFullwidthLatinToBasicLatin (const string &text) |
Protected Member Functions | |
void | InitPangoCairo () |
void | FreePangoCairo () |
void | SetLayoutProperties () |
void | SetWordUnderlineAttributes (const string &page_text) |
void | ComputeClusterBoxes () |
void | CorrectBoxPositionsToLayout (vector< BoxChar * > *boxchars) |
bool | GetClusterStrings (vector< 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_ |
int | pen_color_ [3] |
double | 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_ |
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_ |
vector< BoxChar * > | boxchars_ |
int | box_padding_ |
Boxa * | page_boxes_ |
hash_map< char32, inT64 > | char_map_ |
int | total_chars_ |
int | font_index_ |
int | last_offset_ |
Definition at line 48 of file stringrenderer.h.
tesseract::StringRenderer::StringRenderer | ( | const string & | font_desc, |
int | page_width, | ||
int | page_height | ||
) |
Definition at line 97 of file stringrenderer.cpp.
tesseract::StringRenderer::~StringRenderer | ( | ) |
Definition at line 151 of file stringrenderer.cpp.
void tesseract::StringRenderer::ClearBoxes | ( | ) |
Definition at line 334 of file stringrenderer.cpp.
|
protected |
Definition at line 454 of file stringrenderer.cpp.
|
static |
Definition at line 688 of file stringrenderer.cpp.
|
static |
Definition at line 708 of file stringrenderer.cpp.
|
protected |
Definition at line 597 of file stringrenderer.cpp.
|
protected |
Definition at line 276 of file stringrenderer.cpp.
|
inline |
Definition at line 126 of file stringrenderer.h.
|
protected |
Definition at line 215 of file stringrenderer.cpp.
const vector< BoxChar * > & tesseract::StringRenderer::GetBoxes | ( | ) | const |
Definition at line 320 of file stringrenderer.cpp.
|
protected |
Definition at line 347 of file stringrenderer.cpp.
Boxa * tesseract::StringRenderer::GetPageBoxes | ( | ) | const |
Definition at line 324 of file stringrenderer.cpp.
|
inline |
Definition at line 129 of file stringrenderer.h.
|
protected |
Definition at line 156 of file stringrenderer.cpp.
|
static |
Definition at line 665 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderAllFontsToImage | ( | double | min_coverage, |
const char * | text, | ||
int | text_length, | ||
string * | font_used, | ||
Pix ** | pix | ||
) |
Definition at line 827 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToBinaryImage | ( | const char * | text, |
int | text_length, | ||
int | threshold, | ||
Pix ** | pix | ||
) |
Definition at line 647 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToGrayscaleImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 636 of file stringrenderer.cpp.
int tesseract::StringRenderer::RenderToImage | ( | const char * | text, |
int | text_length, | ||
Pix ** | pix | ||
) |
Definition at line 727 of file stringrenderer.cpp.
void tesseract::StringRenderer::RotatePageBoxes | ( | float | rotation | ) |
Definition at line 328 of file stringrenderer.cpp.
|
inline |
Definition at line 111 of file stringrenderer.h.
|
inline |
Definition at line 96 of file stringrenderer.h.
|
inline |
Definition at line 67 of file stringrenderer.h.
|
inline |
Definition at line 99 of file stringrenderer.h.
bool tesseract::StringRenderer::set_font | ( | const string & | desc | ) |
Definition at line 132 of file stringrenderer.cpp.
|
inline |
Definition at line 77 of file stringrenderer.h.
|
inline |
Definition at line 120 of file stringrenderer.h.
|
inline |
Definition at line 70 of file stringrenderer.h.
|
inline |
Definition at line 105 of file stringrenderer.h.
|
inline |
Definition at line 93 of file stringrenderer.h.
|
inline |
Definition at line 115 of file stringrenderer.h.
|
inline |
Definition at line 80 of file stringrenderer.h.
void tesseract::StringRenderer::set_resolution | ( | const int | resolution | ) |
Definition at line 138 of file stringrenderer.cpp.
|
inline |
Definition at line 102 of file stringrenderer.h.
void tesseract::StringRenderer::set_underline_continuation_prob | ( | const double | frac | ) |
Definition at line 147 of file stringrenderer.cpp.
void tesseract::StringRenderer::set_underline_start_prob | ( | const double | frac | ) |
Definition at line 143 of file stringrenderer.cpp.
|
inline |
Definition at line 90 of file stringrenderer.h.
|
inline |
Definition at line 123 of file stringrenderer.h.
|
inline |
Definition at line 74 of file stringrenderer.h.
|
protected |
Definition at line 178 of file stringrenderer.cpp.
|
protected |
Definition at line 230 of file stringrenderer.cpp.
int tesseract::StringRenderer::StripUnrenderableWords | ( | string * | utf8_text | ) | const |
Definition at line 609 of file stringrenderer.cpp.
|
inline |
Definition at line 132 of file stringrenderer.h.
void tesseract::StringRenderer::WriteAllBoxes | ( | const string & | filename | ) |
Definition at line 341 of file stringrenderer.cpp.
|
protected |
Definition at line 191 of file stringrenderer.h.
|
protected |
Definition at line 204 of file stringrenderer.h.
|
protected |
Definition at line 203 of file stringrenderer.h.
Definition at line 209 of file stringrenderer.h.
|
protected |
Definition at line 180 of file stringrenderer.h.
|
protected |
Definition at line 195 of file stringrenderer.h.
|
protected |
Definition at line 189 of file stringrenderer.h.
|
protected |
Definition at line 175 of file stringrenderer.h.
|
protected |
Definition at line 211 of file stringrenderer.h.
|
protected |
Definition at line 183 of file stringrenderer.h.
|
protected |
Definition at line 177 of file stringrenderer.h.
|
protected |
Definition at line 212 of file stringrenderer.h.
|
protected |
Definition at line 196 of file stringrenderer.h.
|
protected |
Definition at line 181 of file stringrenderer.h.
|
protected |
Definition at line 192 of file stringrenderer.h.
|
protected |
Definition at line 200 of file stringrenderer.h.
|
protected |
Definition at line 206 of file stringrenderer.h.
|
protected |
Definition at line 177 of file stringrenderer.h.
|
protected |
Definition at line 177 of file stringrenderer.h.
|
protected |
Definition at line 179 of file stringrenderer.h.
|
protected |
Definition at line 184 of file stringrenderer.h.
|
protected |
Definition at line 181 of file stringrenderer.h.
|
protected |
Definition at line 199 of file stringrenderer.h.
|
protected |
Definition at line 190 of file stringrenderer.h.
|
protected |
Definition at line 194 of file stringrenderer.h.
|
protected |
Definition at line 210 of file stringrenderer.h.
|
protected |
Definition at line 186 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 177 of file stringrenderer.h.
|
protected |
Definition at line 182 of file stringrenderer.h.