Logo Search packages:      
Sourcecode: librasterlite version File versions  Download package

char** eps_get_fb_info ( int  type )

Query available filterbanks

Depending on the type parameter this function composes a NULL terminated list of all available filterbank IDs, names or orthogonality types.

Note:
The caller should subsequently release allocated list (using eps_free_fb_info function) when it is no longer required.
The caller should not modify allocated structure.
Parameters:
typeType of information: either EPS_FB_ID or EPS_FB_NAME or EPS_FB_TYPE
Returns:
List of strings

Definition at line 549 of file libmain.c.

References BIORTHOGONAL, EPS_FB_ID, EPS_FB_NAME, EPS_FB_TYPE, filterbanks, filterbank_t_tag::id, filterbank_t_tag::name, and xmalloc().

{
    char **info;
    int i, n;

    /* Get the number of all available filterbanks */
    for (n = 0; filterbanks[n]; n++);
    info = (char **) xmalloc((n + 1) * sizeof(char *));

    /* Travels the list and populate `info' with requested information */
    for (i = 0; i < n; i++) {
        if (type == EPS_FB_ID) {
            info[i] = filterbanks[i]->id;
        } else if (type == EPS_FB_NAME) {
            info[i] = filterbanks[i]->name;
        } else if (type == EPS_FB_TYPE) {
            if (filterbanks[i]->type == BIORTHOGONAL) {
                info[i] = "biorthogonal";
            } else {
                info[i] = "orthogonal";
            }
        } else {
            info[i] = NULL;
        }
    }

    /* Terminate list with NULL pointer */
    info[n] = NULL;

    return info;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index