com.aspose.barcode.barcoderecognition

Class ProcessorSettings

  • java.lang.Object
    • com.aspose.barcode.barcoderecognition.ProcessorSettings


  • public class ProcessorSettings
    extends java.lang.Object

    ProcessorSettings allow to recognize barcodes with multi-threaded increasing of performance


     This sample shows how to use ProcessorSettings to add maximum multi-threaded performnce
     
     BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount()* 2);
     //this allows to use all cores for single BarCodeReader call
     BarCodeReader.getProcessorSettings().setUseAllCores(true);
     //this allows to use current count of cores
     BarCodeReader.getProcessorSettings().setUseAllCores(false);
     BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
     
    • Method Detail

      • getUseAllCores

        public boolean getUseAllCores()

        Is needed to use all cores.


         
         BarCodeReader.getProcessorSettings().setUseAllCores(true);
         
      • setUseAllCores

        public void setUseAllCores(boolean value)

        Is needed to use all cores.


         
         BarCodeReader.getProcessorSettings().setUseAllCores(true);
         
      • getUseOnlyThisCoresCount

        public int getUseOnlyThisCoresCount()

        Specify the number of cores to use. You need to change the property "UseAllCores" to "false".


         
         BarCodeReader.getProcessorSettings().setUseAllCores(false);
         BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
         
      • setUseOnlyThisCoresCount

        public void setUseOnlyThisCoresCount(int value)

        Specify the number of cores to use. You need to change the property "UseAllCores" to "false".


         
         BarCodeReader.getProcessorSettings().setUseAllCores(false);
         BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
         
      • getMaxAdditionalAllowedThreads

        public int getMaxAdditionalAllowedThreads()

        Specify the maximal number of additional threads to run code in parallel


         
         BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);
         
      • setMaxAdditionalAllowedThreads

        public void setMaxAdditionalAllowedThreads(int value)

        Specify the maximal number of additional threads to run code in parallel


         
         BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);