|
tesseract 3.04.01
|
#include <imagedata.h>
Public Member Functions | |
| DocumentData (const STRING &name) | |
| ~DocumentData () | |
| bool | LoadDocument (const char *filename, const char *lang, int start_page, inT64 max_memory, FileReader reader) |
| bool | SaveDocument (const char *filename, FileWriter writer) |
| bool | SaveToBuffer (GenericVector< char > *buffer) |
| void | AddPageToDocument (ImageData *page) |
| const STRING & | document_name () const |
| int | NumPages () const |
| inT64 | memory_used () const |
| const ImageData * | GetPage (int index) |
| ImageData * | TakePage (int index) |
Definition at line 186 of file imagedata.h.
| tesseract::DocumentData::DocumentData | ( | const STRING & | name | ) | [explicit] |
Definition at line 344 of file imagedata.cpp.
: document_name_(name), pages_offset_(0), total_pages_(0),
memory_used_(0), max_memory_(0), reader_(NULL) {}
| tesseract::DocumentData::~DocumentData | ( | ) |
Definition at line 348 of file imagedata.cpp.
| void tesseract::DocumentData::AddPageToDocument | ( | ImageData * | page | ) |
Definition at line 434 of file imagedata.cpp.
| const STRING& tesseract::DocumentData::document_name | ( | ) | const [inline] |
Definition at line 202 of file imagedata.h.
{
return document_name_;
}
| const ImageData * tesseract::DocumentData::GetPage | ( | int | index | ) |
Definition at line 381 of file imagedata.cpp.
{
pages_offset_ = index;
if (!ReCachePages()) return NULL;
}
return pages_[index - pages_offset_];
}
| bool tesseract::DocumentData::LoadDocument | ( | const char * | filename, |
| const char * | lang, | ||
| int | start_page, | ||
| inT64 | max_memory, | ||
| FileReader | reader | ||
| ) |
Definition at line 352 of file imagedata.cpp.
| inT64 tesseract::DocumentData::memory_used | ( | ) | const [inline] |
Definition at line 208 of file imagedata.h.
{
return memory_used_;
}
| int tesseract::DocumentData::NumPages | ( | ) | const [inline] |
Definition at line 205 of file imagedata.h.
{
return total_pages_;
}
| bool tesseract::DocumentData::SaveDocument | ( | const char * | filename, |
| FileWriter | writer | ||
| ) |
Definition at line 364 of file imagedata.cpp.
{
tprintf("Serialize failed: %s\n", filename);
return false;
}
return true;
}
bool DocumentData::SaveToBuffer(GenericVector<char>* buffer) {
| bool tesseract::DocumentData::SaveToBuffer | ( | GenericVector< char > * | buffer | ) |
Definition at line 373 of file imagedata.cpp.
| ImageData* tesseract::DocumentData::TakePage | ( | int | index | ) | [inline] |
Definition at line 215 of file imagedata.h.
{
ImageData* page = pages_[index];
pages_[index] = NULL;
return page;
}