#include <imagedata.h>
Definition at line 320 of file imagedata.h.
◆ DocumentCache()
tesseract::DocumentCache::DocumentCache |
( |
int64_t |
max_memory | ) |
|
|
explicit |
Definition at line 560 of file imagedata.cpp.
561 : num_pages_per_doc_(0), max_memory_(max_memory) {}
◆ ~DocumentCache()
tesseract::DocumentCache::~DocumentCache |
( |
| ) |
|
◆ AddToCache()
bool tesseract::DocumentCache::AddToCache |
( |
DocumentData * |
data | ) |
|
◆ Clear()
void tesseract::DocumentCache::Clear |
( |
| ) |
|
|
inline |
Definition at line 326 of file imagedata.h.
328 num_pages_per_doc_ = 0;
◆ documents()
◆ FindDocument()
DocumentData * tesseract::DocumentCache::FindDocument |
( |
const STRING & |
document_name | ) |
const |
Definition at line 597 of file imagedata.cpp.
598 for (
int i = 0; i < documents_.size(); ++i) {
599 if (documents_[i]->document_name() == document_name)
600 return documents_[i];
◆ GetPageBySerial()
const ImageData* tesseract::DocumentCache::GetPageBySerial |
( |
int |
serial | ) |
|
|
inline |
Definition at line 343 of file imagedata.h.
345 return GetPageSequential(serial);
347 return GetPageRoundRobin(serial);
◆ LoadDocuments()
Definition at line 566 of file imagedata.cpp.
569 cache_strategy_ = cache_strategy;
570 int64_t fair_share_memory = 0;
575 fair_share_memory = max_memory_ / filenames.
size();
576 for (
int arg = 0; arg < filenames.
size(); ++arg) {
577 STRING filename = filenames[arg];
578 auto* document =
new DocumentData(filename);
579 document->SetDocument(filename.
c_str(), fair_share_memory, reader);
582 if (!documents_.empty()) {
585 tprintf(
"Load of page 0 failed!\n");
◆ TotalPages()
int tesseract::DocumentCache::TotalPages |
( |
| ) |
|
Definition at line 607 of file imagedata.cpp.
611 if (num_pages_per_doc_ == 0) GetPageSequential(0);
612 return num_pages_per_doc_ * documents_.size();
615 int num_docs = documents_.size();
616 for (
int d = 0; d < num_docs; ++d) {
618 documents_[d]->GetPage(0);
619 total_pages += documents_[d]->NumPages();
The documentation for this class was generated from the following files: