tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
23 #ifndef TESSERACT_TRAINING_BOXCHAR_H_
24 #define TESSERACT_TRAINING_BOXCHAR_H_
29 #include "allheaders.h"
38 BoxChar(
const char* utf8_str,
int len);
44 const Box*
box()
const {
return box_; }
45 const int&
page()
const {
return page_; }
47 const int&
rtl_index()
const {
return rtl_index_; }
50 void AddBox(
int x,
int y,
int width,
int height);
60 if (box_ ==
nullptr)
return true;
61 if (other.box_ ==
nullptr)
return false;
62 return box_->x < other.box_->x;
72 std::vector<BoxChar*>* boxes);
79 std::vector<BoxChar*>* boxes);
82 static void InsertSpaces(
bool rtl_rules,
bool vertical_rules,
83 std::vector<BoxChar*>* boxes);
101 std::vector<BoxChar*>* boxes);
106 const std::vector<BoxChar*>& boxes);
110 const std::vector<BoxChar*>& boxes);
126 return *box1 < *box2;
132 #endif // TESSERACT_TRAINING_BOXCHAR_H_
static void TranslateBoxes(int xshift, int yshift, std::vector< BoxChar * > *boxes)
std::string * mutable_ch()
const std::string & ch() const
static void ReorderRTLText(std::vector< BoxChar * > *boxes)
bool operator<(const BoxChar &other) const
static bool MostlyVertical(const std::vector< BoxChar * > &boxes)
static std::string GetTesseractBoxStr(int height, const std::vector< BoxChar * > &boxes)
void GetDirection(int *num_rtl, int *num_ltr) const
static void WriteTesseractBoxFile(const std::string &name, int height, const std::vector< BoxChar * > &boxes)
void set_rtl_index(int index)
static void InsertNewlines(bool rtl_rules, bool vertical_rules, std::vector< BoxChar * > *boxes)
static void RotateBoxes(float rotation, int xcenter, int ycenter, int start_box, int end_box, std::vector< BoxChar * > *boxes)
static void InsertSpaces(bool rtl_rules, bool vertical_rules, std::vector< BoxChar * > *boxes)
void AddBox(int x, int y, int width, int height)
static int TotalByteLength(const std::vector< BoxChar * > &boxes)
static void PrepareToWrite(std::vector< BoxChar * > *boxes)
const int & rtl_index() const
BoxChar(const char *utf8_str, int len)
bool operator()(const BoxChar *box1, const BoxChar *box2) const
static bool ContainsMostlyRTL(const std::vector< BoxChar * > &boxes)
void ReverseUnicodesInBox()