5.5.5   HGetElemL, HGetElemD, HGetElemS

Names

    HGetElemL, HGetElemD, HGetElemS

Conversion Flags

    CONV_NONE   /* no conversion; do only consider original element types */
    CONV_CAST   /* <INT4_8>=(INT4_8)<double>; <double>=(double)<INT4_8>   */
    CONV_IDNT   /* convert double to INT4_8, if double has no fraction    */
    CONV_RND    /* <INT4_8>=(INT4_8)(<double>+0.5)                        */

Synopsis

    #include "Halcon.h"

    HGetElemL(      Hproc_handle             proc_handle,
                    int                      par,
                    int                      convert,
                    int                      memtype,
                    INT4_8 *restrict         *elem,
                    INT4_8                   *num)

    HGetElemD(      Hproc_handle             proc_handle,
                    int                      par,
                    int                      convert,
                    int                      memtype,
                    double *restrict         *elem,
                    INT4_8                   *num)

    HGetElemS(      Hproc_handle             proc_handle,
                    int                      par,
                    int                      convert,
                    int                      memtype,
                    char *restrict*restrict  *elem,
                    INT4_8                   *num)

Figure 5.29: Routines for reading control input parameters by copy.

HGetElemL, HGetElemD, and HGetElemS (see figure 5.29) return a copy of the input control parameter array with the index par (1… n). According to the expected type of the array, HGetElemL is used to get LONG_PAR arrays, HGetElemD for DOUBLE_PAR, and HGetElemS for STRING_PAR arrays. In contrast to HGetPElemL, HGetPElemD, and HGetPElemS, the input arrays will be allocated and the values copied in any case. Therefore, the resulting array can be modified with the drawback of memory overhead and loss of performance. The kind of memory allocation (compare section “Memory Management”) can be specified by the parameter memtype. It supports the values HMEMglobal, HMEMlocal, and HMEMtemp, specifying the allocation function HAlloc, HAllocLocal, or HAllocTmp that is used internally. The specified function is used by the routines to allocate the array, respectively. But note that this array must be freed explicitly with the according function HFree, HFreeLocal or HFreeTmp after usage. The behavior of the routines in case of passing array types different to the expected can be specified by the convert parameter according to the description in section “HGetPElemL, HGetPElemD, HGetPElemS”.

Note that HGetPPar automatically checks the result state of the underlying procedure similarly to the macro HCkP (see section “HCkP”). Thus, you must not use HCkP on HGetPPar yourself.