#include <imagedata.h>
Definition at line 204 of file imagedata.h.
◆ DocumentData()
tesseract::DocumentData::DocumentData |
( |
const STRING & |
name | ) |
|
|
explicit |
◆ ~DocumentData()
tesseract::DocumentData::~DocumentData |
( |
| ) |
|
◆ AddPageToDocument()
void tesseract::DocumentData::AddPageToDocument |
( |
ImageData * |
page | ) |
|
Definition at line 426 of file imagedata.cpp.
428 pages_.push_back(page);
429 set_memory_used(
memory_used() + page->MemoryUsed());
inT64 memory_used() const
◆ document_name()
const STRING& tesseract::DocumentData::document_name |
( |
| ) |
const |
|
inline |
Definition at line 225 of file imagedata.h.
227 return document_name_;
◆ GetPage()
const ImageData * tesseract::DocumentData::GetPage |
( |
int |
index | ) |
|
Definition at line 448 of file imagedata.cpp.
449 ImageData* page = NULL;
453 bool needs_loading = pages_offset_ != index;
458 #if __cplusplus > 199711L && !defined(__MINGW32__) 459 std::this_thread::sleep_for(std::chrono::seconds(1));
void LoadPageInBackground(int index)
bool IsPageAvailable(int index, ImageData **page)
void Lock()
Locks on a mutex.
void Unlock()
Unlocks on a mutex.
◆ IsCached()
bool tesseract::DocumentData::IsCached |
( |
| ) |
const |
|
inline |
◆ IsPageAvailable()
bool tesseract::DocumentData::IsPageAvailable |
( |
int |
index, |
|
|
ImageData ** |
page |
|
) |
| |
Definition at line 472 of file imagedata.cpp.
475 if (num_pages == 0 || index < 0) {
480 index =
Modulo(index, num_pages);
481 if (pages_offset_ <= index && index < pages_offset_ + pages_.size()) {
482 *page = pages_[index - pages_offset_];
◆ LoadDocument()
bool tesseract::DocumentData::LoadDocument |
( |
const char * |
filename, |
|
|
const char * |
lang, |
|
|
int |
start_page, |
|
|
inT64 |
max_memory, |
|
|
FileReader |
reader |
|
) |
| |
Definition at line 387 of file imagedata.cpp.
391 pages_offset_ = start_page;
392 return ReCachePages();
void SetDocument(const char *filename, const char *lang, inT64 max_memory, FileReader reader)
◆ LoadPageInBackground()
void tesseract::DocumentData::LoadPageInBackground |
( |
int |
index | ) |
|
Definition at line 434 of file imagedata.cpp.
435 ImageData* page = NULL;
438 if (pages_offset_ == index)
return;
439 pages_offset_ = index;
441 #ifndef GRAPHICS_DISABLED 443 #endif // GRAPHICS_DISABLED friend void * ReCachePagesFunc(void *data)
bool IsPageAvailable(int index, ImageData **page)
static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
◆ memory_used()
inT64 tesseract::DocumentData::memory_used |
( |
| ) |
const |
|
inline |
◆ NumPages()
int tesseract::DocumentData::NumPages |
( |
| ) |
const |
|
inline |
◆ SaveDocument()
bool tesseract::DocumentData::SaveDocument |
( |
const char * |
filename, |
|
|
FileWriter |
writer |
|
) |
| |
◆ SaveToBuffer()
bool tesseract::DocumentData::SaveToBuffer |
( |
GenericVector< char > * |
buffer | ) |
|
Definition at line 418 of file imagedata.cpp.
421 fp.OpenWrite(buffer);
422 return pages_.Serialize(&fp);
◆ SetDocument()
void tesseract::DocumentData::SetDocument |
( |
const char * |
filename, |
|
|
const char * |
lang, |
|
|
inT64 |
max_memory, |
|
|
FileReader |
reader |
|
) |
| |
◆ TakePage()
ImageData* tesseract::DocumentData::TakePage |
( |
int |
index | ) |
|
|
inline |
Definition at line 257 of file imagedata.h.
259 ImageData* page = pages_[index];
260 pages_[index] = NULL;
◆ UnCache()
inT64 tesseract::DocumentData::UnCache |
( |
| ) |
|
Definition at line 491 of file imagedata.cpp.
498 tprintf(
"Unloaded document %s, saving %d memory\n", document_name_.
string(),
const char * string() const
inT64 memory_used() const
◆ ReCachePagesFunc
void* ReCachePagesFunc |
( |
void * |
data | ) |
|
|
friend |
Definition at line 366 of file imagedata.cpp.
368 document_data->ReCachePages();
DocumentData(const STRING &name)
The documentation for this class was generated from the following files: