Tesseract  3.02
tesseract-ocr/ccstruct/blread.cpp File Reference
#include "mfcpch.h"
#include <stdlib.h>
#include "scanutils.h"
#include "fileerr.h"
#include "blread.h"

Go to the source code of this file.


#define UNLV_EXT   ".uzn"


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

Define Documentation

#define UNLV_EXT   ".uzn"

Definition at line 29 of file blread.cpp.

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);
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);
  return true;