📄 imgshow.c
字号:
/****************************************************************************
File Name : imgshow.c
Purpose : to show image in _bin or SUN rater format
Date : Aug 31,1995
GSNAKE API is jointly developed by the Information Technology Institute (ITI), Singapore, and the School of Applied Science, Nanyang Technological
University (NTU), Singapore.
These software programs are available to the user without any license or royalty fees. Permission is hereby granted to use, copy, modify, and distribute this software and its documentation for any purpose. ITI and NTU gives no warranty, express, implied, or statuary for the software and/or documentation provided, including, without limitation, waranty of merchantibility and warranty of fitness for a particular purpose. The software provided hereunder is on an "as is" basis, and ITI and NTU has no obligation to provide maintenance, support, updates, enhancements, or modifications.
GSNAKE API is available for any UNIX compatible system. User feedback, bugs, or software and manual suggestions should be sent via electronic mail to one of the following, who may or may not act on them as he/she desires :
asschan@ntu.ac.sg
kflai@iti.gov.sg
***************************************************************************/
#include "xwindow.h"
#include "gsnake.h"
int GetMfactor(int , char**, int*);
void printhelp();
main(int argc, char **argv)
{
IMAGE myimage;
register short i;
int pos =0;
int Magnify;
char title[30] = "imgshow : ";
if (argc==1) printhelp();
else {
Magnify = GetMfactor(argc, argv, &pos);
for ( i=1; i<argc ; i++ ) {
if ( i != pos ) {
printf("\n\nReading image file : %s\n", argv[i]);
if ( !(myimage.read(argv[i])) ) {
/*
xwin_setTitle( argv[i] );
*/
myimage.show( Magnify );
printf("\nPress enter to continue");
getchar();
}
}
}
}
xwin_close();
}
/* GetMfactor returns the Magnification factor specified in the command line
It also returns the position of the -m command, so that it will not be read
as a file */
int GetMfactor( int ac, char *av[],int *p )
{
short register j;
int Mag = 1; /* magnification factor */
for (j=1;j<ac;j++) {
if (*av[j] == '-'){
if ( *(av[j]+1) =='M')
{
Mag = atoi(av[j]+2);
*p = j;
}
}
}
return (Mag);
}
void printhelp()
{
printf("\n\n Image show utility");
printf("\n Usage : imgshow <image> <image> ... -[option]");
printf("\n [ option ]");
printf("\n M : magnification factor, default 1.\n\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -