23 #ifndef TESSERACT_TRAINING_BOXCHAR_H_ 24 #define TESSERACT_TRAINING_BOXCHAR_H_ 29 #include "allheaders.h" 31 #ifdef USE_STD_NAMESPACE 42 BoxChar(
const char* utf8_str,
int len);
47 const string&
ch()
const {
return ch_; }
48 const Box*
box()
const {
return box_; }
49 const int&
page()
const {
return page_; }
53 void AddBox(
int x,
int y,
int width,
int height);
63 if (box_ == NULL)
return true;
64 if (other.box_ == NULL)
return false;
65 return box_->x < other.box_->x;
69 vector<BoxChar*>* boxes);
76 vector<BoxChar*>* boxes);
78 static void InsertSpaces(
bool rtl_rules,
bool vertical_rules,
79 vector<BoxChar*>* boxes);
97 vector<BoxChar*>* boxes);
102 const vector<BoxChar*>& boxes);
116 return *box1 < *box2;
122 #endif // TESSERACT_TRAINING_BOXCHAR_H_ static void TranslateBoxes(int xshift, int yshift, vector< BoxChar *> *boxes)
bool operator()(const BoxChar *box1, const BoxChar *box2) const
static void ReorderRTLText(vector< BoxChar *> *boxes)
void AddBox(int x, int y, int width, int height)
BoxChar(const char *utf8_str, int len)
static string GetTesseractBoxStr(int height, const vector< BoxChar *> &boxes)
bool operator<(const BoxChar &other) const
const string & ch() const
static void PrepareToWrite(vector< BoxChar *> *boxes)
static void WriteTesseractBoxFile(const string &name, int height, const vector< BoxChar *> &boxes)
static void InsertNewlines(bool rtl_rules, bool vertical_rules, vector< BoxChar *> *boxes)
static int TotalByteLength(const vector< BoxChar *> &boxes)
static bool ContainsMostlyRTL(const vector< BoxChar *> &boxes)
static void RotateBoxes(float rotation, int xcenter, int ycenter, int start_box, int end_box, vector< BoxChar *> *boxes)
static void InsertSpaces(bool rtl_rules, bool vertical_rules, vector< BoxChar *> *boxes)
static bool MostlyVertical(const vector< BoxChar *> &boxes)