WXP version 5
Program Reference

WXPLOOP

Sections

NAME

wxploop - WXP loop and overlay program

SYNOPSIS

wxploop [parameters] [files...]

PARAMETERS

Command Line Resource Default Description
-h help No Lists basic help information.
-df=filename default .wxpdef Sets the name of the resource file.
-na=name name wxploop Specifies the name used in resource file parsing.
-ba batch No Run program in batch mode
-me=level message out2 Specifies level of messages to be displayed
-wn=window window_num 0 Specifies the window number. This sets up a unique route between this program and WXPloop so that WXPloop can be run multiple times simultaneously.
-pd=domain plot_domain None
This specifies the plotting domain. The projection, aspect ratio and the domain size are specified.
-cd=commands command None Specifies a list of commands to execute.
-pp=param[,param...] plot_param None Specifies additional plotting parameters. See the plot_param resource for more details.
-fl=font_list font_list modern.fnt Specifies a list of fonts to use in the plots.
-ct=color_table color_table wxp.clr Specifies the color table to use in the plot. This maps color names to actual RGB color values.
-ti=title title Program name Specifies the window title.
-ic icon Off Specifies whether to open window in iconified mode.
-bg=color background black
white for inverse plots
Specifies the background color of the window.
-ge=geometry geometry 640x480 Specifies the window and paper geometry.
files ... filename None Specifies the files to load into the WXPloop window. Specifying more than one will create a loop.

DESCRIPTION

The WXPloop program is a program set up to allow multiple WXP programs to overlay graphics and produce loops. The program offers a window to other WXP programs so that their graphics can be drawn to that window.  Also the program uses the concept of a pixmap which is an allocated portion of memory that emulates a window to create pseudo windows which can be looped or animated. Once WXPloop runs, a single main window can be opened, but several pixmaps can be also be created (up to 128). Sequencing through these pixmaps will give the sense of animation.

Information can be drawn onto the window or a pixmap in one of three ways:

WXPloop can be run in one of two operational modes: interactive and batch

Interactive Mode

Interactive mode allows the user to communicate with the WXPloop program, issuing commands to it via the loopset program. Once WXPloop is started, a message queue is opened allowing communications with the loopset program. This message queue key ID is a positive integer number set by the window_num resource. More than one WXPloop program can be running but each must have a unique window_num.  If a queue exists for a particular window number and WXPloop is run, the program will exit with a message "Unable to create message queue". At this point, either the queue must be deleted or another window number must be picked.  The "loopset alloc" command will return the next available window number after 20.

The program is initially in STOP mode and runs any commands passed through the command line (command resource). Then, the program will load into a loop, any image files specified on the command line. After the images are loaded, the program animates those images and waits for commands to be entered via loopset where pixmaps can be created and deleted, images annotated and loop parameters changed.

At any point through loopset, a window ID of the main window can be queried. This window ID can then be passed to any WXP graphics program by specifying the window device.

Example return: +8627531:8627533:800x600 or +8627531:8627533 (if size is the default 640x512)

Also, pixmaps can be created. The pixmap ID can be queried and graphics drawn directly to the pixmap by specifying its ID and size to the device resource.

Batch Mode

WXPloop can also be run in a batch mode. If the following command is entered:

   wxploop -wn=-1 -ba

By specifying a window number of -1, the WXPloop program does not open up a message queue. This alleviates the problem of having to allocate a different message queue for each WXPloop window. Obviously, this lack of interactivity limits the capability of WXPloop. This configuration is optimal for simple overlay displays and cannot be used for animation since there is no way to create pixmaps with a shell script.

The program will run those commands pass on the command line and load any images in listed on the command line. The WXPloop program opens the main window and titles the window "wxp_win". The program will then print the window ID of the main window allowing WXP programs to access that window with the window specification under the device resource.

+8627531:8627533:800x600

Then the WXPloop program will automatically background itself. This way, the window ID can be set to a shell variable and passed to another graphics program. Manual backgrounding is not necessary with "&" on the command line and is also not recommended.

The window ID information can also be written to a file if the filename is specified with the window_num resource "-wn=filename". The filename is then specified with the device resource "-de=w,,filename".

Keyboard and Mouse Controls

STOP GRAPHICS MODE
Once WXPloop is started, it defaults to STOP mode. In this mode, just the main X window is active. No animation is possible. Different images in the loop can be viewed, however. Some important mouse and keyboard commands are:

Keyboard/Mouse Command
<RightButton> Display next image in loop
<LeftButton> Display previous image in loop
<MiddleButton> Toggle to LOOP mode
<Meta>d Delete current image in loop
<Meta>z Zoom image around cursor 2x
<Meta>g Saves window to a GIF file
<Meta>x Saves window to a XWD file
<Meta>q Quit WXPloop
<Enter> Quit WXPloop

The cursor is a circle (X11) or arrow (Win32).

LOOP GRAPHICS MODE
In this mode, pixmaps are copied into the main window in a set order. Any information previously displayed to the main window will be destroyed. Some important mouse/keyboard commands are:

Keyboard/Mouse Command
<RightButton> Reduce delay between pixmaps by .1 seconds
<LeftButton> Increase delay by .1 seconds
<MiddleButton> Toggle to STOP mode
<Meta>z Zoom image around cursor 2x
<Meta>g Saves all pixmaps to GIF files
<Meta>x Saves all pixmaps to XWD files
<Meta>q Quit WXPloop
<Enter> Quit WXPloop

The cursor is two arrows pointing beginning to end (X11 exchange cursor) or an up/down arrow (Win32). Zooms in loop mode are done on the fly to preserve the integrity of the original image.

Loopset Program

The loopset program allows WXPloop's parameters to be changed. A IPC channel is used to communicate with the ingest program. When the loopset program establishes a connection with wxploop, the following prompt will appear:

   Message queue opened (id:nnnnnn)
   Connected to WXPloop program
      Type help for help
   Message:1: 

At this point, you may enter a WXPloop command. To see the list of WXPloop commands, check the wxploop command documentation. The loopset program continues to accept dataset commands until "quit" or "exit" commands are entered. If a valid command is specified from the resource file or command line, only that command will be processed and the program will exit.

Drawing

WXPloop allows the user to annotate images using the drawing commands available through loopset. These allow the user to draw lines, plot markers or text. There is a full range of set attribute commands to change colors, styles, sizes, etc. The drawing canvas is based on the viewport and window concept. There are 3 defined transformations that can be used:

0 - Pixel coordinate system (0-width,0-height) where 0,0 is in the upper left corner.

1 - Normalized coordinates (0-1, 0-1) where 0,0 is at the lower left and the extent is 0 to 1 for the largest side and a value less than 1 for the smaller side.

2 - Map coordinates where the mapping is based on the domain specified either through the plot_domain resource or through the "set domain" command.

Zooming Images

Images can be zoomed in either STOP or LOOP mode with <Meta>z. Each zoom enlarges the image at the cursor position 2x. There is a limit of 1024x on enlargement. In loop mode, the zoom is performed before each image is displayed in the window. These are not cached because contents of original unzoomed window may be changing during the zoom. Also, this avoids the extra memory requirements necessary to cache all the zoomed images.

Colors

WXPloop starts with no defined colors. If a color table is specified with the color_table resource, it is loaded into the program and those colors fixed. To use any other colors, a color table must be set up by directing WXPloop to read in a color table file with the "color" command. This will first, allocate those colors so that they cannot change if another program is run and second, set up those colors to be used by the internal WXPloop annotation commands.

NOTE: When plotting graphics to a WXPloop window or pixmap, it is highly recommended to allocate all colors used in the final graphic by using the "color" command. If this is not done, no colors are allocated and therefore fixed in the server's color table. Even though each WXP program allocates its own colors, these only remain allocated for the duration of each graphics program which is independent of WXPloop. Once the graphics program exits, the colors are deallocated and those colors displayed on a WXPloop window or pixmap may be changed by the next program that wishes to allocate colors. Running the "color" command in WXPloop will allocate/lock those colors in the color table. If a graphic uses multiple color table, the "color" must be run again to allocate the other color tables. This command does not deallocate any previous colors.

Saving Loops

Once a loop has been created, it can be saved to a GIF (Graphics Interchange Format used by Compuserve -- Default) or X window dump files with the save command. The specified filename is sent through the file name convention function. Keys include "%p" for program name and "%i" for frame index. Then these files can be read back into WXPloop later on and again animated. WXPloop will read and write image files for 1,4, 8, 16 and 24 bit displays. WXPloop will read any image files as long as the display WXPloop is connected to has a depth greater than or equal to the depth of the image contained in the file.

Commands

FILES

SEE ALSO


Last updated July 30, 1998