Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : HELP.C

 
Output of file : HELP.C contained in archive : IMDSRC78.ZIP
/*** IMDISP module HELP.C

HELP.C contains the command which services help requests from
the IMDISP main menu. All help text for new commands goes here.

***/

#define __MSC

/* * * * INCLUDE files * * * */

#include
#include
#include "imdef.h"
#include "imdisp.h"
#include "dispio.h"
#include "labutil.h"
#include "textutil.h"

/* * * * External functions * * * */

/* * * * Function declarations * * * */

int GiveHelp (void);
void NextPage (void);

/* * * * Global Variables * * * */

/*
* dispnl = 200 -> 15 text lines/display
* dispnl = 350 -> 23 text lines/display
* dispnl = 400 -> 30 text lines/display
* dispnl = 480 -> 30 text lines/display
* dispnl = 600 -> 30 text lines/display
* dispnl = 768 -> 30 text lines/display
*/

int GiveHelp (void)
{
int command;


if (OneScreen)
{
ClearDisplay (0);
TextLine = TextHeight + 5;
TextSample = 1;
}

command = GetCommand (&CommandString[4],
"FIL DIS ERA SET HIS PAL STR CUR PRO REF HEL EXI QUI DON BAT SAV "
"CD DIR TYP SYS > MEN LAB TEX OVE BRO PLO SER PRI NEG BRI DAR "
"ENH SLA LOG PER COP MER MAS WIN ROT");

switch (command)
{
case 0 :
WriteText ("The following commands are available :");
WriteText ("BATch . . . . to execute a batch command file");
WriteText ("BRIghten . . . . add n to each DN value");
WriteText ("BROwse . . . . to display multiple files");
WriteText ("CD . . . . MSDOS change directory command");
WriteText ("COPy . . . . copy image to an internal buffer");
WriteText ("CURsor . . . . to move the cursor around");
WriteText ("DARken . . . . subtract n to each DN value");
WriteText ("DIR . . . . MSDOS directory command");
WriteText ("DISplay . . . . to display the image");
WriteText ("ENHance name . . . . filter the image");
WriteText ("ERAse . . . . to erase the display");
WriteText ("EXIt or QUIt . . . . to exit from the program");
WriteText ("FILe . . . . to specify the name of the image");
WriteText ("HIStogram . . . . to display the histogram of the image");

if (dispnl <= 200) /* 15 lines */
NextPage();

WriteText ("LABel . . . . to show image label");
WriteText ("LOG . . . . to save commands to a text file");
WriteText ("MASk . . . . to mask off pixels in the image");
WriteText ("MENu . . . . to invoke menu list");
WriteText ("MERge . . . . to combine internal buffers");
WriteText ("NEGative . . . . to photo negative the image");
WriteText ("OVErlay . . . . to draw grid lines on image");
WriteText ("PALette . . . . to adjust the palette for the display");
WriteText ("PERspective . . . . to display a pseudo-3D plot of the image");

if ((dispnl > 200) && (dispnl <= 400))
NextPage();

WriteText ("PLOt . . . . to display and plot spectral data");
/* WriteText ("PRInt . . . . to print out the image"); */
WriteText ("PROfile . . . . to plot a profile of the image");
WriteText ("REFresh . . . . to refresh the image plane");
WriteText ("ROTate . . . . to rotate a piece of the image");
WriteText ("SAVe . . . . to save the image display to a file");
/* WriteText ("SERial . . . . to send commands to the serial port"); */
WriteText ("SET . . . . to set display options");
WriteText ("SLAnt . . . . displays the image slanted left/right");

if ((dispnl <= 200) || (dispnl > 400)) /* 30 lines */
NextPage();

WriteText ("STRetch . . . . to do a linear gray scale stretch");
WriteText ("SYStem . . . . to execute MSDOS commands");
WriteText ("TEXt . . . . to place text on screen");
WriteText ("TYPe . . . . MSDOS type command");
WriteText ("WINdow . . . . to mark of a subimage on the display");
WriteText (" ");
WriteText ("Only the capitalized letters are required for the command.");
WriteText ("The commands take optional keywords and values.");
WriteText (" The syntax is: COMMAND KEY1=VAL1 KEY2 VAL2 . . .");
WriteText (" ");
WriteText ("You can recall previous commands with the up arrow key.");
WriteText ("Recalled command lines can then be edited.");
WriteText (" ");
WriteText ("Type 'HELP command' for help on a particular command.");
break;

case 1 :
WriteText ("FILE takes a required string value, i.e. the file name");
WriteText ("FILE without filename enters file prompt mode");
WriteText ("FILE with a filename mask enters file prompt mode with");
WriteText (" only the matching filenames");
WriteText ("FILE also takes the following keyword: ");
WriteText (" ");
WriteText ("NOMemory forces FILE to read the image from disk, even");
WriteText (" if the image is already in XMS memory");
break;
case 2 :
WriteText ("DISPlay takes the following keywords:");
WriteText (" ");
WriteText ("SUBsample a positive integral subsampling factor");
WriteText ("ZOOm a positive integral zoom factor");
WriteText ("CENter to display area around cursor");
WriteText ("AUToset to automatically set dnlow and dnhigh to some");
WriteText (" percent n (def. 5 percent), based on histogram");
WriteText ("NL NS number of lines and samples to display in image");
WriteText ("SL SS starting line and sample in image");
WriteText ("LEFT RIGHT move starting sample left or right from previous");
WriteText ("UP DOWN move starting line up or down from previous");
WriteText ("DSL DSS starting line and sample on display");
WriteText ("FLIp flips the image top-to-bottom");
WriteText ("SOUrce displays the source file, if given in the label");
WriteText (" for Mars MDIM and Magellan F-MIDR only");
WriteText ("NOPrompt command line prompt is not displayed");
break;
case 3 :
WriteText ("ERAse takes no parameters");
break;
case 4 :
WriteText ("SET takes the following keywords :");
WriteText (" ");
WriteText ("DNLOw DNHIgh the DN range to compress into display pixel");
WriteText (" Use no parameters to see the current values");
WriteText ("BROwse fname sets the default filename for use with BROWSE");
WriteText ("SELect fname sets default filename for use with BROWSE SELECT");
WriteText ("PALette dir sets default palette directory name for use with");
WriteText (" PAL LOAD command");
WriteText ("NS = n sets the number of samples/line for display");
WriteText ("SWAP swaps bytes when reading the image (>8 bits)");
WriteText ("UNSWAP resets SWAP, so bytes aren't swapped");
WriteText ("REFRESH ON turns on the refresh buffer");
WriteText ("REFRESH OFF turns off the refresh buffer");
WriteText ("DELay ON for batch files - pauses before executing a line");
WriteText ("DELay OFF for batch files - no pause before executing a line");
WriteText ("PROmpt ON for batch files - enables display of each command");
WriteText ("PROmpt OFF for batch files - disables display of each command");
if (dispnl < 300)
{
WriteText ("Press any key to continue>>");
getch();
ClearDisplay (0);
TextLine = TextHeight + 5; TextSample = 1;
}
WriteText ("DISplay vname changes the display type to the one specified.");
WriteText (" Standard graphics modes supported:");
WriteText (" CGA (640x200x2) EGA (640x350x16)");
WriteText (" EGA480 (640x480x16) VGA320 (320x200x256)");
WriteText (" VGA (640x480x16)");

if (dispnl < 400)
NextPage();

WriteText (" Super VGA supported for the following:");
WriteText (" ATI640 (640x480x256) - ATI VGA Wonder Board");
WriteText (" ATI800 (800x600x256) - ATI VGA Wonder Board");
WriteText (" ATI1024 (1024x768x16) - ATI VGA Wonder Board");
WriteText (" EVGA512 (512x480x256) - Everex Board");
WriteText (" EVGA640 (640x480x256) - Everex Board");
WriteText (" ORCHID (640x480x256) - Orchid Board");
WriteText (" ORCHID800 (800x600x256) - Orchid Board");
WriteText (" ORCHID1024 (1024x768x256) - Orchid Board");

if (dispnl > 400)
NextPage();

WriteText (" PARADISE (640x400x256) - Paradise Board 256K");
WriteText (" (640x480x256) - Paradise Board 512K");
WriteText (" TRIDENT (800x600x256) - Trident SVGA Boards");
WriteText (" PGA (640x480x256) - PGA Board");
WriteText (" Use the DOS SET command before starting IMDISP to set the default");
WriteText (" display type. EG: SET IMDISP=VGA will start up in VGA mode.");

break;
case 5 :
WriteText ("HISTogram takes the following keywords :");
WriteText (" ");
WriteText ("SUBsample a integral subsample factor for speed");
WriteText ("NL NS number of lines and samples from image");
WriteText ("SL SS starting line and sample in image");
WriteText ("CENter do histogram on displayed portion of image");
WriteText ("VOY Use histogram from standard PDS Voyager image");
WriteText ("VIK Use histogram from standard PDS Viking image");
WriteText ("COL draw histogram using current color settings");
break;
case 6 :
WriteText ("PALette takes the following keywords :");
WriteText (" ");
WriteText ("EDIt = n to interactively adjust n color palette");
WriteText (" using the arrow keys on numeric keypad:");
WriteText (" left(4) and right(6) move to different palette color,");
WriteText (" ^left and ^right move to colors in larger steps,");
WriteText (" HOME and END move to the beginning/end colors,");
WriteText (" up(2), down(8) to increment/decrement all colors,");
WriteText (" letters R, r, G, g, B, b to incr/decr the color, ");
WriteText (" invert the palette with x or X, scroll with S or s, ");
WriteText (" and . or carriage return to end.");
WriteText ("PSeudo color PS = 0 for default palette");
WriteText (" PS = 1 for gray scale palette");
WriteText (" PS = 2 IBM EGA palette");
WriteText (" PS = 3 Redorange PS = 4 Prism");
WriteText (" PS = 5 Topo PS = 6 Contour");
WriteText (" PS = 7 BGRY PS = 8 Glasses1");
WriteText (" PS = 9 Glasses2 PS =10 Perspective");
WriteText ("SAVe = file saves palette in text file");
WriteText ("LOAd = file loads palette from file, if no file is ");
WriteText (" blank, then prompt mode is entered");

if ((dispnl > 200) && (dispnl <= 400))
NextPage();

WriteText ("DISplay displays the current palette on the screen");
WriteText ("ERAse erases the current palette from the screen");
WriteText ("CYCle number Cycle color palette, S or s saves the palette");
WriteText (" CYC = 0 Blink CYC = 1 Blink 4 times");
WriteText (" CYC = 2 Rotate left CYC = 3 Rotate right");
WriteText (" CYC = 4 Rotate+random CYC = 5 Random");
WriteText (" CYC = 6 Double rotate CYC = 7 Random swap ");
WriteText (" FAST delay .1 seconds between cycles");
WriteText (" instead of the default .3 seconds");
WriteText (" TIME n to cycle for n seconds");
break;
case 7 :
WriteText ("STREtch takes the following keywords :");
WriteText (" ");
WriteText ("LOw, HIgh the low and high DN values of the stretch");
WriteText (" e.g. STRET HI=128 for a stretch between 0 and 128");
break;
case 8 :
WriteText ("CURSor takes the following keywords:");
WriteText (" ");
WriteText ("DSL, DSS place the cursor at the specified display");
WriteText (" line and sample location");
WriteText (" ");
WriteText ("Use the mouse or numeric keypad to move the cursor");
WriteText (" around, '-' and '+' to change the cursor step size, ");
WriteText (" and '.' or carriage return to end.");
break;
case 9 :
WriteText ("PROFile takes no parameters");
WriteText ("Use the mouse or numeric keypad to move the cursor");
WriteText (" around, '-' and '+' to change the cursor step size, ");
WriteText (" '.' or carriage return to select the first and second points");
break;
case 10 :
WriteText ("REFResh takes no parameters");
WriteText ("Redisplays the images from the refresh buffer");
WriteText ("and erases any graphics currently on the screen.");
break;
case 15 :
WriteText ("BATch takes the following keywords :");
WriteText (" ");
WriteText ("filename filename of batch command file");
break;
case 16 :
WriteText ("SAVe takes the following keywords :");
WriteText (" ");
WriteText ("filename filename of image to save. If the filename");
WriteText (" has the extension GIF, the file will be");
WriteText (" saved in GIF format. Be patient - it takes");
WriteText (" time.");
WriteText ("FORmat GIF/RAW/PDS saves the screen in the specified format");
WriteText ("REFRESH saves the screen to the refresh buffer");
WriteText ("NL NS number of lines and samples to save");
WriteText ("SL SS starting line and sample to save");
WriteText ("BP number of bits per pixel in output image");
break;
case 17 :
case 18 :
case 19 :
case 20 :
case 21 :
WriteText ("The following MSDOS commands are supported:");
WriteText (" ");
WriteText ("drive letter: Change default drive to specified letter");
WriteText ("CD path MSDOS change directory command");
WriteText ("DIR mask MSDOS directory command");
WriteText ("TYPe filename MSDOS type command");
WriteText ("SYStem or > Spawns an MSDOS process");
WriteText ("SYStem name executes program name");
break;
case 22 :
WriteText ("MENu takes the following keywords :");
WriteText (" ");
WriteText ("filename filename of menu list file");
break;
case 23 :
WriteText ("LABel prints the label for the current PDS or FITS");
WriteText ("format image.");
break;
case 24 :
WriteText ("TEXt takes the following format :");
WriteText (" ");
WriteText ("LINe line number to position text at");
WriteText ("SAMple sample number to position text at");
WriteText ("TEXT 'text to type out on screen' ");
break;
case 25 :
WriteText ("OVErlay takes the following keywords :");
WriteText (" ");
WriteText ("MAXLAT the upper left latitude of the current image");
WriteText ("MAXLON the upper left longitude of the current image");
WriteText ("LEGend draw a legend with the current color assignments");
WriteText ("DN the dn value to use for drawing grid lines");
break;
case 26 :
WriteText ("BROwse takes the following keywords :");
WriteText (" ");
WriteText ("mask a wildcard (ie. *.IMG) to select files to browse");
WriteText ("SIZE the size to use for displaying multiple images");
WriteText ("SUB a subsampling factor to use to display images");
WriteText (" ie. 'SUB 2' scales the image to half size");
WriteText ("AUToset to automatically set dnlow and dnhigh to some");
WriteText (" percent n (def. 5 percent), based on histogram");
WriteText ("NOLabel do not put the filename label on displayed images");
WriteText ("DNLow DNHigh sets the DN range for all images (see SET)");
WriteText ("PAUse n pauses display for n seconds when the screen gets full");
WriteText ("ALL searches all subdirectories in addition to");
WriteText (" the current directory");
WriteText ("SELect interactively selects files as they are being");
WriteText (" displayed and writes the filenames out to a");
WriteText (" select file");
WriteText ("FILe fname select files to browse from a file instead of");
WriteText (" using a mask");
break;
case 27:
WriteText("PLOt takes the following keywords :");
WriteText (" ");
WriteText ("LIN n plot line n of the image (2-D file only)");
WriteText ("SYMbol x draw the plot using character x instead of a line");
WriteText ("ZOOm prompt user to zoom the plot");
WriteText ("OVErlay overplot - do not erase the current plot");
WriteText ("CENter plot the image line containing the cursor");
WriteText ("MAX n set the maximum value in the plot");
WriteText ("MIN n set the minimum value in the plot");
WriteText ("COLor n use DN value n to plot the data");
break;
case 28 :
WriteText ("SERial takes the following keywords :");
WriteText (" ");
WriteText ("INIt initialize the serial port");
WriteText ("COM n set COMn as the serial port to use");
WriteText ("BAUd n set the baud rate to n");
WriteText ("COMmand 'string' write 'string' out the serial port");
break;
case 29 :
WriteText ("PRInt takes the following keyword :");

WriteText (" ");
WriteText ("TEK4693 use the Tektronix 4693DX driver");
break;
case 30 :
WriteText ("NEGative takes no parameters");
break;
case 31 :
WriteText ("BRIghten n adds n to every pixel in the image");
WriteText (" The default is 10% of the total range, i.e.,");
WriteText (" 2 for a 16 color display, 26 for a 256 color");
break;
case 32 :
WriteText ("DARken n subtracts n from every pixel in the image");
WriteText (" The default is 10% of the total range, i.e.,");
WriteText (" 2 for a 16 color display, 26 for a 256 color");
break;
case 33 :
WriteText ("ENHance takes the following keywords:");
WriteText (" ");
WriteText ("BAAlke applies a custom filter developed by Ron Baalke");
WriteText ("CONvolution n applies one of 2 weighted 3x3 filter to the image");
WriteText ("EDGe n applies one of 4 3x3 edge enhancement filters");
WriteText ("HIGh n applies a high pass filter to the image");
WriteText ("HISt applies histogram equalization to the image");
WriteText ("LOG n applies a logarithmic filter to the image");
WriteText ("MEAn n applies one of 3 mean filters to the image");
WriteText ("MEDian applies a 3x3 median filter to the image");
WriteText ("POWer n applies an exponential filter to the image");
WriteText ("STAir n applies a stairstep smoothing to the image");
WriteText ("SMEar applies a smearing filter to the image");
WriteText ("UNSharp applies an unsharp mask filter to the image");
WriteText ("SCReen applies the filter only to the image on the");
WriteText (" screen, instead of the entire image");
break;
case 34:
WriteText ("SLAnt takes the following keywords:");
WriteText (" ");
WriteText ("LEFt displays the image slanted to the left");
WriteText ("RIGht displays the image slanted to the right (default)");
WriteText ("SCReen slants the image currently on the screen");
break;
case 35:
WriteText ("LOG takes the following keywords:");
WriteText (" ");
WriteText ("ON saves entered commands to the file IMDISP.LOG");
WriteText ("FILe name saves entered commands to the file named");
WriteText ("OFF closes the log file (same as CLOse)");
WriteText ("CLOse closes the log file (same as OFF)");
break;
case 36:
WriteText ("PERspective takes the following keywords:");
WriteText (" ");
WriteText ("SL n starting line of the image");
WriteText ("SCR reads image from the screen buffer");
break;
case 37:
WriteText ("COPy uses buffers named A through Z. COPy has these forms:");
WriteText (" ");
WriteText ("COPy buffer [FILE] copies last displayed image to the");
WriteText (" buffer specified (may be a disk file");
WriteText (" ");
WriteText ("COPy source TO buffer [FILE] where source can be SCREEN");
WriteText (" or another buffer");
break;
case 38:
WriteText ("MERge combines buffers or images. MERge has these forms:");
WriteText (" ");
WriteText ("MERGE buffer Merge last displayed image with the buffer");
WriteText (" named and display the result");
WriteText (" ");
WriteText ("MERge source1 [scale1] WITH source2 [scale2] [TO buffer] [FILE]");
WriteText (" to perform image arithmetic");
break;

case 39:
WriteText ("MASk substitutes a value for all pixels above or below a");
WriteText (" specified value. MASk takes the following keywords:");
WriteText (" ");
WriteText ("LO n sets all pixels with a DN less than n to 0");
WriteText ("HI n sets all pixels with a DN greater than n to 255");
WriteText ("WITh n sets the pixels to value n instead of the default");
break;

case 40:
WriteText ("WINdow sets the limits of a subimage by marking out a box");
WriteText (" on the screen. WINdow takes the following keywords:");
WriteText (" ");
WriteText ("CANcel sets the default back to the entire screen");
WriteText ("L1 sets the first line of the window");
WriteText ("L2 sets the last line of the window");
WriteText ("S1 sets the first sample of the window");
WriteText ("S2 sets the last sample of the window");
break;

case 41:
WriteText ("ROTate n rotates the image or subimage through the specified");
WriteText (" angle. ROTate takes the following keywords:");
WriteText (" ");
WriteText ("SCReen rotates the screen, rather than the entire image ");
WriteText ("CLIp trims off pieces of the image off the screen");
WriteText ("NOFill don't blank out the empty parts of the result");
break;
}
WriteText (" ");
}

void NextPage (void)
{
WriteText ("Press any key to continue>>");
getch();
ClearDisplay (0);
TextLine = TextHeight + 5;
TextSample = 1;
}


  3 Responses to “Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : HELP.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/