20 #ifndef TESSERACT_IMAGE_IMAGEDATA_H_
21 #define TESSERACT_IMAGE_IMAGEDATA_H_
47 int* max_x,
int* max_y);
53 int x()
const {
return x_; }
54 int y()
const {
return y_; }
55 int dir()
const {
return dir_; }
98 const char* imagedata,
int imagedatasize,
99 const char* truth_text,
const char*
box_text);
109 return imagefilename_;
112 imagefilename_ =
name;
130 return transcription_;
139 return box_texts_[index];
150 float PreScale(
int target_height, Pix** pix,
151 int* scaled_width,
int* scaled_height,
172 bool AddBoxes(
const char* box_text);
203 return document_name_;
217 pages_[index] =
NULL;
286 #endif // TESSERACT_IMAGE_IMAGEDATA_H_
bool DeSerialize(bool swap, FILE *fp)
const STRING & transcription() const
static ImageData * Build(const char *name, int page_number, const char *lang, const char *imagedata, int imagedatasize, const char *truth_text, const char *box_text)
bool DeSerialize(bool swap, TFile *fp)
ImageData * TakePage(int index)
static void ComputeSize(const GenericVector< WordFeature > &features, int *max_x, int *max_y)
bool(* FileWriter)(const GenericVector< char > &data, const STRING &filename)
const STRING & language() const
const int kFeaturePadding
void set_language(const STRING &lang)
float PreScale(int target_height, Pix **pix, int *scaled_width, int *scaled_height, GenericVector< TBOX > *boxes) const
bool(* FileReader)(const STRING &filename, GenericVector< char > *data)
const ImageData * GetPageBySerial(int serial)
void AddBoxes(const GenericVector< TBOX > &boxes, const GenericVector< STRING > &texts, const GenericVector< int > &box_pages)
const ImageData * GetPage(int index)
const PointerVector< DocumentData > & documents() const
bool Serialize(FILE *fp) const
const GenericVector< STRING > & box_texts() const
bool SaveDocument(const char *filename, FileWriter writer)
const int kNumPagesPerMiniBatch
DocumentCache(inT64 max_memory)
bool LoadDocuments(const GenericVector< STRING > &filenames, const char *lang, FileReader reader)
DocumentData * FindDocument(const STRING &document_name) const
void AddPageToDocument(ImageData *page)
static int SortByXBucket(const void *, const void *)
void set_imagefilename(const STRING &name)
const GenericVector< TBOX > & boxes() const
bool AddToCache(DocumentData *data)
DocumentData(const STRING &name)
void set_page_number(int num)
inT64 memory_used() const
static void Draw(const GenericVector< WordFeature > &features, ScrollView *window)
const GenericVector< char > & image_data() const
bool SaveToBuffer(GenericVector< char > *buffer)
bool LoadDocument(const char *filename, const char *lang, int start_page, inT64 max_memory, FileReader reader)
bool Serialize(TFile *fp) const
const STRING & imagefilename() const
const STRING & box_text(int index) const
const STRING & document_name() const
static void FromWordFeatures(const GenericVector< WordFeature > &word_features, GenericVector< FloatWordFeature > *float_features)