#include <imagedata.h>
Definition at line 204 of file imagedata.h.
| tesseract::DocumentData::DocumentData |
( |
const STRING & |
name | ) |
|
|
explicit |
| tesseract::DocumentData::~DocumentData |
( |
| ) |
|
| void tesseract::DocumentData::AddPageToDocument |
( |
ImageData * |
page | ) |
|
Definition at line 426 of file imagedata.cpp.
428 pages_.push_back(page);
429 set_memory_used(
memory_used() + page->MemoryUsed());
inT64 memory_used() const
| const STRING& tesseract::DocumentData::document_name |
( |
| ) |
const |
|
inline |
Definition at line 225 of file imagedata.h.
227 return document_name_;
| const ImageData * tesseract::DocumentData::GetPage |
( |
int |
index | ) |
|
Definition at line 446 of file imagedata.cpp.
447 ImageData* page = NULL;
451 bool needs_loading = pages_offset_ != index;
456 #if __cplusplus > 199711L
457 std::this_thread::sleep_for(std::chrono::seconds(1));
bool IsPageAvailable(int index, ImageData **page)
void Unlock()
Unlocks on a mutex.
void LoadPageInBackground(int index)
void Lock()
Locks on a mutex.
| bool tesseract::DocumentData::IsCached |
( |
| ) |
const |
|
inline |
| bool tesseract::DocumentData::IsPageAvailable |
( |
int |
index, |
|
|
ImageData ** |
page |
|
) |
| |
Definition at line 470 of file imagedata.cpp.
473 if (num_pages == 0 || index < 0) {
478 index =
Modulo(index, num_pages);
479 if (pages_offset_ <= index && index < pages_offset_ + pages_.size()) {
480 *page = 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 387 of file imagedata.cpp.
391 pages_offset_ = start_page;
392 return ReCachePages();
void SetDocument(const char *filename, const char *lang, inT64 max_memory, FileReader reader)
| void tesseract::DocumentData::LoadPageInBackground |
( |
int |
index | ) |
|
Definition at line 434 of file imagedata.cpp.
435 ImageData* page = NULL;
438 if (pages_offset_ == index)
return;
439 pages_offset_ = index;
static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
bool IsPageAvailable(int index, ImageData **page)
friend void * ReCachePagesFunc(void *data)
| inT64 tesseract::DocumentData::memory_used |
( |
| ) |
const |
|
inline |
| int tesseract::DocumentData::NumPages |
( |
| ) |
const |
|
inline |
| bool tesseract::DocumentData::SaveDocument |
( |
const char * |
filename, |
|
|
FileWriter |
writer |
|
) |
| |
| bool tesseract::DocumentData::SaveToBuffer |
( |
GenericVector< char > * |
buffer | ) |
|
Definition at line 418 of file imagedata.cpp.
421 fp.OpenWrite(buffer);
422 return pages_.Serialize(&fp);
| void tesseract::DocumentData::SetDocument |
( |
const char * |
filename, |
|
|
const char * |
lang, |
|
|
inT64 |
max_memory, |
|
|
FileReader |
reader |
|
) |
| |
| ImageData* tesseract::DocumentData::TakePage |
( |
int |
index | ) |
|
|
inline |
Definition at line 257 of file imagedata.h.
259 ImageData* page = pages_[index];
260 pages_[index] = NULL;
| inT64 tesseract::DocumentData::UnCache |
( |
| ) |
|
Definition at line 489 of file imagedata.cpp.
496 tprintf(
"Unloaded document %s, saving %d memory\n", document_name_.
string(),
inT64 memory_used() const
const char * string() const
| void* ReCachePagesFunc |
( |
void * |
data | ) |
|
|
friend |
Definition at line 366 of file imagedata.cpp.
368 document_data->ReCachePages();
DocumentData(const STRING &name)
The documentation for this class was generated from the following files: