#include <imagedata.h>
Definition at line 288 of file imagedata.h.
◆ DocumentCache()
tesseract::DocumentCache::DocumentCache |
( |
int64_t |
max_memory | ) |
|
|
explicit |
◆ ~DocumentCache()
tesseract::DocumentCache::~DocumentCache |
( |
| ) |
|
Definition at line 606 of file imagedata.cpp.
607 for (
auto *document : documents_) {
◆ AddToCache()
bool tesseract::DocumentCache::AddToCache |
( |
DocumentData * |
data | ) |
|
◆ Clear()
void tesseract::DocumentCache::Clear |
( |
| ) |
|
|
inline |
Definition at line 296 of file imagedata.h.
297 for (
auto *document : documents_) {
301 num_pages_per_doc_ = 0;
◆ documents()
const std::vector<DocumentData *>& tesseract::DocumentCache::documents |
( |
| ) |
const |
|
inline |
◆ FindDocument()
DocumentData * tesseract::DocumentCache::FindDocument |
( |
const std::string & |
document_name | ) |
const |
Definition at line 647 of file imagedata.cpp.
649 for (
auto *document : documents_) {
650 if (document->document_name() == document_name) {
◆ GetPageBySerial()
const ImageData* tesseract::DocumentCache::GetPageBySerial |
( |
int |
serial | ) |
|
|
inline |
Definition at line 317 of file imagedata.h.
319 return GetPageSequential(serial);
321 return GetPageRoundRobin(serial);
◆ LoadDocuments()
bool tesseract::DocumentCache::LoadDocuments |
( |
const std::vector< std::string > & |
filenames, |
|
|
CachingStrategy |
cache_strategy, |
|
|
FileReader |
reader |
|
) |
| |
Definition at line 614 of file imagedata.cpp.
617 cache_strategy_ = cache_strategy;
618 int64_t fair_share_memory = 0;
623 fair_share_memory = max_memory_ / filenames.size();
625 for (
const auto &filename : filenames) {
626 auto *document =
new DocumentData(filename);
627 document->SetDocument(filename.c_str(), fair_share_memory, reader);
630 if (!documents_.empty()) {
635 tprintf(
"Load of page 0 failed!\n");
void tprintf(const char *format,...)
bool AddToCache(DocumentData *data)
const ImageData * GetPageBySerial(int serial)
◆ TotalPages()
int tesseract::DocumentCache::TotalPages |
( |
| ) |
|
Definition at line 659 of file imagedata.cpp.
663 if (num_pages_per_doc_ == 0) {
664 GetPageSequential(0);
666 return num_pages_per_doc_ * documents_.size();
669 for (
auto *document : documents_) {
671 document->GetPage(0);
672 total_pages += document->NumPages();
The documentation for this class was generated from the following files: