ABBYY Mobile OCR Engine 4

Go to: Contents | Native Library API Reference | Functions | Callback Functions

TFineProgressCallbackFunction

This is a callback function that should be implemented on the client side. It delivers to the client the information about the approximate percentage of analysis or recognition and warnings or errors that have occurred during processing.

C Syntax
int (*TFineProgressCallbackFunction)( 
  int   processedPercentage,
  DWORD warning,
  void* warningData
);

Parameters

processedPercentage
[in] The percentage of the current work which has already been done. It is in the range from 0 to 100. 
warning
[in] The constant of the TFineWarningCode enumeration which describes the warning which has occurred during processing.
warningData
[in] A pointer to data structure with the details of the warning. Its contents depend on the type of the warning. See the description of the TFineWarningCode constants for details.

Return value

If this function returns zero, the recognition is cancelled.

Sample

Here is a sample implementation of the callback function:

int TFineProgressCallbackFunction( int processedPercentage, DWORD warning, void* warningData )
{
  fprintf( TraceFile, "%d%% of the work is done.\n", processedPercentage );
  if( warning == FWC_ProbablyBadImage) {
    fprintf( TraceFile, "The image quality is too low.\n" );
  }
  if( processedPercentage < 50 && ( warning == FWC_SlowRecognition ) != 0 ) {
    return 0;
  } else {
  return 1;
 }
} 

See also

FineAnalyzeImage
FinePrebuildWordsInfo
FineRecognizeBlocks
FineRecognizeImage
FineRecognizeRegion
FineRecognizeBusinessCard