CLIENTLIB

Section: LAWRENCE BERKELEY LABORATORY (n)
Updated: 1992
Index Return to Main Contents
 

NAME

scry_send_image, scry_connect, scry_close, scry_save_anima, scry_set_max_color, scry_set_map, scry_set_corner, scry_v_flip- routines for image compression, transmission, and recording  

SYNOPSIS

#include <scry.h>

scry_send_image(rawimage,comp_option,height,width,depth)
unsigned char *rawimage;
int comp_option;
int height;
int width;
int depth;

scry_connect(host,prognum)
char *host;
int prognum;

scry_close()

scry_set_max_color(max)
int max;

scry_set_map(num,map)
int num;
unsigned char *map;

scry_set_corner(winx,winy)
int winx;
int winy;

scry_v_flip(rawimage,height,width,depth)
unsigned char *rawimage;
int height;
int width;
int depth;

scry_init_record(rec_option,total,movie_id)
int rec_option;
int total;
char *movie_id;

scry_set_filename(filename,total)
char *filename;
int total;

scry_save_anima(rawimage,height,width,depth)
unsigned char *rawimage;
int height;
int width;
int depth;
 

DESCRIPTION

Routines to take a raw 1, 2, 3, or 4 byte format image, optionally compress it, and optionally transmit it to a server workstation via Sun RPC's for decompression and display. The depth argument in the routines refers to the number of bytes per pixel. Three-byte images are assumed to be in RGB order; 4-byte images are assumed to be in ARGB order. It is assumed that the upper left hand corner of the image is (0,0), and the user will have to transform the image with scry_v_flip if its lower left hand corner is (0,0). Programs using these calls for compression and/or transmission, are in scry/samples. The size of the images that can be handled depends on the amount of memory on the client, and on the spatial resolution of the server. If an image is larger than that of the server display, it is truncated to the server spatial resolution. Automatic centering can be used, or scry_set_corner can be used to set truncation. If the width or height of the image on the client is not divisible by 4, the image is truncated so that it is.

scry_connect is called first to set up the connection to the server workstation. host is the symbolic name of the server system, or its Internet address. (If the symbolic name is used, then an entry needs to be set in the system /etc/hosts file to map this symbolic name into the Internet address of the server system.)

prognum is an identifier for the particular instance of the server executing. In the case of the Scry X or Sunview server there can be several servers representing several different windows on a single Sun. prognum should always be PCPROGRAM for use with the PC server, which can run only one process at a time.

scry_close is called at the end of a session to close Scry and terminate the connection with the server workstation if a connection was opened.

scry_send_image transmits the software frame buffer, optionally compressing it first, to the server workstation. If the depth or size of the server display is less than the image to be transmitted, the image is truncated to that depth and size.

comp_option sets the compression type. The particular compression is chosen by |'ing (in C) the options CCC, QUANTIZE, and/or LEMPEL_ZIV. CCC chooses CCC compression and run-length encoding, QUANTIZE chooses Paul Raveling's IMG 1.3 color quantization algorithm, LEMPEL_ZIV chooses Lempel-Ziv compression. (The availability of the original IMG 1.3 code is described in the README in this directory.) For example, to use CCC compression and then LEMPEL_ZIV compression: CCC | LEMPEL_ZIV. Use NONE by itself if no compression is desired.

The following compression options are legal:
(1) NONE
(2) CCC
(3) CCC | LEMPEL_ZIV
(4) QUANTIZE (ignored for 8-bit images)
(5) QUANTIZE | LEMPEL_ZIV (LEMPEL_ZIV only for 8-bit images)

If MESSAGES is DEFINE'd, the total compression achieved is printed after completion. Note that it if the image was truncated, the compression ratio is only for the portion of the image remaining.

scry_set_max_color sets the maximum number of color table entries. The largest that can be set is 256. The default is 221, which can be changed before compiling Scry by changing the constant S_MAX_COL_DISPLAY in scry/include/scry_limits.h. See svanima(n) and Xanima(n) for more on the use of color with 8-bit displays.

scry_set_map is used to set the color map when the image has already been converted into indices into a color map, as in an 8-bit Sun rasterfile. The number of entries overrides that set with scry_set_max_color.

scry_set_corner is only useful if it is known that the image is larger than the server display. It sets the upper left hand corner of the image that will be transmitted. The lower right corner is determined by the height and width of the server display. If scry_set_corner is not called, the appropriately-sized center portion of the image is transmitted.

scry_v_flip flips a raw image around an x axis in its center.

scry_init_record is used to initialize the video recorder associated with a PC server workstation. rec_option sets the recording mode. If rec_option is PREVIEW the images are displayed on the PC server workstation but not recorded. If the PC is equipped with a Panasonic videodisk, rec_option and total have the following effects. If rec_option is a positive number, frames are recorded starting at the frame on videotape or videodisk identified by that number. If rec_option is AUTOSEEK, the videodisk seeks to the first unrecorded group of frames large enough to hold total frames. If the PC is equipped with a Sony videodisk, the videodisk seeks to the first unrecorded frame for all non-preview cases. movie_id contains up to 80 characters of description of the movie to be made. It will be saved in the file \movie\movie.log on the PC server workstation. This file must be created before using the server. The user id of the person using the client, the date, and the locations of the frames recorded on videotape or videodisk will be written into movie.log along with movie_id.

scry_set_filename sets filename, which is the name that the Anima file will be saved under if scry_send_image or scry_save_anima is called. The images are saved locally with scry_save_anima, and on the server with scry_send_image. total frames will be saved. All images are saved with the CCC compression format. If another compression option has been chosen, it will be ignored. If, during transmission or compression of a sequence of images, more than one file name is chosen, Scry assumes the first file is completed, and starts a new Anima file.

scry_save_anima compresses and stores a raw image in Anima format under the file name set with scry_set_filename. If it is called more than once, all images are saved in the same file. If the image is 8-bit, the color map should be saved by scry_set_map before calling scry_save_anima. scry_close should be called after the image(s) have been saved. depth is the depth of the image in bytes.  

FILES

Contained in scry/client:
Makefile
makes library scry/libs/libclient.a.
cccalg.c
CCC compression and run-length encoding
compress.c
compression setup
control.c
controls communication with the Scry server
convis.c
make the image to transmit the same size and format as the target server
lzw.c
Lempel-Ziv compression
record.c
controls recording
send.c
image transmission
quantiz.c
modified IMG 1.3 color quantization algorithm from Paul Raveling
imglib.h
IMG 1.3 include file for quantiz.c
 

AUTHORS

David Robertson, Nicole Texier, James Huang, and Bill Johnston  

WARNINGS

Scry cannot deal with 2-byte format images on the Cray.

If the compression option chosen is quantization combined with Lempel-Ziv, the PC server essentially cannot decompress the image (the image would have to be not bigger than 32K bytes).

Do not attempt to save, in the same Anima file, images of different widths and/or heights. It will make Xanima and svanima die on the first frame that is of a different size.

If a Sony videodisk is used that has unrecorded areas separated by recorded areas, recording will probably fail.  

SEE ALSO

scry(n), scry_client(n), pcserv(n), Xserv(n), svserv(n)


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
AUTHORS
WARNINGS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 01:44:50 GMT, December 05, 2024