typedef union { INT4_8 l; /* 4/8 byte integer */ double d; /* 8 byte real */ char* s; /* string */ Hphandle H; /* Pointer to handle */ } Hpar; typedef struct { Hpar par; int type; } Hcpar;
Figure 4.11: Data types Hpar and Hcpar for control parameters.
HALCON's basic and essential view on control data are arrays. These arrays are used to pass control parameter values to supply procedures and can assume five different types, four basic or a mixed type, see section “Describing the Parameters”.
Basic types are supported INT4_8 arrays, coded as LONG_PAR, double arrays coded as DOUBLE_PAR, handle arrays coded as HANDLE_PAR, and string arrays, i.e., char* arrays, coded as STRING_PAR. Note that all strings passed to and from the HALCON library must be encoded in UTF-8. The legacy encoding mode (set_system('filename_encoding','locale') is not supported for extension packages that use strings with non-ASCII characters.
The structure Hcpar enables HALCON to pass a mixed type (MIXED_PAR), holding any of the basic types in the union Hpar, encoded by the specifyer type. Figure 4.11 shows the corresponding definitions. Thus, it is possible to pass a native array type or to combine different types within an array of Hcpar values. For it, the selector type must be set to one of the basic type codes LONG_PAR, DOUBLE_PAR, HANDLE_PAR or STRING_PAR.
The Extension Package Interface procedures described in section “Reading and Writing Control Parameters” are used to access the control parameters of HALCON operators and pass the control data arrays through the interface.