2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: APIs of the OCR(Optical Character Recognition), current engine
15 * can recognize 24 bit colored image and 8 bit gray scale image
31 * Bad image or unsupported format
33 const TInt KErrOcrBadImage (-1001);
36 * Unsupported language
38 const TInt KErrOcrBadLanguage (-1002);
43 const TInt KErrOcrBadRegion (-1003);
46 * Not set any language
48 const TInt KErrOcrNotSetLanguage (-1004);
51 * Not set any language packages
53 const TInt KErrOcrBadDictFile (-1005);
55 /** Type of the text layouts
59 /** Texts in the block is horizontal
63 /** Texts in the block is vertical
72 /** when the image or recognition area has multi-line format
76 /** when the image or recognition area has single-line format
81 /** Type of the text background
83 enum TOcrBackgroundType
85 /** light character with light background
89 /** dark character with dark background
93 /** un-suspected background
99 * OCR (Optical Character Recognition) Text Line Information
101 * This class holds the information from the OCR engine after the recognition
102 * Note that all memory ownership belongs to the OCR engine, so do not need to
103 * either allocate memory for it or push it to the CleanupStack. Engine will
104 * release the memory whenever necessary
109 class TOCRTextLineInfo
114 * Text buffer for the line. Note that after layout analysis, this is NULL
115 * and the buffer will be filled after recognition (Not Own)
120 * Region coordinate to be processed
125 * Array of the character rects. (Not Own)
130 * Number of characters
136 * OCR (Optical Character Recognition) Text Line Information
138 * This class holds the information from the layout analysis, the engine
139 * will allocate the memory of TOCRBlockInfo array, and pass the ownership
140 * to you while you can remove it by delete[]
150 * Region coordinate to be processed
155 * Layout Type (Horizontal or Vertical)
157 TOcrLayoutType iType;
166 * OCR (Optical Character Recognition) Text Block Information
168 * This class holds the information from the OCR engine after the recognition
169 * Note that all memory ownership belongs to the OCR engine, so do not need to
170 * either allocate memory for it or push it to the CleanupStack. Engine will
171 * release the memory whenever necessary
176 class TOCRTextRgnInfo
181 * Region coordinate to be processed
186 * Layout Type (Horizontal or Vertical)
188 TOcrLayoutType iType;
196 * Text line Information (Not Own)
198 TOCRTextLineInfo* iLines;
207 * OCR (Optical Character Recognition) Setting for Layout Analysis
209 * The setting for layout analysis
214 class TOCRLayoutSetting
223 ENormal, ///< brightness is normal
224 ELight, ///< brightness is light
225 EDark ///< brightness is dark
229 * Whether skew adjustment enabled, in most cases
230 * this flag shall be always on; But if images are in
231 * very good contition, this flag can be off to increase
232 * the recognition speed
237 * Brightness for text background
239 TOcrBrightness iBrightness;
243 * OCR (Optical Character Recognition) Setting for Recognize (Reserved)
245 * The setting for recognition
250 class TOCRRecognizeSetting
255 * Reserved for future use
261 * OCR (Optical Character Recognition) Block Information for Recognizing Blocks
263 * This class is for recognizing blocks. @see MOCREngineRecognizeBlock::RecognizeBlockL
268 class TOCRLayoutBlockInfo
273 * Region coordinate to be processed
278 * Layout Type (Horizontal or Vertical)
280 TOcrLayoutType iLayout;
283 * Text Type (Multi or Single line)
288 * Brightness for text background
290 TOcrBackgroundType iBackgroundColor;
294 * OCR (Optical Character Recognition) Block Information for Recognizing Blocks
296 * This class is for recognizing blocks. @see MOCREngineRecognizeBlock::RecognizeSpecialRegionL
310 EEmailAddress, ///< E-mail address
311 ETelephoneNumber, ///< telephone number
312 EWWWAddress ///< website address
317 * Region coordinate to be processed
322 * Brightness for text background
324 TOcrBackgroundType iBackgroundColor;
329 TOcrRegionType iType;
333 * OCR (Optical Character Recognition) Engine Environment Settings
335 * This class is for setting the thread priority and the maximum heap
336 * allocation for the ocr engine
345 * Thread priority. The Engine Factory will create a child thread
346 * for the OCR process, EPriorityLess is recommended for most cases
348 TThreadPriority iPriority;
351 * The maximum heap size for the OCR process, must be larger than
352 * KMinHeapGrowBy x 1200 to do recognition for 1600x1200 images. If
353 * this value is lower(equal) than KMinHeapGrowBy*1000, a leave will
354 * happen in CreateOCREngineL with KErrArgument
359 #endif // OCRCOMMON_H