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 * converttops.c 00018 * 00019 * Syntax: converttops filein fileout [level] 00020 * 00021 * where level = {1,2,3} and 2 is the default 00022 */ 00023 00024 #include <stdio.h> 00025 #include <stdlib.h> 00026 #include "allheaders.h" 00027 00028 00029 main(int argc, 00030 char **argv) 00031 { 00032 char *filein, *fileout; 00033 char error_msg[] = " ps level = {1,2,3}; level 2 is default"; 00034 l_int32 level; 00035 PIX *pix, *pixs; 00036 static char mainName[] = "converttops"; 00037 00038 if (argc != 3 && argc != 4) { 00039 fprintf(stderr, "Syntax: converttops filein fileout [level]\n"); 00040 fprintf(stderr, "%s\n", error_msg); 00041 return 1; 00042 } 00043 00044 filein = argv[1]; 00045 fileout = argv[2]; 00046 00047 level = 2; 00048 if (argc == 4) { 00049 level = atoi(argv[3]); 00050 if (level != 1 && level != 2 && level != 3) { 00051 L_WARNING("ps level must be 1, 2 or 3; setting to 2", mainName); 00052 level = 2; 00053 } 00054 } 00055 00056 convertToPSEmbed(filein, fileout, level); 00057 return 0; 00058 } 00059 00060