Main Page | Modules | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages | Search

vvxtrSample2.cc File Reference

Sample file for the OCR Shop XTR/API: Loading image data from memory. More...

#include <vvocr/vvxtrFactory.h>
#include <string>
#include <ios>
#include <iostream>
#include <fstream>
#include <signal.h>

Include dependency graph for vvxtrSample2.cc:

Include dependency graph

Go to the source code of this file.

Functions

vvEngAPICreateEngine ()
vvxtrStatus runOCR (vvEngAPI *xtrEngine)
vvxtrStatus processOneDocument (vvEngAPI *xtrEngine)
vvxtrStatus processOnePage (vvEngAPI *xtrEngine)
vvxtrStatus outputDoc (vvEngAPI *xtrEngine)
vvxtrStatus outputImg (vvEngAPI *xtrEngine)
vvxtrStatus createImageStruct (unsigned char *buf, vvxtrImage **inputImage)
 Helper function that sets up a vvxtrImage structure using the raw image data stored in buf.

vvxtrImagereadFromRawData ()
 Read raw image data from a file and place it in a vvxtrImage structure so it may be sent to the OCR engine.

void CloseDown ()
void SigTermHandler (int param)
void SigErrorHandler (int param)
int main (int argc, char **argv)

Variables

string g_remoteEngine
vvEngAPIg_xtrEngine = NULL


Detailed Description

Sample file for the OCR Shop XTR/API: Loading image data from memory.

This sample program demonstrates how to load image data from memory directly into the OCR engine through a call to vvEngAPI::vvReadImageData(const struct vvxtrImage * img).

The raw image data must be in chunky (interleaved) format, can be 1, 8, or 24 bits per pixel, and should have any line padding taken into account in the bytes per line.

A sample raw image for use as input is available off of Vividata's website:

http://www.vividata.com/images/sample.raw.gz

For this sample image:

width = 2058
height = 319
bpl = 2058
xdpi = 300
ydpi = 300
bpp = 8
bps = 8

Copyright (C) 2003, Vividata, All Rights Reserved

Definition in file vvxtrSample2.cc.


Function Documentation

vvxtrStatus createImageStruct unsigned char *  buf,
vvxtrImage **  inputImage
 

Helper function that sets up a vvxtrImage structure using the raw image data stored in buf.

buf already has memory allocated for it. imageInput is allocated in this function.

Parameters:
buf Memory buffer containing raw image data
inputImage Structure to fill
Returns:
vvxtrStatus

Definition at line 718 of file vvxtrSample2.cc.

References vvxtrStatus.

Referenced by readFromRawData().

vvxtrImage * readFromRawData  ) 
 

Read raw image data from a file and place it in a vvxtrImage structure so it may be sent to the OCR engine.

Returns:
A pointer to the new vvxtrImage structure containing the image data. Memory is allocated for this structure and the image data it contains.

Definition at line 648 of file vvxtrSample2.cc.

References createImageStruct().


Generated on Thu Dec 11 09:32:25 2003 for OCR Shop XTR/API User Documentation by doxygen 1.3.2