Image windows

This library provides platform-independent objects and routines for
opening windows and displaying images on either the desktop or
external video display devices. Only byte-sampled images are
supported. Images are handled using the image buffer protocol.

Easy windows

(easywin-create image) # open window and display image
(easywin-create image title pos) # optional title and position
(easywin-close easywin) # close window
easywin-create opens a window and displays an Isis image
buffer in that window, and returns a window handle. An optional title
and window position may be passed. easywin-close closes a
previously created window.

Window object

(win-create commands ...) # create new window
win-create creates a new window using whatever means
available on the machine. A procedure is returned that serves as the
interface to the window. Commands may be sent to the window in the
win-create call, or by calling the returned procedure.
Commands take the form of lists in which the first item is an "opcode"
that identifies the command to execute, and the rest of the items are
the arguments for that command. Several commands may be passed in
each call to the window, and they will be carried out in order, and
only the result of the last command will be returned.
[win-type typestr] # set type: "external" or "default"
[win-size [xsize ysize]] # set size (default [350 350])
[win-title titlestr] # set title (default "Isis")
[win-pos [xpos ypos]] # set position (default [100 100])
[win-buf] # return current image buffer for the window
[win-output] # output current buffer, return next buffer
[win-put image {pos}] # transfer an image into the buffer, optional pos
[win-combfunc func] # set image combination func: (func put-command image)
[win-close] # close and destroy window
The type, size, title, and position commands should all be specified
when creating the window, as not all platforms support changing these
attributes after creation. None of these commands is actually
required (see default values above). If the type is set to
"external", an external monitor will be used for display, if
available.

The win-buf command will return the current Isis image
serving as the buffer for the window. The user is free to modify this
buffer as needed, and then call win-output to display it on
the device. win-output will return the next Isis image that
will serve as the buffer for the window. Several different buffers
may be in use depending on the device, so it is important to obtain
the current buffer after each win-output command.
Furthermore, image data placed in these buffers may not survive after
each win-output command, so all frames should be prepared
from scratch.

The win-put command transfers the specified image into the
current window buffer at an optional position. Several
win-put commands may be made in succession, but changes will
not be made visible until a win-output command is passed.

Advanced users may use the win-combfunc command to specify
the function used by win-put to transfer images into the
window buffer. The function should accept two arguments: the
win-put command list, and the destination image buffer. The
default is a simple transfer function that works for images with 1 or
3 channels.

win-close closes and destroys the window and frees any
resources that were allocated. Do not attempt to call the window
object again after this command.