#include <imagedata.h>
Definition at line 321 of file imagedata.h.
◆ DocumentCache()
tesseract::DocumentCache::DocumentCache |
( |
int64_t |
max_memory | ) |
|
|
explicit |
Definition at line 574 of file imagedata.cpp.
575 : 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 327 of file imagedata.h.
329 num_pages_per_doc_ = 0;
◆ documents()
◆ FindDocument()
DocumentData * tesseract::DocumentCache::FindDocument |
( |
const STRING & |
document_name | ) |
const |
Definition at line 611 of file imagedata.cpp.
612 for (
int i = 0; i < documents_.size(); ++i) {
613 if (documents_[i]->document_name() == document_name)
614 return documents_[i];
◆ GetPageBySerial()
const ImageData* tesseract::DocumentCache::GetPageBySerial |
( |
int |
serial | ) |
|
|
inline |
Definition at line 344 of file imagedata.h.
346 return GetPageSequential(serial);
348 return GetPageRoundRobin(serial);
◆ LoadDocuments()
Definition at line 580 of file imagedata.cpp.
583 cache_strategy_ = cache_strategy;
584 int64_t fair_share_memory = 0;
589 fair_share_memory = max_memory_ / filenames.
size();
590 for (
int arg = 0; arg < filenames.
size(); ++arg) {
591 STRING filename = filenames[arg];
592 auto* document =
new DocumentData(filename);
593 document->SetDocument(filename.
string(), fair_share_memory, reader);
596 if (!documents_.empty()) {
599 tprintf(
"Load of page 0 failed!\n");
DLLSYM void tprintf(const char *format,...)
const ImageData * GetPageBySerial(int serial)
const char * string() const
bool AddToCache(DocumentData *data)
◆ TotalPages()
int tesseract::DocumentCache::TotalPages |
( |
| ) |
|
Definition at line 621 of file imagedata.cpp.
625 if (num_pages_per_doc_ == 0) GetPageSequential(0);
626 return num_pages_per_doc_ * documents_.size();
629 int num_docs = documents_.size();
630 for (
int d = 0; d < num_docs; ++d) {
632 documents_[d]->GetPage(0);
633 total_pages += documents_[d]->NumPages();
The documentation for this class was generated from the following files: