#include <imagedata.h>
Definition at line 186 of file imagedata.h.
tesseract::DocumentData::DocumentData |
( |
const STRING & |
name | ) |
|
|
explicit |
Definition at line 339 of file imagedata.cpp.
340 : document_name_(name), pages_offset_(0), total_pages_(0),
341 memory_used_(0), max_memory_(0), reader_(
NULL) {}
tesseract::DocumentData::~DocumentData |
( |
| ) |
|
void tesseract::DocumentData::AddPageToDocument |
( |
ImageData * |
page | ) |
|
Definition at line 429 of file imagedata.cpp.
430 pages_.push_back(page);
431 memory_used_ += page->MemoryUsed();
const STRING& tesseract::DocumentData::document_name |
( |
| ) |
const |
|
inline |
Definition at line 202 of file imagedata.h.
203 return document_name_;
const ImageData * tesseract::DocumentData::GetPage |
( |
int |
index | ) |
|
Definition at line 376 of file imagedata.cpp.
377 index =
Modulo(index, total_pages_);
378 if (index < pages_offset_ || index >= pages_offset_ + pages_.size()) {
379 pages_offset_ = index;
380 if (!ReCachePages())
return NULL;
382 return pages_[index - pages_offset_];
bool tesseract::DocumentData::LoadDocument |
( |
const char * |
filename, |
|
|
const char * |
lang, |
|
|
int |
start_page, |
|
|
inT64 |
max_memory, |
|
|
FileReader |
reader |
|
) |
| |
Definition at line 347 of file imagedata.cpp.
352 pages_offset_ = start_page;
353 max_memory_ = max_memory;
355 return ReCachePages();
inT64 tesseract::DocumentData::memory_used |
( |
| ) |
const |
|
inline |
int tesseract::DocumentData::NumPages |
( |
| ) |
const |
|
inline |
bool tesseract::DocumentData::SaveDocument |
( |
const char * |
filename, |
|
|
FileWriter |
writer |
|
) |
| |
bool tesseract::DocumentData::SaveToBuffer |
( |
GenericVector< char > * |
buffer | ) |
|
Definition at line 368 of file imagedata.cpp.
370 fp.OpenWrite(buffer);
371 return pages_.Serialize(&fp);
ImageData* tesseract::DocumentData::TakePage |
( |
int |
index | ) |
|
|
inline |
Definition at line 215 of file imagedata.h.
216 ImageData* page = pages_[index];
217 pages_[index] =
NULL;
The documentation for this class was generated from the following files: