←Select platform

AutoFormsParallelRunItemGetterRasterImage(RasterImage,object,string,object) Delegate

Summary

Callback to get the RasterImage instance to run the AutoFormsEngine on.

Syntax

C#
C++/CLI
Python
public delegate void AutoFormsParallelRunItemGetterRasterImage( 
   ref RasterImage image, 
   ref object itemUserData, 
   ref string repositoryName, 
   object getterUserData 
) 
public: 
   delegate void AutoFormsParallelRunItemGetterRasterImage( 
      RasterImage^ %image, 
      Object^ %itemUserData, 
      String^ %repositoryName, 
      Object^ getterUserData 
   ) 
def AutoFormsParallelRunItemGetterRasterImage(self,image,itemUserData,repositoryName,getterUserData): 
# image : RasterImage&, itemUserData : Object&, repositoryName : String&, getterUserData : Object 

Parameters

image

RasterImage instance to run the AutoFormsEngine on.

itemUserData

Optional object associated with the input item.

repositoryName

If the corresponding repository name of item is not null, then AutoFormsParallelRunItemGetterRasterImage uses it in place of the current value of FullTextSearchRepositoryName.

getterUserData

Optional object that might be passed to the RunParallelPipesOnDemand and then passed to the getter callback.

Remarks

If the getterUserData is used, then apply an appropriate syncing method as multiple getters can be called in parallel threads.

Example

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Auto; 
using Leadtools.Document; 
using Leadtools.Ocr; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Processing; 
using Leadtools.Barcode; 
 
using Leadtools.Forms; 
 
public void ResultCallbackImage3(RasterImage image, AutoFormsRunResult result, int itemIndex, object label) 
{ 
   if (result == null) 
   { 
      Console.WriteLine($"ERROR!!!: Failed to process {label}: [{itemIndex}]"); 
   } 
   else 
   { 
      Console.WriteLine($"Successfully processed {label}: [{itemIndex}]"); 
      foreach (FormPage page in result.FormFields) 
      { 
         foreach (FormField field in page) 
         { 
            Console.WriteLine($"Process for the field {field.Name} is {field.Result.Status} "); 
         } 
      } 
   } 
} 
 
public void ProcessFormsMultiProcessOnDemandImages(AutoFormsEngine autoEngine, List<string> fileNames, List<string> repositoryNames) 
{ 
   int nextItemIndex = -1; 
   RasterCodecs codecs = new RasterCodecs(); 
 
   AutoFormsParallelRunItemGetterRasterImage getter = (ref RasterImage image, ref object itemUserData, ref string repositoryName, object getterUserData) => 
   { 
      int index = Interlocked.Increment(ref nextItemIndex); 
 
      if (index >= fileNames.Count) 
         return; 
 
      lock (codecs) 
      { 
         image = codecs.Load(fileNames[index]); 
      } 
      repositoryName = repositoryNames == null ? null : repositoryNames[index]; 
   }; 
 
   autoEngine.RunParallelPipesOnDemand( 
      getter, 
      null, 
      ResultCallbackImage3, 
      8 
   ); 
 
   codecs.Dispose(); 
} 

Requirements

Target Platforms

See Also

Leadtools.Forms.Auto Namespace

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Auto Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.