src/sel2.c
SELA *
selaAddDwaCombs(SELA  *sela)
{
char     name[L_BUF_SIZE];
l_int32  i, f1, f2, prevsize, size;
SEL     *selh, *selv;

    PROCNAME("selaAddDwaCombs");

    if (!sela) {
        if ((sela = selaCreate(0)) == NULL)
            return (SELA *)ERROR_PTR("sela not made", procName, NULL);
    }

    prevsize = 0;
    for (i = 4; i < 64; i++) {
        selectComposableSizes(i, &f1, &f2);
        size = f1 * f2;
        if (size == prevsize)
            continue;
        selectComposableSels(i, L_HORIZ, NULL, &selh);
        selectComposableSels(i, L_VERT, NULL, &selv);
        snprintf(name, L_BUF_SIZE, "sel_comb_%dh", size);
        selaAddSel(sela, selh, name, 0);
        snprintf(name, L_BUF_SIZE, "sel_comb_%dv", size);
        selaAddSel(sela, selv, name, 0);
        prevsize = size;
    }

    return sela;
}
/*!
 *  selaAddDwaCombs()
 *
 *      Input:  sela (<optional>)
 *      Return: sela with additional sels, or null on error
 *
 *  Notes:
 *      (1) Adds all comb (horizontal, vertical) Sels that are
 *          used in composite linear morphological operations
 *          up to 63 pixels in length, which are the sizes over
 *          which dwa code can be generated.
 */
selaAddDwaCombs()
Input:  sela ()
Return: sela with additional sels, or null on error

(1) Adds all comb (horizontal, vertical) Sels that are
used in composite linear morphological operations
up to 63 pixels in length, which are the sizes over
which dwa code can be generated.
selaAddDwaCombs () Input : sela () Return : sela with additional sels or null on error ( 1 ) Adds all comb ( horizontal vertical ) Sels that are used in composite linear morphological operations up to 63 pixels in length which are the sizes over which dwa code can be generated .
SELA *
selaAddDwaCombs(SELA  *sela)
{
char     name[L_BUF_SIZE];
l_int32  i, f1, f2, prevsize, size;
SEL     *selh, *selv;
    PROCNAME("selaAddDwaCombs");
    if (!sela) {
        if ((sela = selaCreate(0)) == NULL)
            return (SELA *)ERROR_PTR("sela not made", procName, NULL);
    }
    prevsize = 0;
    for (i = 4; i < 64; i++) {
        selectComposableSizes(i, &f1, &f2);
        size = f1 * f2;
        if (size == prevsize)
            continue;
        selectComposableSels(i, L_HORIZ, NULL, &selh);
        selectComposableSels(i, L_VERT, NULL, &selv);
        snprintf(name, L_BUF_SIZE, "sel_comb_%dh", size);
        selaAddSel(sela, selh, name, 0);
        snprintf(name, L_BUF_SIZE, "sel_comb_%dv", size);
        selaAddSel(sela, selv, name, 0);
        prevsize = size;
    }
    return sela;
}
SELA * selaAddDwaCombs ( SELA * sela ) { char name [ L_BUF_SIZE ] ; l_int32 i , f1 , f2 , prevsize , size ; SEL * selh , * selv ; PROCNAME ( " " ) ; if ( ! sela ) { if ( ( sela = selaCreate ( 0 ) ) == NULL ) return ( SELA * ) ERROR_PTR ( " " , procName , NULL ) ; } prevsize = 0 ; for ( i = 4 ; i < 64 ; i ++ ) { selectComposableSizes ( i , & f1 , & f2 ) ; size = f1 * f2 ; if ( size == prevsize ) continue ; selectComposableSels ( i , L_HORIZ , NULL , & selh ) ; selectComposableSels ( i , L_VERT , NULL , & selv ) ; snprintf ( name , L_BUF_SIZE , " " , size ) ; selaAddSel ( sela , selh , name , 0 ) ; snprintf ( name , L_BUF_SIZE , " " , size ) ; selaAddSel ( sela , selv , name , 0 ) ; prevsize = size ; } return sela ; }
selaAddDwaCombs()
      Input:  sela (<optional>)
      Return: sela with additional sels, or null on error
selaAddDwaCombs () Input : sela ( <optional > ) Return : sela with additional sels or null on error