00001
00010 #ifndef VVXTRDEFS_H
00011 #define VVXTRDEFS_H 1
00012
00013 #include <vvutil/vvError.h>
00014 #include <vvutil/vvLog.h>
00015 #include <vvutil/vvConstants.h>
00016
00017 #include <vvlicense/vvLicenseClient.h>
00018
00019
00027 #define VV_DEBUG 1
00028
00032 typedef enum vvxtr_dataType {
00033 vvxtr_none=0,
00034 vvxtr_int,
00035 vvxtr_string,
00036 vvxtr_pib,
00037 vvxtr_ptr
00038 } VVXTR_DATATYPE;
00039
00040
00053 typedef signed long int vvxtr_state;
00054
00058 typedef signed long int vvxtr_cond;
00059
00063 typedef signed long int vvxtrStatus;
00064
00068 typedef void * vvxtr_stdarg;
00069
00070
00074 enum vvxtrResponseEnum {
00075 vvNo = 0,
00076 vvYes = 1,
00077 vvAuto = 2,
00078 vvDetect = 3,
00079 vvCorrect = 4,
00080 vvManual = 5
00081 };
00082
00105 enum vvxtrOutTextFormatEnum {
00106 vvTextFormatDefault = -1,
00107 vvTextFormatNone = 0,
00108 vvTextFormatXdoc = 1,
00109 vvTextFormatXdoclite = 3,
00110 vvTextFormatXdocplus = 4,
00111 vvTextFormatPost = 13,
00112 vvTextFormatIso = 102,
00113 vvTextFormatPdf = 104,
00114 vvTextFormat8bit = 105,
00115 vvTextFormatUnicode = 106,
00116 vvTextFormatHtmlWysiwygP = 107,
00117 vvTextFormatHtmlWysiwygS = 108,
00118 vvTextFormatHtmlTable = 109,
00119 vvTextFormatHtmlSimple = 110
00120 };
00121
00131 enum vvxtrOutGraphicsFormatEnum {
00132 vvSubimageFormatNone = -1,
00134 vvSubimageFormatTiff = 0,
00138 vvSubimageFormatRas = 1,
00141 vvSubimageFormatEpsf = 2,
00144 vvSubimageFormatX11 = 3,
00148 vvSubimageFormatTiffpack = 4,
00149 vvSubimageFormatTiffg31d = 5,
00152 vvSubimageFormatTiffg32d = 6,
00156 vvSubimageFormatTiffg42d = 7,
00159 vvSubimageFormatTifflzw = 8,
00160 vvSubimageFormatPaltiff = 31,
00161 vvSubimageFormatGif = 17,
00163 vvSubimageFormatJpeg = 19,
00166 vvSubimageFormatPng = 21,
00169 vvSubimageFormatXwd = 22,
00172 vvSubimageFormatRgb = 23,
00174 vvSubimageFormatRgbrle = 24,
00176 vvSubimageFormatEPdf = 28,
00177 vvSubimageFormatVvxtrImage = 30
00180 };
00181
00182
00188 enum vvxtrFocusAreaEnum {
00189 vvFocusAreaPage = 0,
00190 vvFocusAreaRegion = 1
00191 };
00192
00199 enum vvxtrVerifierModeEnum {
00200 vvVerifierModeWord = 1,
00201 vvVerifierModeChar = 0
00202 };
00203
00210 enum vvxtrRecModeEnum {
00211 vvRecModeUnspecified = 1,
00212 vvRecModeStandard = 2,
00213 vvRecModeDegraded = 3
00214 };
00215
00225 enum vvxtrTextOutNewlineEnum {
00226 vvTextOutNewlineUnix = 1,
00227 vvTextOutNewlineMac = 2,
00228 vvTextOutNewlinePC = 3
00229 };
00230
00238 enum vvxtrPDFFormatEnum {
00239 vvPDFFormatNormal = 1,
00240 vvPDFFormatText = 2,
00241 vvPDFFormatImgOnly = 3
00242 };
00243
00250 enum vvxtrRegionTypeEnum {
00251 vvRegionTypeAny = 3511,
00252 vvRegionTypeIgnore = 3512,
00253 vvRegionTypeText = 3513,
00254 vvRegionTypeImage = 3514,
00255 vvRegionTypeVrule = 3515,
00256 vvRegionTypeHrule = 3516,
00257 vvRegionTypeHidden = 3517,
00258 vvRegionTypeRevid = 3518,
00259 vvRegionTypeHiddenimage = 3519
00260 };
00261
00268 enum vvxtrRegionSubtypeEnum {
00269 vvRegionSubtypeUnflavored = 0,
00270 vvRegionSubtypeTable = 1,
00271 vvRegionSubtypeTable_inset = 2,
00272 vvRegionSubtypeHeadline = 3,
00273 vvRegionSubtypeTimestamp = 4,
00274 vvRegionSubtypeLineart = 5,
00275 vvRegionSubtypeHalftone = 6,
00276 vvRegionSubtypeInset = 7,
00277 vvRegionSubtypeCaption = 8,
00278 vvRegionSubtypePage_footer = 9,
00279 vvRegionSubtypePage_header = 10,
00280 vvRegionSubtypeVruling = 11,
00281 vvRegionSubtypeHruling = 12,
00282 vvRegionSubtypeNoise = 13,
00283 vvRegionSubtypeIpcorePictureMask = 14
00284 };
00285
00292 enum vvxtrRegionGrammarModeEnum {
00293 vvRegGrammarModeWord = 0,
00294 vvRegGrammarModeLine = 1
00295 };
00296
00303 enum vvxtrRegionLexmodeEnum {
00304 vvRegionLexmodeNolex = 0,
00305 vvRegionLexmodePreference = 1,
00306 vvRegionLexmodeAbsolute = 2
00307 };
00308
00309
00316 enum vvxtrRegionForegroundEnum {
00317 vvRegionForegroundBlack = 0,
00318 vvRegionForegroundWhite = 1,
00319 vvRegionForegroundUnknown = 2
00320 };
00321
00328 enum vvxtrRegionOpacityEnum {
00329 vvRegionOpacityOpaque = 0,
00330 vvRegionOpacityTransparent = 1
00331 };
00332
00339 enum vvxtrRegionAbutmentEnum {
00340 vvRegionAbutmentUnknown = -1,
00341 vvRegionAbutmentNone = 0,
00342 vvRegionAbutmentLeft = 1,
00343 vvRegionAbutmentRight = 2,
00344 vvRegionAbutmentLeftAndRight = 3
00345 };
00346
00353 enum vvxtrLexicalConstraintModeEnum {
00354 vvLexConstraintModeReplace = 0,
00355 vvLexConstraintModeAdd = 1
00356 };
00357
00364 enum vvxtrDisplayAlignmentEnum {
00365 vvAlign8 = 8,
00366 vvAlign16 = 16,
00367 vvAlign32 = 32,
00368 vvAlign64 = 64
00369 };
00370
00379 enum vvxtrVersionLocationEnum {
00380 vvLocal = 0,
00381 vvRemote = 1
00382 };
00383
00398 enum vvxtrImageSpecificationEnum {
00399 vvInputImage = 0,
00400 vvProcessedImage = 1
00401 };
00402 #ifndef DOXYGEN
00403
00404
00405
00406
00407
00408 #endif
00409
00419 #define C_READY 0x400
00420 #define C_OCRSESOPEN 0x200
00421 #define C_OUTDOCOPEN 0x100
00422 #define C_FILEOPEN 0x080
00423 #define C_IMAGELOADED 0x040
00424 #define C_PREPROCDONE 0x020
00425 #define C_RECOGDONE 0x010
00426 #define C_DOCREADY 0x008
00427 #define C_SUBIMAGEREADY 0x004
00428 #define C_ENGINEBUSY 0x002
00429 #define C_ERROR 0x001
00431
00432
00443 enum vvInternalEngineState
00444 {
00445 vvS_NONE = 0x00000000,
00446 vvS_IDLE = 0x00000001,
00447 vvS_SESSION = 0x00000002,
00448 vvS_CANCEL = 0x00000004,
00449 vvS_PGCAN = 0x00000008,
00451 vvS_ACQUISITION_READY = 0x00000010,
00452 vvS_ACQUIRING = 0x00000020,
00453 vvS_RECOGNITION_READY = 0x00000040,
00454 vvS_RECOGNIZING = 0x00000080,
00456 vvS_PREPROCESS = 0x00000100,
00457 vvS_TEXT_OUTPUT = 0x00000200,
00458 vvS_REGION_MAPPING = 0x00000400,
00459 vvS_SHAPES_LOADED = 0x00000800,
00461 vvS_AWAITING_DRAW = 0x00001000,
00462 vvS_AWAITING_VERIFIER = 0x00002000,
00463 vvS_PATTERN_LOADED = 0x00008000,
00465 vvS_BUFFER_FULL = 0x00010000,
00466 vvS_UNUSED_2 = 0x00020000,
00467 vvS_UNUSED_3 = 0x00040000,
00469 vvS_XDOC_LOADED = 0x00080000,
00470 vvS_PAGE_ANALYZED = 0x00200000,
00471 vvS_ANALYZING_PAGE = 0x00400000,
00472 vvS_PAGE_LAID_OUT = 0x00800000,
00473 vvS_CHARSET_TABLE_LOADED = 0x02000000,
00475 vvS_ANY = 0x00ffffff,
00476 vvS_ERROR = 0x01000000,
00478 vvS_BLOCKED = (vvS_AWAITING_DRAW | vvS_AWAITING_VERIFIER),
00479 vvS_READY = (vvS_ACQUISITION_READY | vvS_RECOGNITION_READY),
00480 vvS_RECOGNITION = (vvS_RECOGNITION_READY | vvS_RECOGNIZING),
00481 vvS_ACQUISITION = (vvS_ACQUISITION_READY | vvS_ACQUIRING),
00482 vvS_PROCESSING = (vvS_ACQUIRING | vvS_PREPROCESS | vvS_RECOGNIZING | vvS_REGION_MAPPING | vvS_TEXT_OUTPUT )
00484 };
00485
00486
00493 #define VVXTR_KILL_PROCESS -1000
00494 #define VVXTR_PREVIOUS_ERROR -1001
00496 #define VVXTR_ERR -1
00498 enum vvxtrErrorCodes
00499 {
00500 VVXTR_ERR_INVALID_SYNTAX=1001,
00501 VVXTR_ERR_NO_INPUT,
00502 VVXTR_ERR_INVALID_STATE,
00503 VVXTR_ERR_INITINSTANCE_FAILURE,
00504 VVXTR_ERR_ENDINSTANCE_FAILURE,
00505 VVXTR_ERR_NO_INPUT_FILE_SPECIFIED,
00506 VVXTR_ERR_UNABLE_TO_LOAD_IMAGE_FILE,
00507 VVXTR_ERR_IMG_ACQ_FAILED,
00508 VVXTR_ERR_START_SESSION_FAILED,
00509 VVXTR_ERR_RECOGNITION_FAILED,
00510 VVXTR_ERR_OPEN_CHAR_SET_FAILURE,
00511 VVXTR_ERR_INVALID_SHAPE_PACK_PATH,
00512 VVXTR_ERR_BAD_LANGUAGE,
00513 VVXTR_ERR_OPENING_LANG_PACK,
00514 VVXTR_ERR_LOAD_LANG_FAILED,
00515 VVXTR_ERR_CREATE_LANG_GROUP,
00516 VVXTR_ERR_LANG_NOT_LICENSED,
00517 VVXTR_ERR_SET_DEF_LEX_CONSTRAINTS,
00518 VVXTR_ERR_WRITE_OUTPUT_FAILED,
00519 VVXTR_ERR_OPENING_OUTPUT_FILE,
00520 VVXTR_ERR_REGION_ECLIPSED,
00521 VVXTR_ERR_COULD_NOT_CONVERT_DEPTH,
00522 VVXTR_ERR_GETTING_IMG_REGION,
00523 VVXTR_ERR_END_SESSION_FAILED,
00524 VVXTR_ERR_OUTPUT_INV_REGION,
00525 VVXTR_ERR_NOT_IMPLEMENTED,
00526 VVXTR_ERR_INV_PDF_FORMAT,
00527 VVXTR_ERR_PDF_IMG_OUTPUT,
00528 VVXTR_ERR_PDF_END_OUTPUT,
00529 VVXTR_ERR_UNABLE_TO_WRITE_PDF,
00530 VVXTR_ERR_HOST_LOOKUP_FAILED,
00531 VVXTR_ERR_CONNECTION_FAILED,
00532 VVXTR_ERR_TRANSFER_FAILED,
00533 VVXTR_ERR_NO_SUBIMAGE,
00534 VVXTR_ERR_PP_FAILED,
00535 VVXTR_ERR_SET_OPTIONS_FAILED,
00536 VVXTR_ERR_REMOVE_FILE_FAILED,
00537 VVXTR_ERR_NO_DOC,
00538 VVXTR_ERR_INV_SUBIMG_FORMAT,
00539 VVXTR_ERR_SYNCHRONIZATION,
00540 VVXTR_ERR_NOENGINE,
00541 VVXTR_ERR_BUFFER_TOO_SMALL,
00542 VVXTR_ERR_INVALID_PAGE,
00543 VVXTR_ERR_MISSING_LANG,
00544 VVXTR_ERR_ENG_OUT_OF_MEMORY,
00545 VVXTR_ERR_INVALID_UOR_COUNT,
00546 VVXTR_ERR_INVALID_UOR_STRING,
00547 VVXTR_ERR_READONLY_VALUE,
00548 VVXTR_ERR_INVALID_REGION_ID,
00549 VVXTR_ERR_SET_REGION_UNSUCCESSFUL,
00550 VVXTR_ERR_REGION_HANDLER,
00551 VVXTR_ERR_ENGINE_KILLED,
00553 VVXTR_ERR_NO_LICENSE =
00554 VVLIC_ERR_NO_LICENSE,
00555 VVXTR_ERR_NO_LICENSE_MANAGER =
00556 VVLIC_ERR_NO_LICENSE_MANAGER,
00557 VVXTR_ERR_LICENSE_COMM_ERROR =
00558 VVLIC_ERR_COMMUNICATION,
00559 VVXTR_ERR_NO_FEATURE=
00560 VVLIC_ERR_NO_FEATURE,
00561 };
00562
00571 enum vvxtrHint
00572 {
00573 vvHintLocalFilesystem,
00575 vvNumberOfHints
00576 };
00577
00578
00579 #undef tablemacro
00580 #define tablemacro(key, value, type, kernelFunc, defaultUsed, defaultVal, kernelVal, write) \
00581 dm_##key,
00582
00589 enum vvxtrEngineVariables {
00590 #include "vvocr/dataTable.table"
00591 VVXTR_ENGINE_VARIABLE_COUNT
00592 };
00593
00594 #ifndef DOXYGEN
00595
00598 #undef statustable
00599 #define statustable(psKey, handler, addlKey) psKey,
00600
00601 enum vvxtrEngineStatus
00602 {
00603 #include "vvocr/statusTable.table"
00604 VVXTR_ENGINE_STATUS_COUNT
00605 };
00606
00607 #undef actiontable
00608 #define actiontable( key, action ) \
00609 dm_##key,
00610
00611 enum vvxtrActions
00612 {
00613 #include "vvocr/actions.table"
00614 VVXTR_ACTION_COUNT
00615 };
00616
00617
00618 #undef commandtable
00619 #define commandtable( command, func, type ) \
00620 vvxtrCommand_##command,
00621
00622 enum vvxtrCommands
00623 {
00624 #include "vvocr/commandKey.table"
00625 VVXTR_COMMAND_COUNT
00626 };
00627 #endif
00628
00630 #endif