Leptonica 1.68
C Image Processing Library

fcombautogen.c

Go to the documentation of this file.
00001 /*====================================================================*
00002  -  Copyright (C) 2001 Leptonica.  All rights reserved.
00003  -  This software is distributed in the hope that it will be
00004  -  useful, but with NO WARRANTY OF ANY KIND.
00005  -  No author or distributor accepts responsibility to anyone for the
00006  -  consequences of using this software, or for whether it serves any
00007  -  particular purpose or works at all, unless he or she says so in
00008  -  writing.  Everyone is granted permission to copy, modify and
00009  -  redistribute this source code, for commercial or non-commercial
00010  -  purposes, with the following restrictions: (1) the origin of this
00011  -  source code must not be misrepresented; (2) modified versions must
00012  -  be plainly marked as such; and (3) this notice may not be removed
00013  -  or altered from any source or modified source distribution.
00014  *====================================================================*/
00015 
00016 /*
00017  * fcombautogen.c
00018  *
00019  *    This program is used to generate the two files of dwa code for combs,
00020  *    that are used in linear composite dwa operations for brick Sels.
00021  *    If filename is not given, the files are:
00022  *         dwacomb.<n>.c
00023  *         dwacomblow.<n>.c
00024  *    Otherwise they are:
00025  *         <filename>.<n>.c
00026  *         <filename>low.<n>.c
00027  *    where <n> is the input index.
00028  *    These two files, when compiled, are used to implement all
00029  *    the composite dwa operations for brick Sels, that are
00030  *    generated by selaAddDwaCombs().
00031  *
00032  *    The library files dwacomp.2.c and dwacomblow.2.c were made
00033  *    using <n> = 2.
00034  */
00035 
00036 #include "allheaders.h"
00037 
00038 main(int    argc,
00039      char **argv)
00040 {
00041 char        *filename;
00042 l_int32      index, ret;
00043 SELA        *sela;
00044 static char  mainName[] = "fcombautogen";
00045 
00046     if (argc != 2 && argc != 3)
00047         exit(ERROR_INT(" Syntax:  fcombautogen index <filename>",
00048                        mainName, 1));
00049 
00050     index = atoi(argv[1]);
00051     sela = selaAddDwaCombs(NULL);
00052 
00053     if (argc == 2)
00054         filename = stringNew("dwacomb");
00055     else
00056         filename = argv[2];
00057     ret = fmorphautogen(sela, index, filename);
00058 
00059     if (argc == 2)
00060         lept_free(filename);
00061     selaDestroy(&sela);
00062     return ret;
00063 }
00064 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines