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 * fhmtautogen.c 00018 * 00019 * This program is used to generate the two files. 00020 * If filename is not given, the files are: 00021 * fhmtgen.<n>.c 00022 * fhmtgenlow.<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 hit-miss dwa 00027 * operations for all sels generated by selaAddHitMiss(). 00028 * 00029 * The library files fhmtgen.1.c and fhmtgenlow.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[] = "fhmtautogen"; 00042 00043 if (argc != 2 && argc != 3) 00044 exit(ERROR_INT(" Syntax: fhmtautogen index <filename>", mainName, 1)); 00045 00046 index = atoi(argv[1]); 00047 filename = NULL; 00048 if (argc == 3) 00049 filename = argv[2]; 00050 00051 sela = selaAddHitMiss(NULL); 00052 if (fhmtautogen(sela, index, filename)) 00053 return 1; 00054 00055 selaDestroy(&sela); 00056 return 0; 00057 } 00058