Class ProcessorSettings
java.lang.Object
com.aspose.barcode.barcoderecognition.ProcessorSettings
ProcessorSettings allow to recognize barcodes with multi-threaded increasing of performance
This sample shows how to use ProcessorSettings to add maximum multi-threaded performnceBarCodeReader.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 Summary
Modifier and TypeMethodDescriptionintSpecify the maximal number of additional threads to run code in parallelbooleanIs needed to use all cores.intSpecify the number of cores to use.voidsetMaxAdditionalAllowedThreads(int value) Specify the maximal number of additional threads to run code in parallelvoidsetUseAllCores(boolean value) Is needed to use all cores.voidsetUseOnlyThisCoresCount(int value) Specify the number of cores to use.
-
Method Details
-
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);
-