OCREngineFactory Class Reference

API published in: S60 3rd Ed FP 1

Link against: ocrsrv.lib

Capability Information

Required Capabilities

None


#include <ocrsrv.h>

Detailed Description

OCR (Optical Character Recognition) API.

This static class offers the OCR APIs. The user shall call CreateOCREngineL and get the instance of one type of the OCR engine and then convert the instance from MOCREngineInterface to MOCREngineLayoutRecognize or MOCREngineRecognizeBlock according to the type information. And use ReleaseOCREngine to destroy the engine.

See also:
OCREngineFactory::TEngineType
Note: This procedure will create a new thread in your current process in order to run the OCR APIs, so you don't need to create new threads for OCR by yourself

For example: A typical usage for the factory class would be like:

  const TOcrEngineEnv env;
  env.iPriority = EPriorityLess;
  env.iMaxHeapSize = 1200*KMinHeapGrowBy;
  MOCREngineInterface* myEngine = CreateOCREngineL( aObserver, env, EEngineLayoutRecognize);
  MOCREngineLayoutRecognize* layoutEngine = STATIC_CAST( MOCREngineLayoutRecognize*, myEngine );
  // TODO: call coresponding methods in layoutEngine
  ReleaseOCREngine( layoutEngine );

Public Types

enum   TEngineType { EEngineLayoutRecognize, EEngineRecognizeBlock }
  OCR Engine Types. More...

Static Public Member Functions

static IMPORT_C MOCREngineInterface CreateOCREngineL (MOCREngineObserver &aObserver, const TOcrEngineEnv aEngineEnv, TEngineType aEngineType)
  Create the OCR engine instance.
static IMPORT_C void  ReleaseOCREngine (MOCREngineInterface *aEng)
  Release the OCR engine instance.

Member Enumeration Documentation

enum OCREngineFactory::TEngineType
 

OCR Engine Types.

Enumerator:
EEngineLayoutRecognize  OCR Engine with layout analysis feature: by selecting this type of engine, LayoutAnalysisL shall be called first before RecognizeL.
EEngineRecognizeBlock  Engine without layout analysis feature: Layout information shall be passed through TOCRLayoutBlockInfo or TRegionInfo to the interfaces.

Member Function Documentation

static IMPORT_C MOCREngineInterface* OCREngineFactory::CreateOCREngineL MOCREngineObserver aObserver,
const TOcrEngineEnv  aEngineEnv,
TEngineType  aEngineType
[static]
 

Create the OCR engine instance.

Parameters:
aObserver  Pointer to the call callback function
aEngineEnv  Engine environment settings
See also:
TOcrEngineEnv
Parameters:
aEngineType  Select a type of engine to be created
See also:
OCREngineFactory::TEngineType
Returns:
Pointer to the engine created
See also:
MOCREngineInterface
Leave:
KErrArgument aEngineEnv.iMaxHeapSize is lower(equal) than KMinHeapGrowBy*1000
Leave:
KErrNotSupported aEngineType is not supported
static IMPORT_C void OCREngineFactory::ReleaseOCREngine MOCREngineInterface aEng  )  [static]
 

Release the OCR engine instance.

Parameters:
aEng  Pointer to the instance of the Engine
Returns:
None

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top