Leptonica 1.68
C Image Processing Library

xvdisp.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  * xvdisp.c
00018  *
00019  *   xv automatically downscales if necessary, to display the entire
00020  *   image without scrollbars.  Because xv downscaling is suboptimal,
00021  *   the image looks worse than it will actually look using our
00022  *   area mapping downscaling.
00023  *
00024  *   With xvdisp, we do the scaling, if necessary, and launch xv on
00025  *   the downscaled image.
00026  */
00027 
00028 #include <stdio.h>
00029 #include <stdlib.h>
00030 #include "allheaders.h"
00031 
00032 
00033 main(int    argc,
00034      char **argv)
00035 {
00036 PIX         *pixs;
00037 char        *filein;
00038 static char  mainName[] = "xvdisp";
00039 
00040     if (argc != 2)
00041         exit(ERROR_INT(" Syntax:  xvdisp filein", mainName, 1));
00042 
00043     filein = argv[1];
00044     if ((pixs = pixRead(filein)) == NULL)
00045         exit(ERROR_INT("pixs not made", mainName, 1));
00046             
00047     pixDisplay(pixs, 20, 20);
00048     pixDestroy(&pixs);
00049     return 0;
00050 }
00051 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines