Tesseract  3.02
tesseract-ocr/ccstruct/blread.h File Reference
#include "params.h"
#include "ocrblock.h"

Go to the source code of this file.

Functions

bool read_unlv_file (STRING name, inT32 xsize, inT32 ysize, BLOCK_LIST *blocks)
void FullPageBlock (int width, int height, BLOCK_LIST *blocks)

Function Documentation

void FullPageBlock ( int  width,
int  height,
BLOCK_LIST *  blocks 
)

Definition at line 69 of file blread.cpp.

                                                              {
  BLOCK_IT block_it(blocks);
  BLOCK* block = new BLOCK("", TRUE, 0, 0, 0, 0, width, height);
  block_it.add_to_end(block);
}
bool read_unlv_file ( STRING  name,
inT32  xsize,
inT32  ysize,
BLOCK_LIST *  blocks 
)

Definition at line 37 of file blread.cpp.

                      {
  FILE *pdfp;                    //file pointer
  BLOCK *block;                  //current block
  int x;                         //current top-down coords
  int y;
  int width;                     //of current block
  int height;
  BLOCK_IT block_it = blocks;    //block iterator

  name += UNLV_EXT;              //add extension
  if ((pdfp = fopen (name.string (), "rb")) == NULL) {
    return false;                //didn't read one
  }
  else {
    while (fscanf (pdfp, "%d %d %d %d %*s", &x, &y, &width, &height) >= 4) {
                                 //make rect block
      block = new BLOCK (name.string (), TRUE, 0, 0,
                         (inT16) x, (inT16) (ysize - y - height),
                         (inT16) (x + width), (inT16) (ysize - y));
                                 //on end of list
      block_it.add_to_end (block);
    }
    fclose(pdfp);
  }
  return true;
}