#include <imagedata.h>
Definition at line 314 of file imagedata.h.
◆ DocumentCache()
tesseract::DocumentCache::DocumentCache |
( |
inT64 |
max_memory | ) |
|
|
explicit |
Definition at line 552 of file imagedata.cpp.
553 : num_pages_per_doc_(0), max_memory_(max_memory) {}
◆ ~DocumentCache()
tesseract::DocumentCache::~DocumentCache |
( |
| ) |
|
◆ AddToCache()
bool tesseract::DocumentCache::AddToCache |
( |
DocumentData * |
data | ) |
|
Definition at line 584 of file imagedata.cpp.
585 inT64 new_memory = data->memory_used();
586 documents_.push_back(data);
◆ Clear()
void tesseract::DocumentCache::Clear |
( |
| ) |
|
|
inline |
Definition at line 320 of file imagedata.h.
322 num_pages_per_doc_ = 0;
◆ documents()
◆ FindDocument()
DocumentData * tesseract::DocumentCache::FindDocument |
( |
const STRING & |
document_name | ) |
const |
Definition at line 591 of file imagedata.cpp.
592 for (
int i = 0; i < documents_.size(); ++i) {
593 if (documents_[i]->document_name() == document_name)
594 return documents_[i];
◆ GetPageBySerial()
const ImageData* tesseract::DocumentCache::GetPageBySerial |
( |
int |
serial | ) |
|
|
inline |
Definition at line 337 of file imagedata.h.
339 return GetPageSequential(serial);
341 return GetPageRoundRobin(serial);
◆ LoadDocuments()
Definition at line 558 of file imagedata.cpp.
562 cache_strategy_ = cache_strategy;
563 inT64 fair_share_memory = 0;
568 fair_share_memory = max_memory_ / filenames.
size();
569 for (
int arg = 0; arg < filenames.
size(); ++arg) {
571 DocumentData* document =
new DocumentData(
filename);
572 document->SetDocument(
filename.string(),
lang, fair_share_memory, reader);
575 if (!documents_.empty()) {
578 tprintf(
"Load of page 0 failed!\n");
const ImageData * GetPageBySerial(int serial)
bool AddToCache(DocumentData *data)
◆ TotalPages()
int tesseract::DocumentCache::TotalPages |
( |
| ) |
|
Definition at line 601 of file imagedata.cpp.
605 if (num_pages_per_doc_ == 0) GetPageSequential(0);
606 return num_pages_per_doc_ * documents_.size();
609 int num_docs = documents_.size();
610 for (
int d = 0; d < num_docs; ++d) {
612 documents_[d]->GetPage(0);
613 total_pages += documents_[d]->NumPages();
The documentation for this class was generated from the following files: