RecAPI
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Modules Pages

Barcode recognition module. More...

Classes

struct  BAR_INFO
 Barcode information. More...
 

Typedefs

typedef BAR_TYPELPBAR_TYPE
 Pointer to a BAR_TYPE.
 
typedef enum BAR_ENA BAR_ENA
 Barcode enabling.
 
typedef BAR_ENALPBAR_ENA
 Pointer to a BAR_ENA type variable.
 
typedef const BAR_ENALPCBAR_ENA
 Const pointer to a BAR_ENA type variable.
 

Enumerations

enum  BAR_TYPE {
  BAR_EAN = 0 ,
  BAR_UPC_A = 2 ,
  BAR_UPC_E ,
  BAR_ITF ,
  BAR_C39 = 6 ,
  BAR_C39_EXT = 9 ,
  BAR_C128 = 10 ,
  BAR_CB = 12 ,
  BAR_POSTNET = 14 ,
  BAR_A2of5 ,
  BAR_UCC128 ,
  BAR_2of5 ,
  BAR_C93 ,
  BAR_PATCH ,
  BAR_PDF417 ,
  BAR_PLANET ,
  BAR_C32 ,
  BAR_DMATRIX = 23 ,
  BAR_C39_NSS ,
  BAR_QR = 26 ,
  BAR_MAT25 ,
  BAR_AZTEC =29 ,
  BAR_CODE11 ,
  BAR_ITAPOST25 ,
  BAR_MSI ,
  BAR_BOOKLAND ,
  BAR_ITF14 ,
  BAR_EAN14 ,
  BAR_SSCC18 ,
  BAR_DATABAR_LTD ,
  BAR_DATABAR_EXP ,
  BAR_4STATE_USPS ,
  BAR_4STATE_AUSPOST ,
  BAR_SIZE
}
 Barcode types. More...
 
enum  BAR_ENA {
  BAR_DISABLED = 0 ,
  BAR_ENABLED
}
 Barcode enabling. More...
 
enum  AUSPOST_ENC {
  AUSPOST_ENC_CHARACTER = 1 ,
  AUSPOST_ENC_NUMERIC ,
  AUSPOST_ENC_RAW
}
 Australian Post barcode encoding methods. More...
 

Functions

RECERR RECAPIKRN kRecSetBarTypes (int sid, LPCBAR_ENA pBarEna)
 Enabling barcode types.
 
RECERR RECAPIKRN kRecGetBarTypes (int sid, LPBAR_ENA pBarEnaOut)
 Getting the enabled barcode types.
 
RECERR RECAPIKRN kRecGetAutoBarTypes (int sid, LPBAR_ENA pBarEnaOut)
 Getting the set of barcode types for automatic barcode detection.
 
RECERR RECAPIKRN kRecCheckBarTypes (int sid, LPCBAR_ENA pBarEnaIn, LPBAR_ENA pBarEnaOut, LPCBAR_ENA pBarEnaPrev)
 Checking enabled barcode types.
 
RECERR RECAPIKRN kRecGetBarTypeName (BAR_TYPE Bartype, LPCSTR *pBarname)
 Getting the name of a barcode type.
 
RECERR RECAPIKRN kRecGetBarInfo (BAR_TYPE BarCodeType, BAR_INFO *pBarInfo)
 Getting information of barcode.
 

BAR_INFO flag values

Possible values of BAR_INFO::BarFlags See also BAR_INFO.

#define BF_BAR_1D   1
 1D barcode
 
#define BF_BAR_2D   2
 2D barcode
 
#define BF_BAR_POSTAL   4
 Postal barcode (different length lines)
 
#define BF_BAR_OTHER   8
 Other barcode (Patch code)
 
#define BF_BAR_DEPRECATED   0x1000
 Do not use this barcode!
 
#define BF_BAR_NOTSUPPORTED   0x2000
 Do not use this barcode! Note that BF_BAR_DEPRECATED is also set.
 

Detailed Description

Barcode recognition module.

See the general description of BAR recognition module and its settings.

Typedef Documentation

◆ BAR_ENA

typedef enum BAR_ENA BAR_ENA

Barcode enabling.

This enum defines the possible values for the particular barcode type selection when the RM_BAR recognition module is used. See kRecSetBarTypes.

Enumeration Type Documentation

◆ AUSPOST_ENC

Australian Post barcode encoding methods.

Using the setting Kernel.Ocr.BAR.bar1D.4State.AusPost.CustomerEncoding it can be specified which encoding method was used in the barcode to be recognized.

Enumerator
AUSPOST_ENC_CHARACTER 

Alphanumeric character set

AUSPOST_ENC_NUMERIC 

Numeric character set

AUSPOST_ENC_RAW 

Binary data (retrieved in 8-bit code words)

◆ BAR_ENA

enum BAR_ENA

Barcode enabling.

This enum defines the possible values for the particular barcode type selection when the RM_BAR recognition module is used. See kRecSetBarTypes.

Enumerator
BAR_DISABLED 

The particular barcode type is disabled.

BAR_ENABLED 

The particular barcode type is enabled.

◆ BAR_TYPE

enum BAR_TYPE

Barcode types.

List of barcode types supported by the RM_BAR recognition module.

Note
Note that the barcode recognition modules are configured to recognize, by default, the following barcode types only: EAN, ITF, Code 39, Code 128 and Codabar. This setting can be changed with the kRecSetBarTypes function.
Barcode types BAR_EAN_SUPPL, BAR_ITF_CDT, BAR_C39_CDT, BAR_C39_SST, BAR_C39_FA, BAR_C128_CDT, BAR_4STATE, BAR_4STATE_DK1, BAR_AZTEC are removed from this enum. Of course, their support is not discontinued, but it is changed. See the topic Deprecated barcode types for more information.
Barcode type BAR_CB_NO_SST is not supported anymore.
See also the table of the barcode type combinations.
Enumerator
BAR_EAN 

EAN 8/13. See also the setting Kernel.Ocr.BAR.bar1D.EAN.SUPPL.

BAR_UPC_A 

UPC-A. See also the setting Kernel.Ocr.BAR.bar1D.UPCA.SUPPL.

BAR_UPC_E 

UPC-E (6-digit). See also the setting Kernel.Ocr.BAR.bar1D.UPCE.SUPPL.

BAR_ITF 

ITF (Interleaved 2 of 5). See also the setting Kernel.Ocr.BAR.bar1D.ITF.CDX.

BAR_C39 

Code 39. See also the settings Kernel.Ocr.BAR.bar1D.C39.CDX, Kernel.Ocr.BAR.bar1D.C39.SST, Kernel.Ocr.BAR.bar1D.C39.FA.

BAR_C39_EXT 

Code 39 Extended. The full ASCII character set is supported. See also the settings Kernel.Ocr.BAR.bar1D.C39.CDX, Kernel.Ocr.BAR.bar1D.C39.SST.

BAR_C128 

Code 128. See also the setting Kernel.Ocr.BAR.bar1D.C128.CDT.

BAR_CB 

Codabar.

BAR_POSTNET 

Postnet code (US postal code).

BAR_A2of5 

Airline 2 of 5.

BAR_UCC128 

UCC/EAN Code 128. Includes SSCC-18 and EAN-14 as well.

BAR_2of5 

Code 2 of 5 Standard. See also the setting Kernel.Ocr.BAR.bar1D.2OF5.CDX.

BAR_C93 

Code 93. The full ASCII character set is supported.

BAR_PATCH 

Patch Code.

BAR_PDF417 

PDF417 (2D barcode).

BAR_PLANET 

Planet Code (US postal code).

BAR_C32 

Code 32. Italian Pharmacode.

BAR_DMATRIX 

Data Matrix (2D barcode).

BAR_C39_NSS 

Code 39 without start-stop characters.

BAR_QR 

QR Code (Quick Response) (2D barcode).

BAR_MAT25 

Matrix 2 of 5. See also the setting Kernel.Ocr.BAR.bar1D.M2OF5.CDX.

BAR_AZTEC 

Aztec (2D barcode). Only recognized by Atalasoft.

BAR_CODE11 

Code 11.

BAR_ITAPOST25 

Italian Postal 2 of 5 Code.

BAR_MSI 

Modified Plessey Code. See also the setting Kernel.Ocr.BAR.bar1D.MSI.CDX.

BAR_BOOKLAND 

Bookland EAN Code.

BAR_ITF14 

ITF 14 Code.

BAR_EAN14 

EAN-14 Code.

BAR_SSCC18 

SSCC18/EAN-18 Code.

BAR_DATABAR_LTD 

GS1 Databar Limited Code.

BAR_DATABAR_EXP 

GS1 Databar Expanded Code.

BAR_4STATE_USPS 

USPS 4-State Customer Barcode. (a.k.a. OneCode, Intelligent Mail).

BAR_4STATE_AUSPOST 

Australia Post 4-State Customer Barcode. See also the setting Kernel.Ocr.BAR.bar1D.4STATE.AUSPOST.CustomerEncoding.

BAR_SIZE 

Number of barcode types.

Function Documentation

◆ kRecCheckBarTypes()

RECERR RECAPIKRN kRecCheckBarTypes ( int sid,
LPCBAR_ENA pBarEnaIn,
LPBAR_ENA pBarEnaOut,
LPCBAR_ENA pBarEnaPrev )

Checking enabled barcode types.

The kRecCheckBarTypes function is used to check the enabled barcode type(s) for the RM_BAR recognition module. The function checks that the barcode type combination is correct and fixes it in the pBarEnaOut array by removing incompatible ones.

Parameters
[in]sidSettings Collection ID.
[in]pBarEnaInPointer of a BAR_ENA type array having BAR_SIZE elements. Each element of this array will be checked whether they are incompatible with each other.
[out]pBarEnaOutPointer of a BAR_ENA type array having BAR_SIZE elements. Each element of this array corresponding to the pBarEnaIn array are enabled/disabled in a correct combination. This parameter can be NULL.
[in]pBarEnaPrevPointer of a BAR_ENA type array having BAR_SIZE elements. Using this array is useful for those applications where the user can select barcode types from a user interface. This array must contain the previous state of the barcode set. The function uses this array to learn which barcode is actually selected by the user. This information is used as a hint to keep this barcode selected in the pBarEnaOut array. This parameter can be NULL.
Return values
RECERRSee details in notes below.
Note
To use this function simply for checking a barcode type combination without fixing it, set both pBarEnaOut and pBarEnaPrev to NULL.
The function works according to the table of the barcode type combinations.
The following barcode types are deprecated: BAR_EAN_SUPPL, BAR_ITF_CDT, BAR_C39_CDT, BAR_C39_SST, BAR_C39_FA, BAR_C128_CDT, BAR_CB_NO_SST. Enabling them results in the return value BAR_DEPRECATED_TYPE_ERR. If necessary use the following settings instead according to the type: Kernel.Ocr.BAR.bar1D.EAN.SUPPL, Kernel.Ocr.BAR.bar1D.ITF.CDX, Kernel.Ocr.BAR.bar1D.C39.CDX, Kernel.Ocr.BAR.bar1D.C39.SST and Kernel.Ocr.BAR.bar1D.C128.CDT.
If the currently used barcode recognition module does not support one of the enabled barcode types, the return value of this function is BAR_NOTSUPPORTED_TYPE_ERR.
To get additional information about the return errors use the kRecGetLastError function. Its supplementary character string may help identify the problem. This function should be called immediately after the kRecCheckBarTypes function.
See also the module BAR.
The specification of this function in C# is:
RECERR kRecCheckBarTypes(int sid, [In] BAR_ENA[] pBarEnaIn, [Out] BAR_ENA[] pBarEnaOut, [In] BAR_ENA[] pBarEnaPrev);
BAR_ENA
Barcode enabling.
Definition KernelApi.h:1499
RECERR RECAPIKRN kRecCheckBarTypes(int sid, LPCBAR_ENA pBarEnaIn, LPBAR_ENA pBarEnaOut, LPCBAR_ENA pBarEnaPrev)
Checking enabled barcode types.
RECERR
Error codes.
Definition RECERR_doc.h:19
The specification of this function in Java is:
int kRecCheckBarTypes(int sid, int[] pBarEnaIn, int[] pBarEnaOut, int[] pBarEnaPrev)
The specification of this function in Python is:
def kRecCheckBarTypes(sid: int, pBarEnaIn: "IntArray", pBarEnaPrev: "IntArray") -> Tuple[int, "IntArray"]

◆ kRecGetAutoBarTypes()

RECERR RECAPIKRN kRecGetAutoBarTypes ( int sid,
LPBAR_ENA pBarEnaOut )

Getting the set of barcode types for automatic barcode detection.

The kRecGetAutoBarTypes function inquires the largest set of barcode types of the RM_BAR recognition module that can be used simultaneously for automatic detection.

Parameters
[in]sidSettings Collection ID.
[out]pBarEnaOutAddress of a buffer size of BAR_SIZE to receive the barcode type enable/disable array.
Return values
RECERR
Note
Use the returned buffer with kRecSetBarTypes to enable the largest set for automatic barcode detection.
The settings Kernel.OcrMgr.BarEnable1D2D, Kernel.OcrMgr.BarEnableC39C39EXT and Kernel.OcrMgr.BarEnableC39C32 have an effect on the resulting set of barcodes.
The specification of this function in C# is:
RECERR kRecGetAutoBarTypes(int sid, out BAR_ENA[] pBarEnaOut);
RECERR RECAPIKRN kRecGetAutoBarTypes(int sid, LPBAR_ENA pBarEnaOut)
Getting the set of barcode types for automatic barcode detection.
The specification of this function in Java is:
int kRecGetAutoBarTypes(int sid, int[] pBarEnaOut)
The specification of this function in Python is:
def kRecGetAutoBarTypes(sid: int) -> Tuple[int, "IntArray"]

◆ kRecGetBarInfo()

RECERR RECAPIKRN kRecGetBarInfo ( BAR_TYPE BarCodeType,
BAR_INFO * pBarInfo )

Getting information of barcode.

The kRecGetBarInfo function gets information of the specified barcode type

Parameters
[in]BarCodeTypeThe barcode type inquired.
[out]pBarInfoAddress of a pointer to the BAR_INFO structure.
Note
The specification of this function in C# is:
RECERR kRecGetBarInfo(BAR_TYPE BarType, out BAR_INFO BarInfo);
BAR_TYPE
Barcode types.
Definition KernelApi.h:1428
RECERR RECAPIKRN kRecGetBarInfo(BAR_TYPE BarCodeType, BAR_INFO *pBarInfo)
Getting information of barcode.
Barcode information.
Definition KernelApi.h:1535
The specification of this function in Java is:
int kRecGetBarInfo(int BarCodeType, BAR_INFO pBarInfo)
The specification of this function in Python is:
def kRecGetBarInfo(BarCodeType: int) -> Tuple[int, "BAR_INFO"]

◆ kRecGetBarTypeName()

RECERR RECAPIKRN kRecGetBarTypeName ( BAR_TYPE Bartype,
LPCSTR * pBarname )

Getting the name of a barcode type.

The kRecGetBarTypeName function gets the full name string of the specified barcode type of the RM_BAR recognition module.

Parameters
[in]BartypeThe barcode type inquired.
[out]pBarnameAddress of a pointer to the name of the specified barcode.
Note
Barcode type names are available in ASCII encoding. You may use kRecConvertCodePage2UnicodeEx to convert to UTF-16.
Barcode type names may change in newer versions, thus these names cannot be used as identifiers.
If you need more information than name about barcode types, we suggest to use the kRecGetBarInfo function.
The specification of this function in C# is:
RECERR kRecGetBarTypeName(BAR_TYPE Bartype, out string pBarname);
RECERR RECAPIKRN kRecGetBarTypeName(BAR_TYPE Bartype, LPCSTR *pBarname)
Getting the name of a barcode type.
The specification of this function in Java is:
int kRecGetBarTypeName(int Bartype, String[] pBarname)
The specification of this function in Python is:
def kRecGetBarTypeName(Bartype: int) -> Tuple[int, str]

◆ kRecGetBarTypes()

RECERR RECAPIKRN kRecGetBarTypes ( int sid,
LPBAR_ENA pBarEnaOut )

Getting the enabled barcode types.

The kRecGetBarTypes function inquires the barcode types of the RM_BAR recognition module currently validated for recognition.

Parameters
[in]sidSettings Collection ID.
[out]pBarEnaOutAddress of a buffer size of BAR_SIZE to receive the barcode type enable/disable array.
Return values
RECERR
Note
This function gets the value of the setting Kernel.OcrMgr.BarTypes. This setting can be changed by kRecSetBarTypes.
The specification of this function in C# is:
RECERR kRecGetBarTypes(int sid, out BAR_ENA[] pBarEnaOut);
RECERR RECAPIKRN kRecGetBarTypes(int sid, LPBAR_ENA pBarEnaOut)
Getting the enabled barcode types.
The specification of this function in Java is:
int kRecGetBarTypes(int sid, int[] pBarEnaOut)
The specification of this function in Python is:
def kRecGetBarTypes(sid: int) -> Tuple[int, "IntArray"]

◆ kRecSetBarTypes()

RECERR RECAPIKRN kRecSetBarTypes ( int sid,
LPCBAR_ENA pBarEna )

Enabling barcode types.

The kRecSetBarTypes function is used to specify the enabled barcode type(s) for the RM_BAR module.

Parameters
[in]sidSettings Collection ID.
[in]pBarEnaPointer of a BAR_ENA type array having BAR_SIZE elements. Each element of this array variable corresponds to a BAR_TYPE barcode type, and their values represent the enabled/disabled status of the appropriate barcode type.
Return values
RECERR
Note
This function sets the value of the setting Kernel.OcrMgr.BarTypes. This setting can be retrieved by kRecGetBarTypes.
Not all barcode types are compatible! To check the barcode type combination to be enabled, use the kRecCheckBarTypes function. See that function also for the list of incompatible barcode type combinations.
If all the barcode types are disabled, the RM_BAR module uses the array returned by an internal call to kRecGetAutoBarTypes instead during recognition.
See also the module BAR.
The specification of this function in C# is:
RECERR kRecSetBarTypes(int sid, BAR_ENA[] pBarEna);
RECERR RECAPIKRN kRecSetBarTypes(int sid, LPCBAR_ENA pBarEna)
Enabling barcode types.
The specification of this function in Java is:
int kRecSetBarTypes(int sid, int[] pBarEna)
The specification of this function in Python is:
def kRecSetBarTypes(sid: int, pBarEna: "IntArray") -> int