Leptonica 1.68
C Image Processing Library
|
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 * fmorphautogen.c 00018 * 00019 * This program is used to generate the two files. 00020 * If filename is not given, the files are: 00021 * fmorphgen.<n>.c 00022 * fmorphgenlow.<n>.c 00023 * where <n> is the input index. Otherwise they are: 00024 * <filename>.<n>.c 00025 * <filename>low.<n>.c 00026 * These two files, when compiled, implement dwa operations for 00027 * all sels generated by selaAddBasic(). 00028 * 00029 * The library files fmorphgen.1.c and fmorphgenlow.1.c 00030 * were made using index = 1. 00031 */ 00032 00033 #include "allheaders.h" 00034 00035 main(int argc, 00036 char **argv) 00037 { 00038 char *filename; 00039 l_int32 index; 00040 SELA *sela; 00041 static char mainName[] = "fmorphautogen"; 00042 00043 if (argc != 2 && argc != 3) 00044 exit(ERROR_INT(" Syntax: fmorphautogen index <filename>", 00045 mainName, 1)); 00046 00047 index = atoi(argv[1]); 00048 filename = NULL; 00049 if (argc == 3) 00050 filename = argv[2]; 00051 00052 sela = selaAddBasic(NULL); 00053 if (fmorphautogen(sela, index, filename)) 00054 return 1; 00055 00056 selaDestroy(&sela); 00057 return 0; 00058 } 00059