Download HALCON Programmer`s Guide
Transcript
22.2 Control parameters void create_tuple_i(tuple,value) Htuple *tuple; Hlong val; /* creates a tuple with specifified integer value */ void create_tuple_d(tuple,value) Htuple *tuple; double val; /* creates a tuple with specifified double value */ void create_tuple_d(tuple,value) Htuple *tuple; char *val; /* creates a tuple with specifified string value */ void reuse_tuple_i(tuple,val) Htuple *tuple; Hlong val; /* reuses a tuple with specifified integer value */ void reuse_tuple_d(tuple,val) Htuple *tuple; double val; /* reuses a tuple with specifified double value */ void reuse_tuple_s(tuple,val) Htuple *tuple; char *val; /* reuses a tuple with specifified string value */ 189 Figure 22.3: HALCON/C Htuple procedures (part two). 22.2.2.3 Call Operator Then, the HALCON operator is actually called. The operator name is (as already explained) preceded by a T_ to denote tuple mode. Process Output Parameters Further processing of the output parameter tuples takes place, using the procedures length_tuple, get_type and get_* (see figure 22.4). When processing strings (using get_s), please note that the allocated memory is freed automatically upon deleting the tuple with destroy_tuple. If the string has to be processed even after the deletion of the tuple, the whole string must be copied first. The maximal string length (incl. termination character “\0”) in HALCON is MAX_STRING (1024 in HALCON version 11.0). C 22.2.2.4