tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
28 #ifndef TESSERACT_TRAINING_STRINGRENDERER_H_
29 #define TESSERACT_TRAINING_STRINGRENDERER_H_
32 #include <unordered_map>
36 #include "pango/pango-layout.h"
37 #include "pango/pangocairo.h"
43 # define strdup(s) _strdup(s)
58 int RenderToImage(
const char* text,
int text_length, Pix** pix);
66 int text_length,
std::string* font_used, Pix** pix);
139 const std::vector<BoxChar*>&
GetBoxes()
const;
225 #endif // THIRD_PARTY_TESSERACT_TRAINING_STRINGRENDERER_H_
bool render_fullwidth_latin_
int RenderToImage(const char *text, int text_length, Pix **pix)
double underline_start_prob_
PangoUnderline underline_style_
void set_output_word_boxes(bool val)
int StripUnrenderableWords(std::string *utf8_text) const
bool GetClusterStrings(std::vector< std::string > *cluster_text)
const PangoFontInfo & font() const
static std::string InsertWordJoiners(const std::string &text)
void ComputeClusterBoxes()
std::vector< BoxChar * > boxchars_
int RenderAllFontsToImage(double min_coverage, const char *text, int text_length, std::string *font_used, Pix **pix)
bool gravity_hint_strong_
bool drop_uncovered_chars_
void set_char_spacing(int char_spacing)
void set_add_ligatures(bool add_ligatures)
void set_drop_uncovered_chars(bool val)
bool strip_unrenderable_words_
static std::string ConvertFullwidthLatinToBasicLatin(const std::string &text)
void set_pen_color(double r, double g, double b)
void set_features(const char *features)
void set_strip_unrenderable_words(bool val)
void set_render_fullwidth_latin(bool render_fullwidth_latin)
double underline_continuation_prob_
void CorrectBoxPositionsToLayout(std::vector< BoxChar * > *boxchars)
void set_underline_continuation_prob(const double frac)
int FindFirstPageBreakOffset(const char *text, int text_length)
void set_underline_style(const PangoUnderline style)
void set_gravity_hint_strong(bool gravity_hint_strong)
void SetWordUnderlineAttributes(const std::string &page_text)
Boxa * GetPageBoxes() const
int RenderToBinaryImage(const char *text, int text_length, int threshold, Pix **pix)
void set_resolution(const int resolution)
void RotatePageBoxes(float rotation)
static std::string ConvertBasicLatinToFullwidthLatin(const std::string &text)
std::string GetBoxesStr()
void set_v_margin(const int v_margin)
std::unordered_map< char32, int64_t > char_map_
int RenderToGrayscaleImage(const char *text, int text_length, Pix **pix)
void set_leading(int leading)
void SetLayoutProperties()
void WriteAllBoxes(const std::string &filename)
const std::vector< BoxChar * > & GetBoxes() const
void set_underline_start_prob(const double frac)
void set_h_margin(const int h_margin)
void set_vertical_text(bool vertical_text)
bool set_font(const std::string &desc)
void set_box_padding(int val)
StringRenderer(const std::string &font_desc, int page_width, int page_height)
cairo_surface_t * surface_