tesseract 3.04.01

tesseract::DocumentData Class Reference

#include <imagedata.h>

List of all members.

Public Member Functions

 DocumentData (const STRING &name)
 ~DocumentData ()
bool LoadDocument (const char *filename, const char *lang, int start_page, inT64 max_memory, FileReader reader)
bool SaveDocument (const char *filename, FileWriter writer)
bool SaveToBuffer (GenericVector< char > *buffer)
void AddPageToDocument (ImageData *page)
const STRINGdocument_name () const
int NumPages () const
inT64 memory_used () const
const ImageDataGetPage (int index)
ImageDataTakePage (int index)

Detailed Description

Definition at line 186 of file imagedata.h.


Constructor & Destructor Documentation

tesseract::DocumentData::DocumentData ( const STRING name) [explicit]

Definition at line 344 of file imagedata.cpp.

  : document_name_(name), pages_offset_(0), total_pages_(0),
    memory_used_(0), max_memory_(0), reader_(NULL) {}

tesseract::DocumentData::~DocumentData ( )

Definition at line 348 of file imagedata.cpp.


Member Function Documentation

void tesseract::DocumentData::AddPageToDocument ( ImageData page)

Definition at line 434 of file imagedata.cpp.

const STRING& tesseract::DocumentData::document_name ( ) const [inline]

Definition at line 202 of file imagedata.h.

                                      {
    return document_name_;
  }
const ImageData * tesseract::DocumentData::GetPage ( int  index)

Definition at line 381 of file imagedata.cpp.

                                                                       {
    pages_offset_ = index;
    if (!ReCachePages()) return NULL;
  }
  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 352 of file imagedata.cpp.

                                                   {
  document_name_ = filename;
  lang_ = lang;
  pages_offset_ = start_page;
  max_memory_ = max_memory;
  reader_ = reader;
  return ReCachePages();
}

inT64 tesseract::DocumentData::memory_used ( ) const [inline]

Definition at line 208 of file imagedata.h.

                            {
    return memory_used_;
  }
int tesseract::DocumentData::NumPages ( ) const [inline]

Definition at line 205 of file imagedata.h.

                       {
    return total_pages_;
  }
bool tesseract::DocumentData::SaveDocument ( const char *  filename,
FileWriter  writer 
)

Definition at line 364 of file imagedata.cpp.

                                                                  {
    tprintf("Serialize failed: %s\n", filename);
    return false;
  }
  return true;
}
bool DocumentData::SaveToBuffer(GenericVector<char>* buffer) {
bool tesseract::DocumentData::SaveToBuffer ( GenericVector< char > *  buffer)

Definition at line 373 of file imagedata.cpp.

ImageData* tesseract::DocumentData::TakePage ( int  index) [inline]

Definition at line 215 of file imagedata.h.

                                 {
    ImageData* page = pages_[index];
    pages_[index] = NULL;
    return page;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines