Skip to main content
This interface is implemented in FRE for Linux and Windows.
This is the interface for a custom source of images. This interface and all its methods are implemented on the client-side. This interface is used by the Batch Processor (the BatchProcessor object). This interface allows you to implement image processing queue in a custom way. Batch Processor requests the next image from this queue using the GetNextImageFile or GetNextImageDocument methods.
All the ImageDocument objects in the queue must be valid till the end of processing. For correct operation the ImageDocument objects should be created via the Engine object. If they are created via the FRDocument object an error may occur because of the FRDocument object being destroyed during the call to the GetNextImageDocument method.

Methods

NameDescription
GetNextImageDocumentReturns the next image document from the image processing queue of the source.
GetNextImageFileReturns the next image file from the image processing queue of the source.
IsEmptyChecks if there are any image files in the image processing queue of the source.

Input parameter

The Start method of the BatchProcessor object receives a pointer to this interface as an input parameter.

Samples

// Sample implementation of a custom image source which maintains a queue of image files
public class ImageSourceCallback : FREngine.IImageSource
{
   public ImageSourceCallback( string imageFilesDirectory )
   {
       imageFiles = ImageSourceHelper.LoadFilesNames( imageFilesDirectory );
       nextFileIndex = 0;
   }
   public bool IsEmpty()
   {
       return nextFileIndex >= imageFiles.Length;
   }
   public FREngine.IFileAdapter GetNextImageFile()
   {
       if( !IsEmpty() ) {
           return new FileAdapterCallback( imageFiles[nextFileIndex++] );
       }
       return null;
   }
   public FREngine.IImageDocument GetNextImageDocument()
   {
       ...
   }
   private string[] imageFiles;
   private int nextFileIndex;
}
public class FileAdapterCallback : FREngine.IFileAdapter
{
    ...
}
public class ImageSourceHelper
{
    ...
}
The interface is used in the following code samples: BatchProcessing; and Windows demo tools: BatchProcessingRecognition.

See also

BatchProcessor