src/sel1.c
static void
selaComputeCompositeParameters(const char  *fileout)
{
char    *str, *nameh1, *nameh2, *namev1, *namev2;
char     buf[L_BUF_SIZE];
l_int32  size, size1, size2, len;
SARRAY  *sa;
SELA    *selabasic, *selacomb;

    selabasic = selaAddBasic(NULL);
    selacomb = selaAddDwaCombs(NULL);
    sa = sarrayCreate(64);
    for (size = 2; size < 64; size++) {
        selectComposableSizes(size, &size1, &size2);
        nameh1 = selaGetBrickName(selabasic, size1, 1);
        namev1 = selaGetBrickName(selabasic, 1, size1);
        if (size2 > 1) {
            nameh2 = selaGetCombName(selacomb, size1 * size2, L_HORIZ);
            namev2 = selaGetCombName(selacomb, size1 * size2, L_VERT);
        }
        else {
            nameh2 = stringNew("");
            namev2 = stringNew("");
        }
        snprintf(buf, L_BUF_SIZE,
                 "      { %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\" },",
                 size, size1, size2, nameh1, nameh2, namev1, namev2);
	sarrayAddString(sa, buf, L_COPY);
        FREE(nameh1);
        FREE(nameh2);
        FREE(namev1);
        FREE(namev2);
    }
    str = sarrayToString(sa, 1);
    len = strlen(str);
    l_binaryWrite(fileout, "w", str, len + 1);
    FREE(str);
    sarrayDestroy(&sa);
    selaDestroy(&selabasic);
    selaDestroy(&selacomb);
    return;
}
/*!
 *  selaComputeCompParameters()
 *
 *      Input:  output filename
 *      Return: void 
 *
 *  Notes:
 *      (1) This static function was used to construct the comp_parameter_map[]
 *          array at the top of this file.  It is static because it does
 *          not need to be called again.  It remains here to show how
 *          the composite parameter map was computed.
 *      (2) The output file was pasted directly into comp_parameter_map[].
 *          The composite parameter map is used to quickly determine
 *          the linear decomposition parameters and sel names.
 */
selaComputeCompParameters()
Input:  output filename
Return: void

(1) This static function was used to construct the comp_parameter_map[]
array at the top of this file.  It is static because it does
not need to be called again.  It remains here to show how
the composite parameter map was computed.
(2) The output file was pasted directly into comp_parameter_map[].
The composite parameter map is used to quickly determine
the linear decomposition parameters and sel names.
selaComputeCompParameters () Input : output filename Return : void ( 1 ) This static function was used to construct the comp_parameter_map [] array at the top of this file . It is static because it does not need to be called again . It remains here to show how the composite parameter map was computed . ( 2 ) The output file was pasted directly into comp_parameter_map [] . The composite parameter map is used to quickly determine the linear decomposition parameters and sel names .
static void
selaComputeCompositeParameters(const char  *fileout)
{
char    *str, *nameh1, *nameh2, *namev1, *namev2;
char     buf[L_BUF_SIZE];
l_int32  size, size1, size2, len;
SARRAY  *sa;
SELA    *selabasic, *selacomb;
    selabasic = selaAddBasic(NULL);
    selacomb = selaAddDwaCombs(NULL);
    sa = sarrayCreate(64);
    for (size = 2; size < 64; size++) {
        selectComposableSizes(size, &size1, &size2);
        nameh1 = selaGetBrickName(selabasic, size1, 1);
        namev1 = selaGetBrickName(selabasic, 1, size1);
        if (size2 > 1) {
            nameh2 = selaGetCombName(selacomb, size1 * size2, L_HORIZ);
            namev2 = selaGetCombName(selacomb, size1 * size2, L_VERT);
        }
        else {
            nameh2 = stringNew("");
            namev2 = stringNew("");
        }
        snprintf(buf, L_BUF_SIZE,
                 "      { %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\" },",
                 size, size1, size2, nameh1, nameh2, namev1, namev2);
	sarrayAddString(sa, buf, L_COPY);
        FREE(nameh1);
        FREE(nameh2);
        FREE(namev1);
        FREE(namev2);
    }
    str = sarrayToString(sa, 1);
    len = strlen(str);
    l_binaryWrite(fileout, "w", str, len + 1);
    FREE(str);
    sarrayDestroy(&sa);
    selaDestroy(&selabasic);
    selaDestroy(&selacomb);
    return;
}
static void selaComputeCompositeParameters ( const char * fileout ) { char * str , * nameh1 , * nameh2 , * namev1 , * namev2 ; char buf [ L_BUF_SIZE ] ; l_int32 size , size1 , size2 , len ; SARRAY * sa ; SELA * selabasic , * selacomb ; selabasic = selaAddBasic ( NULL ) ; selacomb = selaAddDwaCombs ( NULL ) ; sa = sarrayCreate ( 64 ) ; for ( size = 2 ; size < 64 ; size ++ ) { selectComposableSizes ( size , & size1 , & size2 ) ; nameh1 = selaGetBrickName ( selabasic , size1 , 1 ) ; namev1 = selaGetBrickName ( selabasic , 1 , size1 ) ; if ( size2 > 1 ) { nameh2 = selaGetCombName ( selacomb , size1 * size2 , L_HORIZ ) ; namev2 = selaGetCombName ( selacomb , size1 * size2 , L_VERT ) ; } else { nameh2 = stringNew ( " " ) ; namev2 = stringNew ( " " ) ; } snprintf ( buf , L_BUF_SIZE , " \" \" \" \" \" \" \" \" " , size , size1 , size2 , nameh1 , nameh2 , namev1 , namev2 ) ; sarrayAddString ( sa , buf , L_COPY ) ; FREE ( nameh1 ) ; FREE ( nameh2 ) ; FREE ( namev1 ) ; FREE ( namev2 ) ; } str = sarrayToString ( sa , 1 ) ; len = strlen ( str ) ; l_binaryWrite ( fileout , " " , str , len + 1 ) ; FREE ( str ) ; sarrayDestroy ( & sa ) ; selaDestroy ( & selabasic ) ; selaDestroy ( & selacomb ) ; return ; }
selaComputeCompParameters()
      Input:  output filename
      Return: void
selaComputeCompParameters () Input : output filename Return : void