#include <imagedata.h>
Definition at line 314 of file imagedata.h.
| tesseract::DocumentCache::DocumentCache |
( |
inT64 |
max_memory | ) |
|
|
explicit |
Definition at line 550 of file imagedata.cpp.
551 : num_pages_per_doc_(0), max_memory_(max_memory) {}
| tesseract::DocumentCache::~DocumentCache |
( |
| ) |
|
| bool tesseract::DocumentCache::AddToCache |
( |
DocumentData * |
data | ) |
|
Definition at line 582 of file imagedata.cpp.
583 inT64 new_memory = data->memory_used();
584 documents_.push_back(data);
| void tesseract::DocumentCache::Clear |
( |
| ) |
|
|
inline |
Definition at line 320 of file imagedata.h.
322 num_pages_per_doc_ = 0;
| DocumentData * tesseract::DocumentCache::FindDocument |
( |
const STRING & |
document_name | ) |
const |
Definition at line 589 of file imagedata.cpp.
590 for (
int i = 0; i < documents_.size(); ++i) {
591 if (documents_[i]->document_name() == document_name)
592 return documents_[i];
| const ImageData* tesseract::DocumentCache::GetPageBySerial |
( |
int |
serial | ) |
|
|
inline |
Definition at line 337 of file imagedata.h.
339 return GetPageSequential(serial);
341 return GetPageRoundRobin(serial);
Definition at line 556 of file imagedata.cpp.
560 cache_strategy_ = cache_strategy;
561 inT64 fair_share_memory = 0;
566 fair_share_memory = max_memory_ / filenames.
size();
567 for (
int arg = 0; arg < filenames.
size(); ++arg) {
569 DocumentData* document =
new DocumentData(filename);
570 document->SetDocument(filename.
string(),
lang, fair_share_memory, reader);
573 if (!documents_.empty()) {
576 tprintf(
"Load of page 0 failed!\n");
const ImageData * GetPageBySerial(int serial)
bool AddToCache(DocumentData *data)
const char * string() const
| int tesseract::DocumentCache::TotalPages |
( |
| ) |
|
Definition at line 599 of file imagedata.cpp.
603 if (num_pages_per_doc_ == 0) GetPageSequential(0);
604 return num_pages_per_doc_ * documents_.size();
607 int num_docs = documents_.size();
608 for (
int d = 0; d < num_docs; ++d) {
610 documents_[d]->GetPage(0);
611 total_pages += documents_[d]->NumPages();
The documentation for this class was generated from the following files: