diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/x11iraf/cdl | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'vendor/x11iraf/cdl')
57 files changed, 57734 insertions, 0 deletions
diff --git a/vendor/x11iraf/cdl/.alias b/vendor/x11iraf/cdl/.alias new file mode 100644 index 00000000..fa044759 --- /dev/null +++ b/vendor/x11iraf/cdl/.alias @@ -0,0 +1,3 @@ +alias x /iraf/x11iraf/ximtool/ximtool +alias z cdltest +alias mk make diff --git a/vendor/x11iraf/cdl/Imakefile b/vendor/x11iraf/cdl/Imakefile new file mode 100644 index 00000000..9185071e --- /dev/null +++ b/vendor/x11iraf/cdl/Imakefile @@ -0,0 +1,92 @@ +# +# Imakefile for the Client Display Library V1.8 +# +# Mike Fitzpatrick, National Optical Astronomy Observatories, IRAF project. +# Feb 1997 + +X11IRAFDIR = ../ +#include <../X11IRAF.tmpl> + +#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' + +# CDEBUGFLAGS = -g + EXTRA_INCLUDES = -I. +#if defined (HPArchitecture) || defined(RsArchitecture) + EXTRA_DEFINES = -D_NO_US_ +#else + +# If you plan to use the ANSI function prototypes in your application +# you *must* edit the following to include '-DCDL_ANSIC' so the CDL +# is compiled with prototypes and will not promote arguments to a +# different type. + +# EXTRA_DEFINES = -DCDL_ANSIC +#endif + +#if HasLargeTmp | SystemV4 + ARADD = ar ru +#else + ARADD = ar rul +#endif + + + SUBDIRS = + MATHLIB = -lm + + SRCS = cdl.c cdlmark.c cdlfits.c cdliraf.c cdlzscale.c cdl_f77.c \ + cdl_spp.c eps.c comm.c imd.c + OBJS = cdl.o cdlmark.o cdlfits.o cdliraf.o cdlzscale.o cdl_f77.o \ + cdl_spp.o eps.o comm.o imd.o + CDL_INCLUDES = cdl.h cdlP.h cdlProto.h cdl_f77.h cdlfont.h eps.h + HEADERS = cdl.h cdlspp.h cdlftn.inc + +World:: + @echo "Building Release 1.8 of the IRAF CLient Display Library" + @echo "" ; date ; echo "" + $(MAKE) $(MFLAGS) Makefiles + $(MAKE) $(MFLAGS) clean + $(MAKE) $(MFLAGS) depend + $(MAKE) $(MFLAGS) all + @echo "Done." ; date ; echo "" + +all:: libcdl.a + +NormalLibraryTarget(cdl,$(OBJS)) + +LinkFileList(linklibs,libcdl.a,X11irafLibDir,CDLDir) + +DependTarget() + + +#if InstallLibraries +install:: libcdl.a + @(set -x; $(RM) X11irafLibDir/libcdl.a) + @(set -x; $(CP) -p libcdl.a X11irafLibDir/libcdl.a) +#endif + +includes:: + MakeDir(X11irafIncDir) + @(set -x; for i in $(HEADERS); do \ + $(RM) X11irafIncDir/$$i; \ + $(CP) -p CDLDir/$$i X11irafIncDir/$$i; \ + done) + +#if InstallIncludes +install:: + @(set -x; for i in $(HEADERS); do \ + $(RM) X11irafIncDir/$$i; \ + done) + for i in $(HEADERS); do \ + (set -x; $(CP) -p $$i $(DESTDIR)$(X11IRAFDIR)/include); \ + done +#endif + + +pristine:: + $(MAKE) $(MFLAGS) clean + $(RM) -f Makefile test/Makefile examples/Makefile *spool* + +archive:: + $(MAKE) $(MFLAGS) pristine + !tar -cvf - . | compress > ../cdl.tar.Z + diff --git a/vendor/x11iraf/cdl/Imakefile.standalone b/vendor/x11iraf/cdl/Imakefile.standalone new file mode 100644 index 00000000..9e4d9c39 --- /dev/null +++ b/vendor/x11iraf/cdl/Imakefile.standalone @@ -0,0 +1,97 @@ +# +# Imakefile for the Client Display Library V1.8 +# +# Mike Fitzpatrick, National Optical Astronomy Observatories, IRAF project. +# Feb 1997 + +#define IHaveSubdirs +#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' + + CDEBUGFLAGS = -g + EXTRA_INCLUDES = -I. +#if defined (HPArchitecture) || defined(RsArchitecture) + EXTRA_DEFINES = -D_NO_US_ +#else + +# If you plan to use the ANSI function prototypes in your application +# you *must* edit the following to include '-DCDL_ANSIC' so the CDL +# is compiled with prototypes and will not promote arguments to a +# different type. + +# EXTRA_DEFINES = -DCDL_ANSIC +#endif + +#if HasLargeTmp | SystemV4 + ARADD = ar ru +#else + ARADD = ar rul +#endif + +# Hack to compile under SunPRO V4 on Solaris +#if defined (SunArchitecture) && OSMajorVersion >= 5 && HasSunC +#if OSMinorVersion <= 5 +#if !defined (i386Architecture) + CCOPTIONS = -Xs +EXTRA_LDOPTIONS = -xildoff +#endif +#else + CCOPTIONS = +EXTRA_LDOPTIONS = -xildoff +#endif + +#else +#if defined (UltrixArchitecture) + CCOPTIONS = -DULTRIX +#endif +#if defined (OSF1Architecture) && OSMajorVersion >= 4 + CCOPTIONS = -DOSF1 +#endif +#endif + + SUBDIRS = examples test + MATHLIB = -lm + + SRCS = cdl.c cdlmark.c cdlfits.c cdliraf.c cdlzscale.c cdl_f77.c \ + cdl_spp.c eps.c comm.c imd.c + OBJS = cdl.o cdlmark.o cdlfits.o cdliraf.o cdlzscale.o cdl_f77.o \ + cdl_spp.o eps.o comm.o imd.o + CDL_INCLUDES = cdl.h cdlP.h cdlProto.h cdl_f77.h cdlfont.h eps.h + + +World:: + @echo "Building Release 1.8 of the IRAF Client Display Library" + @echo "" ; date ; echo "" + $(MAKE) $(MFLAGS) Makefiles + $(MAKE) $(MFLAGS) clean + $(MAKE) $(MFLAGS) depend + $(MAKE) $(MFLAGS) all + @echo "Done." ; date ; echo "" + +all:: libcdl.a vximtool + +NormalLibraryTarget(cdl,$(OBJS)) + +vximtool: vximtool.o + $(RM) vximtool + $(CC) -o vximtool -DHAVE_CDL vximtool.o $(LDOPTIONS) libcdl.a \ + $(MATHLIB) $(EXTRA_LIBRARIES) + +vximtool.o: + $(CC) -c $(CFLAGS) -DHAVE_CDL vximtool.c + +clean:: + $(RM) vximtool vximtool.o + +ForceSubdirs($(SUBDIRS)) +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) + +pristine:: + $(MAKE) $(MFLAGS) clean + $(RM) -f Makefile test/Makefile examples/Makefile *spool* + +archive:: + $(MAKE) $(MFLAGS) pristine + !tar -cvf - . | compress > ../cdl.tar.Z + +DependTarget() diff --git a/vendor/x11iraf/cdl/Makefile.generic b/vendor/x11iraf/cdl/Makefile.generic new file mode 100644 index 00000000..1295035e --- /dev/null +++ b/vendor/x11iraf/cdl/Makefile.generic @@ -0,0 +1,205 @@ +# +# Generic Makefile for the Client Display Library V1.0 +# +# Mike Fitzpatrick, National Optical Astronomy Observatories, IRAF project. +# Apr 1997 + + EXTRA_CFLAGS = + CDEBUGFLAGS = -g + + AR = ar r + ARADD = ar rul + RANLIB = ranlib + RM = rm + + SUBDIRS = examples test + MATHLIB = -lm + + SRCS = cdl.c cdlmark.c cdlfits.c cdliraf.c cdlzscale.c cdl_f77.c \ + cdl_spp.c eps.c comm.c imd.c + OBJS = cdl.o cdlmark.o cdlfits.o cdliraf.o cdlzscale.o cdl_f77.o \ + cdl_spp.o eps.o comm.o imd.o + CDL_INCLUDES = cdl.h cdlP.h cdlProto.h cdl_f77.h cdlfont.h eps.h + + +World:: + @echo "Building Release 1.8 of the IRAF CLient Display Library" + @echo "" ; date ; echo "" + $(MAKE) $(MFLAGS) all + @echo "Done." ; date ; echo "" + +.c.o: + $(RM) -f $@ + $(CC) -c $(EXTRA_CFLAGS) $(CFLAGS) $*.c + +all:: libcdl.a vximtool + + +libcdl.a: $(OBJS) $(CDL_INCLUDES) + $(RM) -f libcdl.a + $(AR) libcdl.a $(OBJS) + $(RANLIB) libcdl.a + +vximtool: vximtool.o + $(RM) -f vximtool + $(CC) -o vximtool -DHAVE_CDL vximtool.o libcdl.a $(MATHLIB) + +vximtool.o: + $(CC) -c $(CFLAGS) -DHAVE_CDL vximtool.c + +$(SUBDIRS): FRC + @cd $@ ; echo "making all in $(CURRENT_DIR)/$@..."; \ + $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' all + +FRC: + +all:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' all); \ + done + +depend:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "depending" "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) depend); \ + done + +pristine:: + $(MAKE) $(MFLAGS) clean + $(RM) -f Makefile test/Makefile examples/Makefile + $(RM) -f Makefile.bak test/Makefile.bak examples/Makefile.bak + +clean:: + $(RM) -f *.o *.a *spool* vximtool + +depend:: + +# ------------------------------------------------------------------------- +# common rules for all Makefiles - do not edit + +emptyrule:: + +Makefile:: + -@if [ -f Makefile ]; then set -x; \ + $(RM) -f Makefile.bak; $(MV) Makefile Makefile.bak; \ + else exit 0; fi + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + +tags:: + $(TAGS) -w *.[ch] + $(TAGS) -xw *.[ch] > TAGS + +saber: + # load $(ALLDEFINES) $(SRCS) + +osaber: + # load $(ALLDEFINES) $(OBJS) + +# ------------------------------------------------------------------------- +# rules for building in SUBDIRS - do not edit + +install:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \ + done + +install.man:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \ + done + +clean:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \ + done + +tags:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \ + done + +Makefiles:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \ + case "$$i" in \ + ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \ + ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \ + ./?*/?*) newtop=../../ sub=subsub;; \ + ./?*) newtop=../ sub=sub;; \ + */?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \ + */?*/?*) newtop=../../../ sub=subsubsub;; \ + */?*) newtop=../../ sub=subsub;; \ + *) newtop=../ sub=sub;; \ + esac; \ + case "$(TOP)" in \ + /?*) newtop= upprefix= ;; \ + *) upprefix=../ ;; \ + esac; \ + $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \ + MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\ + done + +subdirMakefiles: + $(RM) -f $(MAKEFILE_SUBDIR)/Makefile.bak + -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \ + $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ + else exit 0; fi + cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \ + $(MAKE) $(MFLAGS) Makefiles + +subsubdirMakefiles: + $(RM) -f $(MAKEFILE_SUBDIR)/Makefile.bak + -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \ + $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ + else exit 0; fi + cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \ + $(MAKE) $(MFLAGS) Makefiles + +subsubsubdirMakefiles: + $(RM) -f $(MAKEFILE_SUBDIR)/Makefile.bak + -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \ + $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ + else exit 0; fi + cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \ + $(MAKE) $(MFLAGS) Makefiles + +subsubsubsubdirMakefiles: + $(RM) -f $(MAKEFILE_SUBDIR)/Makefile.bak + -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \ + $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ + else exit 0; fi + cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \ + $(MAKE) $(MFLAGS) Makefiles + +includes:: + @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \ + $(MAKE) $(MFLAGS) includes); \ + done + +# ------------------------------------------------------------------------- +# dependencies generated by makedepend + +# DO NOT DELETE + diff --git a/vendor/x11iraf/cdl/Notes b/vendor/x11iraf/cdl/Notes new file mode 100644 index 00000000..a929bdec --- /dev/null +++ b/vendor/x11iraf/cdl/Notes @@ -0,0 +1,171 @@ +/* + * CDL -- Client Display Library. This package provides a general interface + * for client applications to do IRAF-like image display and interaction. + * It is layered upon other interfaces for handling basic display, cursor + * and frame buffer operations, and low-level server communications. + * + * cdl = cdl_open (imtdev) + * cdl_displayPix (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) + * cdl_readCursor (cdl, sample, &x, &y, &key) + * cdl_setCursor (cdl, x, y, wcs) + * cdl_clearFrame (cdl) + * cdl_close (cdl) + * + * cdl_displayIRAF (cdl, fname, band, frame, fbconfig, zscale) + * cdl_isIRAF (fname) + * cdl_readIRAF (fname, band, &pix, &nx, &ny, &bitpix); + * + * cdl_displayFITS (cdl, fname, frame, fbconfig, zscale) + * cdl_isFITS (fname) + * cdl_readFITS (fname, &pix, &nx, &ny, &bitpix); + * + * cdl_computeZscale (cdl, pix, nx, ny, bitpix, &z1, &z2) + * cdl_zscaleImage (cdl, &pix, nx, ny, bitpix, z1, z2) + * + * cdl_printPix (cdl, cmd, pix, nx, ny, annotate) + * cdl_printPixToFile (cdl, fname, pix, nx, ny, annotate) + * + * cdl_readImage (cdl, &pix, &nx, &ny) + * cdl_readFrameBuffer (cdl, &pix, &nx, &ny) + * cdl_readSubRaster (cdl, lx, ly, nx, ny, &pix) + * cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix) + * + * cdl_selectFB (cdl, nx, ny, &fb, &fb_w, &fb_h, &nframes, reset) + * cdl_setFBConfig (cdl, configno) + * cdl_getFBConfig (cdl, &configno, &w, &h, &nframes) + * cdl_lookupFBSize (cdl, configno, &w, &h, &nframes) + * + * cdl_[set|get]WCS (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) + * cdl_[set|get]Frame (cdl, frame) + * cdl_[set|get]ZTrans (cdl, ztrans) + * cdl_[set|get]ZScale (cdl, z1, z2) + * cdl_[set|get]Sample (cdl, nsample) + * cdl_[set|get]SampleLines (cdl, nlines) + * cdl_[set|get]Contrast (cdl, contrast) + * cdl_[set|get]Name (cdl, imname) + * cdl_[set|get]Title (cdl, imtitle) + * + * + * GRAPHICS OVERLAY ROUTINES: + * -------------------------- + * cdl_mapFrame (cdl, frame) + * cdl_markPoint (cdl, x, y, number, size, type, color) + * cdl_markLine (cdl, xs, ys, xe, ye, color) + * cdl_markBox (cdl, lx, ly, ux, uy, fill, color) + * cdl_markPolyline (cdl, xpts, ypts, npts, color) + * cdl_markPolygon (cdl, xpts, ypts, npts, fill, color) + * cdl_markCircle (cdl, x, y, radius, fill, color) + * cdl_markCircAnnuli (cdl, x, y, radius, nannuli, sep, color) + * cdl_markEllipse (cdl, x, y, xrad, yrad, ang, fill, color) + * cdl_markEllipAnnuli (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) + * cdl_markText (cdl, x, y, str, size, angle, color) + * + * cdl_setFont (cdl, type) + * + * cdl_beginDisplayList (cdl) + * cdl_endDisplayList (cdl) + * cdl_drawDisplayList (cdl) + * + * cdl_deleteMark (cdl, x, y) + * cdl_clearOverlay (cdl) + * cdl_redrawOverlay (cdl) + * + * + * Client applications begin with a cdl_open() call to initialize the + * interface. The "imtdev" argument is used to specify a connection at device + * open time, or if NULL the procedure will attempt to first connect on a unix + * socket or fifo pipe if that fails. The syntax for the imtdev argument is + * as follows: + * <domain> : <address> + * + * where <domain> is one of "inet" (internet tcp/ip socket), "unix" (unix + * domain socket) or "fifo" (named pipe). The form of the address depends + * upon the domain, see the IMD interface code comments or documentation + * for examples. + * + * The library assumes a logical coordinate system that has the image or + * raster origin in the lower-left corner. All I/O routines should be passed + * or will return a pixel pointer set to the LL corner of the raster, all + * cursor positions will similarly use this coordinate system. Initially the + * [0,0] origin is defined as the LL of the frame buffer, this will remain + * the case until the WCS is redefined either explicitly through a cdl_setWCS() + * call or by using one of the high level cdl_display*() procedures to display + * an image smaller that the current frame buffer. Applications wishing to + * retain this initial origin or those wanting to explicitly place the image + * in the frame buffer should use the cdl_writeSubRaster() for display. This + * is to allow cursor and subraster positions to be specified in image coord- + * inates more easily. Negative positions are allowed and will either refer + * to empty pixels if the frame buffer is larger than the image, or pixels + * outside the frame buffer boundaries. Raster I/O requests will be clipped + * to the frame buffer endpoints, a request completely outside the frame buffer + * is an error. + * + * The high-level display routines cdl_displayIRAF() and cdl_displayFITS() + * can be used to display images directly by name. A WCS will automatically + * be defined for each image after the optional zscaling hass been computed. + * Applications wishing to define their own WCS need to call cdl_setWCS() + * after the display call to redefine the default WCS. + */ + +------------------------------------------------------------------------------ + +/* + * IMAGE DISPLAY -- The image display interface is responsible for actually + * displaying an image to the server, for reading back a raster from the + * server, and cursor positioning. This is a mid-level interface for + * handling the steps necessary for image display operations without dealing + * directly with the details of communicating with the server. + * + * imd = imd_open (imtdev) + * imd_displayImage (imd, pix, nx, ny, frame, fbconfig, comp_wcs) + * imd_readCursor (imd, sample, &x, &y, &key) + * imd_[set|get]WCS (imd, name, title, a, b, c, d, tx, ty, z1, z2, zt) + * imd_close (imd) + * + * Low Level Procedures + * -------------------- + * imd_writeImage (imd, pix, nx, ny, lx, ly) + * imd_readImage (imd, &pix, &nx, &ny) + * imd_readFrameBuffer (imd, &pix, &nx, &ny) + * imd_setFrame (imd, frame) + * imd_setFBConfig (imd, configno) + * imd_getFBConfig (imd, &configno, &width, &height, &nframes)) + * imd_setName (imd, name) + * imd_setTitle (imd, title) + * imd_setCursor (imd, x, y, wcs) + * imd_clearFrame (imd) + * imd_writeSubRaster (imd, lx, ly, nx, ny, pix) + * imd_readSubRaster (imd, lx, ly, nx, ny, &pix) + * + * We leave it to the higher level procedures to handle Z-scale trans- + * formations, spatial scaling, and high level image I/O. All display pixels + * are assumed to be scaled to 8-bits already. + */ + +------------------------------------------------------------------------------ + +/* + * COMMUNICATIONS INTERFACE -- The communications interface handles all the + * low-level communications with the server. It implements only the subset + * of the IIS protocol used by XImtool, SAOtng and SAOimage, not the entire + * IIS protocol. It may be swapped out for another protocol in the future + * without affecting the tasks which use it as long as the basic steps re- + * quired for image display are the same. + * + * com_writeData (fd, x, y, pix, nx, ny) + * com_readData (fd, x, y, &pix, &nx, &ny) + * com_readCursor (fd, sample, &x, &y, &key) + * com_setCursor (fd, x, y, wcs) + * com_setFBConfig (fd, configno) + * com_setFrame (fd, frame) + * com_writeWCS (fd, name, a, b, c, d, tx, ty, z1, z2, zt) + * com_readWCS (fd, &name, &a, &b, &c, &d, &tx, &ty, + * &z1, &z2, &zt) + * com_eraseFrame (fd) + * + * We do not actually display images here, all we do is send the individual + * set frame, write a data chunk, etc commands. The caller is responsible for + * coordinating these calls into a legal sequence for image display. + * All routines return 0 if successfull and 1 otherwise. + */ + diff --git a/vendor/x11iraf/cdl/README b/vendor/x11iraf/cdl/README new file mode 100644 index 00000000..32762ca4 --- /dev/null +++ b/vendor/x11iraf/cdl/README @@ -0,0 +1,36 @@ +########################################################################### +# # +# CDL -- Client Display Library Mar 04, 1998 # +# # +########################################################################### + + + This directory contains the Client Display Library (CDL) sources. +The CDL is a host interface for C or Fortran programs allowing them to +display images or overlay graphics to display servers such as XImtool or +SAOimage / SAOtng. High-level procedures allow IRAF or FITS images to be +displayed simply, other routines permit access to all other server functions +(e.g. cursor and image readback, frame selection, etc). The library also +features a number of functions for doing image overlay graphics; supported +graphics primitives include numerous point shapes, lines, circles, ellipses, +polygons, annular shapes, and text. + + This package is made up of several interfaces, specifically + + CDL - high-level image display and graphics overlay + IMD - mid-level image display routines + COMM - server communications (currently IIS) + +See the Notes file or Reference Guide in the doc subdirectory for more +information. + + Source for the library itself is in this directory. Documentation +is in the 'doc' subdirectory and demonstration applications can be found in +the 'examples' subdirectory. The 'test' subdirectory contains debugging +programs used during development; they're not really good examples of +programming practice but may serve as demos of how individual functions +can be called. + + See the RELEASE.NOTES file in this directory, or the Reference +Guide in the 'doc' subdirectory for information on using and installing +this library. diff --git a/vendor/x11iraf/cdl/Revisions b/vendor/x11iraf/cdl/Revisions new file mode 100644 index 00000000..bd1249e8 --- /dev/null +++ b/vendor/x11iraf/cdl/Revisions @@ -0,0 +1,361 @@ + +cdl.h + Added missing procedure declarations for cdl_isFITS(), cdl_isIRAF(), + and cdl_markPointLabel(). (12/12/02) + +cdlzscal.c + Added a missing <stdlib.h> (12/12/02) + +============= +V1.8 Released +============= + +cdl.c **** INTERFACE CHANGE **** +imd.c **** INTERFACE CHANGE **** +cdl.h **** INTERFACE CHANGE **** +cdl_spp.c **** INTERFACE CHANGE **** +cdl_spp.h **** INTERFACE CHANGE **** +cdl_f77.c **** INTERFACE CHANGE **** +cdl_77.h **** INTERFACE CHANGE **** +cdlspp.h **** INTERFACE CHANGE **** + Added new interface routines for the set/get/query mapping calls. + See the detailed Revisions notes for specifics (8/4/01) + +imd.c +comm.c +cdlP.h +cdlProto.h + Added a new com_wcsVersion() routine to query server for the + WCS version (i.e. new XImtool mapping support) (6/14/01) + +eps.c + Made certain variables static, other lint cleanups (6/14/01) + +cdlzscale.c + Changed to handle the case of a very small slope produced by the + fitting rejection (5/31/01) + +cdlfits.c + Minor change to variable names. (5/30/01) + +imd.c + Fixed a minor bug where the last line of a display was being left + off due to an incorrect indexing of the last block being written + in imd_writeSubRaster(). (4/17/01) + +Imakefile + Incremented version to 1.8 (4/17/01) + +comm.c + Fixed a bug in reading octal cursor values (e.g. space) (11/20/2000) + +cdlzscale.c + Added a '#include "cdl.h"' so the ANSI_FUNC was defined (11/17/2000) + +cdlmark.c + Fixed a bug in the selection of BOX markers for deletion (10/27/2000) + +cdl_f77.c + Fixed a bug preventing cfreadiraf() from getting the pixels + correctly (5/23/2000) + +cdliraf.c + Fixed a bug in getting the V2 image title (5/23/2000) + + +============= +V1.7 Released +============= + +cdl.c **** INTERFACE CHANGE **** + Modified the behavior of cdl_getFrame() to do a sampling cursor + read to get the frame buffer from the server. If the value returned + is zero (as from SAOimage) the current value of the frame number in + the CDL is returned. (3/29/00) + +cdl.[ch] **** INTERFACE CHANGE **** +imd.c **** INTERFACE CHANGE **** +comm.c **** INTERFACE CHANGE **** +cdlProto.h **** INTERFACE CHANGE **** +cdl_f77.[ch] **** INTERFACE CHANGE **** +cdl_spp.c **** INTERFACE CHANGE **** +examples/tvmark.c **** INTERFACE CHANGE **** +test/cdltest.c **** INTERFACE CHANGE **** +test/imdtest.c **** INTERFACE CHANGE **** + Modified the cdl_readCursor() routine to have a new 'wcs' argument + to return the WCS of the cursor read. This is to allow applications + to get the frame number of the read from the wcs (i.e. wcs is + coded as "frame * 100 + wcs". (3/29/00) + +imd.c + Fixed a bug in the drawing of markers where the start coord for + the subraster is (1,1). When writing out the subraster the + routine was incorrectly deciding that the frame buffer did not + need to be readback to edit the subraster. (3/14/00) + +examples/mosaic.c + Added an ability to display raw images of the same size per user + request (2/19/99) + +cdl.c +cdlmark.c + Removed duplicate <stdlib.h> includes (1/5/99) + +comm.c + Fixed a readWCS call so it correctly gets the frame requested, + now it's always getting frame 1. (1/4/99) + +imd.c + Closed the file descriptors in imd_close(). This was preventing + the CDL from reconnecting properly and leaving the server in a + read hang. (1/4/99) + +cdl_f77.c + Modified the CDF_READ* wrappers to use a temporary buffer in the + actual call to the CDL C routines since fortran passes in static + arrays which cannot be reallocated by the low-level C code. The + data is moved from the temp buffer to the input buffer after the + call. (1/2/99) + +cdl_f77.[ch] +cdl_spp.[ch] + Fixed some errors in the binding code not finding certain procedures. + (10/28/98) + +cdlfits.c + Changed bscale/bzero to double to avoid an overflow (10/13/98) + +cdlmark.c + Added an offset to the circle coordinate calculation to assure + circle is centered. (10/13/98) + +cdl.c + Fixed a bug in the zscale of real and double data. (6/3/98) + +cdlzscale.c + Fixed a bug in floatCompare causing the sort to fail when the range + of data is <1.0 (6/2/98) + +imd.c + Modified debug output so individual writes are only printed when + verbose output requested. (6/1/98) + +cdl.c +cdl.h + Modified the zscale code to behave more like the V2.11 code in + determining z1/z2. If the number of sample lines isn't explicitly + set then the sample is derived evenly from the entire image as though + with an image section, otherwise the old method is used. The default + number of sample points was increased to 1000. (6/1/98) + +imd.c + Fixed a bug in the image display code causing garbage values + for some image sizes (3/16/98) + +cdlfits.c + Removed col 30 restriction from logical keywords (3/16/98) + +============= +V1.6 Released +============= + +Imakefile +Makefile.generic + Misc platform bug fixes. (3/3/98) + +doc/cdlref.ms + Updated with latest changes. (3/1/98) + +cdl_spp.[ch] + Misc small bug fixes. (3/1/98) + +cdl.h +Imakefile +Makefile.generic + Updated version number to 1.6 (2/28/98) + +cdlP.h +cdlmark.c +cdlspp.h +cdl_f77.[ch] +cdl_spp.[ch] + Finished implementation of dashed line type for all markers (2/18/98) + +cdlmark.c + Finished implementation of hollow/shadow line type for all markers + (2/13/98) + +cdlmark.c + Fixed a bug in the marker deletetion code (2/13/98) + +All sources + Numerous changes to all sources to provide ANSI C function prototypes + and to separate the public and private declarations. For ANSI use + CDL_ANSIC must be defined prior to the "#include <cdl.h>". (1/16/98) + +cdl_f77.[ch] +cdl_spp.[ch] +cdlspp.h +cdlftn.inc +cdlmark.c +cdl.h + Added new routines cdl_setLineWidth() and cdl_setTextWidth() and + hooked them into marker code. Also added a new BOLD font type + which maintain current font but increases the width. (1/5/98) + +imd.c + Fixed a bug in computing the WCS for images larger than the FB (1/1/98) + +imd.c + Changed the subraster code so it would do a read when writing as + subraster the full width of the FB. (1/1/98) + +cdliraf.c **** INTERFACE CHANGE **** +cdlfits.c **** INTERFACE CHANGE **** +cdl_f77.c **** INTERFACE CHANGE **** +cdl_spp.c **** INTERFACE CHANGE **** + Changed the cdl_readXXX() calls to return the title string (1/1/98) + +cdliraf.c +cdlfits.c +examples/display.c + Fixed a bug in writing the name/title to the WCS (12/31/97) + +cdl.h +cdl.c +imd.c + Fixed a bug where the z1/z2 values weren't being properly loaded by + the cdl_displayPix procedure when zscaling. (12/29/97) + +cdl.h +imd.h + Included cdl.h in the imd.h file so there is only one structure + definition of the IMD struct. Cleaned up duplicate defines. (11/13/97) + +cdlmark.c +cdlfont.h +cdl_f77.[ch] +cdl_spp.[ch] + Added a new routine cdl_setFont() which can be used to choose be- + tween a set of new fonts. (9/9/97) + +cdliraf.c + Modified to handle new V2 OIF format images. (6/6/97) + +cdlmark.c + Fixed up the text presentation a bit by making the default size + a little larger for clarity, added proportional spacing for thin + chars like 'i' and 'l', and fixed a bug in the subregion size (6/4/97) + +configure + +Makefile.generic + +examples/ Makefile.generic + +test/ Makefile.generic + + Added a generalized set of makefiles for sites w/out Imake (4/27/97) + +eps.c + Fixed a minor bug in axis labeling. (4/27/97) + +cdliraf.c +cdlfits.c + Initialized z1/z2 values in display procedures (4/25/97) + +cdl.c +cdlmark.c + The DLHead/DLtail structures were being accessed as one-indexed + arrays, changed so they're zero-index and won't overflow the + allocation. (4/25/97) + +comm.c + Fixed a bug where the fbconfig was being passed in incorrectly in + a clear-frame request. Caused a "shifted buffer" effect on SAOimage + in subsequent calls to the display example. (4/24/97) + +comm.c +doc/cdlref.ms +doc/cdlref.ps + Fixed a bug in the encoding of the frame number as it's passed to + the server, caused display to frames 3-4 to fail. Updated docs. + (4/22/97) + +cdl.c + Removed the imd_setWCS() call from the cdl_open() procedure to + avoid reinitialize the frame buffers in the server. This would + erase previously displayed frames e.g. in the display example + when using an FB larger than the default. (4/13/97) + +cdl.c +cdl_f.c +doc/cdlref.ms +doc/cdlref.ps + Changed the behavior of the cdl_open() procedure (C and F77) to check + automatically for the IMTDEV variable if passed a NULL arg. Also + fixed a bug in the fortran interface string stripping procedure intro- + duced by the earlier bug fix. (3/29/97) + +cdl_f.c + Fixed bug in string passing. Fortran appends a 'hidden' string + length argument that was not being used and strings were being + truncated or assumed to be a certain length improperly. Also + modified CDF_OPEN to handle an empty string properly (the ftn + getenv procedure doesn't always return a NULL, just an empty + string). (3/27/97) + +examples/fdisplay.f +examples/ftvmark.f + Modified to show use of IMTDEV environment variable for making + the server connection. (3/27/97) + +eps.c + Added a grestore to the prolog to workaround a bug on Digital + Printerserver 17 printers. (3/27/97) + +cdlfits.c + Fixed a bug in the reading of FITS files with BSCALE/BZERO (3/18/97) + +cdl_f.c + Removed an errant cdl arg to CDF_CLOSE (3/12/97) + +imd.c +eps.c +cdl.h +comm.c +test/imdtest.c + Ifdef'd uchar typedef for AIX systems. (3/12/97) + +cdliraf.c +examples/display.c + Ifdef'd <sys/types.h> include for lseek on Ultrix systems (3/12/97) + +cdliraf +comm.c + SAOimage assumes that a ClearFrame request passes the fbconfig + number in the tid field of the packet, XImtool doesn't. This + is also what IRAF does so the FEEDBACK unit now also passes in + the fbconfig as well. (2/28/97) + +cdl.c +comm.c + Added debugging output to print each header packet for comm + interface. (2/28/97) + +cdliraf.c + Fixed one bug causing a segvio for odd sized images, fixed another + affecting image with padding in the pixels. (2/27/97) + +examples/display.c + Enabled -fbconfig flag for iraf format (2/27/97) + +cdl.c + Changed a debug print so 'imtdev' isn't printed directly if it's + NULL, causes a segvio on Sol2.5 systems. (2/27/97) + +examples/Imakefile + Needed to add "-lnsl -lsocket" for Solaris linking. (2/27/97) + +Imakefile + Added a "HasSunC" check for Solaris check since the extra flags are + only needed by SunPRO compilers, not GCC. (2/26/97) + +------------------------------------------------------------------------------ +V1.0 Beta released. (2/26/97) diff --git a/vendor/x11iraf/cdl/TODO b/vendor/x11iraf/cdl/TODO new file mode 100644 index 00000000..78db15fd --- /dev/null +++ b/vendor/x11iraf/cdl/TODO @@ -0,0 +1,34 @@ + 2/2/98 + + - Need a better fill area algorithm + - Log scaling seems to be "off" + - Would be nice to be able to create an overlay plane in memory + before display to speed display of a large number of markers. +DONE - Need a tile image procedure? +DONE - selectFB should find the minimal residual size FB rather than + simply the first one larger than the image +DONE - Check for memory leaks +DONE - Write example tasks +DONE - Documentation +DONE - Clean up header files +DONE - Fortran interface +DONE - Clean up procedure decls, find the void procs + - if not doing a scale need to set up a simple type conversion +DONE - be able to rotate text? + - load/save display list procedure? +DONE - SPP interface + - register multiple servers for output? +DONE - fix iraf I/O for V2 image formats +DONE - use better fonts and proportional spacing? +DONE - sub/superscripting, inline font changes +DONE - greek font + - mosaic example has bug with sampling odd sized images +DONE - segvio with missing imtoolrc file + - displaying 32x4 image shows a "fifth" row +DONE - ANSI func prototypes +DONE - polyline width option +DONE - polyline style option +DONE - "hollow" line type to show lines as it crosses intensities + - FITS extension support + - hbar/vbar point types should have complimentary diagonal types + - need better WCS support diff --git a/vendor/x11iraf/cdl/cdl.c b/vendor/x11iraf/cdl/cdl.c new file mode 100644 index 00000000..306b121b --- /dev/null +++ b/vendor/x11iraf/cdl/cdl.c @@ -0,0 +1,1934 @@ +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <math.h> +#define CDL_LIBRARY_SOURCE +#define CDL_NEED_COLORMAPS +#include "cdl.h" + + +/* + * CDL -- Client Display Library. This package provides a general interface + * for client applications to do IRAF-like image display and interaction. + * It is layered upon other interfaces for handling basic display, cursor + * and frame buffer operations, and low-level server communications. + * + * cdl = cdl_open (imtdev) + * cdl_displayPix (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) + * cdl_readCursor (cdl, sample, &x, &y, &wcs, &key) + * cdl_setCursor (cdl, x, y, wcs) + * cdl_clearFrame (cdl) + * cdl_close (cdl) + * + * cdl_displayIRAF (cdl, fname, band, frame, fbconfig, zscale) + * cdl_isIRAF (fname) + * cdl_readIRAF (fname, band, &pix, &nx, &ny, &bitpix, title); + * + * cdl_displayFITS (cdl, fname, frame, fbconfig, zscale) + * cdl_isFITS (fname) + * cdl_readFITS (fname, &pix, &nx, &ny, &bitpix, title); + * + * cdl_computeZscale (cdl, pix, nx, ny, bitpix, &z1, &z2) + * cdl_zscaleImage (cdl, &pix, nx, ny, bitpix, z1, z2) + * + * cdl_printPix (cdl, cmd, pix, nx, ny, annotate) + * cdl_printPixToFile (cdl, fname, pix, nx, ny, annotate) + * + * cdl_readImage (cdl, &pix, &nx, &ny) + * cdl_readFrameBuffer (cdl, &pix, &nx, &ny) + * cdl_readSubRaster (cdl, lx, ly, nx, ny, &pix) + * cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix) + * + * cdl_selectFB (cdl, nx, ny, &fb, &fb_w, &fb_h, &nframes, reset) + * cdl_setFBConfig (cdl, configno) + * cdl_getFBConfig (cdl, &configno, &w, &h, &nframes) + * cdl_lookupFBSize (cdl, configno, &w, &h, &nframes) + * + * cdl_[set|get]WCS (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) + * cdl_[set|get]Mapping (cdl, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) + * cdl_queryMap (cdl, wcs, region, sx,sy,snx,sny, + * dx,dy,dnx,dny, objref) + * + * cdl_[set|get]Frame (cdl, frame) + * cdl_[set|get]ZTrans (cdl, ztrans) + * cdl_[set|get]ZScale (cdl, z1, z2) + * cdl_[set|get]Sample (cdl, nsample) + * cdl_[set|get]SampleLines (cdl, nlines) + * cdl_[set|get]Contrast (cdl, contrast) + * cdl_[set|get]Name (cdl, imname) + * cdl_[set|get]Title (cdl, imtitle) + * + * + * GRAPHICS OVERLAY ROUTINES: + * -------------------------- + * cdl_mapFrame (cdl, frame) + * cdl_markPoint (cdl, x, y, number, size, type, color) + * cdl_markLine (cdl, xs, ys, xe, ye, color) + * cdl_markBox (cdl, lx, ly, ux, uy, fill, color) + * cdl_markPolyline (cdl, xpts, ypts, npts, color) + * cdl_markPolygon (cdl, xpts, ypts, npts, fill, color) + * cdl_markCircle (cdl, x, y, radius, fill, color) + * cdl_markCircAnnuli (cdl, x, y, radius, nannuli, sep, color) + * cdl_markEllipse (cdl, x, y, xrad, yrad, ang, fill, color) + * cdl_markEllipAnnuli (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) + * cdl_markText (cdl, x, y, str, size, angle, color) + * + * cdl_setFont (cdl, type) + * + * cdl_deleteMark (cdl, x, y) + * cdl_clearOverlay (cdl) + * cdl_redrawOverlay (cdl) + * + * + * Client applications begin with a cdl_open() call to initialize the + * interface. The "imtdev" argument is used to specify a connection at device + * open time, or if NULL the procedure will attempt to first connect on a unix + * socket or fifo pipe if that fails. The syntax for the imtdev argument is + * as follows: + * <domain> : <address> + * + * where <domain> is one of "inet" (internet tcp/ip socket), "unix" (unix + * domain socket) or "fifo" (named pipe). The form of the address depends + * upon the domain, see the IMD interface code comments or documentation + * for examples. + * + * The library assumes a logical coordinate system that has the image or + * raster origin in the lower-left corner. All I/O routines should be passed + * or will return a pixel pointer set to the LL corner of the raster, all + * cursor positions will similarly use this coordinate system. Initially the + * [0,0] origin is defined as the LL of the frame buffer, this will remain + * the case until the WCS is redefined either explicitly through a cdl_setWCS() + * call or by using one of the high level cdl_display*() procedures to display + * an image smaller that the current frame buffer. Applications wishing to + * retain this initial origin or those wanting to explicitly place the image + * in the frame buffer should use the cdl_writeSubRaster() for display. This + * is to allow cursor and subraster positions to be specified in image coord- + * inates more easily. Negative positions are allowed and will either refer + * to empty pixels if the frame buffer is larger than the image, or pixels + * outside the frame buffer boundaries. Raster I/O requests will be clipped + * to the frame buffer endpoints, a request completely outside the frame buffer + * is an error. + * + * The high-level display routines cdl_displayIRAF() and cdl_displayFITS() + * can be used to display images directly by name. A WCS will automatically + * be defined for each image after the optional zscaling hass been computed. + * Applications wishing to define their own WCS need to call cdl_setWCS() + * after the display call to redefine the default WCS. + */ + +/* Function prototypes */ +#ifdef __STDC__ +#include <stddef.h> +#endif + +#ifdef ANSI_FUNC + +void cdl_zscale(uchar *im, int nx, int ny, int bitpix, float *z1, float *z2, float contrast, int opt_size, int len_stdline); +int cdl_freeDisplayList(CDLPtr cdl, MarkerPtr head); + +extern char *mktemp(char *template); +extern int system(const char *cmd); +extern void bcopy(char *b1, char *b2, int length); + +#endif + +/* Display list declarations. We keep a separate list for each frame that + * is freed whenever a new image is displayed. The list is maintained as + * a doubly-linked list of Marker structs. + */ +extern MarkerPtr DLHead[MAX_FRAMES]; /* diplay list head */ +extern MarkerPtr DLTail[MAX_FRAMES]; /* diplay list tail */ + + +int cdl_debug = 0; + +static void cdl_applyZscale(), cdl_flip(); + + +/* CDL_OPEN -- Open and initialize the CDL package. + */ + +#ifdef ANSI_FUNC + +CDLPtr +cdl_open ( + char *imtdev /* connection device */ +) +#else + +CDLPtr +cdl_open (imtdev) +char *imtdev; /* connection device */ +#endif +{ + register int i; + CDLPtr cdl; + IMDPtr imd_open(); + + /* If the debug flag isn't set in the code, see if it's set in the + * runtime environment. + */ + if (cdl_debug == 0) { + if (getenv("CDL_DEBUG") != NULL) + cdl_debug = atoi(getenv("CDL_DEBUG")); + else + cdl_debug = 0; + cdl_setDebug (cdl_debug); + } + + if (cdl_debug) + printf ("%s\n[cdl_open] imtdev='%s'\n", CDL_VERSION, + (imtdev ? imtdev : "")); + + /* Allocate the cdl structure. */ + cdl = (struct CDL *) calloc (1, sizeof (struct CDL)); + + /* Open the connection to the server. */ + cdl->imd = imd_open ((imtdev == NULL) ? getenv("IMTDEV") : imtdev); + if (cdl->imd == (IMDPtr) NULL) { + free ((char *)cdl); + return (NULL); + } + + /* Initialize the CDL structure. */ + cdl->frame = 1; + cdl->fbconfig = 1; + cdl->fbwidth = 512; + cdl->fbheight = 512; + cdl->fbnf = 2; + cdl->im_nx = 512; + cdl->im_ny = 512; + + cdl->contrast = DEF_CONTRAST; + cdl->nsample = DEF_NSAMPLE; + cdl->nsamplines = DEF_NSAMPLINES; + + cdl->font = F_ROMAN; + cdl->textwidth = 1; + cdl->linewidth = 1; + cdl->linestyle = L_SOLID; + + /* Initialize a WCS. */ + cdl->a = 1.0; + cdl->b = 0.0; + cdl->c = 0.0; + cdl->d = -1.0; + cdl->tx = 1.0; /* default for 512x512 fb */ + cdl->ty = 512.0; /* default for 512x512 fb */ + cdl->z1 = 0.0; + cdl->z2 = 255.0; + cdl->ztrans = CDL_LINEAR; + + /* Initialize the mapping. */ + cdl->sx = 1.0; + cdl->sy = 1.0; + cdl->snx = 512; + cdl->sny = 512; + cdl->dx = 0; + cdl->dy = 0; + cdl->dnx = 511; + cdl->dny = 511; + + cdl->iis_version = cdl->imd->iis_version; + cdl->iis_valid = cdl->imd->iis_valid; + + cdl->imname = (char *) calloc (SZ_NAME, sizeof(char)); + cdl->imtitle = (char *) calloc (SZ_NAME, sizeof(char)); + cdl->region = (char *) calloc (SZ_NAME, sizeof(char)); + cdl->ref = (char *) calloc (SZ_NAME, sizeof(char)); + + /* Initialize the display list. */ + for (i=0; i < MAX_FRAMES; i++) + DLHead[i] = DLTail[i] = (MarkerPtr) NULL; + + return (cdl); +} + + +/* CDL_DISPLAYPIX -- Display a raw pixel array to the server. Pixels may + * be larger than 8-bits; they will be scaled for display either through + * a simple minmax scaling to 8-bits if zscale=0, or an optimal Z-transform + * will be computed and used if zscale=1. + */ + +#ifdef ANSI_FUNC + +int +cdl_displayPix ( + CDLPtr cdl, /* package ptr */ + uchar *pix, /* pixels to display */ + int nx, + int ny, /* image dimensions */ + int bitpix, /* pixel size */ + int frame, /* display frame */ + int fbconfig, /* frame bvuffer config */ + int zscale /* do zscale of image? */ +) +#else + +int +cdl_displayPix (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) +CDLPtr cdl; /* package ptr */ +uchar *pix; /* pixels to display */ +int nx, ny; /* image dimensions */ +int bitpix; /* pixel size */ +int frame; /* display frame */ +int fbconfig; /* frame bvuffer config */ +int zscale; /* do zscale of image? */ +#endif +{ + float z1 = 0.0, z2 = 0.0; + int fb = fbconfig, w, h, nframes; + + if (cdl_debug) + printf ("[cdl_displayPix] %dx%d-%d frame=%d fb=%d zscale=%d\n", + nx, ny, bitpix, frame, fbconfig, zscale); + + /* Sanity check. */ + if (frame < 1 || frame > MAX_FRAMES) { + perror ("cdl_displayPix: invalid frame number"); + return (ERR); + } + + if (zscale) { + /* Compute the optimal zscale values. */ + cdl_computeZscale (cdl, pix, nx, ny, bitpix, &z1, &z2); + cdl_zscaleImage (cdl, &pix, nx, ny, bitpix, z1, z2); + cdl_setZScale (cdl, z1, z2); + cdl->imd->z1 = z1; + cdl->imd->z2 = z2; + } + + /* See if we need to free the display list for the frame. */ + if (DLHead[frame-1] != (MarkerPtr) NULL) + (void) cdl_freeDisplayList (cdl, DLHead[frame-1]); + + /* Do the frame buffer configuration if needed. */ + if (fbconfig == FB_AUTO) { + cdl_selectFB (cdl, nx, ny, &fb, &w, &h, &nframes, True); + } else if (fbconfig != cdl->fbconfig) { + cdl_setFBConfig (cdl, fbconfig); + fb = max (1, fbconfig); + } + + cdl->frame = frame; + cdl->im_nx = nx; + cdl->im_ny = ny; + + return (imd_displayImage (cdl->imd, pix, nx, ny, frame, fb, 1)); +} + + +/* CDL_READCURSOR -- Read the current cursor position. If sample is defined + * logical cursor position will be sampled and returned immediately, otherwise + * the server will block until a key is hit and we return that value as well. + */ + +#ifdef ANSI_FUNC + +char +cdl_readCursor ( + CDLPtr cdl, /* package ptr */ + int sample, /* wait for keystroke? */ + float *x, + float *y, /* position (output) */ + int *wcs, /* WCS */ + char *key /* keystroke (output) */ +) +#else + +char +cdl_readCursor (cdl, sample, x, y, wcs, key) +CDLPtr cdl; /* package ptr */ +int sample; /* wait for keystroke? */ +float *x, *y; /* position (output) */ +int *wcs; /* WCS */ +char *key; /* keystroke (output) */ +#endif +{ + int status; + + if (cdl_debug) + printf ("[cdl_readCursor]\n"); + + status = imd_readCursor (cdl->imd, sample, x, y, wcs, key); + return (*key); +} + + +/* CDL_SETCURSOR -- Set the current logical cursor position. If 'wcs' is + * non-zero the cursor position is assumed to be defined in terms of the + * current image WCS, otherwise it is in frame buffer coordinates. + */ + +#ifdef ANSI_FUNC + +int +cdl_setCursor ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* position */ + int wcs /* cursor wcs */ +) +#else + +int +cdl_setCursor (cdl, x, y, wcs) +CDLPtr cdl; /* package ptr */ +int x, y; /* position */ +int wcs; /* cursor wcs */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setCursor] x=%d y=%d wcs=%d\n", x, y, wcs); + + return (imd_setCursor (cdl->imd, x, y, wcs)); +} + + +/* CDL_SETWCS -- Set the WCS of the screen. The WCS is passed in a string + * defined as: + * Image_Name_String\n a b c d tx ty z1 z2 zt + * where: + * X' = a*X + c*Y + tx + * Y' = b*X + d*Y + ty + * + * z1 is the minimum pixel value, z2 is the maximum pixel value, zt + * defines the type of transformation to use. + */ + +#ifdef ANSI_FUNC + +int cdl_setWCS ( + CDLPtr cdl, /* package ptr */ + char *imname, /* name string */ + char *imtitle, /* title string */ + float a, + float b, + float c, + float d, /* WCS values */ + float tx, + float ty, /* translation */ + float z1, + float z2, /* zscale values */ + int zt /* transformation type */ +) +#else + +int +cdl_setWCS (cdl, imname, imtitle, a, b, c, d, tx, ty, z1, z2, zt) +CDLPtr cdl; /* package ptr */ +char *imname; /* name string */ +char *imtitle; /* title string */ +float a, b, c, d; /* WCS values */ +float tx, ty; /* translation */ +float z1, z2; /* zscale values */ +int zt; /* transformation type */ +#endif +{ + int status = 0; + + + if (cdl_debug) { + printf ("[cdl_setWCS] name='%s' title='%s'\n", (imname?imname:""), + (imtitle?imtitle:"")); + printf ("\ta=%g b=%g c=%g d=%g tx=%g ty=%g z1=%g z2=%g zt=%d\n", + a, b, c, d, tx, ty, z1, z2, zt); + } + + strcpy (cdl->imname, (imname ? imname : "")); + strcpy (cdl->imtitle, (imtitle ? imtitle : "")); + cdl->a = a; + cdl->b = b; + cdl->c = c; + cdl->d = d; + cdl->tx = tx; + cdl->ty = ty; + cdl->z1 = z1; + cdl->z2 = z2; + cdl->ztrans = zt; + + /* Send the WCS. */ + status = imd_setWCS (cdl->imd, imname, imtitle, a, b, c, d, tx, ty, + z1, z2, zt); + + /* Invalidate the mapping once it's been sent. */ + cdl->iis_valid = 0; + + return (status); +} + + +/* CDL_GETWCS -- Get the current display frame WCS information. + */ + +#ifdef ANSI_FUNC + +int +cdl_getWCS ( + CDLPtr cdl, /* package ptr */ + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt /* transformation type */ +) +#else + +int +cdl_getWCS (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +CDLPtr cdl; /* package ptr */ +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +#endif +{ + int wcs = 0; /* get the frame WCS */ + int status = imd_getWCS (cdl->imd, wcs, name, title, a, b, c, d, + tx, ty, z1, z2, zt); + + cdl->iis_valid = cdl->imd->iis_valid; + + if (cdl_debug) { + printf ("[cdl_getWCS] name='%s' title='%s'\n", (name ? name : ""), + (title ? title : "")); + printf ("\ta=%g b=%g c=%g d=%g tx=%g ty=%g z1=%g z2=%g zt=%d\n", + *a, *b, *c, *d, *tx, *ty, *z1, *z2, *zt); + } + + return (status); +} + + +/* CDL_SETMAPPING -- Set the mapping information to be sent with the next + * cdl_setWcs() call. + */ +#ifdef ANSI_FUNC + +int +cdl_setMapping ( + CDLPtr cdl, /* package ptr */ + char *region, /* region name */ + float sx, /* source rect */ + float sy, + int snx, /* source extent */ + int sny, + int dx, /* dest rect */ + int dy, + int dnx, /* dest extent */ + int dny, + char *ref /* reference name */ +) +#else + +int +cdl_setMapping (cdl, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +CDLPtr cdl; /* package ptr */ +char *region; /* region name */ +float sx, sy; /* source rect */ +int snx, sny; /* source extent */ +int dx, dy; /* dest rect */ +int dnx, dny; /* dest extent */ +char *ref; /* reference name */ +#endif +{ + if (cdl_debug) { + printf ("[cdl_setMapping] region='%s' ref='%s'\n", + (region ? region : ""), (ref ? ref : "")); + printf ("\tsrc = %g,%g,%d,%d dest = %d,%d,%d,%d\n", + sx, sy, snx, sny, dx, dy, dnx, dny); + } + + strcpy (cdl->region, (region ? region : "")); + strcpy (cdl->ref, (ref ? ref : "")); + cdl->sx = sx; + cdl->sy = sy; + cdl->snx = snx; + cdl->sny = sny; + cdl->dx = dx; + cdl->dy = dy; + cdl->dnx = dnx; + cdl->dny = dny; + + return ((cdl->iis_valid = imd_setMapping (cdl->imd, + region, sx,sy,snx,sny, dx,dy,dnx,dny, ref))); +} + + +/* CDL_GETMAPPING -- Get the mapping information returned with the last + * cdl_getWcs() call. + */ +#ifdef ANSI_FUNC +int +cdl_getMapping ( + CDLPtr cdl, /* package ptr */ + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref /* reference name */ +) + +#else +int +cdl_getMapping (cdl, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +CDLPtr cdl; /* package ptr */ +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +#endif +{ + int + status = imd_getMapping (cdl->imd, region, + sx,sy,snx,sny, dx,dy,dnx,dny, ref); + + if (cdl_debug) { + printf ("[cdl_getMapping] region='%s' ref='%s'\n", + (region ? region : ""), (ref ? ref : "")); + printf ("\tsrc = %g,%g,%d,%d dest = %d,%d,%d,%d\n", + *sx, *sy, *snx, *sny, *dx, *dy, *dnx, *dny); + } + + return (status); +} + + +/* CDL_QUERYMAP -- Query a mapping given the wcs number. + */ +#ifdef ANSI_FUNC + +int +cdl_queryMap ( + CDLPtr cdl, /* package ptr */ + int wcs, /* requested wcs number */ + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *objref /* reference name */ +) +#else + +int +cdl_queryMap (cdl, wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref) +CDLPtr cdl; /* package ptr */ +int wcs; /* requested wcs number */ +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *objref; /* reference name */ +#endif +{ + float a, b, c, d, tx, ty, z1, z2; + int zt; + char name[256], title[256]; + int wcs_status = ERR; + int frame = wcs / 100; + + + if (cdl->iis_version > 0) { + /* Do a WCS query so we get the requested mapping. */ + wcs_status = imd_getWCS (cdl->imd, wcs, name, title, + &a, &b, &c, &d, &tx, &ty, &z1, &z2, &zt); + + /* What we really want is the mapping info for the WCS */ + wcs_status = cdl_getMapping (cdl, region, sx,sy,snx,sny, + dx,dy,dnx,dny, objref); + + if (cdl_debug) { + printf ("[cdl_queryMap] wcs=%d name='%s' title='%s'\n", + wcs, (name ? name : ""), (title ? title : "")); + printf ("\ta=%g b=%g c=%g d=%g tx=%g ty=%g z1=%g z2=%g zt=%d\n", + a, b, c, d, tx, ty, z1, z2, zt); + printf ("\tregion='%s' ref='%s'\n", + (region ? region : ""), (objref ? objref : "")); + printf ("\tsrc = %g,%g,%d,%d dest = %d,%d,%d,%d\n", + sx, sy, snx, sny, dx, dy, dnx, dny); + } + } + + return (wcs_status); +} + + + +/* CDL_CLEARFRAME -- Erase the current display frame. + */ + +#ifdef ANSI_FUNC + +int +cdl_clearFrame ( + CDLPtr cdl /* package ptr */ +) +#else + +int +cdl_clearFrame (cdl) +CDLPtr cdl; /* package ptr */ +#endif +{ + if (cdl_debug) + printf ("[cdl_clearFrame]\n"); + + return (imd_clearFrame (cdl->imd)); +} + + +/* CDL_SELECTFB -- Select a frame buffer large enough to contain an image + * of the given size. Instead of finding jsut the first buffer large + * enough to hold the image look for one with minimal edge space. + */ + +#ifdef ANSI_FUNC + +void +cdl_selectFB ( + CDLPtr cdl, /* package ptr */ + int nx, + int ny, /* image size */ + int *fb, /* frame buffer */ + int *w, + int *h, /* frame size */ + int *nf, /* number of frames */ + int reset /* reset after select */ +) +#else + +void +cdl_selectFB (cdl, nx, ny, fb, w, h, nf, reset) +CDLPtr cdl; /* package ptr */ +int nx, ny; /* image size */ +int *fb; /* frame buffer */ +int *w, *h; /* frame size */ +int *nf; /* number of frames */ +int reset; /* reset after select */ +#endif +{ + register int i, edges, mintab = -1, tmin = 100000; + FBTab tab; + + if (cdl_debug) + printf ("[cdl_selectFb] nx=%d ny=%d ", nx, ny); + + for (i=0; i < MAX_FBCONFIG; i++) { + tab = *cdl->imd->fbtab[i]; + if (tab.width == nx && tab.height == ny) { + /* Get an exact match first. */ + tab = *cdl->imd->fbtab[i]; + goto found; + + } else if (tab.width >= nx && tab.height >= ny) { + /* Look for match with smallest padding. */ + edges = tab.width - nx + tab.height - ny; + if (edges < tmin) { + tmin = edges; + mintab = i; + } + } + } + if (mintab >= 0) { + tab = *cdl->imd->fbtab[mintab]; + goto found; + } + + /* Couldn't find one, punt and use the default. */ + fprintf (stderr, + "Warning: cannot find adequate frame buffer, using default.\n"); + tab = *cdl->imd->fbtab[0]; +found: + *fb = tab.config; + *w = tab.width; + *h = tab.height; + *nf = tab.nframes; + if (reset && cdl->fbconfig != *fb) + cdl_setFBConfig (cdl, *fb); + + if (cdl_debug) + printf ("-> fb=%d w=%d h=%d nf=%d\n", *fb, *w, *h, *nf); +} + + +/* CDL_CLOSE -- Close the CDL package descriptor. + */ + +#ifdef ANSI_FUNC + +void +cdl_close ( + CDLPtr cdl /* package ptr */ +) +#else + +void +cdl_close (cdl) +CDLPtr cdl; /* package ptr */ +#endif +{ + register int i; + + if (cdl_debug) + printf ("[cdl_close]\n"); + + for (i=0; i < MAX_FRAMES; i++) + if (DLHead[i] != (MarkerPtr) NULL) + cdl_freeDisplayList (cdl, DLHead[i]); + + free ((char *) cdl->imname); + free ((char *) cdl->imtitle); + free ((char *) cdl->region); + free ((char *) cdl->ref); + + imd_close (cdl->imd); + free ((CDLPtr) cdl); +} + + + +/* CDL_READIMAGE -- Read the currently displayed image and return a pointer to + * the array and it's dimensions. Since we know where the image was written + * in the frame buffer this is really just a large subregion read. + */ + +#ifdef ANSI_FUNC + +int +cdl_readImage ( + CDLPtr cdl, /* package ptr */ + uchar **pix, /* image pixels (output)*/ + int *nx, + int *ny /* dimensions (output) */ +) +#else + +int +cdl_readImage (cdl, pix, nx, ny) +CDLPtr cdl; /* package ptr */ +uchar **pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +#endif +{ + int status; + + if (*pix == NULL) + *pix = (uchar *) malloc (cdl->im_nx * cdl->im_ny); + + status = imd_readImage (cdl->imd, *pix, nx, ny); + if (cdl_debug) + printf ("[cdl_readImage] %dx%d pixels\n", *nx, *ny); + + return (status); +} + + +/* CDL_READFRAMEBUFFER -- Read the contents of the entire frame buffer and + * return a pointer to the array and it's dimensions. + */ + +#ifdef ANSI_FUNC + +int +cdl_readFrameBuffer ( + CDLPtr cdl, /* package ptr */ + uchar **pix, /* image pixels (output)*/ + int *nx, + int *ny /* dimensions (output) */ +) +#else + +int +cdl_readFrameBuffer (cdl, pix, nx, ny) +CDLPtr cdl; /* package ptr */ +uchar **pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +#endif +{ + int status; + + if (*pix == NULL) + *pix = (uchar *) malloc (cdl->fbwidth * cdl->fbheight); + + status = imd_readFrameBuffer (cdl->imd, *pix, nx, ny); + if (cdl_debug) + printf ("[cdl_readFrameBuffer] %dx%d pixels\n", *nx, *ny); + + return (status); +} + + +/* CDL_COMPUTEZSCALE -- Compute the optimal z1/z2 values for an array. We + * don't transform the pixels, just compute the values. + */ + +#ifdef ANSI_FUNC + +void +cdl_computeZscale ( + CDLPtr cdl, /* package ptr */ + uchar *pix, /* data to be sampled */ + int nx, + int ny, /* image dimensions */ + int bitpix, /* bits per pixel */ + float *z1, + float *z2 /* min/max zscale values*/ +) +#else + +void +cdl_computeZscale (cdl, pix, nx, ny, bitpix, z1, z2) +CDLPtr cdl; /* package ptr */ +uchar *pix; /* data to be sampled */ +int nx, ny; /* image dimensions */ +int bitpix; /* bits per pixel */ +float *z1, *z2; /* min/max zscale values*/ +#endif +{ + register float np = nx * ny; + + cdl_zscale ((uchar *)pix, + nx, ny, + bitpix, + z1, z2, + cdl->contrast, + cdl->nsample, + MAX(2, + (int)(cdl->nsample / (cdl->nsamplines > 0 ? + cdl->nsamplines : + (int)((float)ny / sqrt(np / (float)cdl->nsample))) ))); + + if (cdl_debug) + printf ("[cdl_computeZscale] %dx%d-%d --> z1=%g z2=%g zt=%d\n", + nx, ny, bitpix, *z1, *z2, cdl->ztrans); +} + + +/* CDL_ZSCALEIMAGE -- Compute the optimal z1/z2 values for an array and then + * scale the pixels. We only compute the scale values if they're not input, + * otherwise we used the values passed in. + */ + +#ifdef ANSI_FUNC + +void +cdl_zscaleImage ( + CDLPtr cdl, /* package ptr */ + uchar **pix, /* data to be sampled */ + int nx, + int ny, /* image dimensions */ + int bitpix, /* bits per pixel */ + float z1, + float z2 /* min/max zscale values*/ +) +#else + +void +cdl_zscaleImage (cdl, pix, nx, ny, bitpix, z1, z2) +CDLPtr cdl; /* package ptr */ +uchar **pix; /* data to be sampled */ +int nx, ny; /* image dimensions */ +int bitpix; /* bits per pixel */ +float z1, z2; /* min/max zscale values*/ +#endif +{ + if (cdl_debug) + printf ("[cdl_zscaleImage]\n"); + + cdl_setZScale (cdl, z1, z2); + cdl_applyZscale (cdl, pix, nx, ny, bitpix); +} + + +/* CDL_PRINTPIX -- Print the given pixels as EPS to the named command. + * We assume that the 'cmd' argument is a unix command string that takes + * input from the stdin. + */ + +#ifdef ANSI_FUNC + +int +cdl_printPix ( + CDLPtr cdl, /* package ptr */ + char *cmd, /* command string */ + uchar *pix, /* pixel array */ + int nx, + int ny, /* image dimensions */ + int annotate /* annotate output? */ +) +#else + +int +cdl_printPix (cdl, cmd, pix, nx, ny, annotate) +CDLPtr cdl; /* package ptr */ +char *cmd; /* command string */ +uchar *pix; /* pixel array */ +int nx, ny; /* image dimensions */ +int annotate; /* annotate output? */ +#endif +{ + FILE *fp; + PSImagePtr psim, eps_init(); + char tmpfile[SZ_NAME], text[SZ_NAME]; + extern char *mktemp(); + extern int system(); + + if (cdl_debug) + printf ("[cdl_printPix] cmd='%s' %dx%d annotate=%d\n", + cmd, nx, ny, annotate); + + /* Open the image pointer each time since we assume it's not going to + * happen too often. + */ + psim = eps_init(); + + /* Print to a printer device. */ + strcpy (tmpfile, "/tmp/cdlXXXXXX"); + if (mktemp(tmpfile) == (char *)NULL) { + eps_close (psim); + return (ERR); + } + + if (!(fp = fopen (tmpfile, "w"))) { + eps_close (psim); + return (ERR); + } + psim->annotate = annotate; + cdl_flip (pix, nx, ny); + eps_setLabel (psim, cdl->imname); + eps_setCorners (psim, 0, 0, nx, ny); + eps_setColorType (psim, EPS_PSEUDOCOLOR); + eps_setCmap (psim, cmap_r, cmap_g, cmap_b, 256); + eps_print (psim, fp, pix, nx, ny, 8, 0); + + sprintf (text, "cat %s | %s", tmpfile, (cmd ? cmd : "lpr")); + (void)system (text); /* dispose to printer */ + unlink (tmpfile); /* delete tmp file */ + + /* Clean up. */ + fclose (fp); + eps_close (psim); + return (OK); +} + + +/* CDL_PRINTPIXTOFILE -- Print the given pixels as EPS to the named file. + */ + +#ifdef ANSI_FUNC + +int +cdl_printPixToFile ( + CDLPtr cdl, /* package ptr */ + char *fname, /* filename */ + uchar *pix, /* pixel array */ + int nx, + int ny, /* image dimensions */ + int annotate /* annotate output? */ +) +#else + +int +cdl_printPixToFile (cdl, fname, pix, nx, ny, annotate) +CDLPtr cdl; /* package ptr */ +char *fname; /* filename */ +uchar *pix; /* pixel array */ +int nx, ny; /* image dimensions */ +int annotate; /* annotate output? */ +#endif +{ + FILE *fp; + PSImagePtr psim, eps_init(); + + if (cdl_debug) + printf ("[cdl_printPixToFile] fname='%s' %dx%d annotate=%d\n", + fname, nx, ny, annotate); + + /* Open the image pointer each time since we assume it's not going to + * happen too often. + */ + psim = eps_init(); + + /* Dump the EPS to the file. */ + if (access (fname, F_OK) < 0) { + if ((fp = fopen (fname, "w"))) { + eps_setLabel (psim, cdl->imname); + psim->annotate = annotate; + cdl_flip (pix, nx, ny); + eps_setColorType (psim, EPS_PSEUDOCOLOR); + eps_setCmap (psim, cmap_r, cmap_g, cmap_b, 256); + eps_setCorners (psim, 0, 0, nx, ny); + eps_print (psim, fp, pix, nx, nx, 8, 0); + fclose (fp); + } else { + fprintf (stderr, "Could not open file %s", fname); + eps_close (psim); + return (ERR); + } + } + + eps_close (psim); + return (OK); +} + + + +/* CDL_READSUBRASTER -- Read a rectangular region of the frame buffer. + */ + +#ifdef ANSI_FUNC + +int +cdl_readSubRaster ( + CDLPtr cdl, /* package ptr */ + int lx, + int ly, /* region corner */ + int nx, + int ny, /* dimensions */ + uchar **pix /* image pixels (output)*/ +) +#else + +int +cdl_readSubRaster (cdl, lx, ly, nx, ny, pix) +CDLPtr cdl; /* package ptr */ +int lx, ly; /* region corner */ +int nx, ny; /* dimensions */ +uchar **pix; /* image pixels (output)*/ +#endif +{ + register int llx, lly; + + if (*pix == NULL) + *pix = (uchar *) malloc (nx * ny); + + llx = lx + (cdl->fbwidth / 2) - (cdl->im_nx / 2); + lly = ly + cdl->fbheight - ((cdl->fbheight / 2) + (cdl->im_ny / 2)); + + if (cdl_debug) + printf ("[cdl_readSubRaster] %dx%d at [%d,%d] offset [%d,%d]\n", + nx, ny, lx, ly, llx, lly); + + return (imd_readSubRaster (cdl->imd, lx, ly, nx, ny, *pix)); +} + + +/* CDL_WRITESUBRASTER -- Write a rectangular region of the frame buffer. + */ + +#ifdef ANSI_FUNC + +int +cdl_writeSubRaster ( + CDLPtr cdl, /* package ptr */ + int lx, + int ly, /* region corner */ + int nx, + int ny, /* dimensions */ + uchar *pix /* subraster pixels */ +) +#else + +int +cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix) +CDLPtr cdl; /* package ptr */ +int lx, ly; /* region corner */ +int nx, ny; /* dimensions */ +uchar *pix; /* subraster pixels */ +#endif +{ + if (cdl_debug) + printf ("[cdl_writeSubRaster] %dx%d at [%d,%d]\n", + nx, ny, lx, ly); + + return (imd_writeSubRaster (cdl->imd, lx, ly, nx, ny, pix)); +} + + + +/* CDL_SETFBCONFIG -- Set the frame buffer configuration number. + */ + +#ifdef ANSI_FUNC + +void +cdl_setFBConfig ( + CDLPtr cdl, /* package ptr */ + int configno /* fb config number */ +) +#else + +void +cdl_setFBConfig (cdl, configno) +CDLPtr cdl; /* package ptr */ +int configno; /* fb config number */ +#endif +{ + int cfg = max (1, configno); + + if (cdl_debug) + printf ("[cdl_setFBConfig] configno=%d\n", configno); + + cdl->fbconfig = cfg; + cdl->fbwidth = cdl->imd->fbtab[cfg-1]->width; + cdl->fbheight = cdl->imd->fbtab[cfg-1]->height; + cdl->fbnf = cdl->imd->fbtab[cfg-1]->nframes; + (void) imd_setFBConfig (cdl->imd, cdl->fbconfig); +} + + +/* CDL_GETFBCONFIG -- Get the frame buffer configuration number. + */ + +#ifdef ANSI_FUNC + +void +cdl_getFBConfig ( + CDLPtr cdl, /* package ptr */ + int *configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nframes /* number of frames */ +) +#else + +void +cdl_getFBConfig (cdl, configno, w, h, nframes) +CDLPtr cdl; /* package ptr */ +int *configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nframes; /* number of frames */ +#endif +{ + *configno = cdl->fbconfig; + *w = cdl->fbwidth; + *h = cdl->fbheight; + *nframes = cdl->fbnf; + + if (cdl_debug) + printf ("[cdl_getFBConfig] configno=%d\n", *configno); +} + + +/* CDL_LOOKUPFBSIZE -- Get the frame buffer dimensions given a config number. + */ + +#ifdef ANSI_FUNC + +void +cdl_lookupFBSize ( + CDLPtr cdl, /* package ptr */ + int configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nf /* number of frames */ +) +#else + +void +cdl_lookupFBSize (cdl, configno, w, h, nf) +CDLPtr cdl; /* package ptr */ +int configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nf; /* number of frames */ +#endif +{ + *w = cdl->imd->fbtab[configno-1]->width; + *h = cdl->imd->fbtab[configno-1]->height; + *nf = cdl->imd->fbtab[configno-1]->nframes; + + if (cdl_debug) { + printf ("[cdl_lookupFBSize] configno=%d size=%dx%d\n", configno, + *w, *h); + } +} + + + +/* CDL_SETFRAME -- Set the current display frame. + */ + +#ifdef ANSI_FUNC + +void +cdl_setFrame ( + CDLPtr cdl, /* package ptr */ + int frame /* frame number */ +) +#else + +void +cdl_setFrame (cdl, frame) +CDLPtr cdl; /* package ptr */ +int frame; /* frame number */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setFrame] frame=%d\n", frame); + + /* Sanity check. */ + if (frame < 1 || frame > MAX_FRAMES) { + perror ("cdl_setFrame: invalid frame number - resetting."); + } + + cdl->frame = max(1,min(MAX_FRAMES,frame)); + (void) imd_setFrame (cdl->imd, cdl->frame); +} + + +/* CDL_SETZTRANS -- Set the current zscale transform parameters. + */ + +#ifdef ANSI_FUNC + +void +cdl_setZTrans ( + CDLPtr cdl, /* package ptr */ + int ztrans /* z-transform type */ +) +#else + +void +cdl_setZTrans (cdl, ztrans) +CDLPtr cdl; /* package ptr */ +int ztrans; /* z-transform type */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setZTrans] zt=%d\n", ztrans); + + cdl->ztrans = ztrans; +} + + +/* CDL_SETZSCLAE -- Set the current zscale transform parameters. + */ + +#ifdef ANSI_FUNC + +void +cdl_setZScale ( + CDLPtr cdl, /* package ptr */ + float z1, + float z2 /* zscale values */ +) +#else + +void +cdl_setZScale (cdl, z1, z2) +CDLPtr cdl; /* package ptr */ +float z1, z2; /* zscale values */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setZScale] z1=%g z2=%g\n", z1, z2); + + cdl->z1 = z1; + cdl->z2 = z2; + cdl->imd->z1 = z1; + cdl->imd->z2 = z2; +} + + +/* CDL_SETSAMPLE -- Set the number of zscale sample points to use. + */ + +#define cdl_setNSamples (cdl, ns) cdl_setSample(cdl,ns) +#define cdl_setSamples (cdl, ns) cdl_setSample(cdl,ns) + +#ifdef ANSI_FUNC + +void +cdl_setSample ( + CDLPtr cdl, /* package ptr */ + int nsample /* no. of sample pts */ +) +#else + +void +cdl_setSample (cdl, nsample) +CDLPtr cdl; /* package ptr */ +int nsample; /* no. of sample pts */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setSample] nsample=%d\n", nsample); + + cdl->nsample = MAX(5,nsample); +} + + +/* CDL_SETSAMPLELINES -- Set the number of zscale sample lines to use. + */ + +#ifdef ANSI_FUNC + +void +cdl_setSampleLines ( + CDLPtr cdl, /* package ptr */ + int nlines /* no. of sample lines */ +) +#else + +void +cdl_setSampleLines (cdl, nlines) +CDLPtr cdl; /* package ptr */ +int nlines; /* no. of sample lines */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setSampleLines] nlines=%d\n", nlines); + + cdl->nsamplines = MAX(1,nlines); +} + + +/* CDL_SETCONTRAST -- Set the zscale contrast value. + */ + +#ifdef ANSI_FUNC + +void +cdl_setContrast ( + CDLPtr cdl, /* package ptr */ + float contrast /* contrast value */ +) +#else + +void +cdl_setContrast (cdl, contrast) +CDLPtr cdl; /* package ptr */ +float contrast; /* contrast value */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setContrast] contrast=%g\n", contrast); + + cdl->contrast = contrast; +} + + +/* CDL_SETNAME -- Set the image name for the WCS string. + */ + +#ifdef ANSI_FUNC + +void +cdl_setName ( + CDLPtr cdl, /* package ptr */ + char *imname /* image name */ +) +#else + +void +cdl_setName (cdl, imname) +CDLPtr cdl; /* package ptr */ +char *imname; /* image name */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setName] name='%s'\n", (imname?imname:"")); + + (void) imd_setName(cdl->imd, imname); +} + + +/* CDL_SETTITLE -- Set the image title for the WCS string. + */ + +#ifdef ANSI_FUNC + +void +cdl_setTitle ( + CDLPtr cdl, /* package ptr */ + char *imtitle /* image title */ +) +#else + +void +cdl_setTitle (cdl, imtitle) +CDLPtr cdl; /* package ptr */ +char *imtitle; /* image title */ +#endif +{ + if (cdl_debug) + printf ("[cdl_setTitle] title='%s'\n", (imtitle?imtitle:"")); + + (void) imd_setTitle(cdl->imd, imtitle); +} + + +/* CDL_GETFRAME -- Get the current display frame. + */ + +#ifdef ANSI_FUNC + +void +cdl_getFrame ( + CDLPtr cdl, /* package ptr */ + int *frame /* frame number */ +) +#else + +void +cdl_getFrame (cdl, frame) +CDLPtr cdl; /* package ptr */ +int *frame; /* frame number */ +#endif +{ + float x, y; + int wcs; + char key; + + (void) imd_readCursor (cdl->imd, 1, &x, &y, &wcs, &key); + *frame = (int) (wcs / 100); + + if (*frame == 0) + *frame = cdl->frame; + + if (cdl_debug) + printf ("[cdl_getFrame] frame=%d\n", *frame); +} + + +/* CDL_GETZTRANS -- Get the current zscale transform parameters. + */ + +#ifdef ANSI_FUNC + +void +cdl_getZTrans ( + CDLPtr cdl, /* package ptr */ + int *ztrans /* z-transform type */ +) +#else + +void +cdl_getZTrans (cdl, ztrans) +CDLPtr cdl; /* package ptr */ +int *ztrans; /* z-transform type */ +#endif +{ + *ztrans = cdl->ztrans; + + if (cdl_debug) + printf ("[cdl_getZTrans] zt=%d\n", *ztrans); +} + + +/* CDL_GETZTRANS -- Get the current zscale transform parameters. + */ + +#ifdef ANSI_FUNC + +void +cdl_getZScale ( + CDLPtr cdl, /* package ptr */ + float *z1, + float *z2 /* zscale values */ +) +#else + +void +cdl_getZScale (cdl, z1, z2) +CDLPtr cdl; /* package ptr */ +float *z1, *z2; /* zscale values */ +#endif +{ + *z1 = cdl->z1; + *z2 = cdl->z2; + + if (cdl_debug) + printf ("[cdl_getZScale] z1=%g z2=%g\n", *z1, *z2); +} + + +/* CDL_GETSAMPLE -- Get the number of zscale sample points to use. + */ + +#ifdef ANSI_FUNC + +void +cdl_getSample ( + CDLPtr cdl, /* package ptr */ + int *nsample /* no. of sample pts */ +) +#else + +void +cdl_getSample (cdl, nsample) +CDLPtr cdl; /* package ptr */ +int *nsample; /* no. of sample pts */ +#endif +{ + *nsample = cdl->nsample; + + if (cdl_debug) + printf ("[cdl_getSample] nsample=%d\n", *nsample); +} + + +/* CDL_GETSAMPLELINES -- Get the number of zscale sample lines to use. + */ + +#ifdef ANSI_FUNC + +void +cdl_getSampleLines ( + CDLPtr cdl, /* package ptr */ + int *nlines /* no. of sample lines */ +) +#else + +void +cdl_getSampleLines (cdl, nlines) +CDLPtr cdl; /* package ptr */ +int *nlines; /* no. of sample lines */ +#endif +{ + *nlines = cdl->nsamplines; + + if (cdl_debug) + printf ("[cdl_getSampleLines] nlines=%d\n", *nlines); +} + + +/* CDL_GETCONTRAST -- Get the zscale contrast value. + */ + +#ifdef ANSI_FUNC + +void +cdl_getContrast ( + CDLPtr cdl, /* package ptr */ + float *contrast /* contrast value */ +) +#else + +void +cdl_getContrast (cdl, contrast) +CDLPtr cdl; /* package ptr */ +float *contrast; /* contrast value */ +#endif +{ + *contrast = cdl->contrast; + + if (cdl_debug) + printf ("[cdl_getContrast] contrast=%g\n", *contrast); +} + + +/* CDL_GETNAME -- Get the image name for the WCS string. + */ + +#ifdef ANSI_FUNC + +void +cdl_getName ( + CDLPtr cdl, /* package ptr */ + char *imname /* image name */ +) +#else + +void +cdl_getName (cdl, imname) +CDLPtr cdl; /* package ptr */ +char *imname; /* image name */ +#endif +{ + if (imname) + strcpy (imname, cdl->imname); + + if (cdl_debug) + printf ("[cdl_setName] name='%s'\n", (imname?imname:"")); +} + + +/* CDL_GETTITLE -- Get the image title for the WCS string. + */ + +#ifdef ANSI_FUNC + +void +cdl_getTitle ( + CDLPtr cdl, /* package ptr */ + char *imtitle /* image title */ +) +#else + +void +cdl_getTitle (cdl, imtitle) +CDLPtr cdl; /* package ptr */ +char *imtitle; /* image title */ +#endif +{ + if (imtitle) + strcpy (imtitle, cdl->imtitle); + + if (cdl_debug) + printf ("[cdl_setTitle] title='%s'\n", (imtitle?imtitle:"")); +} + + +/* -------------------- + * PRIVATE PROCEDURES + * ------------------ */ + + + +/* CDL_SETDEBUG -- Set the state of the debug flag. + */ + +#ifdef ANSI_FUNC + +void +cdl_setDebug (int state) +#else + +void +cdl_setDebug (state) +int state; +#endif +{ + cdl_debug = state; + if (state >= 1) + imd_setDebug (state); + if (state >= 2) + com_setDebug (state); +} + + +/* CDL_APPLYZSCALE -- Compute the Zscale transform image given an array of + * raw pixels and image size. We use the z1/z2/ztrans values assumed to be + * previously stored. + */ + +#ifdef ANSI_FUNC + +static void +cdl_applyZscale ( + CDLPtr cdl, /* package ptr */ + uchar **pix, /* input image pixels */ + int nx, + int ny, /* image dimensions */ + int bitpix /* pixel type */ +) +#else + +static void +cdl_applyZscale (cdl, pix, nx, ny, bitpix) +CDLPtr cdl; /* package ptr */ +uchar **pix; /* input image pixels */ +int nx, ny; /* image dimensions */ +int bitpix; /* pixel type */ +#endif +{ + register int i, n = nx * ny, pmin = 1, pmax = 200; + register int smax, smin; + float pval, scale = 0.0, dscale = (200.0 / 3.0); + uchar *outpix ; + float z1, z2; /* zscale values */ + int zt; + extern void bcopy(); + + + if (cdl_debug) + printf ("[cdl_applyZscale] nx=%d by=%d bitpix=%d\n", nx,ny,bitpix); + + /* Move the input array to the output array before zscaling. */ + outpix = (uchar *) malloc (nx * ny); + bcopy ((char *)*pix, (char *)outpix, nx * ny); + + /* Get the zscale transform values. */ + cdl_getZTrans (cdl, &zt); + cdl_getZScale (cdl, &z1, &z2); + smin = (int) z1; + smax = (int) z2; + if (bitpix < 0) + scale = (z2 == z1) ? 0. : 200. / (z2 - z1); + else + scale = (smax == smin) ? 0. : 200. / (z2 - z1); + + + /* Now scale the pixels. */ + if (bitpix == 16) { + register short int *buffer = (short *)(*pix); + + if (zt == CDL_LINEAR) { + for (i=0; i < n; i++) + outpix[i] = max (pmin, min (pmax, + (int)(scale * (float)((int)buffer[i] - smin)) )); + } else if (zt == CDL_LOG) { + scale = (smax == smin) ? 0. : (1000.0 - 1.0) / (z2 - z1); + for (i=0; i < n; i++) { + /* Scale that to the range 1-1000 and take the log. */ + pval = max (1.0,min(1000.0, (scale * (buffer[i] - smin)) )); + pval = log10 (pval); + + /* Now scale back to the display range */ + outpix[i] = (uchar) max (pmin, min (pmax, + (uchar)(dscale * pval) )); + } + } else if (zt == CDL_UNITARY) { + for (i=0; i < n; i++) + outpix[i] = buffer[i]; + } + + } else if (bitpix == 32) { + register int *buffer = (int *)(*pix); + + if (zt == CDL_LINEAR) { + for (i=0; i < n; i++) + outpix[i] = max (pmin, min (pmax, + (int)(scale * (float)((int)buffer[i] - smin)) )); + } else if (zt == CDL_LOG) { + scale = (smax == smin) ? 0. : (1000.0 - 1.0) / (z2 - z1); + for (i=0; i < n; i++) { + /* Scale that to the range 1-1000 and take the log. */ + pval = max (1.0,min(1000.0, (scale * (buffer[i] - smin)) )); + pval = log10 (pval); + + /* Now scale back to the display range */ + outpix[i] = (uchar) max (pmin, min (pmax, + (uchar)(dscale * pval) )); + } + } else if (zt == CDL_UNITARY) { + for (i=0; i < n; i++) + outpix[i] = buffer[i]; + } + + } else if (bitpix == 64) { + register long int *buffer = (long *)(*pix); + + if (zt == CDL_LINEAR) { + for (i=0; i < n; i++) + outpix[i] = max (pmin, min (pmax, + (int)(scale * (float)((int)buffer[i] - smin)) )); + } else if (zt == CDL_LOG) { + scale = (smax == smin) ? 0. : (1000.0 - 1.0) / (z2 - z1); + for (i=0; i < n; i++) { + /* Scale that to the range 1-1000 and take the log. */ + pval = max (1.0,min(1000.0, (scale * (buffer[i] - smin)) )); + pval = log10 (pval); + + /* Now scale back to the display range */ + outpix[i] = (uchar) max (pmin, min (pmax, + (uchar)(dscale * pval) )); + } + } else if (zt == CDL_UNITARY) { + for (i=0; i < n; i++) + outpix[i] = buffer[i]; + } + + } else if (bitpix == -32) { + register float *buffer = (float *)(*pix); + + if (zt == CDL_LINEAR) { + for (i=0; i < n; i++) + outpix[i] = max (pmin, min (pmax, + (int)(scale * (float)((float)buffer[i] - z1)) )); + } else if (zt == CDL_LOG) { + scale = (smax == smin) ? 0. : (1000.0 - 1.0) / (z2 - z1); + for (i=0; i < n; i++) { + /* Scale that to the range 1-1000 and take the log. */ + pval = max (1.0,min(1000.0, (scale * (buffer[i] - z1)) )); + pval = log10 (pval); + + /* Now scale back to the display range */ + outpix[i] = (uchar) max (pmin, min (pmax, + (uchar)(dscale * pval) )); + } + } else if (zt == CDL_UNITARY) { + for (i=0; i < n; i++) + outpix[i] = buffer[i]; + } + + } else if (bitpix == -64) { + register double *buffer = (double *)(*pix); + + if (zt == CDL_LINEAR) { + for (i=0; i < n; i++) + outpix[i] = max (pmin, min (pmax, + (int)(scale * (float)((double)buffer[i] - z1)) )); + } else if (zt == CDL_LOG) { + scale = (smax == smin) ? 0. : (1000.0 - 1.0) / (z2 - z1); + for (i=0; i < n; i++) { + /* Scale that to the range 1-1000 and take the log. */ + pval = max (1.0,min(1000.0, (scale * (buffer[i] - z1)) )); + pval = log10 (pval); + + /* Now scale back to the display range */ + outpix[i] = (uchar) max (pmin, min (pmax, + (uchar)(dscale * pval) )); + } + } else if (zt == CDL_UNITARY) { + for (i=0; i < n; i++) + outpix[i] = buffer[i]; + } + } + + /* Copy the scaled pixel array back to the original raster. We don't + * realloc the pointer in case it's some static array. + */ + bcopy ((char *)outpix, (char *)*pix, n); + + if (cdl_debug) + printf ("[cdl_zscaleImage] %dx%d-%d --> z1=%g z2=%g zt=%d\n", + nx, ny, bitpix, z1, z2, zt); + + free ((char *) outpix); +} + + +/* CDL_FLIP -- Reverse order of lines in image. + */ + +#ifdef ANSI_FUNC + +static void +cdl_flip (uchar *buffer, int nx, int ny) +#else + +static void +cdl_flip (buffer, nx, ny) +uchar *buffer; +int nx; +int ny; +#endif +{ + register int i, j, v; + register uchar *buff1, *buff2; + + for (i = 0; i < ny / 2; i++) { + buff1 = &buffer[i*nx]; + buff2 = &buffer[(ny-1-i)*nx]; + for (j = 0; j < nx; j++) { + v = *buff1; + *(buff1++) = *buff2; + *(buff2++) = v; + } + } +} diff --git a/vendor/x11iraf/cdl/cdl.h b/vendor/x11iraf/cdl/cdl.h new file mode 100644 index 00000000..8abdd8a3 --- /dev/null +++ b/vendor/x11iraf/cdl/cdl.h @@ -0,0 +1,336 @@ +/* + * CDL.H -- Global definitions for the Client Display Library. + */ + +#ifndef _CDL_Defined +#define _CDL_Defined + +#define CDL_VERSION "Client Display Library V1.8 07/28/01" + +/* Declare prototypes if using ANSI C */ +#ifdef CDL_ANSIC +#define ANSI_FUNC +#endif + +#define MAX_FBCONFIG 128 /* max size of FB config table */ +#define MAX_FRAMES 16 /* max frames support by server */ +#define MAX_MAPPINGS 32 /* max image mappings per frame */ +#define DEF_CONTRAST 0.25 /* default zscale contrast */ +#define DEF_NSAMPLE 600 /* default number of samples */ +#define DEF_NSAMPLINES -1 /* default no. of sample lines */ +#define INDEF -999 /* INDEF value flag */ + + +/* Include private definitions when compiling library sources. */ +#ifdef CDL_LIBRARY_SOURCE +#include "eps.h" +#include "cdlP.h" +#endif + +/* Frame buffer selection code. */ +#define FB_AUTO -1 /* autoconfig the frame buffer */ + +/* Types of greyscale transformations. */ +#define CDL_UNITARY 0 /* values map without change */ +#define CDL_LINEAR 1 /* linear mapping */ +#define CDL_LOG 2 /* logarithmic mapping */ + +/* Overlay colors. */ +#define C_BLACK 202 /* Static overlay color defs */ +#define C_WHITE 203 +#define C_RED 204 +#define C_GREEN 205 +#define C_BLUE 206 +#define C_YELLOW 207 +#define C_CYAN 208 +#define C_MAGENTA 209 +#define C_CORAL 210 +#define C_MAROON 211 +#define C_ORANGE 212 +#define C_KHAKI 213 +#define C_ORCHID 214 +#define C_TURQUOISE 215 +#define C_VIOLET 216 +#define C_WHEAT 217 + +#define M_FILL 1 /* Overlay point mark types. */ +#define M_POINT 2 +#define M_BOX 4 +#define M_PLUS 8 +#define M_CROSS 16 +#define M_DIAMOND 32 +#define M_CIRCLE 64 +#define M_STAR 128 +#define M_HLINE 256 +#define M_VLINE 512 +#define M_HBLINE 1024 +#define M_VBLINE 2048 + +#define F_ROMAN 0 /* Font types. */ +#define F_GREEK 1 +#define F_FUTURA 2 +#define F_TIMES 3 +#define F_BOLD 4 + +#define L_SOLID 0 /* Polyline attribute values. */ +#define L_DASHED 1 +#define L_DOTTED 2 +#define L_DOTDASH 3 +#define L_HOLLOW 4 +#define L_SHADOW 5 + + +#define MOD_FAST 1 /* SubRaster display model */ +#define MOD_NORMAL 2 +#define DEF_MODEL MOD_FAST + + +/* Local type definitions. */ +typedef struct CDL *CDLPtr; +typedef struct Marker *MarkerPtr; + + +#ifndef AIXV3 +#ifndef OSF1 +typedef unsigned char uchar; +#endif +#endif + + + +/* The main CDL package structure. + */ +struct CDL { +#ifdef CDL_LIBRARY_SOURCE + IMDPtr imd; /* IMD package pointer */ + int memModel; /* Memory model to use */ +#endif + + int frame; /* display frame number */ + int fbconfig; /* fb config number */ + int fbwidth; /* current FB width */ + int fbheight; /* current FB height */ + int fbnf; /* current FB nframes */ + + float contrast; /* zscale contrast value*/ + int nsample; /* opt. sample points */ + int nsamplines; /* opt. sample lines */ + + int im_nx; /* current image width */ + int im_ny; /* current image height */ + + /* Overlay graphics attributes. */ + int font; /* overlay text font */ + int textwidth; /* text width */ + int linewidth; /* line width */ + int linestyle; /* line style */ + + /* WCS descriptor stuff. */ + char *imname; /* image name */ + char *imtitle; /* image title */ + float a, b, c, d; /* WCS values */ + float tx, ty; /* translation values */ + float z1, z2; /* zscale values */ + int ztrans; /* Z trans type */ + + /* Coordinate mappings on the frame buffer. */ + char *ref; /* img reference */ + char *region; /* region name */ + float sx, sy; /* source rect */ + int snx, sny; + int dx, dy; /* destination rect */ + int dnx, dny; + int iis_version; /* server IIS version */ + int iis_valid; /* valid mapping flag */ +}; + + +/* A element of the display list describing the marker. We throw in the + * kitchen sinke here to cover all possible marker types, in reality only + * a few of these are used for any given marker type. + */ +struct Marker { + short type; /* marker type */ + int x, y; /* center coords */ + int number; /* label a point */ + int pt_type; /* point type */ + int size; /* point marker size */ + int fill; /* fill marker */ + int color; /* marker color */ + int *xp, *yp; /* coords */ + int npts; /* npts in array */ + int radius; /* circle radius */ + int nannuli; /* num of annuli */ + int sep; /* annulus separation */ + int xrad, yrad; /* ellipse axes */ + float ang; /* ellipse rotation */ + float txsize; /* text marker size */ + char *str; /* text marker string */ + int font; /* text font type */ + int textwidth; /* text width */ + int linewidth; /* line width */ + int linestyle; /* line style */ + + int nx, ny; /* marker region size */ + int lx, ly; /* marker LL corner */ + + unsigned char *refpix; /* orig image pixels */ + unsigned char *markpix; /* marked image pixels */ + + MarkerPtr back; /* linked list pointers */ + MarkerPtr next; + int markerID; /* assigned id number */ +}; + + +/* Marker types used internally. */ +#define MK_POINT 0 +#define MK_LINE 1 +#define MK_BOX 2 +#define MK_POLYLINE 3 +#define MK_POLYGON 4 +#define MK_CIRCLE 5 +#define MK_CIRCANN 6 +#define MK_ELLIPSE 7 +#define MK_ELLIPANN 8 +#define MK_TEXT 9 + + +/* Function definitions. */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ANSI_FUNC + +CDLPtr cdl_open(); + +char cdl_readCursor(); + +int cdl_displayPix(), cdl_displayIRAF(), cdl_displayFITS(); +int cdl_isIRAF(), cdl_isFITS(); +int cdl_readIRAF(), cdl_readFITS(), cdl_clearFrame(); +int cdl_readImage(), cdl_readFrameBuffer(), cdl_readSubRaster(); +int cdl_writeSubRaster(), cdl_setCursor(); +int cdl_printPix(), cdl_printPixToFile(); +int cdl_setWCS(), cdl_getWCS(); +int cdl_getMapping(), cdl_setMapping(), cdl_queryMap(); + +void cdl_selectFB(), cdl_close(), cdl_computeZscale(), cdl_zscaleImage(); +void cdl_setFrame(), cdl_setFBConfig(), cdl_setZTrans(), cdl_setZoom(); +void cdl_setSample(), cdl_setContrast(), cdl_setName(), cdl_setTitle(); +void cdl_getFrame(), cdl_getFBConfig(), cdl_getZTrans(), cdl_getZoom(); +void cdl_getSample(), cdl_getContrast(), cdl_getName(), cdl_getTitle(); +void cdl_getSampleLines(), cdl_setSampleLines(), cdl_zscale(); +void cdl_setZScale(), cdl_getZScale(), cdl_lookupFBSize(); +void cdl_setDebug(); + +/* Marker function definitions. */ +int cdl_markPoint(), cdl_markLine(), cdl_markBox(), cdl_markPolyline(); +int cdl_markPolygon(), cdl_markCircle(), cdl_markCircAnnuli(); +int cdl_markEllipse(), cdl_markEllipAnnuli(), cdl_markText(); +int cdl_deleteMark(), cdl_clearOverlay(), cdl_redrawOverlay(); +int cdl_markCoordsFile(), cdl_mapFrame(), cdl_markPointLabel(); + +void cdl_setFont(), cdl_setTextWidth(); +void cdl_setLineWidth(), cdl_setLineStyle(); + +#endif + + +/* Include function prototypes for all public CDL functions when using ANSI C */ + +#ifdef ANSI_FUNC + +CDLPtr cdl_open(char *imtdev); +int cdl_displayPix(CDLPtr cdl, uchar *pix, int nx, int ny, int bitpix, int frame, int fbconfig, int zscale); +char cdl_readCursor(CDLPtr cdl, int sample, float *x, float *y, int *wcs, char *key); +int cdl_setCursor(CDLPtr cdl, int x, int y, int wcs); +int cdl_setWCS(CDLPtr cdl, char *imname, char *imtitle, float a, float b, float c, float d, float tx, float ty, float z1, float z2, int zt); +int cdl_getWCS(CDLPtr cdl, char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt); +int cdl_getMapping(CDLPtr cdl, char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref); +int cdl_setMapping(CDLPtr cdl, char *region, float sx, float sy, int snx, int sny, int dx, int dy, int dnx, int dny, char *ref); +int cdl_queryMap(CDLPtr cdl, int wcs, char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *objref); +int cdl_clearFrame(CDLPtr cdl); +void cdl_selectFB(CDLPtr cdl, int nx, int ny, int *fb, int *w, int *h, int *nf, int reset); +void cdl_close(CDLPtr cdl); +int cdl_readImage(CDLPtr cdl, uchar **pix, int *nx, int *ny); +int cdl_readFrameBuffer(CDLPtr cdl, uchar **pix, int *nx, int *ny); +void cdl_computeZscale(CDLPtr cdl, uchar *pix, int nx, int ny, int bitpix, float *z1, float *z2); +void cdl_zscaleImage(CDLPtr cdl, uchar **pix, int nx, int ny, int bitpix, float z1, float z2); +int cdl_printPix(CDLPtr cdl, char *cmd, uchar *pix, int nx, int ny, int annotate); +int cdl_printPixToFile(CDLPtr cdl, char *fname, uchar *pix, int nx, int ny, int annotate); +int cdl_readSubRaster(CDLPtr cdl, int lx, int ly, int nx, int ny, uchar **pix); +int cdl_writeSubRaster(CDLPtr cdl, int lx, int ly, int nx, int ny, uchar *pix); +void cdl_setFBConfig(CDLPtr cdl, int configno); +void cdl_getFBConfig(CDLPtr cdl, int *configno, int *w, int *h, int *nframes); +void cdl_lookupFBSize(CDLPtr cdl, int configno, int *w, int *h, int *nf); +void cdl_setFrame(CDLPtr cdl, int frame); +void cdl_setZTrans(CDLPtr cdl, int ztrans); +void cdl_setZScale(CDLPtr cdl, float z1, float z2); +void cdl_setSample(CDLPtr cdl, int nsample); +void cdl_setSampleLines(CDLPtr cdl, int nlines); +void cdl_setContrast(CDLPtr cdl, float contrast); +void cdl_setName(CDLPtr cdl, char *imname); +void cdl_setTitle(CDLPtr cdl, char *imtitle); +void cdl_getFrame(CDLPtr cdl, int *frame); +void cdl_getZTrans(CDLPtr cdl, int *ztrans); +void cdl_getZScale(CDLPtr cdl, float *z1, float *z2); +void cdl_getSample(CDLPtr cdl, int *nsample); +void cdl_getSampleLines(CDLPtr cdl, int *nlines); +void cdl_getContrast(CDLPtr cdl, float *contrast); +void cdl_getName(CDLPtr cdl, char *imname); +void cdl_getTitle(CDLPtr cdl, char *imtitle); +void cdl_setDebug(int state); + + +int cdl_mapFrame(CDLPtr cdl, int frame); +int cdl_markCoordsFile(CDLPtr cdl, char *fname, int type, int size, int color, int label); +int cdl_markPoint(CDLPtr cdl, int x, int y, int number, int size, int type, int color); +int cdl_markPointLabel(CDLPtr cdl, int x, int y, char *label, int size, int type, int color); +int cdl_markLine(CDLPtr cdl, int xs, int ys, int xe, int ye, int color); +int cdl_markBox(CDLPtr cdl, int lx, int ly, int ux, int uy, int fill, int color); +int cdl_markPolygon(CDLPtr cdl, int xarray[], int yarray[], int npts, int fill, int color); +int cdl_markPolyline(CDLPtr cdl, int *xarray, int *yarray, int npts, int color); +int cdl_markCircle(CDLPtr cdl, int x, int y, int radius, int fill, int color); +int cdl_markCircAnnuli(CDLPtr cdl, int x, int y, int radius, int nannuli, int sep, int color); +int cdl_markEllipse(CDLPtr cdl, int x, int y, int xrad, int yrad, float rotang, int fill, int color); +int cdl_markEllipAnnuli(CDLPtr cdl, int x, int y, int xrad, int yrad, float ang, int nannuli, int sep, int color); +int cdl_markText(CDLPtr cdl, int x, int y, char *str, float size, float angle, int color); +void cdl_setFont(CDLPtr cdl, int font); +void cdl_setTextWidth(CDLPtr cdl, int width); +void cdl_setLineWidth(CDLPtr cdl, int width); +void cdl_setLineStyle(CDLPtr cdl, int style); +int cdl_deleteMark(CDLPtr cdl, int x, int y); +int cdl_clearOverlay(CDLPtr cdl); +int cdl_redrawOverlay(CDLPtr cdl); +void cdl_beginDList(int frame); +void cdl_drawDList(int frame); +void cdl_clearDList(int frame); +void cdl_endDList(int frame, int flush); +int cdl_doTextMarker(int x, int y, char *string, float size, float angle, int color, int width, int font, uchar *pix, int lx, int ly, int nx, int ny); +int cdl_freeDisplayList(CDLPtr cdl, MarkerPtr head); + +int cdl_displayFITS(CDLPtr cdl, char *fname, int frame, int fbconfig, int zscale); +int cdl_isFITS(char *fname); +int cdl_readFITS(char *fname, uchar **pix, int *nx, int *ny, int *bitpix, +char *title); + +int cdl_displayIRAF(CDLPtr cdl, char *fname, int band, int frame, int +fbconfig, int zscale); +int cdl_isIRAF(char *fname); +int cdl_readIRAF(char *fname, int band, uchar **pix, int *nx, int *ny, int *bitpix, char *title); + +#endif + +#ifdef __cplusplus +} +#endif + + +#ifdef CDL_LIBRARY_SOURCE +#include "cdlProto.h" +#endif + +/* _CDL_Defined */ +#endif diff --git a/vendor/x11iraf/cdl/cdlP.h b/vendor/x11iraf/cdl/cdlP.h new file mode 100644 index 00000000..fa1ed457 --- /dev/null +++ b/vendor/x11iraf/cdl/cdlP.h @@ -0,0 +1,177 @@ +/* + * CDLP.H -- Private definitions for the Client Display Library. + */ + +/* Default values, size limiting values. + */ +#define SZ_FNAME 256 /* size of an image name */ +#define SZ_NAME 256 /* size of an image name */ +#define SZ_LINE 256 /* size of temp buffer */ +#define SZ_IMTDEV 128 /* size of an IMTDEV string */ +#define SZ_IMCURVAL 160 /* cursor value str length */ +#define SZ_OLD_WCSBUF 320 /* old wcs buffer length */ +#define SZ_WCSBUF 1024 /* wcs buffer length */ + +#define OK 0 /* success */ +#define ERR 1 /* failure */ +#define EOS '\0' /* end of statement */ + + + +/* Utility macros. + */ +#undef max +#define max(a,b) (a > b ? a : b) +#undef min +#define min(a,b) (a < b ? a : b) + +/* Handy values. + */ +#undef True +#define True 1 +#undef False +#define False 0 + + +/* Define the structures needed by the IMD interface. This is a kludge + * to avoid having applications include the IMD header. + */ + +typedef struct { + int config; /* configuration number */ + int nframes; /* number of frames */ + int width, height; /* frame buffer dimensions */ +} FBTab; + +struct IMD { + int datain, dataout; /* connection file descriptors */ + int domain; /* connection type */ + int model; /* subraster display model */ + + short frame; /* display frame number */ + short fbconfig; /* frame buffer config number */ + FBTab *fbtab[MAX_FBCONFIG]; /* fb configuration table */ + + short xs, xe; /* X start/end values */ + short ys, ye; /* Y start/end values */ + char *name; /* image name */ + char *title; /* image title */ + float a, b, c, d; /* WCS values */ + float tx, ty; /* translation values */ + float z1, z2; /* zscale values */ + short ztrans; /* Z trans type */ + + /* Coordinate mappings on the frame buffer. */ + int iis_version; /* server IIS version */ + int iis_valid; /* valid mapping flag */ + char *ref; /* img reference */ + char *region; /* region name */ + float sx, sy; /* source rect */ + int snx, sny; + int dx, dy; /* destination rect */ + int dnx, dny; +}; +typedef struct IMD *IMDPtr; + + + +#ifdef CDL_NEED_COLORMAPS + +/* Define a grayscale+static colormap used by the print routines. */ +static unsigned char cmap_r[] = { + 0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, + 20, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37, 38, 40, + 41, 42, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 56, 58, 59, 60, + 61, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 79, 81, + 82, 83, 84, 86, 87, 88, 90, 91, 92, 93, 95, 96, 97, 99, 100, 101, +102, 104, 105, 106, 108, 109, 110, 111, 113, 114, 115, 116, 118, 119, 120, 122, +123, 124, 125, 127, 128, 129, 131, 132, 133, 134, 136, 137, 138, 140, 141, 142, +143, 145, 146, 147, 148, 150, 151, 152, 154, 155, 156, 157, 159, 160, 161, 163, +164, 165, 166, 168, 169, 170, 172, 173, 174, 175, 177, 178, 179, 180, 182, 183, +184, 186, 187, 188, 189, 191, 192, 193, 195, 196, 197, 198, 200, 201, 202, 204, +205, 206, 207, 209, 210, 211, 212, 214, 215, 216, 218, 219, 220, 221, 223, 224, +225, 227, 228, 229, 230, 232, 233, 234, 236, 237, 238, 239, 241, 242, 243, 244, +246, 247, 248, 250, 251, 252, 253, 255, 255, 255, 0, 255, 255, 0, 0, 255, + 0, 255, 255, 177, 255, 255, 219, 0, 239, 255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char cmap_g[] = { + 0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, + 20, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37, 38, 40, + 41, 42, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 56, 58, 59, 60, + 61, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 79, 81, + 82, 83, 84, 86, 87, 88, 90, 91, 92, 93, 95, 96, 97, 99, 100, 101, +102, 104, 105, 106, 108, 109, 110, 111, 113, 114, 115, 116, 118, 119, 120, 122, +123, 124, 125, 127, 128, 129, 131, 132, 133, 134, 136, 137, 138, 140, 141, 142, +143, 145, 146, 147, 148, 150, 151, 152, 154, 155, 156, 157, 159, 160, 161, 163, +164, 165, 166, 168, 169, 170, 172, 173, 174, 175, 177, 178, 179, 180, 182, 183, +184, 186, 187, 188, 189, 191, 192, 193, 195, 196, 197, 198, 200, 201, 202, 204, +205, 206, 207, 209, 210, 211, 212, 214, 215, 216, 218, 219, 220, 221, 223, 224, +225, 227, 228, 229, 230, 232, 233, 234, 236, 237, 238, 239, 241, 242, 243, 244, +246, 247, 248, 250, 251, 252, 253, 255, 255, 255, 0, 255, 0, 255, 0, 255, +255, 0, 127, 48, 166, 247, 112, 246, 131, 232, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char cmap_b[] = { + 0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, + 20, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37, 38, 40, + 41, 42, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 56, 58, 59, 60, + 61, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 79, 81, + 82, 83, 84, 86, 87, 88, 90, 91, 92, 93, 95, 96, 97, 99, 100, 101, +102, 104, 105, 106, 108, 109, 110, 111, 113, 114, 115, 116, 118, 119, 120, 122, +123, 124, 125, 127, 128, 129, 131, 132, 133, 134, 136, 137, 138, 140, 141, 142, +143, 145, 146, 147, 148, 150, 151, 152, 154, 155, 156, 157, 159, 160, 161, 163, +164, 165, 166, 168, 169, 170, 172, 173, 174, 175, 177, 178, 179, 180, 182, 183, +184, 186, 187, 188, 189, 191, 192, 193, 195, 196, 197, 198, 200, 201, 202, 204, +205, 206, 207, 209, 210, 211, 212, 214, 215, 216, 218, 219, 220, 221, 223, 224, +225, 227, 228, 229, 230, 232, 233, 234, 236, 237, 238, 239, 241, 242, 243, 244, +246, 247, 248, 250, 251, 252, 253, 255, 255, 255, 0, 255, 0, 0, 255, 0, +255, 255, 80, 96, 0, 144, 215, 255, 239, 187, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#endif + + +#ifdef CDL_NEED_LINESTYLES + +/* Define the linestyle arrays needed in the marker code. */ + +#define HOLLOW_LINE_WIDTH 5 +#define SHADOW_LINE_WIDTH 4 + +static char dash_pattern[] = {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; +static char dot_pattern[] = {1, 1, 0, 0, 0, 0 }; +static char dotdash_pattern[] = {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, 0 }; + +static int dash = 0, sv_dash = 0, p_dash = 0, + dot = 0, sv_dot = 0, p_dot = 0, + dotdash = 0, sv_dotdash = 0, p_dotdash = 0; + +#define LEN_DASH 12 +#define LEN_DOT 6 +#define LEN_DOTDASH 19 + +#define DASH_PIXEL (dash_pattern[(dash++)%LEN_DASH]) +#define DOT_PIXEL (dot_pattern[(dot++)%LEN_DOT]) +#define DOTDASH_PIXEL (dotdash_pattern[(dotdash++)%LEN_DOTDASH]) + +#define SAVE_DASH_COUNT sv_dash=dash; +#define CLEAR_DASH_COUNT dash=0; +#define RESTORE_DASH_COUNT dash=sv_dash; + +#define SAVE_DOT_COUNT sv_dot=dot; +#define CLEAR_DOT_COUNT dot=0; +#define RESTORE_DOT_COUNT dot=sv_dot; + +#define SAVE_DOTDASH_COUNT sv_dotdash=dotdash; +#define CLEAR_DOTDASH_COUNT dotdash=0; +#define RESTORE_DOTDASH_COUNT dotdash=sv_dotdash; + +#endif diff --git a/vendor/x11iraf/cdl/cdlProto.h b/vendor/x11iraf/cdl/cdlProto.h new file mode 100644 index 00000000..1d4caee6 --- /dev/null +++ b/vendor/x11iraf/cdl/cdlProto.h @@ -0,0 +1,106 @@ +/* + * CDLPROTO.H -- CDL Library internal function prototype definitions. + */ + + +/* IMD Interface Function definitions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef ANSI_FUNC + +IMDPtr imd_open(char *imtdev); +int imd_displayImage(IMDPtr imd, uchar *pix, int nx, int ny, int frame, int fbconfig, int comp_wcs); +int imd_readCursor(IMDPtr imd, int sample, float *x, float *y, int *wcs, char *key); +int imd_setWCS(IMDPtr imd, char *name, char *title, float a, float b, float c, float d, float tx, float ty, float z1, float z2, int zt); +int imd_getWCS(IMDPtr imd, int wcs, char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt); +int imd_close(IMDPtr imd); +int imd_writeImage(IMDPtr imd, uchar *pix, int nx, int ny, int llx, int lly); +int imd_readImage(IMDPtr imd, uchar *pix, int *nx, int *ny); +int imd_readFrameBuffer(IMDPtr imd, uchar *pix, int *nx, int *ny); +int imd_setFrame(IMDPtr imd, int frame); +int imd_setFBConfig(IMDPtr imd, int configno); +int imd_getFBConfig(IMDPtr imd, int *configno, int *width, int *height, int *nframes); +int imd_setName(IMDPtr imd, char *name); +int imd_setTitle(IMDPtr imd, char *title); +int imd_setCursor(IMDPtr imd, int x, int y, int wcs); +int imd_clearFrame(IMDPtr imd); +int imd_readSubRaster(IMDPtr imd, int llx, int lly, int nx, int ny, uchar *pix); +int imd_writeSubRaster(IMDPtr imd, int llx, int lly, int nx, int ny, uchar *pix); +int imd_setDebug(int state); + +#else + +IMDPtr imd_open(); +int imd_setFBConfig(), imd_writeDisplay(), imd_readDisplay(); +int imd_setFrame(), imd_setCursor(), imd_readCursor(); +int imd_close(), imd_readSubRaster(), imd_writeSubRaster(); +int imd_clearFrame(), imd_setWCS(), imd_getWCS(); + +#endif + +#ifdef __cplusplus +} +#endif + + + +/* COMM Interface Function definitions. */ + +#ifdef ANSI_FUNC + +int com_writeData(int fd, short x, short y, uchar *pix, int nbytes); +int com_readData(int fdin, int fdout, short x, short y, uchar *pix, int *npix); +int com_writeSubraster(int fd, short x, short y, uchar *pix, int nx, int ny); +int com_readSubraster(int fdin, int fdout, short x, short y, uchar *pix, int *nx, int *ny); +int com_readCursor(int fdin, int fdout, int sample, float *x, float *y, int *wcs, char *key); +int com_setCursor(int fd, int x, int y, int wcs); +int com_setFBConfig(int fd, int configno); +int com_setFrame(int fd, int frame_num); +int com_writeWCS(int fd, char *buffer, int nbytes, int version); +int com_readWCS(int fdin, int fdout, char *buffer, int *nbytes, int wcs,int version); +int com_eraseFrame(int fd); +int com_wcsVersion(int fdin, int fdout); + +int com_setDebug(int state); + +#else + +int com_writeData(), com_readData(), com_setFBConfig(); +int com_readCursor(), com_setCursor(), com_setFrame(); +int com_writeWCS(), com_readWCS(), com_eraseFrame(); +int com_setDebug(), com_wcsVersion(); +int com_writeSubraster(), com_readSubraster(); + +#endif + + + +/* EPS Interface Function definitions. */ + +#ifdef ANSI_FUNC + +PSImage *eps_init(void); +void eps_print(PSImage *psim, FILE *fp, uchar *data, int xdim, int ydim, int depth, int pad); +void eps_close(PSImage *psim); +void eps_setPage(PSImage *psim, int orientation, int paper_size, int scale, int flags); +void eps_setCmap(PSImage *psim, uchar *r, uchar *g, uchar *b, int ncolors); +void eps_setCompress(PSImage *psim, int compress); +void eps_setColorType(PSImage *psim, int color_class); +void eps_setLabel(register PSImage *psim, char *label); +void eps_setTransform(PSImage *psim, float z1, float z2, int ztype, float offset, float scale, char *cmap_name); +void eps_setCorners(PSImage *psim, int llx, int lly, int urx, int ury); +void eps_getImageSize(PSImagePtr psim, int xdim, int ydim, float *width, float *height); +void eps_getImagePos(PSImagePtr psim, int xdim, int ydim, int *llx, int *lly); + +#else + +PSImage *eps_init(); +void eps_print(), eps_close(), eps_setPage(), eps_setCmap(); +void eps_setCompress(), eps_setColorType(), eps_setLabel(); +void eps_setTransform(), eps_setCorners(), eps_getImageSize(); +void eps_getImagePos(); + +#endif diff --git a/vendor/x11iraf/cdl/cdl_f77.c b/vendor/x11iraf/cdl/cdl_f77.c new file mode 100644 index 00000000..8b96e34b --- /dev/null +++ b/vendor/x11iraf/cdl/cdl_f77.c @@ -0,0 +1,1793 @@ +#include <stdio.h> +#include <stdlib.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" +#include "cdl_f77.h" + + +#define ABS(a) (((a)<0) ? -(a) : (a)) + + +/* CDL_F77.C -- Fortran binding for the CDL package. + */ + +static CDLPtr cdl_f = (CDLPtr) NULL; + + +#ifdef ANSI_FUNC +static char * sstrip (char *instr, int len); +#else +static char * sstrip(); +#endif + +#ifdef ANSI_FUNC +static void spad (char *outstr, int len); +#else +static void spad (); +#endif + + + +/* CDF_OPEN -- Open and initialize the CDL package. */ + +#ifdef ANSI_FUNC + +void +CDF_OPEN ( + char *imtdev, /* connection device */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_OPEN (imtdev, ier, len) +char *imtdev; /* connection device */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + char *dev; + + if (imtdev == NULL || *imtdev == '\0') + dev = NULL; + else { + dev = sstrip (imtdev, len); + if (*dev == '\0') + dev = getenv("IMTDEV"); + } + *ier = ((cdl_f = (CDLPtr) cdl_open (dev)) == (CDLPtr) NULL ? 1 : 0); +} + + +/* CDF_DISPLAYPIX -- Display a raw pixel array to the server. */ + +#ifdef ANSI_FUNC + +void +CDF_DISPLAYPIX ( + uchar *pix, /* pixels to display */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* pixel size */ + int *frame, /* display frame */ + int *fbconfig, /* FB config number */ + int *zscale, /* do zscale of image? */ + int *ier /* error code */ +) +#else + +void +CDF_DISPLAYPIX (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +uchar *pix; /* pixels to display */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* pixel size */ +int *frame; /* display frame */ +int *fbconfig; /* FB config number */ +int *zscale; /* do zscale of image? */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_displayPix (cdl_f, pix, *nx, *ny, *bitpix, *frame, + *fbconfig, *zscale); +} + + +/* CDF_READCURSOR -- Read the current cursor position. */ + +#ifdef ANSI_FUNC + +void +CDF_READCURSOR ( + int *sample, /* wait for keystroke? */ + float *x, + float *y, /* position (output) */ + int *wcs, /* WCS */ + char *key, /* keystroke (output) */ + int *ier /* error code */ +) +#else + +void +CDF_READCURSOR (sample, x, y, wcs, key, ier) +int *sample; /* wait for keystroke? */ +float *x, *y; /* position (output) */ +int *wcs; /* WCS */ +char *key; /* keystroke (output) */ +int *ier; /* error code */ +#endif +{ + *ier = (cdl_readCursor (cdl_f, *sample, x, y, wcs, key) != 0 ? 0 : 1); +} + + +/* CDF_DISPLAYIRAF -- Display an IRAF OIF format image. */ + +#ifdef ANSI_FUNC + +void +CDF_DISPLAYIRAF ( + char *fname, /* image name */ + int *band, /* image band if 3-d */ + int *frame, /* display frame */ + int *fbconfig, /* frame buffer config */ + int *zscale, /* do zscale of image? */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_DISPLAYIRAF (fname, band, frame, fbconfig, zscale, ier, len) +char *fname; /* image name */ +int *band; /* image band if 3-d */ +int *frame; /* display frame */ +int *fbconfig; /* frame buffer config */ +int *zscale; /* do zscale of image? */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_displayIRAF(cdl_f, sstrip(fname, len), + *band, *frame, *fbconfig, *zscale); +} + + +/* CDF_ISIRAF -- Test a file to see if it is a IRAF file. */ + +#ifdef ANSI_FUNC + +void +CDF_ISIRAF ( + char *fname, /* input filename */ + int *isiraf, + int len /* string length */ +) +#else + +void +CDF_ISIRAF (fname, isiraf, len) +char *fname; /* input filename */ +int *isiraf; +int len; /* string length */ +#endif +{ + *isiraf = cdl_isIRAF (sstrip(fname, len)); +} + + +/* CDF_READIRAF -- Read the pixels from an IRAF OIF format image. */ + +#ifdef ANSI_FUNC + +void +CDF_READIRAF ( + char *fname, /* image name */ + int *band, /* image band if 3-d */ + uchar *pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title, /* image title */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_READIRAF (fname, band, pix, nx, ny, bitpix, title, ier, len) +char *fname; /* image name */ +int *band; /* image band if 3-d */ +uchar *pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + uchar *data = (uchar) NULL; + + *ier = cdl_readIRAF (sstrip(fname, len), + *band, &data, nx, ny, bitpix, title); + + spad(title, len); + bcopy (data, pix, ((*nx) * (*ny) * (ABS(*bitpix)/8)) ); + + free (data); +} + + +/* CDF_DISPLAYFITS -- Display a simple FITS format image. */ + +#ifdef ANSI_FUNC + +void +CDF_DISPLAYFITS ( + char *fname, + int *frame, + int *fbconfig, + int *zscale, + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_DISPLAYFITS (fname, frame, fbconfig, zscale, ier, len) +char *fname; +int *frame; +int *fbconfig; +int *zscale; +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_displayFITS (cdl_f, sstrip(fname, len), + *frame, *fbconfig, *zscale); +} + + +/* CDF_ISFITS -- Test a file to see if it is a simple FITS file. */ + +#ifdef ANSI_FUNC + +void +CDF_ISFITS ( + char *fname, /* input filename */ + int *isfits, + int len /* string length */ +) +#else + +void +CDF_ISFITS (fname, isfits, len) +char *fname; /* input filename */ +int *isfits; +int len; /* string length */ +#endif +{ + *isfits = cdl_isFITS (sstrip(fname, len)); +} + + +/* CDF_READFITS -- Read the pixels from a simple FITS format image. */ + +#ifdef ANSI_FUNC + +void +CDF_READFITS ( + char *fname, /* image name */ + uchar *pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title, /* image title */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_READFITS (fname, pix, nx, ny, bitpix, title, ier, len) +char *fname; /* image name */ +uchar *pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_readFITS (sstrip(fname, len), &pix, nx, ny, bitpix, title); +} + + +/* CDF_SETCURSOR -- Set the current logical cursor position. */ + +#ifdef ANSI_FUNC + +void +CDF_SETCURSOR ( + int *x, + int *y, /* position */ + int *wcs, /* cursor wcs */ + int *ier /* error code */ +) +#else + +void +CDF_SETCURSOR (x, y, wcs, ier) +int *x, *y; /* position */ +int *wcs; /* cursor wcs */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_setCursor (cdl_f, *x, *y, *wcs); +} + + +/* CDF_SETWCS -- Set the WCS of the screen. */ + +#ifdef ANSI_FUNC + +void +CDF_SETWCS ( + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt, /* transformation type */ + int *ier, /* error code */ + int nlen, + int tlen /* string lengths */ +) +#else + +void +CDF_SETWCS (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier, nlen, tlen) +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +int *ier; /* error code */ +int nlen, tlen; /* string lengths */ +#endif +{ + char localname[SZ_FNAME], localtitle[SZ_FNAME]; + + strcpy (localname, sstrip (name, min(nlen,SZ_FNAME))); + strcpy (localtitle, sstrip (title, min(tlen,SZ_FNAME))); + *ier = cdl_setWCS (cdl_f, localname, localtitle, *a, *b, *c, *d, + *tx, *ty, *z1, *z2, *zt); +} + + +/* CDF_GETWCS -- Get the current display frame WCS information. */ + +#ifdef ANSI_FUNC + +void +CDF_GETWCS ( + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt, /* transformation type */ + int *ier, /* error code */ + int nlen, + int tlen /* string lengths */ +) +#else + +void +CDF_GETWCS (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier, nlen, tlen) +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +int *ier; /* error code */ +int nlen, tlen; /* string lengths */ +#endif +{ + *ier = cdl_getWCS (cdl_f, name, title, a, b, c, d, tx, ty, z1, z2, zt); + spad (name, nlen); + spad (title, tlen); +} + + +/* CDF_SETMAPPING -- Set the mapping information to be sent with the next + * cdl_setWcs() call. + */ +#ifdef ANSI_FUNC + +void +CDF_SETMAPPING ( + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) +#else + +void +CDF_SETMAPPING (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier, reglen, reflen) +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + char objreg[SZ_FNAME], objref[SZ_FNAME]; + + strcpy (objreg, sstrip (region, min(reglen, SZ_FNAME))); + strcpy (objref, sstrip (ref, min(reflen, SZ_FNAME))); + *ier = cdl_setMapping (cdl_f, objreg, *sx,*sy,*snx,*sny, + *dx,*dy,*dnx,*dny, objref); +} + + +/* CDF_GETMAPPING -- Get the mapping information returned with the last + * cdl_getWcs() call. + */ +#ifdef ANSI_FUNC +void +CDF_GETMAPPING ( + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) + +#else +void +CDF_GETMAPPING (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier, reglen, reflen) +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + *ier = cdl_getMapping (cdl_f, region, sx,sy,snx,sny, + dx,dy,dnx,dny, ref); + spad (region, reglen); + spad (ref, reflen); +} + + +/* CDF_QUERYMAP -- Query a mapping given the wcs number. + */ +#ifdef ANSI_FUNC + +void +CDF_QUERYMAP ( + int *wcs, /* requested wcs number */ + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *objref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) +#else + +void +CDF_QUERYMAP (wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref, ier, reglen, reflen) +int *wcs; /* requested wcs number */ +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *objref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + *ier = cdl_queryMap (cdl_f, *wcs, region, sx,sy,snx,sny, + dx,dy,dnx,dny, objref); + spad (region, reglen); + spad (objref, reflen); +} + + +/* CDF_CLEARFRAME -- Erase the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDF_CLEARFRAME ( + int *ier /* error code */ +) +#else + +void +CDF_CLEARFRAME (ier) +int *ier; /* error code */ +#endif +{ + *ier = cdl_clearFrame (cdl_f); +} + + +/* CDF_SELECTFB -- Select an appropriate frame buffer for the image. */ + +#ifdef ANSI_FUNC + +void +CDF_SELECTFB ( + int *nx, + int *ny, /* image size */ + int *fb, /* frame buffer */ + int *w, + int *h, /* frame size */ + int *nf, /* number of frames */ + int *reset /* reset after select */ +) +#else + +void +CDF_SELECTFB (nx, ny, fb, w, h, nf, reset) +int *nx, *ny; /* image size */ +int *fb; /* frame buffer */ +int *w, *h; /* frame size */ +int *nf; /* number of frames */ +int *reset; /* reset after select */ +#endif +{ + cdl_selectFB (cdl_f, *nx, *ny, fb, w, h, nf, *reset); +} + + +/* CDF_CLOSE -- Close the CDL package descriptor. */ + +#ifdef ANSI_FUNC + +void +CDF_CLOSE (void) +#else + +void +CDF_CLOSE () +#endif +{ + if (cdl_f) cdl_close (cdl_f); +} + + +/* CDF_READIMAGE -- Read the currently displayed image. */ + +#ifdef ANSI_FUNC + +void +CDF_READIMAGE ( + uchar *pix, /* image pixels (output)*/ + int *nx, + int *ny, /* dimensions (output) */ + int *ier /* error code */ +) +#else + +void +CDF_READIMAGE (pix, nx, ny, ier) +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_readImage (cdl_f, &pix, nx, ny); +} + + +/* CDF_READFRAMEBUFFER -- Read the contents of the entire frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDF_READFRAMEBUFFER ( + uchar *pix, /* image pixels (output)*/ + int *nx, + int *ny, /* dimensions (output) */ + int *ier /* error code */ +) +#else + +void +CDF_READFRAMEBUFFER (pix, nx, ny, ier) +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_readFrameBuffer (cdl_f, &pix, nx, ny); +} + + +/* CDF_COMPZSCALE -- Compute the optimal z1/z2 values for an array. */ + +#ifdef ANSI_FUNC + +void +CDF_COMPZSCALE ( + uchar *pix, /* data to be sampled */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* bits per pixel */ + float *z1, + float *z2 /* min/max zscale values*/ +) +#else + +void +CDF_COMPZSCALE (pix, nx, ny, bitpix, z1, z2) +uchar *pix; /* data to be sampled */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* bits per pixel */ +float *z1, *z2; /* min/max zscale values*/ +#endif +{ + cdl_computeZscale (cdl_f, pix, *nx, *ny, *bitpix, z1, z2); +} + + +/* CDF_ZSCALEIMAGE -- Compute the optimal z1/z2 values for an array. */ + +#ifdef ANSI_FUNC + +void +CDF_ZSCALEIMAGE ( + uchar *pix, /* data to be sampled */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* bits per pixel */ + float *z1, + float *z2 /* min/max zscale values*/ +) +#else + +void +CDF_ZSCALEIMAGE (pix, nx, ny, bitpix, z1, z2) +uchar *pix; /* data to be sampled */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* bits per pixel */ +float *z1, *z2; /* min/max zscale values*/ +#endif +{ + cdl_zscaleImage (cdl_f, &pix, *nx, *ny, *bitpix, *z1, *z2); +} + + +/* CDF_PRINTPIX -- Print the given pixels as EPS to the named command. */ + +#ifdef ANSI_FUNC + +void +CDF_PRINTPIX ( + char *cmd, /* command string */ + uchar *pix, /* pixel array */ + int *nx, + int *ny, /* image dimensions */ + int *annotate, /* annotate output? */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_PRINTPIX (cmd, pix, nx, ny, annotate, ier, len) +char *cmd; /* command string */ +uchar *pix; /* pixel array */ +int *nx, *ny; /* image dimensions */ +int *annotate; /* annotate output? */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_printPix (cdl_f, sstrip(cmd, len), pix, *nx, *ny, *annotate); +} + + +/* CDF_PRINTPIXTOFILE -- Print the given pixels as EPS to the named file. */ + +#ifdef ANSI_FUNC + +void +CDF_PRINTPIXTOFILE ( + char *fname, /* filename */ + uchar *pix, /* pixel array */ + int *nx, + int *ny, /* image dimensions */ + int *annotate, /* annotate output? */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_PRINTPIXTOFILE (fname, pix, nx, ny, annotate, ier, len) +char *fname; /* filename */ +uchar *pix; /* pixel array */ +int *nx, *ny; /* image dimensions */ +int *annotate; /* annotate output? */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_printPixToFile (cdl_f, sstrip(fname, len), pix, *nx, *ny, *annotate); +} + + +/* CDF_READSUBRASTER -- Read a rectangular region of the frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDF_READSUBRASTER ( + int *lx, + int *ly, /* region corner */ + int *nx, + int *ny, /* dimensions */ + uchar *pix, /* image pixels (output)*/ + int *ier /* error code */ +) +#else + +void +CDF_READSUBRASTER (lx, ly, nx, ny, pix, ier) +int *lx, *ly; /* region corner */ +int *nx, *ny; /* dimensions */ +uchar *pix; /* image pixels (output)*/ +int *ier; /* error code */ +#endif +{ + *ier = cdl_readSubRaster (cdl_f, *lx, *ly, *nx, *ny, &pix); +} + + +/* CDF_WRITESUBRAS -- Write a rectangular region of the frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDF_WRITESUBRAS ( + int *lx, + int *ly, /* region corner */ + int *nx, + int *ny, /* dimensions */ + uchar *pix, /* subraster pixels */ + int *ier /* error code */ +) +#else + +void +CDF_WRITESUBRAS (lx, ly, nx, ny, pix, ier) +int *lx, *ly; /* region corner */ +int *nx, *ny; /* dimensions */ +uchar *pix; /* subraster pixels */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_writeSubRaster (cdl_f, *lx, *ly, *nx, *ny, pix); +} + + +/* CDF_SETFBCONFIG -- Set the frame buffer configuration number. */ + +#ifdef ANSI_FUNC + +void +CDF_SETFBCONFIG ( + int *configno /* fb config number */ +) +#else + +void +CDF_SETFBCONFIG (configno) +int *configno; /* fb config number */ +#endif +{ + cdl_setFBConfig (cdl_f, *configno); +} + + +/* CDF_GETFBCONFIG -- Get the frame buffer configuration number. */ + +#ifdef ANSI_FUNC + +void +CDF_GETFBCONFIG ( + int *configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nframes /* number of frames */ +) +#else + +void +CDF_GETFBCONFIG (configno, w, h, nframes) +int *configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nframes; /* number of frames */ +#endif +{ + cdl_getFBConfig (cdl_f, configno, w, h, nframes); +} + + +/* CDF_LOOKUPFBSIZE -- Lookup the frame buffer dimensions.*/ + +#ifdef ANSI_FUNC + +void +CDF_LOOKUPFBSIZE ( + int *configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nf /* number of frames */ +) +#else + +void +CDF_LOOKUPFBSIZE (configno, w, h, nf) +int *configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nf; /* number of frames */ +#endif +{ + cdl_lookupFBSize (cdl_f, *configno, w, h, nf); +} + + +/* CDF_SETFRAME -- Set the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDF_SETFRAME ( + int *frame /* frame number */ +) +#else + +void +CDF_SETFRAME (frame) +int *frame; /* frame number */ +#endif +{ + cdl_setFrame (cdl_f, *frame); +} + + +/* CDF_SETZTRANS -- Set the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDF_SETZTRANS ( + int *ztrans /* z-transform type */ +) +#else + +void +CDF_SETZTRANS (ztrans) +int *ztrans; /* z-transform type */ +#endif +{ + cdl_setZTrans (cdl_f, *ztrans); +} + + +/* CDF_SETZSCLAE -- Set the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDF_SETZSCALE ( + float *z1, + float *z2 /* zscale values */ +) +#else + +void +CDF_SETZSCALE (z1, z2) +float *z1, *z2; /* zscale values */ +#endif +{ + cdl_setZScale (cdl_f, *z1, *z2); +} + + +/* CDF_SETSAMPLE -- Set the number of zscale sample points to use. */ + +#ifdef ANSI_FUNC + +void +CDF_SETSAMPLE ( + int *nsample /* no. of sample pts */ +) +#else + +void +CDF_SETSAMPLE (nsample) +int *nsample; /* no. of sample pts */ +#endif +{ + cdl_setSample (cdl_f, *nsample); +} + + +/* CDF_SETSAMPLELINES -- Set the number of zscale sample lines to use. */ + +#ifdef ANSI_FUNC + +void +CDF_SETSAMPLELINES ( + int *nlines /* no. of sample lines */ +) +#else + +void +CDF_SETSAMPLELINES (nlines) +int *nlines; /* no. of sample lines */ +#endif +{ + cdl_setSampleLines (cdl_f, *nlines); +} + + +/* CDF_SETCONTRAST -- Set the zscale contrast value. */ + +#ifdef ANSI_FUNC + +void +CDF_SETCONTRAST ( + float *contrast /* contrast value */ +) +#else + +void +CDF_SETCONTRAST (contrast) +float *contrast; /* contrast value */ +#endif +{ + cdl_setContrast (cdl_f, *contrast); +} + + +/* CDF_SETNAME -- Set the image name for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDF_SETNAME ( + char *imname, /* image name */ + int len /* string length */ +) +#else + +void +CDF_SETNAME (imname, len) +char *imname; /* image name */ +int len; /* string length */ +#endif +{ + cdl_setName (cdl_f, sstrip(imname, len)); +} + + +/* CDF_SETTITLE -- Set the image title for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDF_SETTITLE ( + char *imtitle, /* image title */ + int len /* string length */ +) +#else + +void +CDF_SETTITLE (imtitle, len) +char *imtitle; /* image title */ +int len; /* string length */ +#endif +{ + cdl_setTitle (cdl_f, sstrip(imtitle, len)); +} + + +/* CDF_GETFRAME -- Get the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDF_GETFRAME ( + int *frame /* frame number */ +) +#else + +void +CDF_GETFRAME (frame) +int *frame; /* frame number */ +#endif +{ + cdl_getFrame (cdl_f, frame); +} + + +/* CDF_GETZTRANS -- Get the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDF_GETZTRANS ( + int *ztrans /* z-transform type */ +) +#else + +void +CDF_GETZTRANS (ztrans) +int *ztrans; /* z-transform type */ +#endif +{ + cdl_getZTrans (cdl_f, ztrans); +} + + +/* CDF_GETZSCALE -- Get the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDF_GETZSCALE ( + float *z1, + float *z2 /* zscale values */ +) +#else + +void +CDF_GETZSCALE (z1, z2) +float *z1, *z2; /* zscale values */ +#endif +{ + cdl_getZScale (cdl_f, z1, z2); +} + + +/* CDF_GETSAMPLE -- Get the number of zscale sample points to use. */ + +#ifdef ANSI_FUNC + +void +CDF_GETSAMPLE ( + int *nsample /* no. of sample pts */ +) +#else + +void +CDF_GETSAMPLE (nsample) +int *nsample; /* no. of sample pts */ +#endif +{ + cdl_getSample (cdl_f, nsample); +} + + +/* CDF_GETSAMPLELINES -- Get the number of zscale sample lines to use. */ + +#ifdef ANSI_FUNC + +void +CDF_GETSAMPLELINES ( + int *nlines /* no. of sample lines */ +) +#else + +void +CDF_GETSAMPLELINES (nlines) +int *nlines; /* no. of sample lines */ +#endif +{ + cdl_getSampleLines (cdl_f, nlines); +} + + +/* CDF_GETCONTRAST -- Get the zscale contrast value. */ + +#ifdef ANSI_FUNC + +void +CDF_GETCONTRAST ( + float *contrast /* contrast value */ +) +#else + +void +CDF_GETCONTRAST (contrast) +float *contrast; /* contrast value */ +#endif +{ + cdl_getContrast (cdl_f, contrast); +} + + +/* CDF_GETNAME -- Get the image name for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDF_GETNAME ( + char *imname, /* image name */ + int len /* string length */ +) +#else + +void +CDF_GETNAME (imname, len) +char *imname; /* image name */ +int len; /* string length */ +#endif +{ + cdl_getName (cdl_f, imname); spad (imname, len); +} + + +/* CDF_GETTITLE -- Get the image title for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDF_GETTITLE ( + char *imtitle, /* image title */ + int len /* string length */ +) +#else + +void +CDF_GETTITLE (imtitle, len) +char *imtitle; /* image title */ +int len; /* string length */ +#endif +{ + cdl_getTitle (cdl_f, imtitle); spad (imtitle, len); +} + + +/* CDF_MAPFRAME -- Map the current frame buffer as an image for overlay. */ + +#ifdef ANSI_FUNC + +void +CDF_MAPFRAME ( + int *frame, /* fb frame to map */ + int *ier /* error code */ +) +#else + +void +CDF_MAPFRAME (frame, ier) +int *frame; /* fb frame to map */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_mapFrame (cdl_f, *frame); +} + + +/* CDF_MARKCOORDSFILE -- Mark a list of coords from a file. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKCOORDSFILE ( + char *fname, /* file name */ + int *type, /* marker type */ + int *size, /* marker size */ + int *color, /* marker color */ + int *label, /* label? */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_MARKCOORDSFILE (fname, type, size, color, label, ier, len) +char *fname; /* file name */ +int *type; /* marker type */ +int *size; /* marker size */ +int *color; /* marker color */ +int *label; /* label? */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + *ier = cdl_markCoordsFile (cdl_f, sstrip (fname, len), *type, *size, *color, *label); +} + + +/* CDF_MARKPOINT -- Draw a mark on the display at the given point. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKPOINT ( + int *x, + int *y, /* marker position */ + int *number, /* if > 0, label value */ + int *size, /* marker size (pixels) */ + int *type, /* type to draw */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKPOINT (x, y, number, size, type, color, ier) +int *x, *y; /* marker position */ +int *number; /* if > 0, label value */ +int *size; /* marker size (pixels) */ +int *type; /* type to draw */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markPoint (cdl_f, *x, *y, *number, *size, *type, *color); +} + + +/* CDF_MARKPOINTLABEL -- Draw a mark on the display at the given point. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKPOINTLABEL ( + int *x, + int *y, /* marker position */ + char *label, /* point label string */ + int *size, /* marker size (pixels) */ + int *type, /* type to draw */ + int *color, /* marker color */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_MARKPOINTLABEL (x, y, label, size, type, color, ier, len) +int *x, *y; /* marker position */ +char *label; /* point label string */ +int *size; /* marker size (pixels) */ +int *type; /* type to draw */ +int *color; /* marker color */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + sstrip (label, len); + *ier = cdl_markPointLabel (cdl_f, *x, *y, sstrip(label, len), + *size, *type, *color); +} + + +/* CDF_MARKLINE -- Draw a line of given color between two points. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKLINE ( + int *xs, + int *ys, /* line start points */ + int *xe, + int *ye, /* line end points */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKLINE (xs, ys, xe, ye, color, ier) +int *xs, *ys; /* line start points */ +int *xe, *ye; /* line end points */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markLine (cdl_f, *xs, *ys, *xe, *ye, *color); +} + + +/* CDF_MARKBOX -- Draw a rectangular box given two corner endpoints. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKBOX ( + int *lx, + int *ly, /* LL corner points */ + int *ux, + int *uy, /* UR corner points */ + int *fill, /* fill rectangle? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKBOX (lx, ly, ux, uy, fill, color, ier) +int *lx, *ly; /* LL corner points */ +int *ux, *uy; /* UR corner points */ +int *fill; /* fill rectangle? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markBox (cdl_f, *lx, *ly, *ux, *uy, *fill, *color); +} + + +/* CDF_MARKPOLYGON -- Draw a polygon on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKPOLYGON ( + int *xarray, + int *yarray, /* vertex points */ + int *npts, /* number of corners */ + int *fill, /* fill polygon? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKPOLYGON (xarray, yarray, npts, fill, color, ier) +int *xarray, *yarray; /* vertex points */ +int *npts; /* number of corners */ +int *fill; /* fill polygon? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markPolygon (cdl_f, xarray, yarray, *npts, *fill, *color); +} + + +/* CDF_MARKPOLYLINE -- Draw a polyline on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKPOLYLINE ( + int *xarray, + int *yarray, /* vertex points */ + int *npts, /* number of points */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKPOLYLINE (xarray, yarray, npts, color, ier) +int *xarray, *yarray; /* vertex points */ +int *npts; /* number of points */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markPolyline (cdl_f, xarray, yarray, *npts, *color); +} + + +/* CDF_MARKCIRCLE -- Draw of circle on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKCIRCLE ( + int *x, + int *y, /* center position */ + int *radius, /* radius of circle */ + int *fill, /* fill circle? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKCIRCLE (x, y, radius, fill, color, ier) +int *x, *y; /* center position */ +int *radius; /* radius of circle */ +int *fill; /* fill circle? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markCircle (cdl_f, *x, *y, *radius, *fill, *color); +} + + +/* CDF_MARKCIRCANNULI -- Draw circular annuli on the display. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKCIRCANNULI ( + int *x, + int *y, /* center position */ + int *radius, /* radius of 1st annulus*/ + int *nannuli, /* no. of annuli */ + int *sep, /* annuli sep (pixels) */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKCIRCANNULI (x, y, radius, nannuli, sep, color, ier) +int *x, *y; /* center position */ +int *radius; /* radius of 1st annulus*/ +int *nannuli; /* no. of annuli */ +int *sep; /* annuli sep (pixels) */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markCircAnnuli (cdl_f, *x, *y, *radius, *nannuli, + *sep, *color); +} + + +/* CDF_MARKELLIPSE -- Draw an ellipse. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKELLIPSE ( + int *x, + int *y, /* center position */ + int *xrad, + int *yrad, /* x and y radii */ + float *ang, /* position angle (deg) */ + int *fill, /* fill ellipse? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKELLIPSE (x, y, xrad, yrad, ang, fill, color, ier) +int *x, *y; /* center position */ +int *xrad, *yrad; /* x and y radii */ +float *ang; /* position angle (deg) */ +int *fill; /* fill ellipse? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markEllipse (cdl_f, *x, *y, *xrad, *yrad, *ang, + *fill, *color); +} + + +/* CDF_MARKELLIPANNULI -- Draw elliptical annuli on the display. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKELLIPANNULI ( + int *x, + int *y, /* center position */ + int *xrad, + int *yrad, /* radius of 1st annulus*/ + float *ang, /* rotation angle */ + int *nannuli, /* no. of annuli */ + int *sep, /* annuli sep (pixels) */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDF_MARKELLIPANNULI (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +int *x, *y; /* center position */ +int *xrad, *yrad; /* radius of 1st annulus*/ +float *ang; /* rotation angle */ +int *nannuli; /* no. of annuli */ +int *sep; /* annuli sep (pixels) */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_markEllipAnnuli (cdl_f, *x, *y, *xrad, *yrad, *ang, + *nannuli, *sep, *color); +} + + +/* CDF_MARKTEXT -- Draw a text string on the display at the given location. */ + +#ifdef ANSI_FUNC + +void +CDF_MARKTEXT ( + int *x, + int *y, /* marker position */ + char *str, /* text string */ + float *size, /* size scale factor */ + float *angle, /* text rotation angle */ + int *color, /* marker color */ + int *ier, /* error code */ + int len /* string length */ +) +#else + +void +CDF_MARKTEXT (x, y, str, size, angle, color, ier, len) +int *x, *y; /* marker position */ +char *str; /* text string */ +float *size; /* size scale factor */ +float *angle; /* text rotation angle */ +int *color; /* marker color */ +int *ier; /* error code */ +int len; /* string length */ +#endif +{ + sstrip (str, len); + *ier = cdl_markText (cdl_f, *x, *y, sstrip(str, len), + *size, *angle, *color); +} + + +/* CDF_SETFONT -- Set the font to be used for text. */ + +#ifdef ANSI_FUNC + +void +CDF_SETFONT ( + int *font /* font type */ +) +#else + +void +CDF_SETFONT (font) +int *font; /* font type */ +#endif +{ + cdl_setFont (cdl_f, *font); +} + + +/* CDF_SETLINEWIDTH -- Set the line width to be used. */ + +#ifdef ANSI_FUNC + +void +CDF_SETLINEWIDTH ( + int *width /* line width */ +) +#else + +void +CDF_SETLINEWIDTH (width) +int *width; /* line width */ +#endif +{ + cdl_setLineWidth (cdl_f, *width); +} + + +/* CDF_SETLINESTYLE -- Set the line style to be used. */ + +#ifdef ANSI_FUNC + +void +CDF_SETLINESTYLE ( + int *style /* line style */ +) +#else + +void +CDF_SETLINESTYLE (style) +int *style; /* line style */ +#endif +{ + cdl_setLineStyle (cdl_f, *style); +} + + +/* CDF_SETTEXTWIDTH -- Set the line width to be used. */ + +#ifdef ANSI_FUNC + +void +CDF_SETTEXTWIDTH ( + int *width /* text width */ +) +#else + +void +CDF_SETTEXTWIDTH (width) +int *width; /* text width */ +#endif +{ + cdl_setTextWidth (cdl_f, *width); +} + + +/* CDF_DELETEMARK -- Delete the overlay mark whose center is closest. */ + +#ifdef ANSI_FUNC + +void +CDF_DELETEMARK ( + int *x, + int *y, /* marker position */ + int *ier /* error code */ +) +#else + +void +CDF_DELETEMARK (x, y, ier) +int *x, *y; /* marker position */ +int *ier; /* error code */ +#endif +{ + *ier = cdl_deleteMark (cdl_f, *x, *y); +} + + +/* CDF_CLEAROVERLAY -- Erase all marks in the current display list. */ + +#ifdef ANSI_FUNC + +void +CDF_CLEAROVERLAY ( + int *ier /* error code */ +) +#else + +void +CDF_CLEAROVERLAY (ier) +int *ier; /* error code */ +#endif +{ + *ier = cdl_clearOverlay (cdl_f); +} + + +/* CDF_REDRAWOVERLAY -- Redraw all marks in the current display list. */ + +#ifdef ANSI_FUNC + +void +CDF_REDRAWOVERLAY ( + int *ier /* error code */ +) +#else + +void +CDF_REDRAWOVERLAY (ier) +int *ier; /* error code */ +#endif +{ + *ier = cdl_redrawOverlay (cdl_f); +} + + +/* Debug routine. */ +#ifdef ANSI_FUNC + +void +CDF_SETDEBUG (int *state) +#else + +void CDF_SETDEBUG (state) int *state; +#endif + { cdl_setDebug (*state); } + + +/* ------------------- + * PRIVATE PROCEDURES + * -------------------*/ + +/* Support utility to trim trailing blanks from string and add + * a null terminator. + */ + +static char t[SZ_LINE]; + +#ifdef ANSI_FUNC + +static char * +sstrip (char *instr, int len) +#else + +static char * +sstrip (instr, len) +char *instr; +int len; +#endif +{ + int i; + + if (instr == NULL) + t[0] = '\0'; + else { + strncpy (t, instr, min(len, SZ_LINE)); + i = min(len, SZ_LINE) - 1; + while (t[i] == ' ') + i = i - 1; + t[i+1] = '\0'; + } + return(t); +} + +/* + * SPAD --- Pad a string to length 'len' with blanks, as Fortran + * requires. + */ + +#ifdef ANSI_FUNC +static void +spad (char *outstr, int len) +#else + +static void +spad (outstr, len) +char *outstr; +int len; +#endif +{ + int i; + + for (i = strlen(outstr); i < len; i++) + outstr[i] = ' '; +} diff --git a/vendor/x11iraf/cdl/cdl_f77.h b/vendor/x11iraf/cdl/cdl_f77.h new file mode 100644 index 00000000..7688245e --- /dev/null +++ b/vendor/x11iraf/cdl/cdl_f77.h @@ -0,0 +1,250 @@ +/* + * CDL_F77.H -- header file for the CDL Fortran interface. Fortran compilers + * on various platforms may append one or more trailing underscores to + * symbol names, we'll use macros for the interface names and use defines + * to see what the symbol name is. + */ + + +#ifdef _NO_US_ + +#define CDF_OPEN cfopen +#define CDF_DISPLAYPIX cfdisplaypix +#define CDF_READCURSOR cfreadcursor +#define CDF_SETCURSOR cfsetcursor +#define CDF_CLEARFRAME cfclearframe +#define CDF_SELECTFB cfselectfb +#define CDF_CLOSE cfclose +#define CDF_DISPLAYIRAF cfdisplayiraf +#define CDF_ISIRAF cfisiraf +#define CDF_READIRAF cfreadiraf +#define CDF_DISPLAYFITS cfdisplayfits +#define CDF_ISFITS cfisfits +#define CDF_READFITS cfreadfits +#define CDF_COMPZSCALE cfcompzscale +#define CDF_ZSCALEIMAGE cfzscaleimage +#define CDF_PRINTPIX cfprintpix +#define CDF_PRINTPIXTOFILE cfprintpixtofile +#define CDF_READIMAGE cfreadimage +#define CDF_READFRAMEBUFFER cfreadframebuffer +#define CDF_READSUBRAS cfreadsubras +#define CDF_WRITESUBRAS cfwritesubras +#define CDF_SETWCS cfsetwcs +#define CDF_SETFBCONFIG cfsetfbconfig +#define CDF_GETFBCONFIG cfgetfbconfig +#define CDF_LOOKUPFBSIZE cflookupfbsize +#define CDF_SETFRAME cfsetframe +#define CDF_SETZTRANS cfsetztrans +#define CDF_SETZSCALE cfsetzscale +#define CDF_SETSAMPLE cfsetsample +#define CDF_SETSAMPLELINES cfsetsamplelines +#define CDF_SETCONTRAST cfsetcontrast +#define CDF_SETNAME cfsetname +#define CDF_SETTITLE cfsettitle +#define CDF_GETWCS cfgetwcs +#define CDF_GETFRAME cfgetframe +#define CDF_GETZTRANS cfgetztrans +#define CDF_GETZSCALE cfgetzscale +#define CDF_GETSAMPLE cfgetsample +#define CDF_GETSAMPLELINES cfgetsamplelines +#define CDF_GETCONTRAST cfgetcontrast +#define CDF_GETNAME cfgetname +#define CDF_GETTITLE cfgettitle +#define CDF_MAPFRAME cfmapframe +#define CDF_MARKCOORDSFILE cfmarkcoordsfile +#define CDF_MARKPOINT cfmarkpoint +#define CDF_MARKPOINTLABEL cfmarkpointlabel +#define CDF_MARKLINE cfmarkline +#define CDF_MARKBOX cfmarkbox +#define CDF_MARKPOLYLINE cfmarkpolyline +#define CDF_MARKPOLYGON cfmarkpolygon +#define CDF_MARKCIRCLE cfmarkcircle +#define CDF_MARKCIRCANNULI cfmarkcircannuli +#define CDF_MARKELLIPSE cfmarkellipse +#define CDF_MARKELLIPANNULI cfmarkellipannuli +#define CDF_SETFONT cfsetfont +#define CDF_SETLINEWIDTH cfsetlwidth +#define CDF_SETLINESTYLE cfsetlstyle +#define CDF_SETTEXTWIDTH cfsettwidth +#define CDF_MARKTEXT cfmarktext +#define CDF_DELETEMARK cfdeletemark +#define CDF_CLEAROVERLAY cfclearoverlay +#define CDF_REDRAWOVERLAY cfredrawoverlay +#define CDF_SETDEBUG cfsetdebug +#define CDF_SETMAPPING cfsetmapping +#define CDF_GETMAPPING cfgetmapping +#define CDF_QUERYMAP cfquerymap + + +#else + +#define CDF_OPEN cfopen_ +#define CDF_DISPLAYPIX cfdisplaypix_ +#define CDF_READCURSOR cfreadcursor_ +#define CDF_SETCURSOR cfsetcursor_ +#define CDF_CLEARFRAME cfclearframe_ +#define CDF_SELECTFB cfselectfb_ +#define CDF_CLOSE cfclose_ +#define CDF_DISPLAYIRAF cfdisplayiraf_ +#define CDF_ISIRAF cfisiraf_ +#define CDF_READIRAF cfreadiraf_ +#define CDF_DISPLAYFITS cfdisplayfits_ +#define CDF_ISFITS cfisfits_ +#define CDF_READFITS cfreadfits_ +#define CDF_COMPZSCALE cfcompzscale_ +#define CDF_ZSCALEIMAGE cfzscaleimage_ +#define CDF_PRINTPIX cfprintpix_ +#define CDF_PRINTPIXTOFILE cfprintpixtofile_ +#define CDF_READIMAGE cfreadimage_ +#define CDF_READFRAMEBUFFER cfreadframebuffer_ +#define CDF_READSUBRAS cfreadsubras_ +#define CDF_WRITESUBRAS cfwritesubras_ +#define CDF_SETWCS cfsetwcs_ +#define CDF_SETFBCONFIG cfsetfbconfig_ +#define CDF_GETFBCONFIG cfgetfbconfig_ +#define CDF_LOOKUPFBSIZE cflookupfbsize_ +#define CDF_SETFRAME cfsetframe_ +#define CDF_SETZTRANS cfsetztrans_ +#define CDF_SETZSCALE cfsetzscale_ +#define CDF_SETSAMPLE cfsetsample_ +#define CDF_SETSAMPLELINES cfsetsamplelines_ +#define CDF_SETCONTRAST cfsetcontrast_ +#define CDF_SETNAME cfsetname_ +#define CDF_SETTITLE cfsettitle_ +#define CDF_GETWCS cfgetwcs_ +#define CDF_GETFRAME cfgetframe_ +#define CDF_GETZTRANS cfgetztrans_ +#define CDF_GETZSCALE cfgetzscale_ +#define CDF_GETSAMPLE cfgetsample_ +#define CDF_GETSAMPLELINES cfgetsamplelines_ +#define CDF_GETCONTRAST cfgetcontrast_ +#define CDF_GETNAME cfgetname_ +#define CDF_GETTITLE cfgettitle_ +#define CDF_MAPFRAME cfmapframe_ +#define CDF_MARKCOORDSFILE cfmarkcoordsfile_ +#define CDF_MARKPOINT cfmarkpoint_ +#define CDF_MARKPOINTLABEL cfmarkpointlabel_ +#define CDF_MARKLINE cfmarkline_ +#define CDF_MARKBOX cfmarkbox_ +#define CDF_MARKPOLYLINE cfmarkpolyline_ +#define CDF_MARKPOLYGON cfmarkpolygon_ +#define CDF_MARKCIRCLE cfmarkcircle_ +#define CDF_MARKCIRCANNULI cfmarkcircannuli_ +#define CDF_MARKELLIPSE cfmarkellipse_ +#define CDF_MARKELLIPANNULI cfmarkellipannuli_ +#define CDF_MARKTEXT cfmarktext_ +#define CDF_SETFONT cfsetfont_ +#define CDF_SETLINEWIDTH cfsetlwidth_ +#define CDF_SETLINESTYLE cfsetlstyle_ +#define CDF_SETTEXTWIDTH cfsettwidth_ +#define CDF_DELETEMARK cfdeletemark_ +#define CDF_CLEAROVERLAY cfclearoverlay_ +#define CDF_REDRAWOVERLAY cfredrawoverlay_ +#define CDF_SETDEBUG cfsetdebug_ +#define CDF_SETMAPPING cfsetmapping_ +#define CDF_GETMAPPING cfgetmapping_ +#define CDF_QUERYMAP cfquerymap_ + +#endif + + +#ifdef ANSI_FUNC + +void CDF_OPEN(char *imtdev, int *ier, int len); +void CDF_DISPLAYPIX(uchar *pix, int *nx, int *ny, int *bitpix, int *frame, int *fbconfig, int *zscale, int *ier); +void CDF_READCURSOR(int *sample, float *x, float *y, int *wcs, char *key, int *ier); +void CDF_DISPLAYIRAF(char *fname, int *band, int *frame, int *fbconfig, int *zscale, int *ier, int len); +void CDF_ISIRAF(char *fname, int *isiraf, int len); +void CDF_READIRAF(char *fname, int *band, uchar *pix, int *nx, int *ny, int *bitpix, char *title, int *ier, int len); +void CDF_DISPLAYFITS(char *fname, int *frame, int *fbconfig, int *zscale, int *ier, int len); +void CDF_ISFITS(char *fname, int *isfits, int len); +void CDF_READFITS(char *fname, uchar *pix, int *nx, int *ny, int *bitpix, char *title, int *ier, int len); +void CDF_SETCURSOR(int *x, int *y, int *wcs, int *ier); +void CDF_SETWCS(char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt, int *ier, int nlen, int tlen); +void CDF_GETWCS(char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt, int *ier, int nlen, int tlen); +void CDF_CLEARFRAME(int *ier); +void CDF_SELECTFB(int *nx, int *ny, int *fb, int *w, int *h, int *nf, int *reset); +void CDF_CLOSE(void); +void CDF_READIMAGE(uchar *pix, int *nx, int *ny, int *ier); +void CDF_READFRAMEBUFFER(uchar *pix, int *nx, int *ny, int *ier); +void CDF_COMPZSCALE(uchar *pix, int *nx, int *ny, int *bitpix, float *z1, float *z2); +void CDF_ZSCALEIMAGE(uchar *pix, int *nx, int *ny, int *bitpix, float *z1, float *z2); +void CDF_PRINTPIX(char *cmd, uchar *pix, int *nx, int *ny, int *annotate, int *ier, int len); +void CDF_PRINTPIXTOFILE(char *fname, uchar *pix, int *nx, int *ny, int *annotate, int *ier, int len); +void CDF_READSUBRAS(int *lx, int *ly, int *nx, int *ny, uchar *pix, int *ier); +void CDF_WRITESUBRAS(int *lx, int *ly, int *nx, int *ny, uchar *pix, int *ier); +void CDF_SETFBCONFIG(int *configno); +void CDF_GETFBCONFIG(int *configno, int *w, int *h, int *nframes); +void CDF_LOOKUPFBSIZE(int *configno, int *w, int *h, int *nf); +void CDF_SETFRAME(int *frame); +void CDF_SETZTRANS(int *ztrans); +void CDF_SETZSCALE(float *z1, float *z2); +void CDF_SETSAMPLE(int *nsample); +void CDF_SETSAMPLELINES(int *nlines); +void CDF_SETCONTRAST(float *contrast); +void CDF_SETNAME(char *imname, int len); +void CDF_SETTITLE(char *imtitle, int len); +void CDF_GETFRAME(int *frame); +void CDF_GETZTRANS(int *ztrans); +void CDF_GETZSCALE(float *z1, float *z2); +void CDF_GETSAMPLE(int *nsample); +void CDF_GETSAMPLELINES(int *nlines); +void CDF_GETCONTRAST(float *contrast); +void CDF_GETNAME(char *imname, int len); +void CDF_GETTITLE(char *imtitle, int len); +void CDF_MAPFRAME(int *frame, int *ier); +void CDF_MARKCOORDSFILE(char *fname, int *type, int *size, int *color, int *label, int *ier, int len); +void CDF_MARKPOINT(int *x, int *y, int *number, int *size, int *type, int *color, int *ier); +void CDF_MARKPOINTLABEL(int *x, int *y, char *label, int *size, int *type, int *color, int *ier, int len); +void CDF_MARKLINE(int *xs, int *ys, int *xe, int *ye, int *color, int *ier); +void CDF_MARKBOX(int *lx, int *ly, int *ux, int *uy, int *fill, int *color, int *ier); +void CDF_MARKPOLYGON(int *xarray, int *yarray, int *npts, int *fill, int *color, int *ier); +void CDF_MARKPOLYLINE(int *xarray, int *yarray, int *npts, int *color, int *ier); +void CDF_MARKCIRCLE(int *x, int *y, int *radius, int *fill, int *color, int *ier); +void CDF_MARKCIRCANNULI(int *x, int *y, int *radius, int *nannuli, int *sep, int *color, int *ier); +void CDF_MARKELLIPSE(int *x, int *y, int *xrad, int *yrad, float *ang, int *fill, int *color, int *ier); +void CDF_MARKELLIPANNULI(int *x, int *y, int *xrad, int *yrad, float *ang, int *nannuli, int *sep, int *color, int *ier); +void CDF_MARKTEXT(int *x, int *y, char *str, float *size, float *angle, int *color, int *ier, int len); +void CDF_SETFONT(int *font); +void CDF_SETLINEWIDTH(int *width); +void CDF_SETLINESTYLE(int *style); +void CDF_SETTEXTWIDTH(int *width); +void CDF_DELETEMARK(int *x, int *y, int *ier); +void CDF_CLEAROVERLAY(int *ier); +void CDF_REDRAWOVERLAY(int *ier); +void CDF_SETDEBUG(int *state); +void CDF_SETMAPPING(char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); +void CDF_GETMAPPING(char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); +void CDF_QUERYMAP(int *wcs, char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); + + +#else + +/* Function Definitions. */ +void CDF_OPEN(); +void CDF_DISPLAYPIX(), CDF_DISPLAYIRAF(), CDF_DISPLAYFITS(); +void CDF_READIRAF(), CDF_READFITS(), CDF_CLEARFRAME(); +void CDF_READIMAGE(), CDF_READFRAMEBUFFER(), CDF_READSUBRAS(); +void CDF_WRITESUBRAS(), CDF_SETCURSOR(), CDF_READCURSOR(); +void CDF_SELECTFB(), CDF_CLOSE(), CDF_COMPZSCALE(), CDF_ZSCALEIMAGE(); +void CDF_SETFRAME(), CDF_SETFBCONFIG(), CDF_SETZTRANS(), CDF_SETZOOM(); +void CDF_SETSAMPLE(), CDF_SETCONTRAST(), CDF_SETNAME(), CDF_SETTITLE(); +void CDF_GETFRAME(), CDF_GETFBCONFIG(), CDF_GETZTRANS(), CDF_GETZOOM(); +void CDF_GETSAMPLE(), CDF_GETCONTRAST(), CDF_GETNAME(), CDF_GETTITLE(); +void CDF_SETZSCALE(), CDF_GETZSCALE(), CDF_LOOKUPFBSIZE(); +void CDF_ISIRAF(), CDF_ISFITS(), CDF_SETDEBUG(); +void CDF_PRINTPIX (), CDF_PRINTPIXTOFILE (); +void CDF_SETSAMPLELINES (), CDF_GETSAMPLELINES (); +void CDF_SETWCS(), CDF_GETWCS(); +void CDF_SETMAPPING(), CDF_GETMAPPING(), CDF_QUERYMAP(); + +/* Marker Function Definitions. */ +void CDF_MARKPOINT(), CDF_MARKLINE(), CDF_MARKBOX(), CDF_MARKPOLYLINE(); +void CDF_MARKPOLYGON(), CDF_MARKCIRCLE(), CDF_MARKCIRCANNULI(); +void CDF_MARKELLIPSE(), CDF_MARKELLIPANNULI(), CDF_MARKTEXT(); +void CDF_MARKPOINTLABEL(), CDF_SETFONT(); +void CDF_DELETEMARK(), CDF_CLEAROVERLAY(), CDF_REDRAWOVERLAY(); +void CDF_SETLINEWIDTH(), CDF_SETTEXTWIDTH(), CDF_SETLINESTYLE(); +void CDF_MARKCOORDSFILE(); + +#endif diff --git a/vendor/x11iraf/cdl/cdl_spp.c b/vendor/x11iraf/cdl/cdl_spp.c new file mode 100644 index 00000000..6dfab5cf --- /dev/null +++ b/vendor/x11iraf/cdl/cdl_spp.c @@ -0,0 +1,1754 @@ +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" +#include "cdl_spp.h" + + + +/* + * CDL_SPP.C -- SPP binding for the CDL package. Even though we mostly + * call the F77 routines here we need a unique procedure for each function + * so we can map the SPP symbol names correctly. + */ + +char cstr[512], cstr2[512]; + + +/* CDS_OPEN -- Open and initialize the CDL package. */ + +#ifdef ANSI_FUNC + +void +CDS_OPEN ( + char *imtdev, /* connection device */ + int *ier /* error code */ +) +#else + +void +CDS_OPEN (imtdev, ier) +char *imtdev; /* connection device */ +int *ier; /* error code */ +#endif +{ + strpak (imtdev, cstr, SZ_FNAME); + CDF_OPEN (cstr, ier, strlen(cstr)); +} + + +/* CDS_DISPLAYPIX -- Display a raw pixel array to the server. */ + +#ifdef ANSI_FUNC + +void +CDS_DISPLAYPIX ( + uchar *pix, /* pixels to display */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* pixel size */ + int *frame, /* display frame */ + int *fbconfig, /* FB config number */ + int *zscale, /* do zscale of image? */ + int *ier /* error code */ +) +#else + +void +CDS_DISPLAYPIX (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +uchar *pix; /* pixels to display */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* pixel size */ +int *frame; /* display frame */ +int *fbconfig; /* FB config number */ +int *zscale; /* do zscale of image? */ +int *ier; /* error code */ +#endif +{ + CDF_DISPLAYPIX (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier); +} + + +/* CDS_READCURSOR -- Read the current cursor position. */ + +#ifdef ANSI_FUNC + +void +CDS_READCURSOR ( + int *sample, /* wait for keystroke? */ + float *x, + float *y, /* position (output) */ + int *wcs, /* WCS */ + char *key, /* keystroke (output) */ + int *ier /* error code */ +) +#else + +void +CDS_READCURSOR (sample, x, y, wcs, key, ier) +int *sample; /* wait for keystroke? */ +float *x, *y; /* position (output) */ +int *wcs; /* WCS */ +char *key; /* keystroke (output) */ +int *ier; /* error code */ +#endif +{ + char ch[2]; + CDF_READCURSOR (sample, x, y, wcs, ch, ier); + strupk (ch, key, 2); + + /* If the char read is a control char, return EOS */ + if (iscntrl(key[0])) + key[0] = key[1] = '\0'; +} + + +/* CDS_DISPLAYIRAF -- Display an IRAF OIF format image. */ + +#ifdef ANSI_FUNC + +void +CDS_DISPLAYIRAF ( + char *fname, /* image name */ + int *band, /* image band if 3-d */ + int *frame, /* display frame */ + int *fbconfig, /* frame buffer config */ + int *zscale, /* do zscale of image? */ + int *ier /* error code */ +) +#else + +void +CDS_DISPLAYIRAF (fname, band, frame, fbconfig, zscale, ier) +char *fname; /* image name */ +int *band; /* image band if 3-d */ +int *frame; /* display frame */ +int *fbconfig; /* frame buffer config */ +int *zscale; /* do zscale of image? */ +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_DISPLAYIRAF (cstr, band, frame, fbconfig, zscale, ier, SZ_FNAME); +} + + +/* CDS_ISIRAF -- Test a file to see if it is a IRAF file. */ + +#ifdef ANSI_FUNC + +void +CDS_ISIRAF ( + char *fname, /* input filename */ + int *isiraf +) +#else + +void +CDS_ISIRAF (fname, isiraf) +char *fname; /* input filename */ +int *isiraf; +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_ISIRAF (cstr, isiraf, SZ_FNAME); +} + + +/* CDS_READIRAF -- Read the pixels from an IRAF OIF format image. */ + +#ifdef ANSI_FUNC + +void +CDS_READIRAF ( + char *fname, /* image name */ + int *band, /* image band if 3-d */ + uchar *pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title, /* image title (output) */ + int *ier /* error code */ +) +#else + +void +CDS_READIRAF (fname, band, pix, nx, ny, bitpix, title, ier) +char *fname; /* image name */ +int *band; /* image band if 3-d */ +uchar *pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title (output) */ +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_READIRAF (cstr, band, pix, nx, ny, bitpix, cstr2, ier, SZ_FNAME); + strupk (cstr2, title, SZ_FNAME); +} + + +/* CDS_DISPLAYFITS -- Display a simple FITS format image. */ + +#ifdef ANSI_FUNC + +void +CDS_DISPLAYFITS ( + char *fname, + int *frame, + int *fbconfig, + int *zscale, + int *ier /* error code */ +) +#else + +void +CDS_DISPLAYFITS (fname, frame, fbconfig, zscale, ier) +char *fname; +int *frame; +int *fbconfig; +int *zscale; +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_DISPLAYFITS (cstr, frame, fbconfig, zscale, ier, SZ_FNAME); +} + + +/* CDS_ISFITS -- Test a file to see if it is a simple FITS file. */ + +#ifdef ANSI_FUNC + +void +CDS_ISFITS ( + char *fname, /* input filename */ + int *isfits /* return value */ +) +#else + +void +CDS_ISFITS (fname, isfits) +char *fname; /* input filename */ +int *isfits; /* return value */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_ISFITS (cstr, isfits, SZ_FNAME); +} + + +/* CDS_READFITS -- Read the pixels from a simple FITS format image. */ + +#ifdef ANSI_FUNC + +void +CDS_READFITS ( + char *fname, /* image name */ + uchar *pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title, /* image title (output) */ + int *ier /* error code */ +) +#else + +void +CDS_READFITS (fname, pix, nx, ny, bitpix, title, ier) +char *fname; /* image name */ +uchar *pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title (output) */ +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_READFITS (fname, pix, nx, ny, bitpix, cstr2, ier, SZ_FNAME); + strupk (cstr2, title, SZ_FNAME); +} + + +/* CDS_SETCURSOR -- Set the current logical cursor position. */ + +#ifdef ANSI_FUNC + +void +CDS_SETCURSOR ( + int *x, + int *y, /* position */ + int *wcs, /* cursor wcs */ + int *ier /* error code */ +) +#else + +void +CDS_SETCURSOR (x, y, wcs, ier) +int *x, *y; /* position */ +int *wcs; /* cursor wcs */ +int *ier; /* error code */ +#endif +{ + CDF_SETCURSOR (x, y, wcs, ier); +} + + +/* CDS_SETWCS -- Set the WCS of the screen. */ + +#ifdef ANSI_FUNC + +void +CDS_SETWCS ( + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt, /* transformation type */ + int *ier /* error code */ +) +#else + +void +CDS_SETWCS (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +int *ier; /* error code */ +#endif +{ + strpak (name, cstr, SZ_FNAME); + strpak (title, cstr2, SZ_FNAME); + CDF_SETWCS (cstr, cstr2, a, b, c, d, tx,ty, z1,z2, zt, ier, + SZ_FNAME, SZ_FNAME); +} + + +/* CDS_GETWCS -- Get the current display frame WCS information. */ + +#ifdef ANSI_FUNC + +void +CDS_GETWCS ( + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt, /* transformation type */ + int *ier /* error code */ +) +#else + +void +CDS_GETWCS (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +int *ier; /* error code */ +#endif +{ + CDF_GETWCS (cstr, cstr2, a, b, c, d, tx,ty, z1,z2, zt, ier, + SZ_FNAME, SZ_FNAME); + strupk (cstr, name, SZ_FNAME); + strupk (cstr2, title, SZ_FNAME); +} + + +/* CDS_SETMAPPING -- Set the mapping information to be sent with the next + * cdl_setWcs() call. + */ +#ifdef ANSI_FUNC + +void +CDS_SETMAPPING ( + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) +#else + +void +CDS_SETMAPPING (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier, reglen, reflen) +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + strpak (region, cstr, SZ_FNAME); + strpak (ref, cstr2, SZ_FNAME); + CDF_SETMAPPING (cstr, sx,sy,snx,sny, dx,dy,dnx,dny, cstr2, ier, + SZ_FNAME, SZ_FNAME); +} + + +/* CDS_GETMAPPING -- Get the mapping information returned with the last + * cdl_getWcs() call. + */ +#ifdef ANSI_FUNC +void +CDS_GETMAPPING ( + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) + +#else +void +CDS_GETMAPPING (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier, reglen, reflen) +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + CDF_GETMAPPING (cstr, sx,sy,snx,sny, dx,dy,dnx,dny, cstr2, ier, + SZ_FNAME, SZ_FNAME); + strupk (cstr, region, SZ_FNAME); + strupk (cstr2, ref, SZ_FNAME); +} + + +/* CDS_QUERYMAP -- Query a mapping given the wcs number. + */ +#ifdef ANSI_FUNC + +void +CDS_QUERYMAP ( + int *wcs, /* requested wcs number */ + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *objref, /* reference name */ + int *ier, /* error code */ + int reglen, /* string lengths */ + int reflen +) +#else + +void +CDS_QUERYMAP (wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref, ier, reglen, reflen) +int *wcs; /* requested wcs number */ +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *objref; /* reference name */ +int *ier; /* error code */ +int reglen, reflen; /* string lengths */ +#endif +{ + CDF_QUERYMAP (wcs, cstr, sx,sy,snx,sny, dx,dy,dnx,dny, cstr2, ier, + SZ_FNAME, SZ_FNAME); + strupk (cstr, region, SZ_FNAME); + strupk (cstr2, objref, SZ_FNAME); +} + + +/* CDS_CLEARFRAME -- Erase the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDS_CLEARFRAME ( + int *ier /* error code */ +) +#else + +void +CDS_CLEARFRAME (ier) +int *ier; /* error code */ +#endif +{ + CDF_CLEARFRAME (ier); +} + + +/* CDS_SELECTFB -- Select an appropriate frame buffer for the image. */ + +#ifdef ANSI_FUNC + +void +CDS_SELECTFB ( + int *nx, + int *ny, /* image size */ + int *fb, /* frame buffer */ + int *w, + int *h, /* frame size */ + int *nf, /* number of frames */ + int *reset /* reset after select */ +) +#else + +void +CDS_SELECTFB (nx, ny, fb, w, h, nf, reset) +int *nx, *ny; /* image size */ +int *fb; /* frame buffer */ +int *w, *h; /* frame size */ +int *nf; /* number of frames */ +int *reset; /* reset after select */ +#endif +{ + CDF_SELECTFB (nx, ny, fb, w, h, nf, reset); +} + + +/* CDS_CLOSE -- Close the CDL package descriptor. */ + +#ifdef ANSI_FUNC + +void +CDS_CLOSE (void) +#else + +void +CDS_CLOSE () +#endif +{ + CDF_CLOSE (); +} + + +/* CDS_READIMAGE -- Read the currently displayed image. */ + +#ifdef ANSI_FUNC + +void +CDS_READIMAGE ( + uchar *pix, /* image pixels (output)*/ + int *nx, + int *ny, /* dimensions (output) */ + int *ier /* error code */ +) +#else + +void +CDS_READIMAGE (pix, nx, ny, ier) +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +int *ier; /* error code */ +#endif +{ + CDF_READIMAGE (pix, nx, ny, ier); +} + + +/* CDS_READFRAMEBUFFER -- Read the contents of the entire frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDS_READFRAMEBUFFER ( + uchar *pix, /* image pixels (output)*/ + int *nx, + int *ny, /* dimensions (output) */ + int *ier /* error code */ +) +#else + +void +CDS_READFRAMEBUFFER (pix, nx, ny, ier) +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +int *ier; /* error code */ +#endif +{ + CDF_READFRAMEBUFFER (pix, nx, ny, ier); +} + + +/* CDS_COMPZSCALE -- Compute the optimal z1/z2 values for an array. */ + +#ifdef ANSI_FUNC + +void +CDS_COMPZSCALE ( + uchar *pix, /* data to be sampled */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* bits per pixel */ + float *z1, + float *z2 /* min/max zscale values*/ +) +#else + +void +CDS_COMPZSCALE (pix, nx, ny, bitpix, z1, z2) +uchar *pix; /* data to be sampled */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* bits per pixel */ +float *z1, *z2; /* min/max zscale values*/ +#endif +{ + CDF_COMPZSCALE (pix, nx, ny, bitpix, z1, z2); +} + + +/* CDS_ZSCALEIMAGE -- Compute the optimal z1/z2 values for an array. */ + +#ifdef ANSI_FUNC + +void +CDS_ZSCALEIMAGE ( + uchar *pix, /* data to be sampled */ + int *nx, + int *ny, /* image dimensions */ + int *bitpix, /* bits per pixel */ + float *z1, + float *z2 /* min/max zscale values*/ +) +#else + +void +CDS_ZSCALEIMAGE (pix, nx, ny, bitpix, z1, z2) +uchar *pix; /* data to be sampled */ +int *nx, *ny; /* image dimensions */ +int *bitpix; /* bits per pixel */ +float *z1, *z2; /* min/max zscale values*/ +#endif +{ + CDF_ZSCALEIMAGE (pix, nx, ny, bitpix, z1, z2); +} + + +/* CDS_PRINTPIX -- Print the given pixels as EPS to the named command. */ + +#ifdef ANSI_FUNC + +void +CDS_PRINTPIX ( + char *cmd, /* command string */ + uchar *pix, /* pixel array */ + int *nx, + int *ny, /* image dimensions */ + int *annotate, /* annotate output? */ + int *ier /* error code */ +) +#else + +void +CDS_PRINTPIX (cmd, pix, nx, ny, annotate, ier) +char *cmd; /* command string */ +uchar *pix; /* pixel array */ +int *nx, *ny; /* image dimensions */ +int *annotate; /* annotate output? */ +int *ier; /* error code */ +#endif +{ + strpak (cmd, cstr, SZ_FNAME); + CDF_PRINTPIX (cmd, pix, nx, ny, annotate, ier, SZ_FNAME); +} + + +/* CDS_PRINTPIXTOFILE -- Print the given pixels as EPS to the named file. */ + +#ifdef ANSI_FUNC + +void +CDS_PRINTPIXTOFILE ( + char *fname, /* filename */ + uchar *pix, /* pixel array */ + int *nx, + int *ny, /* image dimensions */ + int *annotate, /* annotate output? */ + int *ier /* error code */ +) +#else + +void +CDS_PRINTPIXTOFILE (fname, pix, nx, ny, annotate, ier) +char *fname; /* filename */ +uchar *pix; /* pixel array */ +int *nx, *ny; /* image dimensions */ +int *annotate; /* annotate output? */ +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_PRINTPIXTOFILE (cstr, pix, nx, ny, annotate, ier, SZ_FNAME); +} + + +/* CDS_READSUBRAS -- Read a rectangular region of the frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDS_READSUBRAS ( + int *lx, + int *ly, /* region corner */ + int *nx, + int *ny, /* dimensions */ + uchar *pix, /* image pixels (output)*/ + int *ier /* error code */ +) +#else + +void +CDS_READSUBRAS (lx, ly, nx, ny, pix, ier) +int *lx, *ly; /* region corner */ +int *nx, *ny; /* dimensions */ +uchar *pix; /* image pixels (output)*/ +int *ier; /* error code */ +#endif +{ + CDF_READSUBRAS (lx, ly, nx, ny, pix, ier); +} + + +/* CDS_WRITESUBRAS -- Write a rectangular region of the frame buffer. */ + +#ifdef ANSI_FUNC + +void +CDS_WRITESUBRAS ( + int *lx, + int *ly, /* region corner */ + int *nx, + int *ny, /* dimensions */ + uchar *pix, /* subraster pixels */ + int *ier /* error code */ +) +#else + +void +CDS_WRITESUBRAS (lx, ly, nx, ny, pix, ier) +int *lx, *ly; /* region corner */ +int *nx, *ny; /* dimensions */ +uchar *pix; /* subraster pixels */ +int *ier; /* error code */ +#endif +{ + CDF_WRITESUBRAS (lx, ly, nx, ny, pix, ier); +} + + +/* CDS_SETFBCONFIG -- Set the frame buffer configuration number. */ + +#ifdef ANSI_FUNC + +void +CDS_SETFBCONFIG ( + int *configno /* fb config number */ +) +#else + +void +CDS_SETFBCONFIG (configno) +int *configno; /* fb config number */ +#endif +{ + CDF_SETFBCONFIG (configno); +} + + +/* CDS_GETFBCONFIG -- Get the frame buffer configuration number. */ + +#ifdef ANSI_FUNC + +void +CDS_GETFBCONFIG ( + int *configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nframes /* number of frames */ +) +#else + +void +CDS_GETFBCONFIG (configno, w, h, nframes) +int *configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nframes; /* number of frames */ +#endif +{ + CDF_GETFBCONFIG (configno, w, h, nframes); +} + + +/* CDS_LOOKUPFBSIZE -- Lookup the frame buffer dimensions.*/ + +#ifdef ANSI_FUNC + +void +CDS_LOOKUPFBSIZE ( + int *configno, /* fb config number */ + int *w, + int *h, /* fb frame size */ + int *nf /* number of frames */ +) +#else + +void +CDS_LOOKUPFBSIZE (configno, w, h, nf) +int *configno; /* fb config number */ +int *w, *h; /* fb frame size */ +int *nf; /* number of frames */ +#endif +{ + CDF_LOOKUPFBSIZE (configno, w, h, nf); +} + + +/* CDS_SETFRAME -- Set the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDS_SETFRAME ( + int *frame /* frame number */ +) +#else + +void +CDS_SETFRAME (frame) +int *frame; /* frame number */ +#endif +{ + CDF_SETFRAME (frame); +} + + +/* CDS_SETZTRANS -- Set the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDS_SETZTRANS ( + int *ztrans /* z-transform type */ +) +#else + +void +CDS_SETZTRANS (ztrans) +int *ztrans; /* z-transform type */ +#endif +{ + CDF_SETZTRANS (ztrans); +} + + +/* CDS_SETZSCLAE -- Set the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDS_SETZSCALE ( + float *z1, + float *z2 /* zscale values */ +) +#else + +void +CDS_SETZSCALE (z1, z2) +float *z1, *z2; /* zscale values */ +#endif +{ + CDF_SETZSCALE (z1, z2); +} + + +/* CDS_SETSAMPLE -- Set the number of zscale sample points to use. */ + +#ifdef ANSI_FUNC + +void +CDS_SETSAMPLE ( + int *nsample /* no. of sample pts */ +) +#else + +void +CDS_SETSAMPLE (nsample) +int *nsample; /* no. of sample pts */ +#endif +{ + CDF_SETSAMPLE (nsample); +} + + +/* CDS_SETSAMPLELINES -- Set the number of zscale sample lines to use. */ + +#ifdef ANSI_FUNC + +void +CDS_SETSAMPLELINES ( + int *nlines /* no. of sample lines */ +) +#else + +void +CDS_SETSAMPLELINES (nlines) +int *nlines; /* no. of sample lines */ +#endif +{ + CDF_SETSAMPLELINES (nlines); +} + + +/* CDS_SETCONTRAST -- Set the zscale contrast value. */ + +#ifdef ANSI_FUNC + +void +CDS_SETCONTRAST ( + float *contrast /* contrast value */ +) +#else + +void +CDS_SETCONTRAST (contrast) +float *contrast; /* contrast value */ +#endif +{ + CDF_SETCONTRAST (contrast); +} + + +/* CDS_SETNAME -- Set the image name for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDS_SETNAME ( + char *imname /* image name */ +) +#else + +void +CDS_SETNAME (imname) +char *imname; /* image name */ +#endif +{ + strpak (imname, cstr, SZ_FNAME); + CDF_SETNAME (imname, SZ_FNAME); +} + + +/* CDS_SETTITLE -- Set the image title for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDS_SETTITLE ( + char *imtitle /* image title */ +) +#else + +void +CDS_SETTITLE (imtitle) +char *imtitle; /* image title */ +#endif +{ + strpak (imtitle, cstr, SZ_FNAME); + CDF_SETTITLE (imtitle, SZ_FNAME); +} + + +/* CDS_GETFRAME -- Get the current display frame. */ + +#ifdef ANSI_FUNC + +void +CDS_GETFRAME ( + int *frame /* frame number */ +) +#else + +void +CDS_GETFRAME (frame) +int *frame; /* frame number */ +#endif +{ + CDF_GETFRAME (frame); +} + + +/* CDS_GETZTRANS -- Get the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDS_GETZTRANS ( + int *ztrans /* z-transform type */ +) +#else + +void +CDS_GETZTRANS (ztrans) +int *ztrans; /* z-transform type */ +#endif +{ + CDF_GETZTRANS (ztrans); +} + + +/* CDS_GETZSCALE -- Get the current zscale transform parameters. */ + +#ifdef ANSI_FUNC + +void +CDS_GETZSCALE ( + float *z1, + float *z2 /* zscale values */ +) +#else + +void +CDS_GETZSCALE (z1, z2) +float *z1, *z2; /* zscale values */ +#endif +{ + CDF_GETZSCALE (z1, z2); +} + + +/* CDS_GETSAMPLE -- Get the number of zscale sample points to use. */ + +#ifdef ANSI_FUNC + +void +CDS_GETSAMPLE ( + int *nsample /* no. of sample pts */ +) +#else + +void +CDS_GETSAMPLE (nsample) +int *nsample; /* no. of sample pts */ +#endif +{ + CDF_GETSAMPLE (nsample); +} + + +/* CDS_GETSAMPLELINES -- Get the number of zscale sample lines to use. */ + +#ifdef ANSI_FUNC + +void +CDS_GETSAMPLELINES ( + int *nlines /* no. of sample lines */ +) +#else + +void +CDS_GETSAMPLELINES (nlines) +int *nlines; /* no. of sample lines */ +#endif +{ + CDF_GETSAMPLELINES (nlines); +} + + +/* CDS_GETCONTRAST -- Get the zscale contrast value. */ + +#ifdef ANSI_FUNC + +void +CDS_GETCONTRAST ( + float *contrast /* contrast value */ +) +#else + +void +CDS_GETCONTRAST (contrast) +float *contrast; /* contrast value */ +#endif +{ + CDF_GETCONTRAST (contrast); +} + + +/* CDS_GETNAME -- Get the image name for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDS_GETNAME ( + char *imname /* image name */ +) +#else + +void +CDS_GETNAME (imname) +char *imname; /* image name */ +#endif +{ + CDF_GETNAME (cstr, SZ_FNAME); + strupk (cstr, imname, SZ_FNAME); +} + + +/* CDS_GETTITLE -- Get the image title for the WCS string. */ + +#ifdef ANSI_FUNC + +void +CDS_GETTITLE ( + char *imtitle /* image title */ +) +#else + +void +CDS_GETTITLE (imtitle) +char *imtitle; /* image title */ +#endif +{ + CDF_GETTITLE (cstr, SZ_FNAME); + strupk (cstr, imtitle, SZ_FNAME); +} + + +/* CDS_MAPFRAME -- Map the current frame buffer as an image for overlay. */ + +#ifdef ANSI_FUNC + +void +CDS_MAPFRAME ( + int *frame, /* fb frame to map */ + int *ier /* error code */ +) +#else + +void +CDS_MAPFRAME (frame, ier) +int *frame; /* fb frame to map */ +int *ier; /* error code */ +#endif +{ + CDF_MAPFRAME (frame, ier); +} + +/* CDF_MARKCOORDSFILE -- Mark a list of coords from a file. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKCOORDSFILE ( + char *fname, /* file name */ + int *type, /* marker type */ + int *size, /* marker size */ + int *color, /* marker color */ + int *label, /* label? */ + int *ier /* error code */ +) +#else + +void +CDS_MARKCOORDSFILE (fname, type, size, color, label, ier) +char *fname; /* file name */ +int *type; /* marker type */ +int *size; /* marker size */ +int *color; /* marker color */ +int *label; /* label? */ +int *ier; /* error code */ +#endif +{ + strpak (fname, cstr, SZ_FNAME); + CDF_MARKCOORDSFILE (cstr, type, size, color, label, ier, SZ_FNAME); +} + + +/* CDS_MARKPOINT -- Draw a mark on the display at the given point. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKPOINT ( + int *x, + int *y, /* marker position */ + int *number, /* if > 0, label value */ + int *size, /* marker size (pixels) */ + int *type, /* type to draw */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKPOINT (x, y, number, size, type, color, ier) +int *x, *y; /* marker position */ +int *number; /* if > 0, label value */ +int *size; /* marker size (pixels) */ +int *type; /* type to draw */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKPOINT (x, y, number, size, type, color, ier); +} + + +/* CDS_MARKPOINTLABEL -- Draw a mark on the display at the given point. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKPOINTLABEL ( + int *x, + int *y, /* marker position */ + char *label, /* point label string */ + int *size, /* marker size (pixels) */ + int *type, /* type to draw */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKPOINTLABEL (x, y, label, size, type, color, ier) +int *x, *y; /* marker position */ +char *label; /* point label string */ +int *size; /* marker size (pixels) */ +int *type; /* type to draw */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + strpak (label, cstr, SZ_FNAME); + CDF_MARKPOINTLABEL (x, y, cstr, size, type, color, ier, SZ_FNAME); +} + + +/* CDS_MARKLINE -- Draw a line of given color between two points. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKLINE ( + int *xs, + int *ys, /* line start points */ + int *xe, + int *ye, /* line end points */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKLINE (xs, ys, xe, ye, color, ier) +int *xs, *ys; /* line start points */ +int *xe, *ye; /* line end points */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKLINE (xs, ys, xe, ye, color, ier); +} + + +/* CDS_MARKBOX -- Draw a rectangular box given two corner endpoints. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKBOX ( + int *lx, + int *ly, /* LL corner points */ + int *ux, + int *uy, /* UR corner points */ + int *fill, /* fill rectangle? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKBOX (lx, ly, ux, uy, fill, color, ier) +int *lx, *ly; /* LL corner points */ +int *ux, *uy; /* UR corner points */ +int *fill; /* fill rectangle? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKBOX (lx, ly, ux, uy, fill, color, ier); +} + + +/* CDS_MARKPOLYGON -- Draw a polygon on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKPOLYGON ( + int *xarray, + int *yarray, /* vertex points */ + int *npts, /* number of corners */ + int *fill, /* fill polygon? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKPOLYGON (xarray, yarray, npts, fill, color, ier) +int *xarray, *yarray; /* vertex points */ +int *npts; /* number of corners */ +int *fill; /* fill polygon? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKPOLYGON (xarray, yarray, npts, fill, color, ier); +} + + +/* CDS_MARKPOLYLINE -- Draw a polyline on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKPOLYLINE ( + int *xarray, + int *yarray, /* vertex points */ + int *npts, /* number of points */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKPOLYLINE (xarray, yarray, npts, color, ier) +int *xarray, *yarray; /* vertex points */ +int *npts; /* number of points */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKPOLYLINE (xarray, yarray, npts, color, ier); +} + + +/* CDS_MARKCIRCLE -- Draw of circle on the display, optionally filling. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKCIRCLE ( + int *x, + int *y, /* center position */ + int *radius, /* radius of circle */ + int *fill, /* fill circle? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKCIRCLE (x, y, radius, fill, color, ier) +int *x, *y; /* center position */ +int *radius; /* radius of circle */ +int *fill; /* fill circle? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKCIRCLE (x, y, radius, fill, color, ier); +} + + +/* CDS_MARKCIRCANNULI -- Draw circular annuli on the display. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKCIRCANNULI ( + int *x, + int *y, /* center position */ + int *radius, /* radius of 1st annulus*/ + int *nannuli, /* no. of annuli */ + int *sep, /* annuli sep (pixels) */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKCIRCANNULI (x, y, radius, nannuli, sep, color, ier) +int *x, *y; /* center position */ +int *radius; /* radius of 1st annulus*/ +int *nannuli; /* no. of annuli */ +int *sep; /* annuli sep (pixels) */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKCIRCANNULI (x, y, radius, nannuli, sep, color, ier); +} + + +/* CDS_MARKELLIPSE -- Draw an ellipse. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKELLIPSE ( + int *x, + int *y, /* center position */ + int *xrad, + int *yrad, /* x and y radii */ + float *ang, /* position angle (deg) */ + int *fill, /* fill ellipse? */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKELLIPSE (x, y, xrad, yrad, ang, fill, color, ier) +int *x, *y; /* center position */ +int *xrad, *yrad; /* x and y radii */ +float *ang; /* position angle (deg) */ +int *fill; /* fill ellipse? */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKELLIPSE (x, y, xrad, yrad, ang, fill, color, ier); +} + + +/* CDS_MARKELLIPANNULI -- Draw elliptical annuli on the display. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKELLIPANNULI ( + int *x, + int *y, /* center position */ + int *xrad, + int *yrad, /* radius of 1st annulus*/ + float *ang, /* rotation angle */ + int *nannuli, /* no. of annuli */ + int *sep, /* annuli sep (pixels) */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKELLIPANNULI (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +int *x, *y; /* center position */ +int *xrad, *yrad; /* radius of 1st annulus*/ +float *ang; /* rotation angle */ +int *nannuli; /* no. of annuli */ +int *sep; /* annuli sep (pixels) */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + CDF_MARKELLIPANNULI (x, y, xrad, yrad, ang, nannuli, sep, color, ier); +} + + +/* CDS_MARKTEXT -- Draw a text string on the display at the given location. */ + +#ifdef ANSI_FUNC + +void +CDS_MARKTEXT ( + int *x, + int *y, /* marker position */ + char *str, /* text string */ + float *size, /* size scale factor */ + float *angle, /* text rotation angle */ + int *color, /* marker color */ + int *ier /* error code */ +) +#else + +void +CDS_MARKTEXT (x, y, str, size, angle, color, ier) +int *x, *y; /* marker position */ +char *str; /* text string */ +float *size; /* size scale factor */ +float *angle; /* text rotation angle */ +int *color; /* marker color */ +int *ier; /* error code */ +#endif +{ + strpak (str, cstr, SZ_FNAME); + CDF_MARKTEXT (x, y, cstr, size, angle, color, ier, SZ_FNAME); +} + + +/* CDS_SETFONT -- Set the font to be used. */ + +#ifdef ANSI_FUNC + +void +CDS_SETFONT ( + int *font /* font type */ +) +#else + +void +CDS_SETFONT (font) +int *font; /* font type */ +#endif +{ + CDF_SETFONT (font); +} + + +/* CDS_SETLINEWIDTH -- Set the line width to be used. */ + +#ifdef ANSI_FUNC + +void +CDS_SETLINEWIDTH ( + int *width /* line width */ +) +#else + +void +CDS_SETLINEWIDTH (width) +int *width; /* line width */ +#endif +{ + CDF_SETLINEWIDTH (width); +} + + +/* CDS_SETLINESTYLE -- Set the line style to be used. */ + +#ifdef ANSI_FUNC + +void +CDS_SETLINESTYLE ( + int *style /* line style */ +) +#else + +void +CDS_SETLINESTYLE (style) +int *style; /* line style */ +#endif +{ + CDF_SETLINESTYLE (style); +} + + +/* CDS_SETTEXTWIDTH -- Set the line width to be used. */ + +#ifdef ANSI_FUNC + +void +CDS_SETTEXTWIDTH ( + int *width /* line width */ +) +#else + +void +CDS_SETTEXTWIDTH (width) +int *width; /* line width */ +#endif +{ + CDF_SETTEXTWIDTH (width); +} + + +/* CDS_DELETEMARK -- Delete the overlay mark whose center is closest. */ + +#ifdef ANSI_FUNC + +void +CDS_DELETEMARK ( + int *x, + int *y, /* marker position */ + int *ier /* error code */ +) +#else + +void +CDS_DELETEMARK (x, y, ier) +int *x, *y; /* marker position */ +int *ier; /* error code */ +#endif +{ + CDF_DELETEMARK (x, y, ier); +} + + +/* CDS_CLEAROVERLAY -- Erase all marks in the current display list. */ + +#ifdef ANSI_FUNC + +void +CDS_CLEAROVERLAY ( + int *ier /* error code */ +) +#else + +void +CDS_CLEAROVERLAY (ier) +int *ier; /* error code */ +#endif +{ + CDF_CLEAROVERLAY (ier); +} + + +/* CDS_REDRAWOVERLAY -- Redraw all marks in the current display list. */ + +#ifdef ANSI_FUNC + +void +CDS_REDRAWOVERLAY ( + int *ier /* error code */ +) +#else + +void +CDS_REDRAWOVERLAY (ier) +int *ier; /* error code */ +#endif +{ + CDF_REDRAWOVERLAY (ier); +} + + +/* Debug routine. */ +#ifdef ANSI_FUNC + +void +CDS_SETDEBUG (int *state) +#else + +void CDS_SETDEBUG (state) int *state; +#endif + { cdl_setDebug (*state); } + + +/* ------------------- + * PRIVATE PROCEDURES + * -------------------*/ + + +/* STRUPK -- Unpack a C string into an SPP string. + */ + +#ifdef ANSI_FUNC + +static void +strupk ( + char *str, /* C string */ + char *outstr, /* SPP string */ + int maxch /* max chars out, incl EOS */ +) +#else + +static void +strupk (str, outstr, maxch) +char *str; /* C string */ +char *outstr; /* SPP string */ +int maxch; /* max chars out, incl EOS */ +#endif +{ + register char *ip = str; + register short *op = (short *)outstr; + register int n = maxch-1; + + /* Is is necessary to determine the length of the string in order to + * be able to unpack the string in place, i.e., from right to left. + */ + if (maxch) + if (str != (char *)outstr) { + n = min (n, strlen(ip)); + op[n] = '\0'; + + for (n = n - 1; n >= 0; --n) + op[n] = ip[n]; + } +} + + +/* STRPAK -- Pack an SPP string (type XCHAR) into a C string in a user + * supplied buffer. Return a pointer to the output buffer. + */ + +#ifdef ANSI_FUNC + +static void +strpak ( + char *sppstr, /* SPP string */ + char *cstr, /* C string */ + int maxch /* max chars out, incl EOS */ +) +#else + +static void +strpak (sppstr, cstr, maxch) +char *sppstr; /* SPP string */ +char *cstr; /* C string */ +int maxch; /* max chars out, incl EOS */ +#endif +{ + register short *ip = (short *)sppstr; + register char *op = cstr; + register int n = maxch-1; + + if (maxch) + if ((char *)sppstr != cstr) { + while (--n >= 0 && (*op++ = *ip++) != '\0') + ; + cstr[maxch-1] = '\0'; + } +} diff --git a/vendor/x11iraf/cdl/cdl_spp.h b/vendor/x11iraf/cdl/cdl_spp.h new file mode 100644 index 00000000..e6e1ce40 --- /dev/null +++ b/vendor/x11iraf/cdl/cdl_spp.h @@ -0,0 +1,253 @@ +/* + * CDL_SPP.H -- Header file for the CDL SPP interface. Fortran compilers + * on various platforms may append one or more trailing underscores to + * symbol names, we'll use macros for the interface names and use defines + * to see what the symbol name is. + */ + +#include "cdl_f77.h" + +#ifdef _NO_US_ + +#define CDS_OPEN cdopen +#define CDS_DISPLAYPIX cdsppx +#define CDS_READCURSOR crdcur +#define CDS_SETCURSOR cscurs +#define CDS_CLEARFRAME cclfrm +#define CDS_SELECTFB cselfb +#define CDS_CLOSE cclose +#define CDS_DISPLAYIRAF cdspir +#define CDS_ISIRAF cisirf +#define CDS_READIRAF crdirf +#define CDS_DISPLAYFITS cdspft +#define CDS_ISFITS cisfts +#define CDS_READFITS crdfts +#define CDS_COMPZSCALE ccmpzs +#define CDS_ZSCALEIMAGE czscim +#define CDS_PRINTPIX cprpix +#define CDS_PRINTPIXTOFILE cprpfl +#define CDS_READIMAGE crdimg +#define CDS_READFRAMEBUFFER crdfrb +#define CDS_READSUBRAS crsubr +#define CDS_WRITESUBRAS cwsubr +#define CDS_SETWCS cstwcs +#define CDS_SETFBCONFIG csfbcf +#define CDS_GETFBCONFIG cgfbcf +#define CDS_LOOKUPFBSIZE clkfbs +#define CDS_SETFRAME csfram +#define CDS_SETZTRANS csztrn +#define CDS_SETZSCALE cszscl +#define CDS_SETSAMPLE cssamp +#define CDS_SETSAMPLELINES cssaml +#define CDS_SETCONTRAST cscntr +#define CDS_SETNAME csname +#define CDS_SETTITLE cstitl +#define CDS_GETWCS cgtwcs +#define CDS_GETFRAME cgfram +#define CDS_GETZTRANS cgztrn +#define CDS_GETZSCALE cgzscl +#define CDS_GETSAMPLE cgsamp +#define CDS_GETSAMPLELINES cgsmpl +#define CDS_GETCONTRAST cgcntr +#define CDS_GETNAME cgname +#define CDS_GETTITLE cgtitl +#define CDS_MAPFRAME cmapfr +#define CDS_MARKCOORDSFILE cmkcfl +#define CDS_MARKPOINT cmkpnt +#define CDS_MARKPOINTLABEL cmkpnl +#define CDS_MARKLINE cmklin +#define CDS_MARKBOX cmkbox +#define CDS_MARKPOLYLINE cmkpln +#define CDS_MARKPOLYGON cmkpgn +#define CDS_MARKCIRCLE cmkcrc +#define CDS_MARKCIRCANNULI cmkcan +#define CDS_MARKELLIPSE cmkell +#define CDS_MARKELLIPANNULI cmkela +#define CDS_MARKTEXT cmktxt +#define CDS_SETFONT csfont +#define CDS_SETLINEWIDTH cslwid +#define CDS_SETLINESTYLE cslsty +#define CDS_SETTEXTWIDTH cstwid +#define CDS_DELETEMARK cdelmk +#define CDS_CLEAROVERLAY cclrov +#define CDS_REDRAWOVERLAY crdrov +#define CDS_SETDEBUG cstdbg +#define CDS_SETMAPPING cstmap +#define CDS_GETMAPPING cgtmap +#define CDS_QUERYMAP cqrmap + +#else + +#define CDS_OPEN cdopen_ +#define CDS_DISPLAYPIX cdsppx_ +#define CDS_READCURSOR crdcur_ +#define CDS_SETCURSOR cscurs_ +#define CDS_CLEARFRAME cclfrm_ +#define CDS_SELECTFB cselfb_ +#define CDS_CLOSE cclose_ +#define CDS_DISPLAYIRAF cdspir_ +#define CDS_ISIRAF cisirf_ +#define CDS_READIRAF crdirf_ +#define CDS_DISPLAYFITS cdspft_ +#define CDS_ISFITS cisfts_ +#define CDS_READFITS crdfts_ +#define CDS_COMPZSCALE ccmpzs_ +#define CDS_ZSCALEIMAGE czscim_ +#define CDS_PRINTPIX cprpix_ +#define CDS_PRINTPIXTOFILE cprpfl_ +#define CDS_READIMAGE crdimg_ +#define CDS_READFRAMEBUFFER crdfrb_ +#define CDS_READSUBRAS crsubr_ +#define CDS_WRITESUBRAS cwsubr_ +#define CDS_SETWCS cstwcs_ +#define CDS_SETFBCONFIG csfbcf_ +#define CDS_GETFBCONFIG cgfbcf_ +#define CDS_LOOKUPFBSIZE clkfbs_ +#define CDS_SETFRAME csfram_ +#define CDS_SETZTRANS csztrn_ +#define CDS_SETZSCALE cszscl_ +#define CDS_SETSAMPLE cssamp_ +#define CDS_SETSAMPLELINES cssaml_ +#define CDS_SETCONTRAST cscntr_ +#define CDS_SETNAME csname_ +#define CDS_SETTITLE cstitl_ +#define CDS_GETWCS cgtwcs_ +#define CDS_GETFRAME cgfram_ +#define CDS_GETZTRANS cgztrn_ +#define CDS_GETZSCALE cgzscl_ +#define CDS_GETSAMPLE cgsamp_ +#define CDS_GETSAMPLELINES cgsmpl_ +#define CDS_GETCONTRAST cgcntr_ +#define CDS_GETNAME cgname_ +#define CDS_GETTITLE cgtitl_ +#define CDS_MAPFRAME cmapfr_ +#define CDS_MARKCOORDSFILE cmkcfl_ +#define CDS_MARKPOINT cmkpnt_ +#define CDS_MARKPOINTLABEL cmkpnl_ +#define CDS_MARKLINE cmklin_ +#define CDS_MARKBOX cmkbox_ +#define CDS_MARKPOLYLINE cmkpln_ +#define CDS_MARKPOLYGON cmkpgn_ +#define CDS_MARKCIRCLE cmkcrc_ +#define CDS_MARKCIRCANNULI cmkcan_ +#define CDS_MARKELLIPSE cmkell_ +#define CDS_MARKELLIPANNULI cmkela_ +#define CDS_MARKTEXT cmktxt_ +#define CDS_SETFONT csfont_ +#define CDS_SETLINEWIDTH cslwid_ +#define CDS_SETLINESTYLE cslsty_ +#define CDS_SETTEXTWIDTH cstwid_ +#define CDS_DELETEMARK cdelmk_ +#define CDS_CLEAROVERLAY cclrov_ +#define CDS_REDRAWOVERLAY crdrov_ +#define CDS_SETDEBUG cstdbg_ +#define CDS_SETMAPPING cstmap_ +#define CDS_GETMAPPING cgtmap_ +#define CDS_QUERYMAP cqrmap_ + +#endif + + +#ifdef ANSI_FUNC + +void CDS_OPEN(char *imtdev, int *ier); +void CDS_DISPLAYPIX(uchar *pix, int *nx, int *ny, int *bitpix, int *frame, int *fbconfig, int *zscale, int *ier); +void CDS_READCURSOR(int *sample, float *x, float *y, int *wcs, char *key, int *ier); +void CDS_DISPLAYIRAF(char *fname, int *band, int *frame, int *fbconfig, int *zscale, int *ier); +void CDS_ISIRAF(char *fname, int *isiraf); +void CDS_READIRAF(char *fname, int *band, uchar *pix, int *nx, int *ny, int *bitpix, char *title, int *ier); +void CDS_DISPLAYFITS(char *fname, int *frame, int *fbconfig, int *zscale, int *ier); +void CDS_ISFITS(char *fname, int *isfits); +void CDS_READFITS(char *fname, uchar *pix, int *nx, int *ny, int *bitpix, char *title, int *ier); +void CDS_SETCURSOR(int *x, int *y, int *wcs, int *ier); +void CDS_SETWCS(char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt, int *ier); +void CDS_GETWCS(char *name, char *title, float *a, float *b, float *c, float *d, float *tx, float *ty, float *z1, float *z2, int *zt, int *ier); +void CDS_CLEARFRAME(int *ier); +void CDS_SELECTFB(int *nx, int *ny, int *fb, int *w, int *h, int *nf, int *reset); +void CDS_CLOSE(void); +void CDS_READIMAGE(uchar *pix, int *nx, int *ny, int *ier); +void CDS_READFRAMEBUFFER(uchar *pix, int *nx, int *ny, int *ier); +void CDS_COMPZSCALE(uchar *pix, int *nx, int *ny, int *bitpix, float *z1, float *z2); +void CDS_ZSCALEIMAGE(uchar *pix, int *nx, int *ny, int *bitpix, float *z1, float *z2); +void CDS_PRINTPIX(char *cmd, uchar *pix, int *nx, int *ny, int *annotate, int *ier); +void CDS_PRINTPIXTOFILE(char *fname, uchar *pix, int *nx, int *ny, int *annotate, int *ier); +void CDS_READSUBRAS(int *lx, int *ly, int *nx, int *ny, uchar *pix, int *ier); +void CDS_WRITESUBRAS(int *lx, int *ly, int *nx, int *ny, uchar *pix, int *ier); +void CDS_SETFBCONFIG(int *configno); +void CDS_GETFBCONFIG(int *configno, int *w, int *h, int *nframes); +void CDS_LOOKUPFBSIZE(int *configno, int *w, int *h, int *nf); +void CDS_SETFRAME(int *frame); +void CDS_SETZTRANS(int *ztrans); +void CDS_SETZSCALE(float *z1, float *z2); +void CDS_SETSAMPLE(int *nsample); +void CDS_SETSAMPLELINES(int *nlines); +void CDS_SETCONTRAST(float *contrast); +void CDS_SETNAME(char *imname); +void CDS_SETTITLE(char *imtitle); +void CDS_GETFRAME(int *frame); +void CDS_GETZTRANS(int *ztrans); +void CDS_GETZSCALE(float *z1, float *z2); +void CDS_GETSAMPLE(int *nsample); +void CDS_GETSAMPLELINES(int *nlines); +void CDS_GETCONTRAST(float *contrast); +void CDS_GETNAME(char *imname); +void CDS_GETTITLE(char *imtitle); +void CDS_MAPFRAME(int *frame, int *ier); +void CDS_MARKCOORDSFILE(char *fname, int *type, int *size, int *color, int *label, int *ier); +void CDS_MARKPOINT(int *x, int *y, int *number, int *size, int *type, int *color, int *ier); +void CDS_MARKPOINTLABEL(int *x, int *y, char *label, int *size, int *type, int *color, int *ier); +void CDS_MARKLINE(int *xs, int *ys, int *xe, int *ye, int *color, int *ier); +void CDS_MARKBOX(int *lx, int *ly, int *ux, int *uy, int *fill, int *color, int *ier); +void CDS_MARKPOLYGON(int *xarray, int *yarray, int *npts, int *fill, int *color, int *ier); +void CDS_MARKPOLYLINE(int *xarray, int *yarray, int *npts, int *color, int *ier); +void CDS_MARKCIRCLE(int *x, int *y, int *radius, int *fill, int *color, int *ier); +void CDS_MARKCIRCANNULI(int *x, int *y, int *radius, int *nannuli, int *sep, int *color, int *ier); +void CDS_MARKELLIPSE(int *x, int *y, int *xrad, int *yrad, float *ang, int *fill, int *color, int *ier); +void CDS_MARKELLIPANNULI(int *x, int *y, int *xrad, int *yrad, float *ang, int *nannuli, int *sep, int *color, int *ier); +void CDS_MARKTEXT(int *x, int *y, char *str, float *size, float *angle, int *color, int *ier); +void CDS_SETFONT(int *font); +void CDS_SETLINEWIDTH(int *width); +void CDS_SETLINESTYLE(int *style); +void CDS_SETTEXTWIDTH(int *width); +void CDS_DELETEMARK(int *x, int *y, int *ier); +void CDS_CLEAROVERLAY(int *ier); +void CDS_REDRAWOVERLAY(int *ier); +void CDS_SETDEBUG(int *state); +void CDS_SETMAPPING(char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); +void CDS_GETMAPPING(char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); +void CDS_QUERYMAP(int *wcs, char *region, float *sx, float *sy, int *snx, int *sny, int *dx, int *dy, int *dnx, int *dny, char *ref, int *ier, int reglen, int reflen); + +static void strupk(char *str, char *outstr, int maxch); +static void strpak(char *sppstr, char *cstr, int maxch); + +#else + +/* Function Definitions. */ +void CDS_OPEN(); +void CDS_DISPLAYPIX(), CDS_DISPLAYIRAF(), CDS_DISPLAYFITS(); +void CDS_READIRAF(), CDS_READFITS(), CDS_CLEARFRAME(); +void CDS_READIMAGE(), CDS_READFRAMEBUFFER(), CDS_READSUBRAS(); +void CDS_WRITESUBRAS(), CDS_SETCURSOR(), CDS_READCURSOR(); +void CDS_SELECTFB(), CDS_CLOSE(), CDS_COMPZSCALE(), CDS_ZSCALEIMAGE(); +void CDS_SETFRAME(), CDS_SETFBCONFIG(), CDS_SETZTRANS(), CDS_SETZOOM(); +void CDS_SETSAMPLE(), CDS_SETCONTRAST(), CDS_SETNAME(), CDS_SETTITLE(); +void CDS_GETFRAME(), CDS_GETFBCONFIG(), CDS_GETZTRANS(), CDS_GETZOOM(); +void CDS_GETSAMPLE(), CDS_GETCONTRAST(), CDS_GETNAME(), CDS_GETTITLE(); +void CDS_SETZSCALE(), CDS_GETZSCALE(), CDS_LOOKUPFBSIZE(); +void CDS_ISIRAF(), CDS_ISFITS(), CDS_SETDEBUG(); +void CDS_PRINTPIX (), CDS_PRINTPIXTOFILE (); +void CDS_SETSAMPLELINES (), CDS_GETSAMPLELINES (); +void CDS_SETWCS(), CDS_GETWCS(); +void CDS_SETMAPPING(), CDS_GETMAPPING(), CDS_QUERYMAP(); + +/* Marker Function Definitions. */ +void CDS_MARKPOINT(), CDS_MARKLINE(), CDS_MARKBOX(), CDS_MARKPOLYLINE(); +void CDS_MARKPOLYGON(), CDS_MARKCIRCLE(), CDS_MARKCIRCANNULI(); +void CDS_MARKELLIPSE(), CDS_MARKELLIPANNULI(), CDS_MARKTEXT(); +void CDS_DELETEMARK(), CDS_CLEAROVERLAY(), CDS_REDRAWOVERLAY(); +void CDS_SETFONT(), CDS_SETLINEWIDTH(), CDS_SETTEXTWIDTH(); +void CDS_SETLINESTYLE(), CDS_MARKCOORDSFILE(), CDS_MARKPOINTLABEL(); + +static void strupk(), strpak(); + +#endif diff --git a/vendor/x11iraf/cdl/cdlfits.c b/vendor/x11iraf/cdl/cdlfits.c new file mode 100644 index 00000000..59d75c5c --- /dev/null +++ b/vendor/x11iraf/cdl/cdlfits.c @@ -0,0 +1,804 @@ +#include <stdio.h> +#include <math.h> +#include <ctype.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + + +/* + * CDLFITS.C -- Routines to load simple FITS files. + * + * cdl_displayFITS (cdl, fname, frame, fbconfig, zscale) + * cdl_isFITS (fname) + * cdl_readFITS (fname, &pix, &nx, &ny, &bitpix, title); + */ + + +#define NCARDS 36 +#define BLOCKSIZE 2880 +#define SZ_CARD 80 + +/* data types */ +enum datatype { T_INT, T_LOG, T_REAL, T_STR, T_NOVAL }; + +typedef struct { + FILE *fp; /* file pointer */ + int bitpix, size; /* number of bits per pixel, sizeof(unit) */ + int naxis; /* number of axes */ + long int axes[2]; /* size of each axis */ + long int ndata; /* number of elements in data */ + long int cpos; /* current position in data file */ + float bscale, bzero; /* scaling parameters */ + char object[SZ_CARD]; /* object keyword name */ +} FITS; + +/* Function prototypes */ +#ifdef __STDC__ +#include <stddef.h> +#include <stdlib.h> +#endif + +#undef max +#define f_max(a,b) ((a) > (b) ? (a) : (b)) +#undef min +#define f_min(a,b) ((a) < (b) ? (a) : (b)) + +extern int cdl_debug; + + +#ifdef ANSI_FUNC + +static int cdl_readFITSHdr(char *fname, float *bscale, float *bzero, char *obj); +static char *cdl_getFITSPixels(char *fname, uchar **pix, int *nx, int *ny, int *bitpix); +static char *cdl_openFITS(FITS *fs, char *file, int *nx, int *ny, int *bitpix); +static char *cdl_readHeader(FITS *fs); +static char *cdl_rdCard(char *card, char *name, enum datatype dtype, long *kvalue, float *rvalue, char *svalue); +static char *cdl_getData(FITS *fs, uchar *buffer, int nelem); +static char *cdl_fixData(FITS *fs, void *buffer, int nelem); + +#else + +static char *cdl_getFITSPixels(); +static char *cdl_openFITS(), *cdl_readHeader (); +static char *cdl_rdCard(), *cdl_getData (), *cdl_fixData(); +static int cdl_readFITSHdr(); + +#endif + + +/* CDL_DISPLAYFITS -- Display a simple FITS format image to the given frame, + * optionally doing a Zscale transform of the image pixels. + */ + +#ifdef ANSI_FUNC + +int +cdl_displayFITS ( + CDLPtr cdl, /* package ptr */ + char *fname, /* image name */ + int frame, /* display frame */ + int fbconfig, /* frame buffer config */ + int zscale /* do zscale of image? */ +) +#else + +int +cdl_displayFITS (cdl, fname, frame, fbconfig, zscale) +CDLPtr cdl; /* package ptr */ +char *fname; /* image name */ +int frame; /* display frame */ +int fbconfig; /* frame buffer config */ +int zscale; /* do zscale of image? */ +#endif +{ + char obj[SZ_CARD]; + int status, nx, ny, bitpix; + uchar *pix; + float z1 = 0.0, z2 = 0.0, bscale, bzero; + + /* See if this is a valid FITS file. */ + if (!cdl_isFITS (fname)) { + fprintf (stderr, "%s: not a simple FITS file or doesn't exist.\n", + fname); + return (ERR); + } + + /* Get the raw FITS image pixels. */ + if (cdl_readFITS (fname, &pix, &nx, &ny, &bitpix, obj)) + return (ERR); + + if (cdl_debug) { + printf("[cdl_displayFITS] '%s' frame=%d zscale=%d\n", + fname, frame, zscale); + printf("[cdl_displayFITS] %dx%d bitpix=%d pixels z1=%g z2=%g\n", + nx, ny, bitpix, z1, z2); + } + + /* Read the header. */ + if (cdl_readFITSHdr (fname, &bscale, &bzero, obj)) + return (ERR); + (void) cdl_setTitle (cdl, obj); + + (void) cdl_setName (cdl, fname); + status = cdl_displayPix (cdl, pix, nx, ny, bitpix, frame, fbconfig, + zscale); + free ((char *) pix); + return (status); +} + + +/* CDL_ISFITS -- Test a file to see if it is a simple FITS file. + */ + +#ifdef ANSI_FUNC + +int +cdl_isFITS ( + char *fname /* input filename */ +) +#else + +int +cdl_isFITS (fname) +char *fname; /* input filename */ +#endif +{ + register FILE *fp; + int value = 0; + char keyw[8], val; + + if ((fp = fopen (fname, "r"))) { + fscanf (fp, "%6s = %c", keyw, &val); + if (strcmp ("SIMPLE", keyw) == 0 && val == 'T') + value = 1; + fclose (fp); + } + return value; +} + + +/* CDL_READFITS -- Read the pixels from a simple FITS format image, ret- + * urning the pixel array, dimensions, and image type. + */ + +#ifdef ANSI_FUNC + +int +cdl_readFITS ( + char *fname, /* image name */ + uchar **pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title /* image title (output) */ +) +#else + +int +cdl_readFITS (fname, pix, nx, ny, bitpix, title) +char *fname; /* image name */ +uchar **pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title (output) */ +#endif +{ + char *errstr, *cdl_getFITSPixels(); + float bscale=1.0, bzero=0.0; + + /* See if this is a valid FITS file. */ + if (!cdl_isFITS (fname)) { + fprintf (stderr, "%s: not a simple FITS file or doesn't exist.\n", + fname); + return (ERR); + } + + if ((errstr = cdl_getFITSPixels (fname, pix, nx, ny, bitpix))) { + fprintf (stderr, "%s\n", errstr); + return (ERR); + } + if (cdl_readFITSHdr (fname, &bscale, &bzero, title)) + return (ERR); + + if (cdl_debug) + printf ("[cdl_readFITS] '%s' nx=%d ny=%d bitpix=%d title='%s'\n", + fname, *nx, *ny, *bitpix, title); + + return (OK); +} + + +/* ------------------ + * Private Procedures + * ------------------*/ + + +/* CDL_READFITSHDR -- Read several header parameters from the image. + */ + +#ifdef ANSI_FUNC + +static int +cdl_readFITSHdr ( + char *fname, /* image name */ + float *bscale, + float *bzero, /* scaling (output) */ + char *obj /* image title (output) */ +) +#else + +static int +cdl_readFITSHdr (fname, bscale, bzero, obj) +char *fname; /* image name */ +float *bscale, *bzero; /* scaling (output) */ +char *obj; /* image title (output) */ +#endif +{ + char *errstr; + register FITS *fs; + register FILE *fp; + + /* See if this is a valid FITS file. */ + if (!cdl_isFITS (fname)) { + fprintf (stderr, "%s: not a simple FITS file or doesn't exist.\n", + fname); + return (ERR); + } + + if ((fp = fopen(fname, "rb")) == NULL) + return (ERR); + + fs = (FITS *) malloc (sizeof(FITS)); + fs->fp = fp; + fs->bitpix = fs->naxis = fs->cpos = 0; + + /* Read the header. */ + if ((errstr = cdl_readHeader (fs))) { + fclose(fs->fp); + free ((char *) fs); + return (ERR); + } + + *bscale = fs->bscale; + *bzero = fs->bzero; + if (obj == (char *)NULL) + obj = (char *) malloc (SZ_CARD+1); + sprintf (obj, "%s", fs->object); + + if (cdl_debug) + printf ("[cdl_readFITSHdr] '%s' bscale=%g bzero=%g obj='%s'\n", + fname, *bscale, *bzero, obj); + + fclose(fs->fp); + free ((char *) fs); + return (OK); +} + + +/* CDL_GETFITSPIXELS -- Given an FITS filename return a pointer to the pixel + * array and the image dimensions. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_getFITSPixels ( + char *fname, /* input filename */ + uchar **pix, /* output pixels */ + int *nx, + int *ny, /* dimensions */ + int *bitpix /* pixel size */ +) +#else + +static char * +cdl_getFITSPixels (fname, pix, nx, ny, bitpix) +char *fname; /* input filename */ +uchar **pix; /* output pixels */ +int *nx, *ny; /* dimensions */ +int *bitpix; /* pixel size */ +#endif +{ + FITS fs; + register int i, nelem; + char *error = NULL; + + + if ((error = cdl_openFITS (&fs, fname, nx, ny, bitpix))) + return error; + + /* Allocate a buffer to store the image. */ + nelem = (*nx) * (*ny); + if (fs.bscale != 1.0 || fs.bzero != 0.0) + *pix = (uchar *) malloc (nelem * f_max(fs.size,4)); + else + *pix = (uchar *) malloc (nelem * fs.size); + if (*pix == NULL) + return "Insufficient memory for workspace"; + + /* If the data is uchar, then read it directly */ + if (fs.bitpix == 8 && (fs.bscale == 1.0 || fs.bzero == 0.0)) + return cdl_getData (&fs, *pix, nelem); + else if ((error = cdl_getData (&fs, *pix, nelem))) + return error; + + /* If we've got BSCALE/BZERO values compute the original pixel values + * and convert the buffer to floating point before processing it. + * The pix buffer was allocated above with this in mind so it should + * be large enough that we can fix the pixels in place. + */ + if (fs.bscale != 1.0 || fs.bzero != 0.0) { + register float *buf; + + buf = (float *)*pix; + + if (fs.bitpix == 8) { + for (i=(nelem-1); i >= 0; i--) + buf[i] = (float) (*pix)[i] * fs.bscale + fs.bzero; + } else if (fs.bitpix == 16) { + register short *old = (short *) *pix; + for (i=(nelem-1); i >= 0; i--) + buf[i] = (float) old[i] * fs.bscale + fs.bzero; + } else if (fs.bitpix == 32) { + register int *old = (int *) *pix; + for (i=(nelem-1); i >= 0; i--) + buf[i] = (float) old[i] * fs.bscale + fs.bzero; + } else if (fs.bitpix == -32) { + register float *old = (float *) *pix; + for (i=(nelem-1); i >= 0; i--) + buf[i] = (float) old[i] * fs.bscale + fs.bzero; + } else if (fs.bitpix == -64) { + register double *old = (double *) *pix, *dbuf; + register float *fpix; + + dbuf = (double *) malloc (nelem * sizeof(double)); + for (i=(nelem-1); i >= 0; i--) + dbuf[i] = (float) old[i] * fs.bscale + fs.bzero; + fpix = (float *) *pix; + for (i=0; i<nelem; i++) + fpix[i] = (float) dbuf[i]; + free ((double *) dbuf); + } + + fs.size = 4; + fs.bitpix = -32; + *bitpix = -32; + } + + /* sucess ! */ + fclose(fs.fp); + return NULL; +} + + +/* CDL_OPENFITS -- Open a 2-dimensional FITS file. Stores the dimensions of + * the file in nx and ny, and updates the FITS structure passed in fs. + * If successful, returns NULL otherwise returns an error message. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_openFITS (FITS *fs, char *file, int *nx, int *ny, int *bitpix) +#else + +static char * +cdl_openFITS(fs, file, nx, ny, bitpix) +FITS *fs; +char *file; +int *nx, *ny, *bitpix; +#endif +{ + register int i; + FILE *fp; + char *error = NULL; + + if ((fp = fopen(file, "rb")) == NULL) + return "Unable to open FITS file"; + + fs->fp = fp; + fs->bitpix = 0; + fs->naxis = 0; + fs->cpos = 0; + + /* Read the header. */ + if ((error = cdl_readHeader (fs))) { + fclose(fs->fp); + return error; + } + + if (fs->naxis > 2) { + fclose(fs->fp); + return "Not a 2-D FITS image."; + } + + /* Get number of pixel. */ + fs->ndata = 1; + for (i = 0; i < fs->naxis; i++) + fs->ndata = fs->ndata * fs->axes[i]; + + *nx = fs->axes[0]; + *ny = fs->axes[1]; + *bitpix = fs->bitpix; + + return NULL; +} + + +/* CDL_READHEADER -- Reads the fits header, and updates the FITS structure fs. + * Returns NULL on success, or an error message otherwise. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_readHeader (FITS *fs) +#else + +static char * +cdl_readHeader (fs) +FITS *fs; +#endif +{ + register int i, j, res; + char name[9]; + char *block; + char *error = NULL; + long int val; /* the value */ + float rval; /* floating point value */ + char sval[SZ_FNAME]; /* string value */ + + + if ((block = (char *) malloc(BLOCKSIZE)) == NULL) + return "Insufficient memory for workspace"; + + if ((res = fread (block, sizeof(char), BLOCKSIZE, fs->fp)) != BLOCKSIZE) + return "Error reading FITS file"; + i = 0; + + /* Read SIMPLE keyword. */ + if ((error = cdl_rdCard (block, "SIMPLE", T_LOG, &val, &rval, sval))) + return error; + if (val == 0) + return "Not a SIMPLE FITS file"; + i++; + + /* Read BITPIX keyword. */ + if ((error = cdl_rdCard(&block[SZ_CARD], "BITPIX", T_INT, &val, &rval, + sval))) + return error; + if (val != 8 && val != 16 && val != 32 && val != 64 && val != -32 && + val != -64) + return "Bad BITPIX value in FITS file"; + fs->bitpix = val; + j = fs->bitpix; + if (j < 0) + j = -j; + fs->size = j / 8; + i++; + + /* Read NAXIS keyword. */ + if ((error=cdl_rdCard(&block[2*SZ_CARD], "NAXIS", T_INT, &val, &rval, + sval))) + return error; + if (val < 0 || val > 999) + return "Bad NAXIS value in FITS file"; + if (val < 2) + return "FITS file is not a two-dimensional image"; + fs->naxis = val; + i++; + + /* Read NAXISnnn keys. We allow NAXIS to be > 2 iff the dimensions + * of the extra axes are 1. + */ + for (j = 0; j < fs->naxis; j++) { + if (i == NCARDS) { + res = fread(block, sizeof(char), BLOCKSIZE, fs->fp); + if (res != BLOCKSIZE) + return "Error reading FITS file"; + i = 0; + } + + sprintf (name, "NAXIS%d", j + 1); + if ((error=cdl_rdCard (&block[i*SZ_CARD], name, T_INT, &val, &rval, + sval))) + return error; + if (val < 0) + return "Bad NAXISn value in FITS file"; + if (j < 2) + fs->axes[j] = val; + else if (val != 1) + return "FITS file is not a two-dimensional image"; + i++; + } + fs->naxis = 2; + + /* Do the remainder. */ + fs->bscale = 1.0; + fs->bzero = 0.0; + fs->object[0] = '\0'; + while (1) { + + /* Try reading a BSCALE or BZERO keyword from this card. */ + if (block[i*SZ_CARD] == 'B') { + error = cdl_rdCard(&block[i*SZ_CARD], "BSCALE", T_REAL, &val, + &rval, sval); + if (error == NULL) + fs->bscale = rval; + error = cdl_rdCard (&block[i*SZ_CARD], "BZERO", T_REAL, &val, + &rval, sval); + if (error == NULL) + fs->bzero = rval; + } else if (strncmp("OBJECT", &block[i*SZ_CARD], 6) == 0) { + /* Read OBJECT keyword. */ + if ((error = cdl_rdCard (&block[i*SZ_CARD], "OBJECT", T_STR, + &val, &rval, sval))) { + strcpy (fs->object, "no title"); + break; + } + strncpy (fs->object, sval, SZ_CARD); + i++; + } + + if (i == NCARDS) { + res = fread (block, sizeof(char), BLOCKSIZE, fs->fp); + if (res != BLOCKSIZE) + return "Unexpected EOF in FITS file"; + i = 0; + } + if (strncmp (&block[i*SZ_CARD], "END ", 8) == 0) + break; + i++; + } + + free (block); + return NULL; +} + + +/* CDL_RDCARD -- Read a header record, from the 80 byte buffer card. + * The keyword name must match 'name'; and parse its value according to + * dtype. This can have the following values: + * dtype = T_LOG # value is logical, either 'T' or 'F' in column 30 + * dtype = T_INT # value is an int, right justified in columns 11-30 + * dtype = T_REAL # value is a real + * dtype = T_STR # value is a string + * + * The value is stored in kvalue. Returns NULL on success, or an error + * message otherwise. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_rdCard ( + char *card, /* FITS keyword card */ + char *name, /* keyword name */ + enum datatype dtype, /* type of value */ + long *kvalue, /* integer value */ + float *rvalue, /* real value */ + char *svalue /* string value */ +) +#else + +static char * +cdl_rdCard (card, name, dtype, kvalue, rvalue, svalue) +char *card; /* FITS keyword card */ +char *name; /* keyword name */ +enum datatype dtype; /* type of value */ +long *kvalue; /* integer value */ +float *rvalue; /* real value */ +char *svalue; /* string value */ +#endif +{ + register int i, ptr; + char namestr[9], *ip; + + /* Get the keyword from the card. */ + bcopy (card, namestr, 8); + for (i=7; i >= 0 && namestr[i] == ' '; i--) + ; + namestr[i+1] = '\0'; + if (strcmp(namestr, name) != 0) + return "Keyword not found in FITS file."; + + /* Get start of value. */ + ptr = 10; + while (ptr < SZ_CARD && card[ptr] == ' ') + ptr++; + if (ptr == SZ_CARD) + return "FITS file has missing keyword value"; /* no value */ + + if (dtype == T_LOG) { + *kvalue = (card[ptr] == 'T'); + + } else if (dtype == T_STR) { + for (ip=&card[9]; *ip != '\''; ip++) + ; + for (i=0, ip=&card[ptr+1]; *ip != '\'' && i < SZ_FNAME; i++) + svalue[i] = *ip++; + svalue[i] = '\0'; + } else { + /* An integer or real value. */ + long int ival; + float fval; + char num[21]; + + if (ptr > 29) + return "Keyword has bad integer value in FITS file"; + memcpy (num, &card[ptr], 30 - ptr); + num[30-ptr] = '\0'; + if (dtype == T_INT) { + i = sscanf (num, "%ld", &ival); + if (i != 1) + return "Keyword has bad integer value in FITS file"; + *kvalue = ival; + *rvalue = 0.0; + } else if (dtype == T_REAL) { + i = sscanf (num, "%g", &fval); + if (i != 1) + return "Keyword has bad real value in FITS file"; + *kvalue = 0; + *rvalue = fval; + } + } + + return NULL; +} + + +/* CDL_GETDATA -- Reads nelem values into the buffer. Copes with the fact + * that the last 2880 byte record of the FITS file may be truncated, and + * should be padded out with zeros. Returns NULL for success or an error + * message. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_getData (FITS *fs, uchar *buffer, int nelem) +#else + +static char * +cdl_getData (fs, buffer, nelem) +FITS *fs; +uchar *buffer; +int nelem; +#endif +{ + int res; + + if (nelem == 0) + return NULL; + + if ((res = fread ((void *)buffer, fs->size, nelem, fs->fp)) != nelem) { + /* Nblock is the number of elements in a record. size is + * always a factor of BLOCKSIZE + */ + int loffs, nblock = BLOCKSIZE / fs->size; + + if (!feof(fs->fp)) + return "I/O error reading FITS file"; + + /* The last record might be short; check this. + * loffs is the offset of the start of the last record from + * the current position. + */ + loffs = ((fs->ndata + nblock - 1) / nblock - 1) * nblock - fs->cpos; + + /* If we didn't read to the end of the penultimate record */ + if (res < loffs) + return "Unexpected eof reading FITS file"; + + /* Pad with zeros */ + memset ((char *)buffer+res*fs->size, '\0', (nelem-res)*fs->size); + } + + fs->cpos += res; + return cdl_fixData(fs, buffer, nelem); +} + + +/* CDL_FIXDATA -- convert the raw data, as stored in the FITS file, to the + * format appropiate for the data representation of the host computer. + * Assumes that + * short int = 2 byte integer + * int = 4 byte integer + */ + +#ifdef ANSI_FUNC + +static char * +cdl_fixData (FITS *fs, void *buffer, int nelem) +#else + +static char * +cdl_fixData (fs, buffer, nelem) +FITS *fs; +void *buffer; +int nelem; +#endif +{ + register int i, n = nelem; + register uchar *ptr = buffer; + + /* Conversions. Although the data may be signed, reverse using unsigned + * variables. Convert from big-endian two-byte signed integer to + * native form. + */ + if (fs->bitpix == 16) + for (i = 0; i < n; i++, ptr += 2) + *(unsigned short int *)ptr = (((int)*ptr) << 8) | (int)(ptr[1]); + + /* Convert from big-endian four-byte signed integer to native form */ + else if (fs->bitpix == 32) + for (i = 0; i < n; i++, ptr += 4) + *(unsigned int *)ptr = (((unsigned int)*ptr) << 24) | + ((unsigned int)ptr[1] << 16) | + ((unsigned int)ptr[2] << 8) | + (unsigned int)ptr[3]; + + /* Convert from IEE 754 single precision to native form */ + else if (fs->bitpix == -32) { + register int j, k, expo; + static float *exps = NULL; + + if (exps == NULL) { + exps = (float *)calloc(256, sizeof(float)); + if (exps == NULL) + return "Insufficient memory for workspace"; + exps[150] = 1.; + for (i = 151; i < 256; i++) + exps[i] = 2. * exps[i-1]; + for (i = 149; i >= 0; i--) + exps[i] = 0.5 * exps[i+1]; + } + + + for (i = 0; i < n; i++, ptr += 4) { + k = (int)*ptr; + j = ((int)ptr[1] << 16) | ((int)ptr[2] << 8) | (int)ptr[3]; + expo = ((k & 127) << 1) | (j >> 23); + if ((expo | j) == 0) + *(float *)ptr = 0.; + else + *(float *)ptr = exps[expo] * (float)(j | 0x800000); + if (k & 128) + *(float *)ptr = -*(float *)ptr; + } + + /* Convert from IEE 754 double precision to native form */ + } else if (fs->bitpix == -64) { + register int expo, k, l; + register unsigned int j; + static double *exps = NULL; + + if (exps == NULL) { + exps = (double *)calloc(2048, sizeof(double)); + if (exps == NULL) + return "Insufficient memory for workspace"; + exps[1075] = 1.; + for (i = 1076; i < 2048; i++) + exps[i] = 2. * exps[i-1]; + for (i = 1074; i >= 0; i--) + exps[i] = 0.5 * exps[i+1]; + } + + for (i = 0; i < n; i++, ptr += 8) { + k = (int)*ptr; + j = ((unsigned int)ptr[1] << 24) | ((unsigned int)ptr[2] << 16)| + ((unsigned int)ptr[3] << 8) | (unsigned int)ptr[4]; + l = ((int)ptr[5] << 16) | ((int)ptr[6] << 8) | (int)ptr[7]; + expo = ((k & 127) << 4) | (j >> 28); + if ((expo | j | l) == 0) + *(double *)ptr = 0.; + else + *(double *)ptr = exps[expo] * (16777216. * + (double)((j & 0x0FFFFFFF) | 0x10000000) + (double)l); + if (k & 128) + *(double *)ptr = -*(double *)ptr; + } + } + + return NULL; +} diff --git a/vendor/x11iraf/cdl/cdlfont.h b/vendor/x11iraf/cdl/cdlfont.h new file mode 100644 index 00000000..ebbbd418 --- /dev/null +++ b/vendor/x11iraf/cdl/cdlfont.h @@ -0,0 +1,790 @@ +/* CDLFONT.H -- Font definitions. + */ + +#define CHARACTER_START 32 +#define CHARACTER_END 126 +#define CHARACTER_HEIGHT 26 +#define CHARACTER_WIDTH 17 + +#define FONT_LEFT 0 +#define FONT_CENTER 9 +#define FONT_RIGHT 27 +#define FONT_TOP 36 +#define FONT_CAP 34 +#define FONT_HALF 23 +#define FONT_BASE 9 +#define FONT_BOTTOM 0 +#define FONT_WIDTH 27 +#define FONT_HEIGHT 36 + +#define COORD_X_START 7 +#define COORD_Y_START 1 +#define COORD_PEN_START 13 +#define COORD_X_LEN 6 +#define COORD_Y_LEN 6 +#define COORD_PEN_LEN 1 + +#define PAINT_BEGIN_START 14 +#define PAINT_END_START 15 +#define PAINT_BEGIN_LEN 1 +#define PAINT_END_LEN 1 + + +/* CHRTAB -- Table of strokes for the printable ASCII characters. Each char- + * acter is encoded as a series of strokes. Each stroke is expressed by a + * single integer containing the following bitfields: + * + * 2 1 + * 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 + * | | | | | | | + * | | | +---------+ +---------+ + * | | | | | + * | | | X Y + * | | | + * | | +-- pen up/down + * | +---- begin paint (not used at present) + * +------ end paint (not used at present) + *------------------------------------------------------------------------------ + */ + +/* Define the database. */ + + +/* Index into CHRTAB of each printable character (starting with SP). */ + +short chridx[] = { /* character index in chrtab */ + 1, 3, 12, 21, 30, 45, 66, 79, 85, 92, + 99, 106, 111, 118, 121, 128, 131, 141, 145, 154, + 168, 177, 187, 199, 203, 221, 233, 246, 259, 263, + 268, 272, 287, 307, 314, 327, 336, 344, 352, 359, + 371, 378, 385, 391, 398, 402, 408, 413, 425, 433, + 445, 455, 468, 473, 480, 484, 490, 495, 501, 506, + 511, 514, 519, 523, 526, 529, 543, 554, 563, 574, + 585, 593, 607, 615, 625, 638, 645, 650, 663, 671, + 681, 692, 703, 710, 723, 731, 739, 743, 749, 754, + 759, 764, 776, 781, 793, 801 +}; + + +short chrtab[] = { /* stroke data to draw the characters */ + 36, 1764, 675, 29328, 585, 21063, 21191, 21193, 21065, 29383, + 1764, 355, 29023, 351, 29027, 931, 29599, 927, 29603, 1764, + 603, 29066, 842, 29723, 1302, 28886, 143, 29839, 1764, 611, + 29256, 78, 20810, 21322, 21581, 21586, 21334, 20822, 20569, 20573, + 20833, 21345, 29789, 1764, 419, 20707, 20577, 20574, 20700, 20892, + 21022, 21025, 20899, 1187, 28744, 717, 21194, 21320, 21512, 21642, + 21645, 21519, 21327, 21197, 1764, 1160, 20700, 20704, 20835, 21027, + 21152, 21149, 20561, 20556, 20744, 21192, 29841, 1764, 611, 21023, + 21087, 21155, 21091, 1764, 739, 21087, 21018, 21009, 21068, 29384, + 1764, 547, 21151, 21210, 21201, 21132, 29192, 1764, 93, 29774, + 608, 29259, 78, 29789, 1764, 604, 29260, 84, 29780, 1764, + 516, 21062, 21065, 21001, 21000, 21064, 1764, 84, 29780, 1764, + 585, 21063, 21191, 21193, 21065, 21191, 1764, 72, 29859, 1764, + 419, 20573, 20558, 20872, 21320, 21646, 21661, 21347, 20899, 1764, + 221, 21155, 29320, 1764, 95, 20835, 21411, 21663, 21655, 20556, + 20552, 29832, 1764, 95, 20899, 21347, 21663, 21658, 21334, 29270, + 854, 5266, 21644, 21320, 20872, 28749, 1764, 904, 21411, 21283, + 20561, 20559, 21391, 911, 13455, 1764, 136, 21320, 21645, 21652, + 21337, 20889, 20565, 20579, 29859, 1764, 83, 20888, 21336, 21651, + 21645, 21320, 20872, 20557, 20563, 20635, 29347, 1764, 99, 21667, + 29064, 1764, 355, 20575, 20570, 20822, 20562, 20556, 20808, 21384, + 21644, 21650, 21398, 20822, 918, 5274, 21663, 21411, 20835, 1764, + 648, 21584, 21656, 21662, 21347, 20899, 20574, 20568, 20883, 21331, + 21656, 1764, 602, 21210, 21207, 21079, 21082, 21207, 592, 21069, + 21197, 21200, 21072, 21197, 1764, 602, 21146, 21143, 21079, 21082, + 21143, 585, 21132, 21136, 21072, 21071, 21135, 1764, 988, 20628, + 29644, 1764, 1112, 28824, 144, 29776, 1764, 156, 21460, 28812, + 1764, 221, 20704, 20899, 21218, 21471, 21466, 21011, 21007, 521, + 20999, 21127, 21129, 21001, 21127, 1764, 908, 20812, 20560, 20571, + 20831, 21407, 21659, 21651, 21521, 21393, 21331, 21335, 21210, 21018, + 20887, 20883, 21009, 21201, 21331, 1764, 72, 20963, 21219, 29768, + 210, 5074, 1764, 99, 21411, 21663, 21658, 21398, 20566, 918, + 5266, 21644, 21384, 20552, 20579, 1764, 1165, 21320, 20872, 20557, + 20574, 20899, 21347, 29854, 1764, 99, 21347, 21662, 21645, 21320, + 20552, 20579, 1764, 99, 20552, 29832, 86, 13078, 99, 29859, + 1764, 99, 20552, 86, 13078, 99, 29859, 1764, 722, 21650, + 29832, 1165, 4936, 20872, 20557, 20574, 20899, 21347, 29854, 1764, + 99, 28744, 85, 5269, 1160, 29859, 1764, 291, 29603, 611, + 4680, 328, 29576, 1764, 77, 20872, 21256, 21581, 29795, 1764, + 99, 28744, 1160, 20887, 82, 13475, 1764, 99, 20552, 29832, + 1764, 72, 20579, 21077, 21603, 29768, 1764, 72, 20579, 21640, + 29859, 1764, 94, 20899, 21347, 21662, 21645, 21320, 20872, 20557, + 20574, 862, 29859, 1764, 72, 20579, 21411, 21663, 21656, 21396, + 20564, 1764, 94, 20557, 20872, 21320, 21645, 21662, 21347, 20899, + 20574, 536, 29828, 1764, 72, 20579, 21411, 21663, 21657, 21398, + 20566, 918, 13448, 1764, 76, 20808, 21384, 21644, 21649, 21397, + 20822, 20570, 20575, 20835, 21411, 29855, 1764, 648, 21155, 99, + 29923, 1764, 99, 20557, 20872, 21320, 21645, 29859, 1764, 99, + 21064, 29795, 1764, 99, 20808, 21141, 21448, 29923, 1764, 99, + 29832, 72, 29859, 1764, 99, 21079, 29256, 599, 13411, 1764, + 99, 21667, 20552, 29832, 1764, 805, 20965, 20935, 29447, 1764, + 99, 29832, 1764, 421, 21221, 21191, 29063, 1764, 288, 21091, + 29600, 1764, 3, 29891, 1764, 547, 29341, 1764, 279, 21207, + 21396, 21387, 21127, 20807, 20555, 20558, 20753, 21201, 21391, 907, + 13447, 1764, 99, 28744, 76, 4424, 21256, 21516, 21523, 21271, + 20823, 20563, 1764, 981, 21271, 20823, 20563, 20556, 20808, 21256, + 29642, 1764, 1043, 4887, 20823, 20563, 20556, 20808, 21256, 21516, + 1032, 29731, 1764, 80, 5136, 21523, 21271, 20823, 20563, 20556, + 20808, 21256, 29707, 1764, 215, 29591, 456, 20958, 21153, 21409, + 29727, 1764, 67, 20800, 21248, 21508, 29719, 1043, 21271, 20823, + 20563, 20556, 20808, 21256, 21516, 1764, 99, 28744, 83, 4439, + 21271, 21523, 29704, 1764, 541, 21019, 21147, 21149, 21021, 21147, + 533, 21077, 29256, 1764, 541, 21019, 21147, 21149, 21021, 21147, + 533, 21077, 21058, 20928, 20736, 28802, 1764, 99, 28744, 84, + 29530, 342, 13320, 1764, 483, 21089, 21066, 29384, 1764, 87, + 28744, 584, 21076, 84, 4375, 20951, 21076, 21207, 21399, 21588, + 29768, 1764, 87, 28744, 83, 20823, 21271, 21523, 29704, 1764, + 83, 20556, 20808, 21256, 21516, 21523, 21271, 20823, 20563, 1764, + 87, 28736, 83, 20823, 21271, 21523, 21516, 21256, 20808, 20556, + 1764, 1047, 29696, 1036, 21256, 20808, 20556, 20563, 20823, 21271, + 21523, 1764, 87, 28744, 83, 20823, 21271, 29716, 1764, 74, + 20808, 21256, 21514, 21518, 21264, 20816, 20562, 20565, 20823, 21271, + 21461, 1764, 279, 29591, 970, 21320, 21128, 21002, 21025, 1764, + 87, 20556, 20808, 21256, 21516, 1032, 29719, 1764, 151, 21064, + 29719, 1764, 87, 20808, 21077, 21320, 29783, 1764, 151, 29704, + 136, 29719, 1764, 87, 21064, 320, 29783, 1764, 151, 21527, + 20616, 29704, 1764, 805, 21157, 21026, 21017, 20951, 20822, 20949, + 21011, 21001, 21127, 21255, 1764, 611, 29273, 594, 29256, 1764, + 485, 21093, 21218, 21209, 21271, 21398, 21269, 21203, 21193, 21063, + 29127, 1764, 83, 20758, 20950, 21265, 21457, 29844, 1764, 0 +}; + + +/* Greek character index in gchtab */ +short gchidx[] = { /* character index in gchtab */ + 1, 3, 16, 29, 38, 77, 107, 154, 162, 181, 200, 205, + 212, 233, 240, 246, 259, 297, 306, 348, 392, 402, 437, 483, + 510, 568, 614, 645, 658, 666, 673, 681, 688, 741, 767, 793, + 795, 806, 821, 863, 874, 883, 888, 899, 901, 912, 921, 930, + 972, 987, 1037, 1067, 1083, 1088, 1117, 1143, 1182, 1207, 1242, 1244, + 1253, 1256, 1265, 1267, 1276, 1284, 1321, 1373, 1394, 1436, 1465, 1500, + 1520, 1549, 1563, 1605, 1630, 1650, 1674, 1694, 1724, 1741, 1783, 1812, + 1844, 1857, 1886, 1888, 1929, 1970, 2001, 2031, 2069, 2074, 2112, 2121, +}; + +/* Width data. */ +short gchwid[] = { /* width data in gchtab */ + 21, 15, 15, 26, 25, 29, 30, 15, 19, 19, + 27, 29, 30, 29, 15, 31, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 29, 15, 29, 31, + 29, 31, 32, 25, 30, 21, 25, 29, 26, 23, + 26, 19, 25, 21, 25, 21, 21, 27, 29, 27, + 29, 26, 19, 24, 25, 27, 27, 28, 21, 19, + 19, 19, 21, 31, 27, 28, 26, 23, 24, 23, + 27, 25, 27, 17, 24, 25, 25, 28, 25, 23, + 27, 28, 24, 26, 25, 25, 21, 28, 22, 28, + 23, 19, 19, 19, 31, 19 +}; + +/* Stroke data. */ +short gchtab[] = { /* stroke data in gchtab */ + 35, 0, 220, 4250, 4302, 4378, 4316, 218, 4308, 201, + 4232, 4295, 4360, 4297, 0, 213, 4244, 4307, 4372, 4309, + 199, 4232, 4297, 4360, 4358, 4292, 4227, 0, 604, 4224, + 988, 4608, 145, 5137, 75, 5067, 0, 416, 4483, 672, + 4739, 921, 4952, 5015, 5080, 5081, 4955, 4764, 4508, 4315, + 4185, 4183, 4245, 4308, 4435, 4817, 4944, 5070, 87, 4309, + 4436, 4818, 4945, 5008, 5070, 5066, 4936, 4743, 4487, 4296, + 4170, 4171, 4236, 4299, 4234, 0, 1244, 4167, 412, 4634, + 4632, 4566, 4437, 4309, 4183, 4185, 4251, 4380, 4508, 4635, + 4826, 5018, 5211, 5340, 974, 4941, 4875, 4873, 4999, 5127, + 5256, 5322, 5324, 5198, 5070, 0, 1236, 5267, 5330, 5395, + 5396, 5333, 5269, 5204, 5138, 5005, 4874, 4744, 4615, 4423, + 4232, 4170, 4173, 4239, 4627, 4757, 4823, 4825, 4763, 4636, + 4507, 4441, 4439, 4500, 4625, 4938, 5064, 5255, 5319, 5384, + 5385, 327, 4296, 4234, 4237, 4303, 4433, 343, 4501, 5002, + 5128, 5255, 0, 218, 4251, 4316, 4379, 4377, 4311, 4246, + 0, 608, 4574, 4443, 4311, 4242, 4238, 4297, 4421, 4546, + 4672, 478, 4442, 4375, 4306, 4302, 4361, 4422, 4546, 0, + 96, 4318, 4443, 4567, 4626, 4622, 4553, 4421, 4290, 4160, + 222, 4442, 4503, 4562, 4558, 4489, 4422, 4290, 0, 151, + 5129, 1047, 4233, 0, 664, 4743, 144, 5264, 135, 5255, + 0, 1227, 5195, 5068, 4942, 4754, 4691, 4564, 4436, 4307, + 4241, 4239, 4301, 4428, 4556, 4685, 4750, 4946, 5076, 5205, + 5333, 0, 664, 4743, 152, 5272, 144, 5264, 0, 201, + 4232, 4295, 4360, 4297, 0, 729, 4760, 4823, 4888, 4825, + 144, 5392, 713, 4744, 4807, 4872, 4809, 0, 476, 4379, + 4248, 4179, 4176, 4235, 4360, 4551, 4679, 4872, 5003, 5072, + 5075, 5016, 4891, 4700, 4572, 476, 4443, 4378, 4312, 4243, + 4240, 4299, 4361, 4424, 4551, 583, 4808, 4873, 4939, 5008, + 5011, 4952, 4890, 4827, 4700, 0, 280, 4505, 4700, 4679, + 539, 4615, 263, 4935, 0, 152, 4311, 4246, 4183, 4184, + 4250, 4315, 4508, 4764, 4955, 5018, 5080, 5078, 5012, 4818, + 4496, 4367, 4237, 4170, 4167, 668, 4891, 4954, 5016, 5014, + 4948, 4754, 4496, 73, 4234, 4362, 4680, 4872, 5001, 5066, + 266, 4679, 4935, 5000, 5066, 5068, 0, 152, 4311, 4246, + 4183, 4184, 4250, 4315, 4508, 4764, 4955, 5017, 5014, 4948, + 4755, 4563, 668, 4891, 4953, 4950, 4884, 4755, 659, 4882, + 5008, 5070, 5067, 5001, 4936, 4743, 4487, 4296, 4233, 4171, + 4172, 4237, 4300, 4235, 849, 5006, 5003, 4937, 4872, 4743, + 0, 666, 4743, 732, 4807, 732, 4109, 5133, 455, 4999, + 0, 220, 4178, 82, 4308, 4501, 4693, 4884, 5010, 5071, + 5069, 5002, 4872, 4679, 4487, 4296, 4233, 4171, 4172, 4237, + 4300, 4235, 597, 4820, 4946, 5007, 5005, 4938, 4808, 4679, + 220, 4956, 219, 4635, 4956, 0, 857, 4888, 4951, 5016, + 5017, 4955, 4828, 4636, 4443, 4313, 4247, 4179, 4173, 4234, + 4360, 4551, 4679, 4872, 5002, 5069, 5070, 5009, 4883, 4692, + 4628, 4435, 4305, 4238, 540, 4507, 4377, 4311, 4243, 4237, + 4298, 4424, 4551, 583, 4808, 4938, 5005, 5006, 4945, 4819, + 4692, 0, 92, 4182, 88, 4250, 4380, 4508, 4825, 4953, + 5018, 5084, 154, 4379, 4507, 4825, 988, 5081, 5014, 4753, + 4687, 4620, 4615, 918, 4689, 4623, 4556, 4551, 0, 412, + 4315, 4249, 4246, 4308, 4499, 4755, 4948, 5014, 5017, 4955, + 4764, 4508, 412, 4379, 4313, 4310, 4372, 4499, 659, 4884, + 4950, 4953, 4891, 4764, 403, 4306, 4241, 4175, 4171, 4233, + 4296, 4487, 4743, 4936, 5001, 5067, 5071, 5009, 4946, 4755, + 403, 4370, 4305, 4239, 4235, 4297, 4360, 4487, 647, 4872, + 4937, 5003, 5007, 4945, 4882, 4755, 0, 917, 4946, 4816, + 4623, 4559, 4368, 4242, 4181, 4182, 4249, 4379, 4572, 4700, + 4891, 5017, 5078, 5072, 5004, 4938, 4808, 4615, 4423, 4296, + 4234, 4235, 4300, 4363, 4298, 463, 4432, 4306, 4245, 4246, + 4313, 4443, 4572, 604, 4827, 4953, 5014, 5008, 4940, 4874, + 4744, 4615, 0, 1247, 5278, 5341, 5406, 5407, 5344, 5216, + 5087, 4957, 4891, 4824, 4756, 4616, 4548, 4482, 926, 4956, + 4888, 4748, 4680, 4613, 4547, 4417, 4288, 4160, 4097, 4098, + 4163, 4226, 4161, 0, 213, 4244, 4307, 4372, 4309, 199, + 4232, 4297, 4360, 4358, 4292, 4227, 0, 1180, 4245, 5262, + 140, 5260, 135, 5255, 0, 149, 5397, 144, 5392, 139, + 5387, 0, 156, 5269, 4238, 140, 5260, 135, 5255, 0, + 1177, 4359, 147, 5395, 141, 5389, 0, 1044, 5078, 4951, + 4759, 4630, 4565, 4498, 4495, 4557, 4684, 4876, 5005, 5071, + 663, 4629, 4562, 4559, 4621, 4684, 1047, 5071, 5069, 5196, + 5324, 5454, 5521, 5523, 5462, 5400, 5274, 5147, 4956, 4764, + 4571, 4442, 4312, 4246, 4179, 4176, 4237, 4299, 4425, 4552, + 4743, 4935, 5128, 5257, 5322, 1111, 5135, 5133, 5196, 0, + 473, 4167, 601, 5063, 537, 4999, 205, 4877, 7, 4423, + 711, 5191, 480, 4447, 4381, 4379, 4441, 4568, 4696, 4825, + 4891, 4893, 4831, 4704, 4576, 0, 1295, 5325, 5196, 5068, + 4941, 4878, 4690, 4627, 4500, 4372, 4243, 4177, 4175, 4237, + 4364, 4492, 4621, 4686, 4882, 4947, 5076, 5204, 5331, 5393, + 5391, 0, 35, 0, 540, 4103, 540, 5127, 537, 5063, + 72, 5064, 7, 5127, 0, 1176, 4824, 4567, 4438, 4308, + 4241, 4239, 4300, 4426, 4553, 4808, 5256, 144, 5008, 0, + 540, 4615, 604, 4679, 407, 4310, 4245, 4179, 4176, 4238, + 4301, 4492, 4812, 5005, 5070, 5136, 5139, 5077, 5014, 4823, + 4503, 407, 4374, 4309, 4243, 4240, 4302, 4365, 4492, 716, + 4941, 5006, 5072, 5075, 5013, 4950, 4823, 348, 4892, 327, + 4871, 0, 220, 4295, 284, 4359, 28, 5084, 5078, 5020, + 7, 4551, 0, 608, 4224, 992, 4608, 147, 5139, 77, + 5069, 0, 160, 4224, 544, 4608, 0, 28, 4615, 92, + 4617, 1052, 4615, 28, 5148, 91, 5083, 0, 35, 0, + 540, 4167, 540, 5063, 537, 4999, 7, 4423, 711, 5191, + 0, 278, 4505, 4630, 83, 4504, 4819, 408, 4487, 0, + 266, 4487, 4618, 77, 4488, 4813, 409, 4488, 0, 540, + 4443, 4313, 4247, 4179, 4176, 4236, 4298, 4424, 4615, 4743, + 4936, 5066, 5132, 5200, 5203, 5143, 5081, 4955, 4764, 4636, + 540, 4507, 4377, 4311, 4243, 4240, 4300, 4362, 4488, 4615, + 647, 4872, 5002, 5068, 5136, 5139, 5079, 5017, 4891, 4764, + 0, 220, 4295, 284, 4359, 1052, 5127, 1116, 5191, 28, + 5404, 7, 4551, 839, 5383, 0, 540, 4443, 4313, 4247, + 4179, 4176, 4236, 4298, 4424, 4615, 4743, 4936, 5066, 5132, + 5200, 5203, 5143, 5081, 4955, 4764, 4636, 540, 4507, 4377, + 4311, 4243, 4240, 4300, 4362, 4488, 4615, 647, 4872, 5002, + 5068, 5136, 5139, 5079, 5017, 4891, 4764, 405, 4494, 789, + 4878, 402, 4882, 401, 4881, 0, 1244, 4167, 412, 4634, + 4632, 4566, 4437, 4309, 4183, 4185, 4251, 4380, 4508, 4635, + 4826, 5018, 5211, 5340, 974, 4941, 4875, 4873, 4999, 5127, + 5256, 5322, 5324, 5198, 5070, 0, 92, 4626, 4103, 28, + 4562, 28, 5084, 5142, 5020, 72, 5000, 7, 5063, 5133, + 4999, 0, 160, 4224, 544, 4608, 0, 23, 4121, 4187, + 4252, 4380, 4443, 4505, 4565, 4551, 25, 4251, 4379, 4505, + 983, 5081, 5019, 4956, 4828, 4763, 4697, 4629, 4615, 985, + 4955, 4827, 4697, 263, 4807, 0, 473, 4167, 601, 5063, + 537, 4999, 205, 4877, 7, 4423, 711, 5191, 480, 4447, + 4381, 4379, 4441, 4568, 4696, 4825, 4891, 4893, 4831, 4704, + 4576, 0, 74, 4231, 4487, 4363, 4239, 4178, 4182, 4249, + 4379, 4572, 4828, 5019, 5145, 5206, 5202, 5135, 5003, 4871, + 5127, 5194, 267, 4302, 4242, 4246, 4313, 4443, 4572, 732, + 4955, 5081, 5142, 5138, 5070, 5003, 136, 4424, 840, 5128, + 0, 157, 4184, 1117, 5144, 404, 4431, 852, 4879, 139, + 4166, 1099, 5126, 155, 5147, 154, 5146, 402, 4882, 401, + 4881, 137, 5129, 136, 5128, 0, 604, 4679, 668, 4743, + 21, 4182, 4309, 4369, 4431, 4494, 4621, 86, 4245, 4305, + 4367, 4430, 4621, 4813, 5006, 5071, 5137, 5205, 5270, 717, + 4942, 5007, 5073, 5141, 5270, 5333, 412, 4956, 391, 4935, + 0, 35, 0, 160, 4224, 224, 4288, 160, 4704, 128, + 4672, 0, 28, 4868, 0, 480, 4544, 544, 4608, 96, + 4640, 64, 4608, 0, 35, 0, 1106, 5392, 5198, 917, + 5328, 5003, 144, 5328, 0, 85, 4437, 4809, 277, 4807, + 1312, 4807, 0, 533, 4436, 4306, 4240, 4173, 4170, 4232, + 4423, 4551, 4680, 4875, 5006, 5138, 5205, 533, 4500, 4370, + 4304, 4237, 4234, 4296, 4423, 533, 4757, 4884, 4946, 5066, + 5128, 5191, 661, 4820, 4882, 5002, 5064, 5191, 5255, 0, + 732, 4635, 4505, 4373, 4306, 4238, 4168, 4096, 732, 4699, + 4569, 4437, 4370, 4302, 4232, 4160, 732, 4956, 5083, 5146, + 5143, 5077, 5012, 4819, 4563, 860, 5082, 5079, 5013, 4948, + 4819, 467, 4818, 4944, 5006, 5003, 4937, 4872, 4679, 4551, + 4424, 4361, 4300, 467, 4754, 4880, 4942, 4939, 4873, 4808, + 4679, 0, 21, 4245, 4372, 4434, 4739, 4801, 4864, 149, + 4308, 4370, 4675, 4737, 4864, 4992, 981, 5011, 4880, 4229, + 4098, 4096, 0, 724, 4693, 4565, 4372, 4241, 4174, 4171, + 4233, 4296, 4423, 4551, 4744, 4875, 4942, 4945, 4883, 4632, + 4570, 4572, 4637, 4765, 4892, 5018, 469, 4436, 4305, 4238, + 4234, 4296, 455, 4680, 4811, 4878, 4882, 4820, 4695, 4633, + 4635, 4700, 4828, 5018, 0, 850, 4820, 4693, 4437, 4308, + 4306, 4432, 4623, 341, 4372, 4370, 4496, 4623, 527, 4302, + 4172, 4170, 4232, 4423, 4615, 4744, 4874, 527, 4366, 4236, + 4234, 4296, 4423, 0, 404, 4371, 4241, 4174, 4171, 4233, + 4296, 4423, 4615, 4808, 5002, 5133, 5200, 5203, 5077, 4949, + 4819, 4687, 4554, 4352, 75, 4297, 4424, 4616, 4809, 5003, + 5133, 1107, 5076, 4948, 4818, 4687, 4553, 4416, 0, 277, + 4231, 341, 4367, 4298, 4231, 981, 5009, 4877, 1045, 5074, + 5008, 4877, 4747, 4553, 4424, 4231, 85, 4437, 0, 17, + 4115, 4245, 4437, 4500, 4498, 4430, 4295, 277, 4436, 4434, + 4366, 4231, 334, 4562, 4692, 4821, 4949, 5076, 5139, 5136, + 5067, 4864, 853, 5075, 5072, 5003, 4800, 0, 277, 4238, + 4170, 4168, 4231, 4423, 4553, 4619, 341, 4302, 4234, 4232, + 4295, 0, 848, 4883, 4820, 4693, 4565, 4372, 4241, 4174, + 4171, 4233, 4296, 4423, 4551, 4744, 4874, 4941, 5010, 5015, + 4954, 4891, 4764, 4572, 4443, 4378, 4377, 4441, 4442, 469, + 4436, 4305, 4238, 4234, 4296, 455, 4680, 4810, 4877, 4946, + 4951, 4890, 4764, 0, 277, 4103, 341, 4167, 917, 5076, + 5140, 5077, 4949, 4820, 4560, 4431, 4303, 335, 4558, 4680, + 4743, 335, 4494, 4616, 4679, 4807, 4936, 5067, 0, 92, + 4316, 4443, 4506, 4568, 4938, 5000, 5063, 220, 4442, 4504, + 4874, 4936, 5063, 5127, 533, 4103, 533, 4167, 0, 341, + 4096, 405, 4096, 338, 4364, 4361, 4487, 4615, 4744, 4874, + 5005, 1045, 4938, 4936, 4999, 5191, 5321, 5387, 1109, 5002, + 5000, 5063, 0, 277, 4231, 341, 4367, 4298, 4231, 981, + 5009, 4877, 1045, 5074, 5008, 4877, 4747, 4553, 4424, 4231, + 85, 4437, 0, 469, 4372, 4241, 4174, 4171, 4233, 4296, + 4423, 4551, 4744, 4875, 4942, 4945, 4883, 4820, 4693, 4565, + 469, 4436, 4305, 4238, 4234, 4296, 455, 4680, 4811, 4878, + 4882, 4820, 0, 468, 4295, 468, 4359, 852, 4935, 852, + 4999, 18, 4244, 4437, 5269, 18, 4243, 4436, 5268, 0, + 17, 4115, 4245, 4437, 4500, 4498, 4429, 4426, 4488, 4551, + 277, 4436, 4434, 4365, 4362, 4424, 4551, 4679, 4808, 4938, + 5069, 5136, 5205, 5209, 5147, 5020, 4892, 4762, 4760, 4821, + 4946, 5072, 5262, 712, 4939, 5005, 5072, 5141, 5145, 5083, + 5020, 0, 140, 4297, 4360, 4487, 4615, 4808, 4939, 5006, + 5009, 4947, 4884, 4757, 4629, 4436, 4305, 4238, 4096, 519, + 4744, 4875, 4942, 4946, 4884, 533, 4500, 4369, 4302, 4096, + 0, 1109, 4565, 4372, 4241, 4174, 4171, 4233, 4296, 4423, + 4551, 4744, 4875, 4942, 4945, 4883, 4820, 4693, 469, 4436, + 4305, 4238, 4234, 4296, 455, 4680, 4811, 4878, 4882, 4820, + 724, 5204, 0, 596, 4487, 596, 4551, 18, 4244, 4437, + 5141, 18, 4243, 4436, 5140, 0, 17, 4115, 4245, 4437, + 4500, 4498, 4364, 4361, 4487, 277, 4436, 4434, 4300, 4297, + 4360, 4487, 4551, 4744, 4874, 5005, 5072, 5075, 5013, 4948, + 5011, 5072, 909, 5075, 0, 35, 0, 145, 4371, 4564, + 4501, 4372, 4241, 4174, 4171, 4232, 4295, 4423, 4552, 4683, + 4750, 75, 4233, 4296, 4424, 4553, 4683, 590, 4683, 4744, + 4807, 4935, 5064, 5195, 5262, 5265, 5204, 5141, 5076, 5203, + 5265, 587, 4745, 4808, 4936, 5065, 5195, 0, 604, 4571, + 4506, 4505, 4568, 4759, 4951, 663, 4502, 4373, 4307, 4305, + 4431, 4622, 4814, 663, 4566, 4437, 4371, 4369, 4495, 4622, + 526, 4365, 4236, 4170, 4168, 4294, 4612, 4675, 4673, 4544, + 4416, 526, 4429, 4300, 4234, 4232, 4358, 4612, 0, 860, + 4544, 924, 4480, 17, 4115, 4245, 4437, 4500, 4498, 4429, + 4426, 4552, 4744, 4873, 5068, 5199, 277, 4436, 4434, 4365, + 4362, 4424, 4551, 4743, 4872, 5002, 5133, 5199, 5333, 0, + 604, 4571, 4506, 4505, 4568, 4759, 5079, 5080, 4887, 4629, + 4435, 4240, 4173, 4171, 4233, 4423, 4613, 4675, 4673, 4608, + 4480, 4417, 662, 4499, 4304, 4237, 4235, 4297, 4423, 0, + 480, 4447, 4382, 4316, 4314, 4376, 4439, 4501, 4499, 4369, + 351, 4381, 4379, 4441, 4504, 4566, 4564, 4498, 4240, 4494, + 4556, 4554, 4488, 4423, 4357, 4355, 4417, 271, 4493, 4491, + 4425, 4360, 4294, 4292, 4354, 4417, 4544, 0, 160, 4224, + 544, 4608, 0, 224, 4447, 4510, 4572, 4570, 4504, 4439, + 4373, 4371, 4497, 351, 4509, 4507, 4441, 4376, 4310, 4308, + 4370, 4624, 4366, 4300, 4298, 4360, 4423, 4485, 4483, 4417, + 399, 4365, 4363, 4425, 4488, 4550, 4548, 4482, 4417, 4288, + 0, 338, 4240, 4430, 533, 4304, 4619, 208, 5392, 0, + 284, 4251, 4185, 4183, 4245, 4372, 4500, 4629, 4695, 4697, + 4635, 4508, 4380, 0, +}; + + +/* Times Font data. */ +short timidx[] = { /* character index in timtab */ + 1, 3, 16, 33, 42, 81, 111, 158, 163, 182, 201, 208, + 213, 221, 224, 230, 233, 271, 280, 322, 366, 376, 411, 457, + 484, 542, 588, 599, 612, 616, 621, 625, 655, 708, 721, 761, + 792, 819, 836, 851, 887, 906, 915, 933, 952, 963, 984, 999, + 1041, 1066, 1126, 1165, 1198, 1211, 1231, 1242, 1259, 1274, 1289, 1302, + 1311, 1314, 1323, 1330, 1333, 1339, 1375, 1404, 1431, 1462, 1491, 1510, + 1565, 1587, 1601, 1623, 1642, 1651, 1686, 1708, 1742, 1773, 1802, 1821, + 1852, 1866, 1888, 1899, 1916, 1931, 1949, 1962, 2000, 2003, 2041, 2064, +}; + +/* Width data. */ +short timwid[] = { /* width data in timtab */ + 21, 15, 23, 26, 25, 29, 30, 13, 19, 19, + 21, 31, 13, 31, 13, 27, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 13, 13, 29, 31, + 29, 23, 32, 25, 27, 26, 27, 26, 25, 28, + 29, 16, 20, 27, 23, 32, 28, 27, 27, 27, + 27, 25, 24, 29, 25, 29, 25, 26, 25, 19, + 19, 19, 27, 25, 17, 25, 26, 24, 26, 24, + 18, 24, 27, 16, 16, 26, 16, 36, 27, 25, + 26, 25, 22, 22, 20, 27, 23, 29, 25, 24, + 23, 19, 13, 19, 29, 21 +}; + +/* Stroke data. */ +short timtab[] = { /* stroke data in timtab */ + 35, 0, 220, 4250, 4302, 4378, 4316, 218, 4308, 201, + 4232, 4295, 4360, 4297, 0, 220, 4251, 4245, 219, 4245, + 220, 4379, 4245, 796, 4827, 4821, 795, 4821, 796, 4955, + 4821, 0, 608, 4224, 992, 4608, 147, 5139, 77, 5069, + 0, 416, 4483, 672, 4739, 921, 4952, 5015, 5080, 5081, + 4955, 4764, 4508, 4315, 4185, 4183, 4245, 4308, 4435, 4817, + 4944, 5070, 87, 4309, 4436, 4818, 4945, 5008, 5070, 5066, + 4936, 4743, 4487, 4296, 4170, 4171, 4236, 4299, 4234, 0, + 1244, 4167, 412, 4634, 4632, 4566, 4437, 4309, 4183, 4185, + 4251, 4380, 4508, 4635, 4826, 5018, 5211, 5340, 974, 4941, + 4875, 4873, 4999, 5127, 5256, 5322, 5324, 5198, 5070, 0, + 1236, 5267, 5330, 5395, 5396, 5333, 5269, 5204, 5138, 5005, + 4874, 4744, 4615, 4423, 4232, 4170, 4173, 4239, 4627, 4757, + 4823, 4825, 4763, 4636, 4507, 4441, 4439, 4500, 4625, 4938, + 5064, 5255, 5319, 5384, 5385, 327, 4296, 4234, 4237, 4303, + 4433, 343, 4501, 5002, 5128, 5255, 0, 156, 4181, 220, + 4181, 0, 608, 4574, 4443, 4311, 4242, 4238, 4297, 4421, + 4546, 4672, 478, 4442, 4375, 4306, 4302, 4361, 4422, 4546, + 0, 96, 4318, 4443, 4567, 4626, 4622, 4553, 4421, 4290, + 4160, 222, 4442, 4503, 4562, 4558, 4489, 4422, 4290, 0, + 406, 4490, 83, 4813, 723, 4173, 0, 729, 4807, 144, + 5392, 0, 203, 4234, 4171, 4236, 4299, 4297, 4167, 0, + 144, 5392, 0, 140, 4171, 4234, 4299, 4236, 0, 1184, + 4096, 0, 476, 4379, 4248, 4179, 4176, 4235, 4360, 4551, + 4679, 4872, 5003, 5072, 5075, 5016, 4891, 4700, 4572, 476, + 4443, 4378, 4312, 4243, 4240, 4299, 4361, 4424, 4551, 583, + 4808, 4873, 4939, 5008, 5011, 4952, 4890, 4827, 4700, 0, + 280, 4505, 4700, 4679, 539, 4615, 263, 4935, 0, 152, + 4311, 4246, 4183, 4184, 4250, 4315, 4508, 4764, 4955, 5018, + 5080, 5078, 5012, 4818, 4496, 4367, 4237, 4170, 4167, 668, + 4891, 4954, 5016, 5014, 4948, 4754, 4496, 73, 4234, 4362, + 4680, 4872, 5001, 5066, 266, 4679, 4935, 5000, 5066, 5068, + 0, 152, 4311, 4246, 4183, 4184, 4250, 4315, 4508, 4764, + 4955, 5017, 5014, 4948, 4755, 4563, 668, 4891, 4953, 4950, + 4884, 4755, 659, 4882, 5008, 5070, 5067, 5001, 4936, 4743, + 4487, 4296, 4233, 4171, 4172, 4237, 4300, 4235, 849, 5006, + 5003, 4937, 4872, 4743, 0, 666, 4743, 732, 4807, 732, + 4109, 5133, 455, 4999, 0, 220, 4178, 82, 4308, 4501, + 4693, 4884, 5010, 5071, 5069, 5002, 4872, 4679, 4487, 4296, + 4233, 4171, 4172, 4237, 4300, 4235, 597, 4820, 4946, 5007, + 5005, 4938, 4808, 4679, 220, 4956, 219, 4635, 4956, 0, + 857, 4888, 4951, 5016, 5017, 4955, 4828, 4636, 4443, 4313, + 4247, 4179, 4173, 4234, 4360, 4551, 4679, 4872, 5002, 5069, + 5070, 5009, 4883, 4692, 4628, 4435, 4305, 4238, 540, 4507, + 4377, 4311, 4243, 4237, 4298, 4424, 4551, 583, 4808, 4938, + 5005, 5006, 4945, 4819, 4692, 0, 92, 4182, 88, 4250, + 4380, 4508, 4825, 4953, 5018, 5084, 154, 4379, 4507, 4825, + 988, 5081, 5014, 4753, 4687, 4620, 4615, 918, 4689, 4623, + 4556, 4551, 0, 412, 4315, 4249, 4246, 4308, 4499, 4755, + 4948, 5014, 5017, 4955, 4764, 4508, 412, 4379, 4313, 4310, + 4372, 4499, 659, 4884, 4950, 4953, 4891, 4764, 403, 4306, + 4241, 4175, 4171, 4233, 4296, 4487, 4743, 4936, 5001, 5067, + 5071, 5009, 4946, 4755, 403, 4370, 4305, 4239, 4235, 4297, + 4360, 4487, 647, 4872, 4937, 5003, 5007, 4945, 4882, 4755, + 0, 917, 4946, 4816, 4623, 4559, 4368, 4242, 4181, 4182, + 4249, 4379, 4572, 4700, 4891, 5017, 5078, 5072, 5004, 4938, + 4808, 4615, 4423, 4296, 4234, 4235, 4300, 4363, 4298, 463, + 4432, 4306, 4245, 4246, 4313, 4443, 4572, 604, 4827, 4953, + 5014, 5008, 4940, 4874, 4744, 4615, 0, 147, 4178, 4241, + 4306, 4243, 140, 4171, 4234, 4299, 4236, 0, 147, 4178, + 4241, 4306, 4243, 203, 4234, 4171, 4236, 4299, 4297, 4167, + 0, 1177, 4240, 5255, 0, 147, 5395, 141, 5389, 0, + 153, 5264, 4231, 0, 152, 4311, 4246, 4183, 4184, 4250, + 4315, 4444, 4636, 4827, 4890, 4952, 4950, 4884, 4819, 4561, + 4558, 540, 4763, 4826, 4888, 4886, 4820, 4690, 457, 4488, + 4551, 4616, 4553, 0, 1044, 5078, 4951, 4759, 4630, 4565, + 4498, 4495, 4557, 4684, 4876, 5005, 5071, 663, 4629, 4562, + 4559, 4621, 4684, 1047, 5071, 5069, 5196, 5324, 5454, 5521, + 5523, 5462, 5400, 5274, 5147, 4956, 4764, 4571, 4442, 4312, + 4246, 4179, 4176, 4237, 4299, 4425, 4552, 4743, 4935, 5128, + 5257, 5322, 1111, 5135, 5133, 5196, 0, 540, 4167, 540, + 5063, 537, 4999, 205, 4877, 7, 4423, 711, 5191, 0, + 220, 4295, 284, 4359, 28, 4892, 5083, 5146, 5208, 5206, + 5140, 5075, 4882, 796, 5019, 5082, 5144, 5142, 5076, 5011, + 4882, 274, 4882, 5073, 5136, 5198, 5195, 5129, 5064, 4871, + 4103, 786, 5009, 5072, 5134, 5131, 5065, 5000, 4871, 0, + 985, 5142, 5148, 5081, 4955, 4764, 4636, 4443, 4313, 4247, + 4180, 4175, 4236, 4298, 4424, 4615, 4743, 4936, 5066, 5132, + 540, 4507, 4377, 4311, 4244, 4239, 4300, 4362, 4488, 4615, + 0, 220, 4295, 284, 4359, 28, 4764, 4955, 5081, 5143, + 5204, 5199, 5132, 5066, 4936, 4743, 4103, 668, 4891, 5017, + 5079, 5140, 5135, 5068, 5002, 4872, 4743, 0, 220, 4295, + 284, 4359, 662, 4750, 28, 5148, 5142, 5084, 274, 4754, + 7, 5127, 5133, 5063, 0, 220, 4295, 284, 4359, 662, + 4750, 28, 5148, 5142, 5084, 274, 4754, 7, 4551, 0, + 985, 5142, 5148, 5081, 4955, 4764, 4636, 4443, 4313, 4247, + 4180, 4175, 4236, 4298, 4424, 4615, 4743, 4936, 5066, 540, + 4507, 4377, 4311, 4244, 4239, 4300, 4362, 4488, 4615, 975, + 5063, 1039, 5127, 783, 5327, 0, 220, 4295, 284, 4359, + 1052, 5127, 1116, 5191, 28, 4572, 860, 5404, 274, 5138, + 7, 4551, 839, 5383, 0, 220, 4295, 284, 4359, 28, + 4572, 7, 4551, 0, 540, 4619, 4552, 4423, 4295, 4168, + 4106, 4108, 4173, 4236, 4171, 476, 4555, 4488, 4423, 284, + 4828, 0, 220, 4295, 284, 4359, 1116, 4367, 595, 5191, + 531, 5127, 28, 4572, 860, 5340, 7, 4551, 839, 5319, + 0, 220, 4295, 284, 4359, 28, 4572, 7, 5063, 5069, + 4999, 0, 220, 4295, 284, 4746, 220, 4743, 1116, 4743, + 1116, 5191, 1180, 5255, 28, 4380, 1116, 5468, 7, 4487, + 903, 5447, 0, 220, 4295, 284, 5129, 282, 5127, 1052, + 5127, 28, 4380, 860, 5340, 7, 4487, 0, 540, 4443, + 4313, 4247, 4179, 4176, 4236, 4298, 4424, 4615, 4743, 4936, + 5066, 5132, 5200, 5203, 5143, 5081, 4955, 4764, 4636, 540, + 4507, 4377, 4311, 4243, 4240, 4300, 4362, 4488, 4615, 647, + 4872, 5002, 5068, 5136, 5139, 5079, 5017, 4891, 4764, 0, + 220, 4295, 284, 4359, 28, 4892, 5083, 5146, 5208, 5205, + 5139, 5074, 4881, 4369, 796, 5019, 5082, 5144, 5141, 5075, + 5010, 4881, 7, 4551, 0, 540, 4443, 4313, 4247, 4179, + 4176, 4236, 4298, 4424, 4615, 4743, 4936, 5066, 5132, 5200, + 5203, 5143, 5081, 4955, 4764, 4636, 540, 4507, 4377, 4311, + 4243, 4240, 4300, 4362, 4488, 4615, 647, 4872, 5002, 5068, + 5136, 5139, 5079, 5017, 4891, 4764, 329, 4426, 4492, 4621, + 4685, 4812, 4874, 4931, 4994, 5122, 5188, 5189, 778, 4934, + 4996, 5059, 5123, 5188, 0, 220, 4295, 284, 4359, 28, + 4892, 5083, 5146, 5208, 5206, 5140, 5075, 4882, 4370, 796, + 5019, 5082, 5144, 5142, 5076, 5011, 4882, 7, 4551, 594, + 4817, 4880, 5065, 5128, 5192, 5257, 721, 4879, 5000, 5063, + 5191, 5257, 5258, 0, 921, 5084, 5078, 5017, 4891, 4700, + 4508, 4315, 4185, 4183, 4245, 4308, 4435, 4817, 4944, 5070, + 87, 4309, 4436, 4818, 4945, 5008, 5070, 5066, 4936, 4743, + 4551, 4360, 4234, 4173, 4167, 4234, 0, 476, 4551, 540, + 4615, 92, 4118, 4124, 5084, 5078, 5020, 263, 4807, 0, + 220, 4301, 4362, 4488, 4679, 4807, 5000, 5130, 5197, 5212, + 284, 4365, 4426, 4552, 4679, 28, 4572, 924, 5404, 0, + 92, 4615, 156, 4618, 988, 4615, 28, 4444, 732, 5212, + 0, 156, 4487, 220, 4492, 668, 4487, 668, 4999, 732, + 5004, 1180, 4999, 28, 4508, 988, 5468, 0, 92, 4999, + 156, 5063, 988, 4167, 28, 4444, 732, 5212, 7, 4423, + 711, 5191, 0, 92, 4625, 4615, 156, 4689, 4679, 1052, + 4689, 28, 4444, 796, 5276, 327, 4871, 0, 924, 4167, + 988, 4231, 156, 4182, 4188, 5084, 71, 5063, 5069, 4999, + 0, 160, 4224, 224, 4288, 160, 4704, 128, 4672, 0, + 28, 4868, 0, 480, 4544, 544, 4608, 96, 4640, 64, + 4608, 0, 78, 4691, 5198, 78, 4690, 5198, 0, 0, + 5248, 0, 156, 4566, 156, 4187, 4566, 0, 211, 4306, + 4242, 4243, 4308, 4437, 4693, 4820, 4883, 4945, 4938, 5000, + 5063, 787, 4874, 4936, 5063, 5127, 785, 4816, 4431, 4238, + 4172, 4170, 4232, 4423, 4615, 4744, 4874, 335, 4302, 4236, + 4234, 4296, 4423, 0, 220, 4295, 284, 4359, 274, 4500, + 4629, 4757, 4948, 5074, 5135, 5133, 5066, 4936, 4743, 4615, + 4488, 4362, 661, 4884, 5010, 5071, 5069, 5002, 4872, 4743, + 28, 4380, 0, 850, 4881, 4944, 5009, 5010, 4884, 4757, + 4565, 4372, 4242, 4175, 4173, 4234, 4360, 4551, 4679, 4872, + 5002, 469, 4436, 4306, 4239, 4237, 4298, 4424, 4551, 0, + 860, 4935, 924, 4999, 850, 4820, 4693, 4565, 4372, 4242, + 4175, 4173, 4234, 4360, 4551, 4679, 4808, 4938, 469, 4436, + 4306, 4239, 4237, 4298, 4424, 4551, 668, 5020, 839, 5191, + 0, 143, 5007, 5009, 4947, 4884, 4757, 4565, 4372, 4242, + 4175, 4173, 4234, 4360, 4551, 4679, 4872, 5002, 847, 4946, + 4884, 469, 4436, 4306, 4239, 4237, 4298, 4424, 4551, 0, + 539, 4570, 4633, 4698, 4699, 4636, 4508, 4379, 4313, 4295, + 412, 4443, 4377, 4359, 21, 4629, 7, 4551, 0, 405, + 4372, 4307, 4241, 4239, 4301, 4364, 4491, 4619, 4748, 4813, + 4879, 4881, 4819, 4756, 4629, 4501, 276, 4306, 4302, 4364, + 652, 4814, 4818, 4756, 723, 4884, 5013, 5012, 4884, 205, + 4236, 4170, 4169, 4231, 4422, 4742, 4933, 4996, 73, 4232, + 4423, 4743, 4934, 4996, 4995, 4929, 4736, 4352, 4161, 4099, + 4100, 4166, 4359, 0, 220, 4295, 284, 4359, 274, 4500, + 4693, 4821, 5012, 5074, 5063, 725, 4948, 5010, 4999, 28, + 4380, 7, 4551, 711, 5255, 0, 220, 4251, 4314, 4379, + 4316, 213, 4295, 277, 4359, 21, 4373, 7, 4551, 0, + 284, 4315, 4378, 4443, 4380, 341, 4419, 4353, 4224, 4096, + 4097, 4098, 4099, 4162, 4097, 277, 4355, 4289, 4224, 85, + 4437, 0, 220, 4295, 284, 4359, 917, 4363, 591, 5063, + 527, 4999, 28, 4380, 725, 5205, 7, 4551, 711, 5191, + 0, 220, 4295, 284, 4359, 28, 4380, 7, 4551, 0, + 213, 4295, 277, 4359, 274, 4500, 4693, 4821, 5012, 5074, + 5063, 725, 4948, 5010, 4999, 978, 5204, 5397, 5525, 5716, + 5778, 5767, 1429, 5652, 5714, 5703, 21, 4373, 7, 4551, + 711, 5255, 1415, 5959, 0, 213, 4295, 277, 4359, 274, + 4500, 4693, 4821, 5012, 5074, 5063, 725, 4948, 5010, 4999, + 21, 4373, 7, 4551, 711, 5255, 0, 469, 4372, 4242, + 4175, 4173, 4234, 4360, 4551, 4679, 4872, 5002, 5069, 5071, + 5010, 4884, 4693, 4565, 469, 4436, 4306, 4239, 4237, 4298, + 4424, 4551, 583, 4808, 4938, 5005, 5007, 4946, 4820, 4693, + 0, 213, 4288, 277, 4352, 274, 4500, 4629, 4757, 4948, + 5074, 5135, 5133, 5066, 4936, 4743, 4615, 4488, 4362, 661, + 4884, 5010, 5071, 5069, 5002, 4872, 4743, 21, 4373, 0, + 4544, 0, 853, 4928, 917, 4992, 850, 4820, 4693, 4565, + 4372, 4242, 4175, 4173, 4234, 4360, 4551, 4679, 4808, 4938, + 469, 4436, 4306, 4239, 4237, 4298, 4424, 4551, 640, 5184, + 0, 213, 4295, 277, 4359, 271, 4434, 4564, 4693, 4885, + 4948, 4947, 4882, 4819, 4884, 21, 4373, 7, 4551, 0, + 723, 4885, 4881, 4819, 4756, 4629, 4373, 4244, 4179, 4177, + 4240, 4367, 4685, 4812, 4875, 82, 4241, 4368, 4686, 4813, + 4876, 4873, 4808, 4679, 4423, 4296, 4233, 4171, 4167, 4233, + 0, 220, 4299, 4360, 4487, 4615, 4744, 4810, 284, 4363, + 4424, 4487, 21, 4629, 0, 213, 4298, 4360, 4551, 4679, + 4872, 5002, 277, 4362, 4424, 4551, 917, 4999, 981, 5063, + 21, 4373, 725, 5077, 903, 5255, 0, 85, 4551, 149, + 4553, 853, 4551, 21, 4437, 597, 5077, 0, 149, 4487, + 213, 4490, 661, 4487, 661, 4999, 725, 5002, 1173, 4999, + 21, 4501, 981, 5461, 0, 149, 4935, 213, 4999, 917, + 4231, 21, 4501, 661, 5141, 7, 4487, 647, 5127, 0, + 149, 4615, 213, 4617, 917, 4615, 4483, 4353, 4224, 4160, + 4097, 4162, 4225, 21, 4501, 661, 5141, 0, 789, 4167, + 853, 4231, 149, 4177, 4181, 4949, 71, 4935, 4939, 4871, + 0, 480, 4447, 4382, 4316, 4314, 4376, 4439, 4501, 4499, + 4369, 351, 4381, 4379, 4441, 4504, 4566, 4564, 4498, 4240, + 4494, 4556, 4554, 4488, 4423, 4357, 4355, 4417, 271, 4493, + 4491, 4425, 4360, 4294, 4292, 4354, 4417, 4544, 0, 160, + 4224, 0, 224, 4447, 4510, 4572, 4570, 4504, 4439, 4373, + 4371, 4497, 351, 4509, 4507, 4441, 4376, 4310, 4308, 4370, + 4624, 4366, 4300, 4298, 4360, 4423, 4485, 4483, 4417, 399, + 4365, 4363, 4425, 4488, 4550, 4548, 4482, 4417, 4288, 0, + 77, 4175, 4242, 4371, 4499, 4626, 4879, 5006, 5134, 5263, + 5329, 79, 4241, 4370, 4498, 4625, 4878, 5005, 5133, 5262, + 5329, 5331, 0, 28, 4103, 4103, 4124, 4124, 4103, 4167, + 4188, 4252, 4231, 4295, 4316, 4380, 4359, 4423, 4444, 4508, + 4487, 4551, 4572, 4636, 4615, 4679, 4700, 4764, 4743, 4807, + 4828, 4892, 4871, 4935, 4956, 5020, 4999, 0, +}; + + +/* Futura Font Data */ +short futidx[] = { /* character index in futtab */ + 1, 3, 11, 16, 25, 50, 80, 115, 123, 134, 145, 152, + 157, 165, 168, 174, 177, 195, 200, 215, 231, 237, 255, 279, + 284, 314, 338, 349, 362, 366, 371, 375, 395, 448, 455, 477, + 496, 511, 520, 527, 549, 556, 559, 570, 577, 582, 591, 598, + 620, 633, 657, 672, 693, 698, 709, 714, 723, 728, 734, 741, + 750, 753, 762, 767, 770, 778, 795, 812, 827, 844, 862, 870, + 892, 902, 910, 921, 928, 931, 948, 958, 976, 993, 1010, 1018, + 1036, 1044, 1054, 1059, 1068, 1073, 1082, 1089, 1127, 1130, 1168, 1191, +}; + +/* Width data. */ +short futwid[] = { /* width data in futtab */ + 21, 15, 21, 26, 25, 29, 31, 15, 19, 19, + 21, 31, 13, 31, 13, 27, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 13, 13, 29, 31, + 29, 23, 32, 23, 26, 26, 26, 24, 23, 26, + 27, 13, 21, 26, 22, 29, 27, 27, 26, 27, + 26, 25, 21, 27, 23, 29, 25, 23, 25, 19, + 19, 19, 21, 23, 13, 24, 24, 23, 24, 23, + 17, 24, 24, 11, 15, 22, 13, 34, 24, 24, + 24, 24, 20, 22, 17, 24, 21, 27, 22, 21, + 22, 19, 13, 19, 29, 21 +}; + +/* Stroke data. */ +short futtab[] = { /* stroke data in futtab */ + 35, 0, 220, 4302, 201, 4232, 4295, 4360, 4297, 0, + 156, 4245, 668, 4757, 0, 608, 4224, 992, 4608, 147, + 5139, 77, 5069, 0, 416, 4483, 672, 4739, 985, 4955, + 4764, 4508, 4315, 4185, 4183, 4245, 4308, 4435, 4817, 4944, + 5007, 5069, 5066, 4936, 4743, 4487, 4296, 4170, 0, 1244, + 4167, 412, 4634, 4632, 4566, 4437, 4309, 4183, 4185, 4251, + 4380, 4508, 4635, 4826, 5018, 5211, 5340, 974, 4941, 4875, + 4873, 4999, 5127, 5256, 5322, 5324, 5198, 5070, 0, 1363, + 5460, 5397, 5333, 5268, 5202, 5069, 4938, 4808, 4679, 4423, + 4296, 4233, 4171, 4173, 4239, 4304, 4756, 4821, 4887, 4889, + 4827, 4700, 4571, 4505, 4503, 4564, 4689, 5002, 5128, 5255, + 5383, 5448, 5449, 0, 218, 4251, 4316, 4379, 4377, 4311, + 4246, 0, 608, 4574, 4443, 4311, 4242, 4238, 4297, 4421, + 4546, 4672, 0, 96, 4318, 4443, 4567, 4626, 4622, 4553, + 4421, 4290, 4160, 0, 406, 4490, 83, 4813, 723, 4173, + 0, 729, 4807, 144, 5392, 0, 203, 4234, 4171, 4236, + 4299, 4297, 4167, 0, 144, 5392, 0, 140, 4171, 4234, + 4299, 4236, 0, 1184, 4096, 0, 476, 4379, 4248, 4179, + 4176, 4235, 4360, 4551, 4679, 4872, 5003, 5072, 5075, 5016, + 4891, 4700, 4572, 0, 280, 4505, 4700, 4679, 0, 151, + 4248, 4314, 4379, 4508, 4764, 4891, 4954, 5016, 5014, 4948, + 4817, 4167, 5063, 0, 220, 5020, 4628, 4820, 4947, 5010, + 5071, 5069, 5002, 4872, 4679, 4487, 4296, 4233, 4171, 0, + 732, 4174, 5134, 732, 4807, 0, 860, 4316, 4243, 4308, + 4501, 4693, 4884, 5010, 5071, 5069, 5002, 4872, 4679, 4487, + 4296, 4233, 4171, 0, 921, 4955, 4764, 4636, 4443, 4312, + 4243, 4238, 4298, 4424, 4615, 4679, 4872, 5002, 5069, 5070, + 5009, 4883, 4692, 4628, 4435, 4305, 4238, 0, 988, 4423, + 92, 5084, 0, 412, 4315, 4249, 4247, 4309, 4436, 4691, + 4882, 5008, 5070, 5067, 5001, 4936, 4743, 4487, 4296, 4233, + 4171, 4174, 4240, 4370, 4563, 4820, 4949, 5015, 5017, 4955, + 4764, 4508, 0, 917, 4946, 4816, 4623, 4559, 4368, 4242, + 4181, 4182, 4249, 4379, 4572, 4636, 4827, 4953, 5013, 5008, + 4939, 4808, 4615, 4487, 4296, 4234, 0, 147, 4178, 4241, + 4306, 4243, 140, 4171, 4234, 4299, 4236, 0, 147, 4178, + 4241, 4306, 4243, 203, 4234, 4171, 4236, 4299, 4297, 4167, + 0, 1177, 4240, 5255, 0, 147, 5395, 141, 5389, 0, + 153, 5264, 4231, 0, 87, 4184, 4250, 4315, 4444, 4700, + 4827, 4890, 4952, 4950, 4884, 4819, 4561, 4558, 457, 4488, + 4551, 4616, 4553, 0, 1044, 5078, 4951, 4759, 4630, 4565, + 4498, 4495, 4557, 4684, 4876, 5005, 5071, 663, 4629, 4562, + 4559, 4621, 4684, 1047, 5071, 5069, 5196, 5324, 5454, 5521, + 5523, 5462, 5400, 5274, 5147, 4956, 4764, 4571, 4442, 4312, + 4246, 4179, 4176, 4237, 4299, 4425, 4552, 4743, 4935, 5128, + 5257, 5322, 1111, 5135, 5133, 5196, 0, 476, 4103, 476, + 5063, 142, 4878, 0, 156, 4231, 156, 4828, 5019, 5082, + 5144, 5142, 5076, 5011, 4818, 146, 4818, 5009, 5072, 5134, + 5131, 5065, 5000, 4807, 4231, 0, 1047, 5081, 4955, 4828, + 4572, 4443, 4313, 4247, 4180, 4175, 4236, 4298, 4424, 4551, + 4807, 4936, 5066, 5132, 0, 156, 4231, 156, 4700, 4891, + 5017, 5079, 5140, 5135, 5068, 5002, 4872, 4679, 4231, 0, + 156, 4231, 156, 5084, 146, 4754, 135, 5063, 0, 156, + 4231, 156, 5084, 146, 4754, 0, 1047, 5081, 4955, 4828, + 4572, 4443, 4313, 4247, 4180, 4175, 4236, 4298, 4424, 4551, + 4807, 4936, 5066, 5132, 5135, 719, 5135, 0, 156, 4231, + 1052, 5127, 146, 5138, 0, 156, 4231, 0, 668, 4748, + 4681, 4616, 4487, 4359, 4232, 4169, 4108, 4110, 0, 156, + 4231, 1052, 4238, 467, 5127, 0, 156, 4231, 135, 4999, + 0, 156, 4231, 156, 4743, 1180, 4743, 1180, 5255, 0, + 156, 4231, 156, 5127, 1052, 5127, 0, 476, 4443, 4313, + 4247, 4180, 4175, 4236, 4298, 4424, 4551, 4807, 4936, 5066, + 5132, 5199, 5204, 5143, 5081, 4955, 4828, 4572, 0, 156, + 4231, 156, 4828, 5019, 5082, 5144, 5141, 5075, 5010, 4817, + 4241, 0, 476, 4443, 4313, 4247, 4180, 4175, 4236, 4298, + 4424, 4551, 4807, 4936, 5066, 5132, 5199, 5204, 5143, 5081, + 4955, 4828, 4572, 651, 5125, 0, 156, 4231, 156, 4828, + 5019, 5082, 5144, 5142, 5076, 5011, 4818, 4242, 594, 5127, + 0, 985, 4955, 4764, 4508, 4315, 4185, 4183, 4245, 4308, + 4435, 4817, 4944, 5007, 5069, 5066, 4936, 4743, 4487, 4296, + 4170, 0, 412, 4487, 28, 4956, 0, 156, 4237, 4298, + 4424, 4615, 4743, 4936, 5066, 5133, 5148, 0, 28, 4551, + 988, 4551, 0, 28, 4423, 668, 4423, 668, 5063, 1308, + 5063, 0, 92, 5063, 988, 4167, 0, 28, 4562, 4551, + 988, 4562, 0, 988, 4167, 92, 5084, 71, 5063, 0, + 160, 4224, 224, 4288, 160, 4704, 128, 4672, 0, 28, + 4868, 0, 480, 4544, 544, 4608, 96, 4640, 64, 4608, + 0, 414, 4112, 414, 5008, 0, 0, 5120, 0, 215, + 4181, 4179, 4242, 4307, 4244, 4179, 0, 853, 4935, 850, + 4820, 4693, 4501, 4372, 4242, 4175, 4173, 4234, 4360, 4487, + 4679, 4808, 4938, 0, 156, 4231, 146, 4372, 4501, 4693, + 4820, 4946, 5007, 5005, 4938, 4808, 4679, 4487, 4360, 4234, + 0, 850, 4820, 4693, 4501, 4372, 4242, 4175, 4173, 4234, + 4360, 4487, 4679, 4808, 4938, 0, 860, 4935, 850, 4820, + 4693, 4501, 4372, 4242, 4175, 4173, 4234, 4360, 4487, 4679, + 4808, 4938, 0, 79, 4943, 4945, 4883, 4820, 4693, 4501, + 4372, 4242, 4175, 4173, 4234, 4360, 4487, 4679, 4808, 4938, + 0, 540, 4508, 4379, 4312, 4295, 21, 4565, 0, 853, + 4933, 4866, 4801, 4672, 4480, 4353, 850, 4820, 4693, 4501, + 4372, 4242, 4175, 4173, 4234, 4360, 4487, 4679, 4808, 4938, + 0, 156, 4231, 145, 4436, 4565, 4757, 4884, 4945, 4935, + 0, 92, 4251, 4316, 4253, 4188, 149, 4231, 0, 220, + 4379, 4444, 4381, 4316, 277, 4356, 4289, 4160, 4096, 0, + 156, 4231, 789, 4235, 399, 4935, 0, 156, 4231, 0, + 149, 4231, 145, 4436, 4565, 4757, 4884, 4945, 4935, 849, + 5140, 5269, 5461, 5588, 5649, 5639, 0, 149, 4231, 145, + 4436, 4565, 4757, 4884, 4945, 4935, 0, 405, 4372, 4242, + 4175, 4173, 4234, 4360, 4487, 4679, 4808, 4938, 5005, 5007, + 4946, 4820, 4693, 4501, 0, 149, 4224, 146, 4372, 4501, + 4693, 4820, 4946, 5007, 5005, 4938, 4808, 4679, 4487, 4360, + 4234, 0, 853, 4928, 850, 4820, 4693, 4501, 4372, 4242, + 4175, 4173, 4234, 4360, 4487, 4679, 4808, 4938, 0, 149, + 4231, 143, 4306, 4436, 4565, 4757, 0, 786, 4820, 4629, + 4437, 4244, 4178, 4240, 4367, 4686, 4813, 4875, 4874, 4808, + 4615, 4423, 4232, 4170, 0, 220, 4299, 4360, 4487, 4615, + 21, 4565, 0, 149, 4235, 4296, 4423, 4615, 4744, 4939, + 853, 4935, 0, 21, 4487, 789, 4487, 0, 85, 4423, + 597, 4423, 597, 4935, 1109, 4935, 0, 85, 4871, 789, + 4167, 0, 21, 4487, 789, 4487, 4355, 4225, 4096, 4096, + 0, 789, 4167, 85, 4885, 71, 4871, 0, 480, 4447, + 4382, 4316, 4314, 4376, 4439, 4501, 4499, 4369, 351, 4381, + 4379, 4441, 4504, 4566, 4564, 4498, 4240, 4494, 4556, 4554, + 4488, 4423, 4357, 4355, 4417, 271, 4493, 4491, 4425, 4360, + 4294, 4292, 4354, 4417, 4544, 0, 160, 4224, 0, 224, + 4447, 4510, 4572, 4570, 4504, 4439, 4373, 4371, 4497, 351, + 4509, 4507, 4441, 4376, 4310, 4308, 4370, 4624, 4366, 4300, + 4298, 4360, 4423, 4485, 4483, 4417, 399, 4365, 4363, 4425, + 4488, 4550, 4548, 4482, 4417, 4288, 0, 77, 4175, 4242, + 4371, 4499, 4626, 4879, 5006, 5134, 5263, 5329, 79, 4241, + 4370, 4498, 4625, 4878, 5005, 5133, 5262, 5329, 5331, 0, + 28, 4103, 4103, 4124, 4124, 4103, 4167, 4188, 4252, 4231, + 4295, 4316, 4380, 4359, 4423, 4444, 4508, 4487, 4551, 4572, + 4636, 4615, 4679, 4700, 4764, 4743, 4807, 4828, 4892, 4871, + 4935, 4956, 5020, 4999, 0, +}; diff --git a/vendor/x11iraf/cdl/cdlftn.inc b/vendor/x11iraf/cdl/cdlftn.inc new file mode 100644 index 00000000..6adecd7d --- /dev/null +++ b/vendor/x11iraf/cdl/cdlftn.inc @@ -0,0 +1,79 @@ +C ======================================================================== +C = +C CDLFTN.INC -- Include file for Fortran programs to give symbolic = +C names to various constants used by the CDL. = +C = +C ======================================================================== + + integer NULL + integer FB_AUTO + integer CDL_UNITARY, CDL_LINEAR, CDL_LOG + + integer C_BLACK, C_WHITE, C_RED, C_GREEN, C_BLUE, C_YELLOW + integer C_CYAN, C_MAGENTA, C_CORAL, C_MAROON, C_ORANGE, C_KHAKI + integer C_ORCHID, C_TURQUOISE, C_VIOLET, C_WHEAT + + integer M_FILL, M_POINT, M_BOX, M_PLUS, M_CROSS, M_DIAMOND + integer M_STAR, M_HLINE, M_VLINE, M_HBLINE, M_VBLINE, M_CIRCLE + + integer F_ROMAN, F_GREEK, F_FUTURA, F_TIMES, F_BOLD + + integer L_SOLID, L_DASHED, L_DOTTED, L_DOTDASH, L_HOLLOW, L_SHADOW + +C Commonly used C constants + parameter (NULL=0) + +C Automatically select frame buffer + parameter (FB_AUTO=-1) + +C Types of greyscale transformations. + parameter (CDL_UNITARY=0) + parameter (CDL_LINEAR=1) + parameter (CDL_LOG=2) + +C Overlay colors. + parameter (C_BLACK=202) + parameter (C_WHITE=203) + parameter (C_RED=204) + parameter (C_GREEN=205) + parameter (C_BLUE=206) + parameter (C_YELLOW=207) + parameter (C_CYAN=208) + parameter (C_MAGENTA=209) + parameter (C_CORAL=210) + parameter (C_MAROON=211) + parameter (C_ORANGE=212) + parameter (C_KHAKI=213) + parameter (C_ORCHID=214) + parameter (C_TURQUOISE=215) + parameter (C_VIOLET=216) + parameter (C_WHEAT=217) + +C Overlay point mark types. + parameter (M_FILL=1) + parameter (M_POINT=2) + parameter (M_BOX=4) + parameter (M_PLUS=8) + parameter (M_CROSS=16) + parameter (M_DIAMOND=32) + parameter (M_CIRCLE=64) + parameter (M_STAR=128) + parameter (M_HLINE=256) + parameter (M_VLINE=512) + parameter (M_HBLINE=1024) + parameter (M_VBLINE=2048) + +C Font types. + parameter (F_ROMAN=0) + parameter (F_GREEK=1) + parameter (F_FUTURA=2) + parameter (F_TIMES=3) + parameter (F_BOLD=4) + +C Line styles. + parameter (L_SOLID=0) + parameter (L_DASHED=1) + parameter (L_DOTTED=2) + parameter (L_DOTDASH=3) + parameter (L_HOLLOW=4) + parameter (L_SHADOW=5) diff --git a/vendor/x11iraf/cdl/cdliraf.c b/vendor/x11iraf/cdl/cdliraf.c new file mode 100644 index 00000000..87c28e57 --- /dev/null +++ b/vendor/x11iraf/cdl/cdliraf.c @@ -0,0 +1,848 @@ +#include <stdio.h> +#ifdef linux +/*#include <gnu/types.h>*/ +#include <sys/types.h> +#endif +#ifdef ULTRIX +#include <sys/types.h> +#endif +#include <unistd.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + + +/* + * CDLIRAF.C -- Routines to read IRAF OIF images. + * + * cdl_displayIRAF (cdl, fname, band, frame, fbconfig, zscale) + * cdl_isIRAF (fname) + * cdl_readIRAF (fname, band, &pix, &nx, &ny, &bitpix, title); + */ + + +#define VERSION_1 1 +#define VERSION_2 2 + +/* Image header parmeters. */ +#define SZ_V1PIXFILE 79 +#define SZ_V1TITLE 79 +#define SZ_V1HDR 2048 + +/* Offsets into header (in sizeof(int) units) for various parameters */ +#define IM_V1PIXTYPE 4 /* datatype of the pixels */ +#define IM_V1NDIM 5 /* number of dimensions */ +#define IM_V1LEN 6 /* image dimensions */ +#define IM_V1PHYSLEN 13 /* physical length (as stored) */ +#define IM_V1PIXOFF 22 /* offset of the pixels */ +#define IM_V1PIXFILE 103 /* name of pixel storage file */ +#define IM_V1TITLE 183 /* title of image */ + +/* Image header parmeters. */ +#define SZ_V2PIXFILE 255 +#define SZ_V2TITLE 383 +#define SZ_V2HDR 1024 + +/* Offsets into header (in sizeof(int) units) for various parameters */ +#define IM_V2PIXTYPE 10 /* datatype of the pixels */ +#define IM_V2SWAPPED 14 /* number of dimensions */ +#define IM_V2NDIM 18 /* number of dimensions */ +#define IM_V2LEN 22 /* image dimensions */ +#define IM_V2PHYSLEN 50 /* physical length (as stored) */ +#define IM_V2PIXOFF 86 /* offset of the pixels */ +#define IM_V2PIXFILE 126 /* name of pixel storage file */ +#define IM_V2TITLE 638 /* title of image */ + +/* IRAF dataype codes */ +#define TY_CHAR 2 +#define TY_SHORT 3 +#define TY_INT 4 +#define TY_LONG 5 +#define TY_REAL 6 +#define TY_DOUBLE 7 +#define TY_USHORT 11 +#define TY_UCHAR 12 + +#ifdef __STDC__ +#include <stddef.h> +#include <stdlib.h> +#endif + +#undef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) + +extern int cdl_debug; + + +#ifdef ANSI_FUNC + +static char *cdl_getIRAFPixels(char *fname, int band, uchar **image, int *nx, int *ny, int *bitpix, char *title); +static int cdl_readImageHdr(char *fname, int *version, int *px, int *py, int *nx, int *ny, int *nbands, int *ptype, int *offset, int *swapped, char *pfile, char *title); +static int cdl_getVersion(FILE *fd); +static void cdl_getPixfile(char *fname, char *pfile); +static int cdl_setBitpix(int ptype, int *pix_size, int *bitpix); +static void cdl_swapPixels(int swapped, int nx, int ny, int ptype, uchar **image); +static void cdl_strpak(char *in, char *out, int len); +static void bswap2(char *a, char *b, int nbytes); +static void bswap4(char *a, int aoff, char *b, int boff, int nbytes); +static void bswap8(char *a, int aoff, char *b, int boff, int nbytes); +static int is_swapped_machine(void); + +#else + +static char *cdl_getIRAFPixels(); +static void cdl_getPixfile(), cdl_strpak(); +static void bswap2(), bswap4(), bswap8(); +static void cdl_swapPixels (); +static int cdl_readImageHdr(), cdl_setBitpix(); +static int cdl_getVersion(); +static int is_swapped_machine(); + +#endif + + + +/* CDL_DISPLAYIRAF -- Display an IRAF OIF format image to the given frame, + * optionally doing a Zscale transform of the image pixels. + */ + +#ifdef ANSI_FUNC + +int +cdl_displayIRAF ( + CDLPtr cdl, /* package ptr */ + char *fname, /* image name */ + int band, /* image band if 3-d */ + int frame, /* display frame */ + int fbconfig, /* frame buffer config */ + int zscale /* do zscale of image? */ +) +#else + +int +cdl_displayIRAF (cdl, fname, band, frame, fbconfig, zscale) +CDLPtr cdl; /* package ptr */ +char *fname; /* image name */ +int band; /* image band if 3-d */ +int frame; /* display frame */ +int fbconfig; /* frame buffer config */ +int zscale; /* do zscale of image? */ +#endif +{ + char title[128]; + int status, nx, ny, bitpix; + uchar *pix = NULL; + float z1 = 0.0, z2 = 0.0; + + + /* See if this is a valid IRAF file. */ + if (!cdl_isIRAF (fname)) { + fprintf (stderr, "%s: not a valid IRAF file or doesn't exist.\n", + fname); + return (ERR); + } + + /* Get the raw IRAF image pixels. */ + if (cdl_readIRAF (fname, band, &pix, &nx, &ny, &bitpix, title)) + return (ERR); + + if (cdl_debug) { + printf("[cdl_displayIRAF] '%s[%d] frame=%d zscale=%d\n", + fname, band, frame, zscale); + printf("[cdl_displayIRAF] %dx%d bitpix=%d pixels z1=%g z2=%g\n", + nx, ny, bitpix, z1, z2); + } + + (void) cdl_setTitle (cdl, title); + (void) cdl_setName (cdl, fname); + status = cdl_displayPix (cdl, pix, nx, ny, bitpix, frame, fbconfig, + zscale); + free ((char *) pix); + return (status); +} + + +/* CDL_ISIRAF -- Test a file to see if it is a IRAF file. We check for both + * V1 and V2 header magic numbers and return the appropriate version if found. + */ + +#ifdef ANSI_FUNC + +int +cdl_isIRAF ( + char *fname /* input filename */ +) +#else + +int +cdl_isIRAF (fname) +char *fname; /* input filename */ +#endif +{ + register FILE *fp; + int value = 0; + char magic[24]; + + if ((fp = fopen (fname, "r"))) { + fread (magic, sizeof (char), 12, fp); + fclose (fp); + + /* See if this is a valid OIF header file. */ + if (strncmp(magic, "imhv2", 5) == 0) + value = 2; + else { + cdl_strpak (magic, magic, 5); + if (strncmp(magic, "imhdr", 5) == 0) + value = 1; + } + } + + return value; +} + + +/* CDL_READIRAF -- Read the pixels from an IRAF OIF format image, returning + * the pixel array, dimensions, and image type. + */ + +#ifdef ANSI_FUNC + +int +cdl_readIRAF ( + char *fname, /* image name */ + int band, /* image band if 3-d */ + uchar **pix, /* pixel array (output) */ + int *nx, + int *ny, /* dimensions (output) */ + int *bitpix, /* pixel size (output) */ + char *title /* image title */ +) +#else + +int +cdl_readIRAF (fname, band, pix, nx, ny, bitpix, title) +char *fname; /* image name */ +int band; /* image band if 3-d */ +uchar **pix; /* pixel array (output) */ +int *nx, *ny; /* dimensions (output) */ +int *bitpix; /* pixel size (output) */ +char *title; /* image title */ +#endif +{ + char *errstr; + char *cdl_getIRAFPixels(); + + /* See if this is a valid IRAF file. */ + if (!cdl_isIRAF (fname)) { + fprintf (stderr, "%s: not a valid IRAF file or doesn't exist.\n", + fname); + return (ERR); + } + + if ((errstr=cdl_getIRAFPixels(fname,band,pix,nx,ny,bitpix,title))) { + fprintf (stderr, "%s\n", errstr); + return (ERR); + } + + if (cdl_debug) + printf ("[cdl_readIRAF] '%s[%d]' nx=%d ny=%d bitpix=%d\n", + fname, band, *nx, *ny, *bitpix); + + return (OK); +} + + + +/* ------------------ + * Private routines. + * ------------------*/ + +/* CDL_GETIRAFPIXELS -- Given an IRAF filename return a pointer to the pixel + * array and the image dimensions. + */ + +#ifdef ANSI_FUNC + +static char * +cdl_getIRAFPixels ( + char *fname, /* input filename */ + int band, /* image band */ + uchar **image, /* output pixels */ + int *nx, + int *ny, /* dimensions */ + int *bitpix, /* pixel size */ + char *title /* image title */ +) +#else + +static char * +cdl_getIRAFPixels (fname, band, image, nx, ny, bitpix, title) +char *fname; /* input filename */ +int band; /* image band */ +uchar **image; /* output pixels */ +int *nx, *ny; /* dimensions */ +int *bitpix; /* pixel size */ +char *title; /* image title */ +#endif +{ + register int i; + int npix, px, py, nbands, pix_size, version, swapped = 0; + FILE *pf; + char *line, pixfile[256]; + int ptype, offset; + + + /* Read the image header params */ + if (cdl_readImageHdr (fname, &version, &px, &py, nx, ny, &nbands, + &ptype, &offset, &swapped, pixfile, title) == ERR) + return "error reading image header"; + + /* Do some simple error checking. */ + if (band > nbands) + return "Invalid band request."; + if (access (pixfile, R_OK) != 0) + return "Cannot access pixel file"; + + /* Open the pixel file and seek to the beginning of the data. */ + if ((pf = fopen (pixfile, "r")) == NULL) + return "Cannot open pixel file."; + + npix = (*nx) * (*ny); + if (cdl_setBitpix (ptype, &pix_size, bitpix) == ERR) { + fclose (pf); + return "Invalid pixel type in image"; + } + + /* Now suck up the pixels. */ + *image = (uchar *) malloc (npix * pix_size); + offset += (band - 1) * (px * py) * pix_size; + lseek (fileno(pf), (off_t)offset, SEEK_SET); + + if (*nx == px) + fread ((void *)*image, pix_size, npix, pf); + else { + line = (char *) malloc (px * pix_size); + for (i=0; i < (*ny); i++) { + fread (line, pix_size, px, pf); + bcopy (line, &((*image)[i*(*nx)*pix_size]), (*nx)*pix_size); + } + free ((char *)line); + } + + /* See if we need to swap the bytes. */ + if (version == 2) + cdl_swapPixels (swapped, *nx, *ny, ptype, image); + + fclose (pf); + return NULL; +} + + +/* CDL_READIMAGEHDR -- Read the image header information. + */ + +#ifdef ANSI_FUNC + +static int +cdl_readImageHdr ( + char *fname, /* image name */ + int *version, /* OIF version number */ + int *px, + int *py, /* physical storage dims */ + int *nx, + int *ny, + int *nbands, /* image dims */ + int *ptype, /* pixel type */ + int *offset, /* offset to pixels */ + int *swapped, /* byte-swapped pixels */ + char *pfile, /* pixfile pathname */ + char *title /* image title */ +) +#else + +static int +cdl_readImageHdr (fname, version, px, py, nx, ny, nbands, ptype, offset, + swapped, pfile, title) +char *fname; /* image name */ +int *version; /* OIF version number */ +int *px, *py; /* physical storage dims */ +int *nx, *ny, *nbands; /* image dims */ +int *ptype; /* pixel type */ +int *offset; /* offset to pixels */ +int *swapped; /* byte-swapped pixels */ +char *pfile; /* pixfile pathname */ +char *title; /* image title */ +#endif +{ + FILE *hdr; + + if ((hdr = fopen (fname, "r")) == NULL) + return (ERR); + + *version = cdl_getVersion (hdr); + if (*version == VERSION_1) { + int header_v1[SZ_V1HDR]; + char pixfile_v1[SZ_V1PIXFILE]; + + /* Read in the image header. */ + fread ((void *)header_v1, sizeof (char), SZ_V1HDR, hdr); + + /* Get the interesting stuff. */ + *px = header_v1[IM_V1PHYSLEN]; + *py = header_v1[IM_V1PHYSLEN+1]; + *nx = header_v1[IM_V1LEN]; + *ny = header_v1[IM_V1LEN+1]; + *ptype = header_v1[IM_V1PIXTYPE]; + *offset = (header_v1[IM_V1PIXOFF] - 1) * sizeof(short); + *nbands = header_v1[IM_V1LEN+2]; + *swapped = 0; + + /* Find the pixfile and see if it exists. */ + cdl_strpak ((char *)&header_v1[IM_V1PIXFILE], pixfile_v1, + SZ_V1PIXFILE); + cdl_getPixfile (fname, pixfile_v1); + (void) strcpy (pfile, pixfile_v1); + + /* Find the image title string */ + if (title == (char *)NULL) + title = (char *) malloc (SZ_V1TITLE+1); + cdl_strpak ((char *)&header_v1[IM_V1TITLE], title, SZ_V1TITLE); + + } else if (*version == VERSION_2) { + char header_v2[SZ_V2HDR], *tp; + char pixfile_v2[SZ_V2PIXFILE]; + + /* Read in the image header. */ + fread (header_v2, sizeof (char), SZ_V2HDR, hdr); + + /* Get the interesting stuff. */ + + if (is_swapped_machine()) + bswap4 (&header_v2[IM_V2SWAPPED], 1, (char *)swapped, + 1, sizeof(int)); + else + bcopy ((char *)&header_v2[IM_V2SWAPPED], (char *)swapped, + sizeof(int)); + + if (is_swapped_machine()) { + bswap4 (&header_v2[IM_V2PHYSLEN], 1, (char *)px, 1, + sizeof(int)); + bswap4 (&header_v2[IM_V2PHYSLEN+sizeof(int)], 1, + (char *)py, 1, sizeof(int)); + bswap4 (&header_v2[IM_V2LEN], 1, (char *)nx, 1, + sizeof(int)); + bswap4 (&header_v2[IM_V2LEN+sizeof(int)], 1, (char *)ny, + 1, sizeof(int)); + bswap4 (&header_v2[IM_V2PIXTYPE], 1, (char *)ptype, 1, + sizeof(int)); + bswap4 (&header_v2[IM_V2PIXOFF], 1, (char *)offset, 1, + sizeof(int)); + bswap4 (&header_v2[IM_V2LEN+(2*sizeof(int))], 1, + (char *)nbands, 1, sizeof(int)); + } else { + bcopy ((char *)&header_v2[IM_V2PHYSLEN], px, sizeof(int)); + bcopy ((char *)&header_v2[IM_V2PHYSLEN+sizeof(int)], py, + sizeof(int)); + bcopy ((char *)&header_v2[IM_V2LEN], nx, sizeof(int)); + bcopy ((char *)&header_v2[IM_V2LEN+sizeof(int)], ny, + sizeof(int)); + bcopy ((char *)&header_v2[IM_V2PIXTYPE], ptype, sizeof(int)); + bcopy ((char *)&header_v2[IM_V2PIXOFF], offset, sizeof(int)); + bcopy ((char *)&header_v2[IM_V2LEN+(2*sizeof(int))], nbands, + sizeof(int)); + } + *offset = (*offset - 1) * sizeof(short); + + /* Find the pixfile and see if it exists. */ + bcopy ((char *)&header_v2[IM_V2PIXFILE], pixfile_v2, SZ_V2PIXFILE); + cdl_getPixfile (fname, pixfile_v2); + (void) strcpy (pfile, pixfile_v2); + + /* Find the image title string */ + tp = (char *)&header_v2[IM_V2TITLE]; + if (title == (char *)NULL) + title = (char *) malloc (SZ_V2TITLE+1); + strcpy (title, (char *)tp); + } + + if (cdl_debug) { + printf("[cdl_readImageHdr] px,py=%d,%d nx,ny,nb=%d,%d,%d\n\t", + *px, *py, *nx, *ny, *nbands); + printf("ptype=%d offset=%d swap=%d pixfile='%s' title='%s'\n", + *ptype, *offset, swapped, pfile, title); + } + + fclose (hdr); /* we're done with the header */ + return (OK); +} + + +/* CDL_GETVERSION -- Return image header version. + */ + +#ifdef ANSI_FUNC + +static int +cdl_getVersion ( + FILE *fd /* input filename */ +) +#else + +static int +cdl_getVersion (fd) +FILE *fd; /* input filename */ +#endif +{ + int value = 0; + char magic[24]; + + rewind (fd); + fread (magic, sizeof (char), 12, fd); + rewind (fd); + + /* See if this is a valid OIF header file. */ + if (strncmp(magic, "imhv2", 5) == 0) + value = 2; + else { + cdl_strpak (magic, magic, 5); + if (strncmp(magic, "imhdr", 5) == 0) + value = 1; + } + return value; +} + + +/* CDL_GETPIXFILE -- Get the pixelfile pathname. + */ + +#ifdef ANSI_FUNC + +static void +cdl_getPixfile (char *fname, char *pfile) +#else + +static void +cdl_getPixfile (fname, pfile) +char *fname; +char *pfile; +#endif +{ + char temp[SZ_V1PIXFILE], *ip; + int len; + char *index(); + + if (strncmp (pfile, "HDR$", 4) == 0) { + /* Handle the special case of a HDR$ pixfile path, prepend the + * current working directory name to the pixfile. + */ + ip = pfile + 4; + (void) strncpy (temp, ip, SZ_V1PIXFILE); + (void) strncpy (pfile, fname, SZ_V1PIXFILE); + + /* Find the end of the pathname. */ + len = strlen (pfile); + while ( (len > 0) && (pfile[len-1] != '/') ) + len--; + + /* Add the image name. */ + pfile[len] = '\0'; + (void) strncat (pfile, temp, SZ_V1PIXFILE); + + } else if (index (pfile, '!') != NULL) { + /* Strip out the leading node! prefix from the pixfile path. */ + for (ip = pfile; *ip != '!' ; ) + ip++; + (void) strcpy (pfile, ++ip); + } +} + + +/* CDL_SETBITPIX -- Set the number of pixels for a given pixel type. + */ + +#ifdef ANSI_FUNC + +static int +cdl_setBitpix (int ptype, int *pix_size, int *bitpix) +#else + +static int +cdl_setBitpix (ptype, pix_size, bitpix) +int ptype; +int *pix_size; +int *bitpix; +#endif +{ + switch (ptype) { + case TY_USHORT: + case TY_SHORT: + *pix_size = sizeof (short); + *bitpix = 16; + break; + case TY_INT: + *pix_size = sizeof (int); + *bitpix = 32; + break; + case TY_LONG: + *pix_size = sizeof (long); + *bitpix = 32; + break; + case TY_REAL: + *pix_size = sizeof (float); + *bitpix = -32; + break; + case TY_DOUBLE: + *pix_size = sizeof (double); + *bitpix = -64; + break; + default: + return (ERR); + } + return (OK); +} + + +/* CDL_SWAPPIXELS -- Byte swap pixels if necessary. + */ + +#ifdef ANSI_FUNC + +static void +cdl_swapPixels (int swapped, int nx, int ny, int ptype, uchar **image) +#else + +static void +cdl_swapPixels (swapped, nx, ny, ptype, image) +int swapped; +int nx, ny; +int ptype; +uchar **image; +#endif +{ + if ((swapped != is_swapped_machine())) { + switch (ptype) { + case TY_USHORT: + case TY_SHORT: + bswap2 ((char *)*image, (char *)*image, + nx * ny * sizeof(short)); + break; + case TY_INT: + case TY_LONG: + bswap4 ((char *)*image, 1, (char *)*image, 1, + nx * ny * sizeof(int)); + break; + case TY_REAL: + bswap4 ((char *)*image, 1, (char *)*image, 1, + nx * ny * sizeof(float)); + break; + case TY_DOUBLE: + bswap8 ((char *)*image, 1, (char *)*image, 1, + nx * ny * sizeof(double)); + break; + } + } +} + + +/* CDL_STRPAK -- Convert ASCII string from SPP char per short to C char + * per byte. + */ + +#ifdef ANSI_FUNC + +static void +cdl_strpak (char *in, char *out, int len) +#else + +static void +cdl_strpak (in, out, len) +char *in, *out; +int len; +#endif +{ + int i, j; + + /* Adaptive byte selection (whichever byte order) chars alternate + * with \0. + */ + j = (in[0] == '\0' ? 1 : 0); + + for (i = 0; i < len; i++, j += 2) + out[i] = in[j]; + out[i] = '\0'; +} + + +/* BSWAP2 - Move bytes from array "a" to array "b", swapping successive + * pairs of bytes. The two arrays may be the same but may not be offset + * and overlapping. + */ + +#ifdef ANSI_FUNC + +static void +bswap2 ( + char *a, + char *b, /* input array */ + int nbytes /* number of bytes to swap */ +) +#else + +static void +bswap2 (a, b, nbytes) +char *a, *b; /* input array */ +int nbytes; /* number of bytes to swap */ +#endif +{ + register char *ip=a, *op=b, *otop; + register unsigned temp; + + /* Swap successive pairs of bytes. + */ + for (otop = op + (nbytes & ~1); op < otop; ) { + temp = *ip++; + *op++ = *ip++; + *op++ = temp; + } + + /* If there is an odd byte left, move it to the output array. + */ + if (nbytes & 1) + *op = *ip; +} + + +/* BSWAP4 - Move bytes from array "a" to array "b", swapping the four bytes + * in each successive 4 byte group, i.e., 12345678 becomes 43218765. + * The input and output arrays may be the same but may not partially overlap. + */ + +#ifdef ANSI_FUNC + +static void +bswap4 ( + char *a, /* input array */ + int aoff, /* first byte in input array */ + char *b, /* output array */ + int boff, /* first byte in output array */ + int nbytes /* number of bytes to swap */ +) +#else + +static void +bswap4 (a, aoff, b, boff, nbytes) +char *a; /* input array */ +int aoff; /* first byte in input array */ +char *b; /* output array */ +int boff; /* first byte in output array */ +int nbytes; /* number of bytes to swap */ +#endif +{ + register char *ip, *op, *tp; + register int n; + static char temp[4]; + + tp = temp; + ip = (char *)a + aoff - 1; + op = (char *)b + boff - 1; + + /* Swap successive four byte groups. + */ + for (n = nbytes >> 2; --n >= 0; ) { + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + } + + /* If there are any odd bytes left, move them to the output array. + * Do not bother to swap as it is unclear how to swap a partial + * group, and really incorrect if the data is not modulus 4. + */ + for (n = nbytes & 03; --n >= 0; ) + *op++ = *ip++; +} + + +/* BSWAP8 - Move bytes from array "a" to array "b", swapping the eight bytes + * in each successive 8 byte group, i.e., 12345678 becomes 87654321. + * The input and output arrays may be the same but may not partially overlap. + */ +#ifdef ANSI_FUNC + +static void +bswap8 ( + char *a, /* input array */ + int aoff, /* first byte in input array */ + char *b, /* output array */ + int boff, /* first byte in output array */ + int nbytes /* number of bytes to swap */ +) +#else + +static void +bswap8 (a, aoff, b, boff, nbytes) +char *a; /* input array */ +int aoff; /* first byte in input array */ +char *b; /* output array */ +int boff; /* first byte in output array */ +int nbytes; /* number of bytes to swap */ +#endif +{ + register char *ip, *op, *tp; + register int n; + static char temp[8]; + + tp = temp; + ip = (char *)a + aoff - 1; + op = (char *)b + boff - 1; + + /* Swap successive eight byte groups. + */ + for (n = nbytes >> 3; --n >= 0; ) { + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *tp++ = *ip++; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + *op++ = *--tp; + } + + /* If there are any odd bytes left, move them to the output array. + * Do not bother to swap as it is unclear how to swap a partial + * group, and really incorrect if the data is not modulus 8. + */ + for (n = nbytes & 03; --n >= 0; ) + *op++ = *ip++; +} + + +#ifdef ANSI_FUNC + +static int +is_swapped_machine (void) +#else + +static int +is_swapped_machine () +#endif +{ + union { char ch[4]; int i; } u; + u.i = 1; + return (u.ch[0]); +} diff --git a/vendor/x11iraf/cdl/cdlmark.c b/vendor/x11iraf/cdl/cdlmark.c new file mode 100644 index 00000000..16a06965 --- /dev/null +++ b/vendor/x11iraf/cdl/cdlmark.c @@ -0,0 +1,3861 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <math.h> +#define CDL_NEED_LINESTYLES +#define CDL_LIBRARY_SOURCE +#include "cdl.h" +#include "cdlfont.h" + +/* + * CDL Marker Procedures -- Procedures for doing overlay graphics. + * + * cdl_mapFrame (cdl, frame) + * cdl_markCoordsFile (cdl, fname, type, size, color, label) + * cdl_markPoint (cdl, x, y, number, size, type, color) + * cdl_markPointLabel (cdl, x, y, label, size, type, color) + * cdl_markLine (cdl, xs, ys, xe, ye, color) + * cdl_markBox (cdl, lx, ly, ux, uy, fill, color) + * cdl_markPolyline (cdl, xpts, ypts, npts, color) + * cdl_markPolygon (cdl, xpts, ypts, npts, fill, color) + * cdl_markCircle (cdl, x, y, radius, fill, color) + * cdl_markCircAnnuli (cdl, x, y, radius, nannuli, sep, color) + * cdl_markEllipse (cdl, x, y, xrad, yrad, ang, fill, color) + * cdl_markEllipAnnuli (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) + * cdl_markText (cdl, x, y, str, size, angle, color) + * + * cdl_setFont (cdl, font) + * cdl_setTextWidth (cdl, width) + * cdl_setLineWidth (cdl, width) + * cdl_setLineStyle (cdl, style) + * + * cdl_deleteMark (cdl, x, y) + * cdl_clearOverlay (cdl) + * cdl_redrawOverlay (cdl) + * + * cdl_beginDList (frame) Not Yet Implemented + * cdl_clearDList (frame) Not Yet Implemented + * cdl_drawDList (frame) Not Yet Implemented + * cdl_endDList (frame, flush) Not Yet Implemented + */ + +/* Function prototypes */ +#ifdef __STDC__ +#include <stddef.h> +#endif + +#ifdef ANSI_FUNC + +static int cdl_getPixRegion(CDLPtr cdl, int lx, int ly, int nx, int ny, uchar *ras); +static void cdl_doPointMark(int color, int type, uchar *pix, int sz); +static void cdl_doLineMark(int color, int width, int style, uchar *pix, int xs, int ys, int xe, int ye); +static void cdl_doBoxMark(int color, int width, int style, int fill, uchar *pix, int lx, int ly, int nx, int ny); +static void cdl_doPolygonMark(int color, int width, int style, int fill, int *x, int *y, int npts, uchar *pix, int lx, int ly, int nx, int ny, int close); +static void cdl_doCircleMark(int x, int y, int radius, int color, int width, int style, int fill, uchar *pix, int lx, int ly, int nx, int ny); +static void cdl_doCircAnnuliMark(int x, int y, int radius, int nannuli, int sep, int color, int width, int style, uchar *pix, int lx, int ly, int nx, int ny); +static void cdl_doEllipseMark(int color, int width, int style, int fill, int xc, int yc, int xrad, int yrad, float ang, uchar *pix, int lx, int ly, int nx, int ny); +static void cdl_doEllipAnnuliMark(int x, int y, int xrad, int yrad, float ang, int nannuli, int sep, int color, int width, int style, uchar *pix, int lx, int ly, int nx, int ny); +int cdl_doTextMarker(int x, int y, char *string, float size, float angle, int color, int width, int font, uchar *pix, int lx, int ly, int nx, int ny); +int cdl_freeDisplayList(CDLPtr cdl, MarkerPtr head); +static void cdl_insertMarker(CDLPtr cdl, MarkerPtr back, MarkerPtr new); +static void cdl_removeMarker(CDLPtr cdl, MarkerPtr mk); +static MarkerPtr cdl_findNearest(MarkerPtr head, int x, int y); +static void cdl_printDisplayList(FILE *fd, MarkerPtr head); +static MarkerPtr cdl_initPointMarker(int x, int y, int number, int size, int type, int color); +static MarkerPtr cdl_initPointLabelMarker(int x, int y, char *label, int size, int type, int color, int font); +static MarkerPtr cdl_initLineMarker(int x1, int y1, int x2, int y2, int color, int width, int style); +static MarkerPtr cdl_initBoxMarker(int lx, int ly, int ux, int uy, int fill, int color, int width, int style); +static MarkerPtr cdl_initPolylineMarker(int *x, int *y, int npts, int color, int width, int style); +static MarkerPtr cdl_initPolygonMarker(int *x, int *y, int npts, int fill, int color, int width, int style); +static MarkerPtr cdl_initCircleMarker(int x, int y, int radius, int fill, int color, int width, int style); +static MarkerPtr cdl_initCircAnnMarker(int x, int y, int radius, int nannuli, int sep, int color, int width, int style); +static MarkerPtr cdl_initEllipseMarker(int x, int y, int xrad, int yrad, float ang, int fill, int color, int width, int style); +static MarkerPtr cdl_initEllAnnMarker(int x, int y, int xrad, int yrad, float ang, int nannuli, int sep, int color, int width, int style); +static MarkerPtr cdl_initTextMarker(int x, int y, char *string, float size, int color, int font, int width); +static void cdl_initMarkPos(MarkerPtr mk, int nx, int ny, int lx, int ly); +static void cdl_doLineInSubRas(uchar *pix, int color, int width, int style, int x1, int x2, int y1, int y2, int lx, int ly, int nx, int ny); +static void cdl_doDashedLine(uchar *pix, int color, int width, int style, int *x, int *y, int np, int lx, int ly, int nx, int ny); +static void cdl_drawThickVector (uchar *pix, int color, int width, int style, int x1, int x2, int y1, int y2, int lx, int ly, int nx, int ny); +static void cdl_drawVector(uchar *pix, int color, int x1, int x2, int y1, int y2, int lx, int ly, int nx, int ny); +static void cdl_drawThickDashVec (uchar *pix, int color, int width, int style, int x1, int x2, int y1, int y2, int lx, int ly, int nx, int ny); +static void cdl_drawDashVec(uchar *pix, int color, int style, int x1, int x2, int y1, int y2, int lx, int ly, int nx, int ny); +static uchar cdl_setpixel(uchar pix, int style, int color); +static void cdl_fillArea(uchar *pix, int nx, int ny, int color); +static void cdl_getCircleCoords(int xcen, int ycen, int radius, int *x, int *y, int npts); +static void cdl_getEllipseCoords(int xcen, int ycen, int xradius, int yradius, float rotang, int *x, int *y); +static void cdl_minmax(int *array, int npts, int *amin, int *amax); +static int cdl_strlen(char *str, float size, int font); +static int bitupk(unsigned int wordp, int offset, int nbits); + +#else + +int cdl_freeDisplayList(); +void cdl_setFont(), cdl_setLineWidth(), cdl_setLineStyle(); +void cdl_beginDList(), cdl_drawDList(); +void cdl_clearDList(), cdl_endDList(), cdl_setTextWidth(); + +static int cdl_getPixRegion(); +static uchar cdl_setpixel(); +static void cdl_insertMarker(), cdl_removeMarker(); +static void cdl_doLineInSubRas(), cdl_drawThickVector(), cdl_drawVector(); +static void cdl_doPointMark(), cdl_doLineMark(), cdl_doBoxMark(); +static void cdl_doPolygonMark(), cdl_doCircleMark(), cdl_doCircAnnuliMark(); +static void cdl_doEllipseMark(), cdl_doEllipAnnuliMark(); +static void cdl_getCircleCoords(), cdl_getEllipseCoords(); +static void cdl_printDisplayList(), cdl_initMarkPos(); +static void cdl_fillArea(), cdl_minmax(), cdl_doDashedLine(); +static void cdl_drawThickDashVec(), cdl_drawDashVec(); + +static int cdl_strlen(), bitupk(); + +static MarkerPtr cdl_initPointMarker(), cdl_initLineMarker(); +static MarkerPtr cdl_initBoxMarker(), cdl_initPolylineMarker(); +static MarkerPtr cdl_initPolygonMarker(), cdl_initCircleMarker(); +static MarkerPtr cdl_initCircAnnMarker(), cdl_initEllipseMarker(); +static MarkerPtr cdl_initEllAnnMarker(), cdl_findNearest(); +static MarkerPtr cdl_initTextMarker(), cdl_initPointLabelMarker(); + +#endif + + +/* Display list declarations. We keep a separate list for each frame that + * is freed whenever a new image is displayed. The list is maintained as + * a doubly-linked list of Marker structs. + */ +MarkerPtr DLHead[MAX_FRAMES]; /* diplay list head */ +MarkerPtr DLTail[MAX_FRAMES]; /* diplay list tail */ +int DLFlag[] = { /* display list flags. */ + 0, 0, 0, 0, /* If set we're doing */ + 0, 0, 0, 0 /* markers in memory */ + }; +uchar *DLFBPix[MAX_FRAMES]; /* frame buffer pixels */ + + +/* absolute value of a */ +#define ABS(a) (((a)<0) ? -(a) : (a)) + +/* take binary sign of a, either -1, or 1 if >= 0 */ +#define SGN(a) (((a)<0) ? -1 : 1) + +#define N_CIRCLE_PTS 48 /* no. of points defining unit circle */ +#define N_ELLIPSE_PTS 64 /* no. of points defining unit ellipse */ +#define FONT_SCALE 0.36 /* default text font scale */ +#define FONT_SPACE 4 /* default text font spacing */ + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +extern int cdl_debug; + + + +/* CDL_MAPFRAME -- Map the current frame buffer as an image for overlay. + * This routine is a bit of a hack since we're trying to make some guesses + * about what the server has displayed, there's no way to actually query it. + * We assume the fbconfig has already been reset if it's not the default, + * and we assume the WCS defined is for a single image centered in the frame. + */ + +#ifdef ANSI_FUNC + +int +cdl_mapFrame ( + CDLPtr cdl, /* package ptr */ +int frame /* fb frame to map */ +) +#else + +int +cdl_mapFrame (cdl, frame) +CDLPtr cdl; /* package ptr */ +int frame; /* fb frame to map */ +#endif +{ + int xo, yo; + float a, b, c, d, tx, ty, z1, z2; + int zt; + char *name = NULL, *title = NULL; + + name = (char *) malloc (SZ_NAME); + title = (char *) malloc (SZ_NAME); + + /* Select the requested frame. */ + cdl_setFrame (cdl, frame); + + /* Get/Set the current WCS. */ + (void) cdl_getWCS (cdl, name, title, &a, &b, &c, &d, &tx, &ty, + &z1, &z2, &zt); + + /* If no WCS is defined for the frame make up a default. */ + if ((a+b+c+d+tx+ty+z1+z2+zt) == 0.0) { + a = 1.0; + b = 0.0; + c = 0.0; + d = -1.0; + tx = 1.0; + ty = (float) cdl->fbheight; + z1 = 0.0; + z2 = 255.0; + zt = CDL_LINEAR; + } + (void) cdl_setWCS (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt); + + /* Reset the image corners, assume image is centered in the frame. */ + xo = - cdl->tx + 1; + yo = cdl->fbheight - cdl->ty; + cdl->imd->xs = xo; + cdl->imd->ys = yo; + cdl->imd->xe = cdl->fbwidth - xo + 1; + cdl->imd->ye = cdl->fbheight - yo + 1; + + free (name); + free (title); + return (OK); +} + + +/* CDL_MARKPOINT -- Draw a mark on the display at the given point. Marks + * be specified as either a '+', 'x', or '*'. If the number argument is + * positive that value will be drawn next to the mark as a label string. + */ + +#ifdef ANSI_FUNC + +int +cdl_markPoint ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* marker position */ + int number, /* if > 0, label value */ + int size, /* marker size (pixels) */ + int type, /* type to draw */ + int color /* marker color */ +) +#else + +int +cdl_markPoint (cdl, x, y, number, size, type, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* marker position */ +int number; /* if > 0, label value */ +int size; /* marker size (pixels) */ +int type; /* type to draw */ +int color; /* marker color */ +#endif +{ + register int lx, ly, sz; + uchar *pix = NULL; + MarkerPtr mk = cdl_initPointMarker (x, y, number, size, type, color); + + if (cdl_debug) + printf ("[cdl_markPoint] (%dx%d) num=%d size=%d type=%d color=%d\n", + x, y, number, size, type, color); + + sz = (size % 2 ? size : size + 1); + sz = max (sz, 3); + lx = x - (sz / 2); + ly = y - (sz / 2); + cdl_initMarkPos (mk, sz, sz, lx, ly); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (sz * sz); + if (cdl_getPixRegion (cdl, lx, ly, sz, sz, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (sz * sz); + mk->markpix = (uchar *) malloc (sz * sz); + bcopy (pix, mk->refpix, sz * sz); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doPointMark (color, type, pix, sz); + bcopy (pix, mk->markpix, sz * sz); + + /* Number the point if requested. */ + if (number > 0) { + char lab[64]; + int cx, cy, llen; + + sprintf (lab, "%d", number); + llen = strlen(lab) * (CHARACTER_WIDTH * FONT_SCALE) + strlen(lab); + + /* Position the label so it isn't clipped. + */ + cx = x + (sz / 2) - 1; + cy = y + (sz / 2) - 1; + if ((cx + llen) > cdl->im_nx) cx = x - llen + 1; + if ((cy + llen) > cdl->im_ny) cy = y - llen + 1; + cdl_markText (cdl, cx, cy, lab, 1., 0.0, color); + } + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, sz, sz, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKPOINTLABEL -- Draw a mark on the display at the given point. + * Marks be specified as either a '+', 'x', or '*'. If the number argument + * is positive that value will be drawn next to the mark as a label string. + */ + +#ifdef ANSI_FUNC + +int +cdl_markPointLabel ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* marker position */ + char *label, /* point label str */ + int size, /* marker size (pixels) */ + int type, /* type to draw */ + int color /* marker color */ +) +#else + +int +cdl_markPointLabel (cdl, x, y, label, size, type, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* marker position */ +char *label; /* point label str */ +int size; /* marker size (pixels) */ +int type; /* type to draw */ +int color; /* marker color */ +#endif +{ + register int lx, ly, sz; + uchar *pix = NULL; + MarkerPtr mk = cdl_initPointLabelMarker(x,y, label, size, type, + color, cdl->font); + + if (cdl_debug) + printf("[cdl_pointLabel] (%dx%d) lab=%s size=%d type=%d color=%d\n", + x, y, label, size, type, color); + + sz = (size % 2 ? size : size + 1); + sz = max (sz, 3); + lx = x - (sz / 2); + ly = y - (sz / 2); + cdl_initMarkPos (mk, sz, sz, lx, ly); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (sz * sz); + if (cdl_getPixRegion (cdl, lx, ly, sz, sz, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (sz * sz); + mk->markpix = (uchar *) malloc (sz * sz); + bcopy (pix, mk->refpix, sz * sz); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doPointMark (color, type, pix, sz); + bcopy (pix, mk->markpix, sz * sz); + + /* Number the point if requested. */ + if (label) { + int cx, cy, llen; + + llen = cdl_strlen (label, mk->txsize, mk->font); + + /* Position the label so it isn't clipped. */ + cx = x + (sz / 2) - 1; + cy = y + (sz / 2) - 1; + if ((cx + llen) > cdl->im_nx) cx = x - llen + 1; + if ((cy + llen) > cdl->im_ny) cy = y - llen + 1; + cdl_markText (cdl, cx, cy, label, 1., 0.0, color); + } + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, sz, sz, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKLIST -- Given a filename of (x,y) and possibly label strings + * mark all points on the display with a point marker of the given type, + * size and color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markCoordsFile ( + CDLPtr cdl, /* package ptr */ + char *fname, /* file name */ + int type, /* marker type */ + int size, /* marker size */ + int color, /* marker color */ + int label /* label? */ +) +#else + +int +cdl_markCoordsFile (cdl, fname, type, size, color, label) +CDLPtr cdl; /* package ptr */ +char *fname; /* file name */ +int type; /* marker type */ +int size; /* marker size */ +int color; /* marker color */ +int label; /* label? */ +#endif +{ + if (fname == (char *)NULL) + return (ERR); + + /* If a coordinate file was specified read the file and mark those + * coords with points of the specified size, type and color. + */ + if (access (fname, F_OK) == 0) { + FILE *fp; + float rx, ry; + int i, x, y; + + if ((fp = fopen (fname, "r"))) { + /* The coord file is assumed to be simply a file containing + * (x,y) pairs, one per line. Scan the file and mark each + * point. We do no bounds checking to see if the coords + * are correct for the frame. + */ + i = 1; + while (fscanf (fp, "%g %g", &rx, &ry) != EOF) { + x = (int) (rx + 0.5); + y = (int) (ry + 0.5); + if (label) + cdl_markPoint (cdl, x, y, i++, size, type, color); + else + cdl_markPoint (cdl, x, y, 0, size, type, color); + } + + } else { + fprintf (stderr, "cannot open coord file '%s'.\n", fname); + return (ERR); + } + } else { + fprintf (stderr, "'%s': coord file doesn't exist, ignoring.\n", + fname); + return (ERR); + } + return (OK); +} + + +/* CDL_MARKLINE -- Draw a line of given color between the two points + * specified. + */ + +#ifdef ANSI_FUNC + +int +cdl_markLine ( + CDLPtr cdl, /* package ptr */ + int xs, + int ys, /* line start points */ + int xe, + int ye, /* line end points */ + int color /* marker color */ +) +#else + +int +cdl_markLine (cdl, xs, ys, xe, ye, color) +CDLPtr cdl; /* package ptr */ +int xs, ys; /* line start points */ +int xe, ye; /* line end points */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix = NULL; + MarkerPtr mk = cdl_initLineMarker (xs, ys, xe, ye, color, width, style); + + if (cdl_debug) + printf ("[cdl_markLine] (%d,%d) -> (%d,%d) color=%d\n", + xs, ys, xe, ye, color); + + if (style >= L_HOLLOW) width = HOLLOW_LINE_WIDTH; + nx = ABS(xe-xs) + width + 1; + ny = ABS(ye-ys) + width + 1; + lx = min(xs,xe) - width/2 - 1; + ly = min(ys,ye) - width/2 - 1; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doLineMark (color, width, style, pix, xs, ys, xe, ye); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKBOX -- Draw a rectangular box given two corner endpoints. The + * box may be optionally filled with the specified color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markBox ( + CDLPtr cdl, /* package ptr */ + int lx, + int ly, /* LL corner points */ + int ux, + int uy, /* UR corner points */ + int fill, /* fill rectangle? */ + int color /* marker color */ +) +#else + +int +cdl_markBox (cdl, lx, ly, ux, uy, fill, color) +CDLPtr cdl; /* package ptr */ +int lx, ly; /* LL corner points */ +int ux, uy; /* UR corner points */ +int fill; /* fill rectangle? */ +int color; /* marker color */ +#endif +{ + register int tmp, nx, ny; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix = NULL; + MarkerPtr mk = cdl_initBoxMarker (lx, ly, ux, uy, fill, color, + width, style); + + if (cdl_debug) + printf ("[cdl_markBox] (%d,%d) -> (%d,%d) fill=%d color=%d\n", + lx, ly, ux, uy, fill, color); + + /* Take care of a corner specified the wrong way. */ + if (lx > ux) { tmp = ux; ux = lx; lx = tmp; } + if (ly > uy) { tmp = uy; uy = ly; ly = tmp; } + nx = ux - lx + width + 1; + ny = uy - ly + width + 1; + lx = lx - width/2 - 1; + ly = ly - width/2 - 1; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doBoxMark (color, width, style, fill, pix, lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKPOLYGON -- Draw a polygon on the display, optionally filling with + * the specified color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markPolygon ( + CDLPtr cdl, /* package ptr */ + int xarray[], + int yarray[], /* vertex points */ + int npts, /* number of corners */ + int fill, /* fill polygon? */ + int color /* marker color */ +) +#else + +int +cdl_markPolygon (cdl, xarray, yarray, npts, fill, color) +CDLPtr cdl; /* package ptr */ +int xarray[], yarray[]; /* vertex points */ +int npts; /* number of corners */ +int fill; /* fill polygon? */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + int xmin, xmax, ymin, ymax; + uchar *pix; + MarkerPtr mk = cdl_initPolygonMarker (xarray, yarray, npts, + fill, color, width, style); + + /* Find the boundaries of the polygon. */ + cdl_minmax (xarray, npts, &xmin, &xmax); + cdl_minmax (yarray, npts, &ymin, &ymax); + nx = ABS(xmax-xmin) + width + 1; + ny = ABS(ymax-ymin) + width + 1; + lx = min(xmin,xmax) - width/2 - 1; + ly = min(ymin,ymax) - width/2 - 1; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf ("[cdl_markPolygon] npts=%d fill=%d color=%d nx=%d ny=%d\n", + npts, fill, color, nx, ny); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doPolygonMark (color, width, style, fill, xarray, yarray, npts, + pix, lx, ly, nx, ny, True); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKPOLYLINE -- Draw a polyline on the display, optionally filling with + * the specified color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markPolyline ( + CDLPtr cdl, /* package ptr */ + int *xarray, + int *yarray, /* vertex points */ + int npts, /* number of points */ + int color /* marker color */ +) +#else + +int +cdl_markPolyline (cdl, xarray, yarray, npts, color) +CDLPtr cdl; /* package ptr */ +int *xarray, *yarray; /* vertex points */ +int npts; /* number of points */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + int xmin, xmax, ymin, ymax; + uchar *pix; + MarkerPtr mk = cdl_initPolylineMarker (xarray, yarray, npts, color, + width, style); + + /* Find the boundaries of the polyline. */ + cdl_minmax (xarray, npts, &xmin, &xmax); + cdl_minmax (yarray, npts, &ymin, &ymax); + nx = ABS(xmax-xmin) + width + 1; + ny = ABS(ymax-ymin) + width + 1; + lx = min(xmin,xmax) - width/2 - 1; + ly = min(ymin,ymax) - width/2 - 1; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf ("[cdl_markPolyline] npts=%d color=%d nx=%d ny=%d\n", + npts, color, nx, ny); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doPolygonMark (color, width, style, False, xarray, yarray, npts, + pix, lx, ly, nx, ny, False); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKCIRCLE -- Draw of circle on the display, optionally filling with + * the specified color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markCircle ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* center position */ + int radius, /* radius of circle */ + int fill, /* fill circle? */ + int color /* marker color */ +) +#else + +int +cdl_markCircle (cdl, x, y, radius, fill, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* center position */ +int radius; /* radius of circle */ +int fill; /* fill circle? */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix; + MarkerPtr mk = cdl_initCircleMarker (x, y, radius, fill, color, + width, style); + + nx = ny = 2 * radius + width + 3; + lx = x - radius - width/2 - 1; + ly = y - radius - width/2 - 1; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf ("[cdl_markCircle] (%d,%d) radius=%d fill=%d color=%d\n", + x, y, radius, fill, color); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doCircleMark (x, y, radius, color, width, style, fill, pix, + lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKCIRCANNULI -- Draw circular annuli on the display. + */ + +#ifdef ANSI_FUNC + +int +cdl_markCircAnnuli ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* center position */ + int radius, /* radius of 1st annulus*/ + int nannuli, /* no. of annuli */ + int sep, /* annuli sep (pixels) */ + int color /* marker color */ +) +#else + +int +cdl_markCircAnnuli (cdl, x, y, radius, nannuli, sep, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* center position */ +int radius; /* radius of 1st annulus*/ +int nannuli; /* no. of annuli */ +int sep; /* annuli sep (pixels) */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix; + MarkerPtr mk = cdl_initCircAnnMarker(x, y, radius, nannuli, sep, + color, width, style); + + nx = ny = 2 * (radius + nannuli * sep) + width + 3; + lx = x - (nx / 2) - width/2; + ly = y - (ny / 2) - width/2; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf("[cdl_markAnnuli] (%d,%d) radius=%d N=%d sep=%d color=%d\n", + x, y, radius, nannuli, sep, color); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doCircAnnuliMark (x, y, radius, nannuli, sep, color, width, style, + pix, lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKELLIPSE -- Draw an ellipse with a given center, eccentricity + * and position on the display, optionally filling with the specified color. + */ + +#ifdef ANSI_FUNC + +int +cdl_markEllipse ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* center position */ + int xrad, + int yrad, /* x and y radii */ + float rotang, /* position angle (deg) */ + int fill, /* fill ellipse? */ + int color /* marker color */ +) +#else + +int +cdl_markEllipse (cdl, x, y, xrad, yrad, rotang, fill, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* center position */ +int xrad, yrad; /* x and y radii */ +float rotang; /* position angle (deg) */ +int fill; /* fill ellipse? */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix; + MarkerPtr mk = cdl_initEllipseMarker (x, y, xrad, yrad, rotang, + fill, color, width, style); + + nx = 2 * max(xrad,yrad) + width + 3; + ny = 2 * max(xrad,yrad) + width + 3; + lx = x - (nx / 2) - width/2; + ly = y - (ny / 2) - width/2; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf("[cdl_markEllipse] (%d,%d) R=(%d,%d) pa=%g fill=%d col=%d\n", + x, y, xrad, yrad, rotang, fill, color); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doEllipseMark (color, width, style, fill, x, y, xrad, yrad, rotang, + pix, lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_MARKELLIPANNULI -- Draw elliptical annuli on the display. + */ + +#ifdef ANSI_FUNC + +int +cdl_markEllipAnnuli ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* center position */ + int xrad, + int yrad, /* radius of 1st annulus*/ + float ang, /* rotation angle */ + int nannuli, /* no. of annuli */ + int sep, /* annuli sep (pixels) */ + int color /* marker color */ +) +#else + +int +cdl_markEllipAnnuli (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* center position */ +int xrad, yrad; /* radius of 1st annulus*/ +float ang; /* rotation angle */ +int nannuli; /* no. of annuli */ +int sep; /* annuli sep (pixels) */ +int color; /* marker color */ +#endif +{ + register int nx, ny, lx, ly; + register int width = cdl->linewidth, style = cdl->linestyle; + uchar *pix; + MarkerPtr mk = cdl_initEllAnnMarker (x, y, xrad, yrad, ang, nannuli, + sep, color, width, style); + + nx = 2 * max(xrad + nannuli * sep, yrad + nannuli * sep) + width + 3; + ny = 2 * max(xrad + nannuli * sep, yrad + nannuli * sep) + width + 3; + lx = x - (nx / 2) - width/2; + ly = y - (ny / 2) - width/2; + cdl_initMarkPos (mk, nx, ny, lx, ly); + + if (cdl_debug) + printf("[cdl_markElAnn] (%d,%d) R=(%d,%d) pa=%g N=%d S=%d col=%d\n", + x, y, xrad, yrad, ang, nannuli, sep, color); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doEllipAnnuliMark (x, y, xrad, yrad, ang, nannuli, + sep, color, width, style, pix, lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + + +/* CDL_MARKTEXT -- Draw a text string on the display at the given location. + */ + +#ifdef ANSI_FUNC + +int +cdl_markText ( + CDLPtr cdl, /* package ptr */ + int x, + int y, /* marker position */ + char *str, /* text string */ + float size, /* size scale factor */ + float angle, /* text rotation angle */ + int color /* marker color */ +) +#else + +int +cdl_markText (cdl, x, y, str, size, angle, color) +CDLPtr cdl; /* package ptr */ +int x, y; /* marker position */ +char *str; /* text string */ +float size; /* size scale factor */ +float angle; /* text rotation angle */ +int color; /* marker color */ +#endif +{ + register int lx, ly, nx, ny, w = cdl->textwidth; + register int len, font = cdl->font; + uchar *pix = NULL; + float cw, ch; + MarkerPtr mk = cdl_initTextMarker (x, y, str, size, color, font, w); + extern int cdl_getPixRegion(); + extern void cdl_insertMarker(), cdl_doLineInSubRas(); + + if (cdl_debug) + printf ("[cdl_markText] (%d,%d) str='%s' size=%g color=%d ang=%g\n", + x, y, str, size, color, angle); + + len = cdl_strlen (str, size, mk->font); + cw = CHARACTER_WIDTH * (size * FONT_SCALE) + FONT_SPACE; + ch = CHARACTER_HEIGHT * (size * FONT_SCALE); + if (angle == 0.0) { + /* Optimize a bit for horizontal text. */ + lx = x; + ly = y - (2 * size); + nx = cdl_strlen (str, size, mk->font); + ny = FONT_HEIGHT * (size * FONT_SCALE) + (6 * size); + if (strstr(str, "\\fU")) { + ny += ch - (ch * 0.666) / 2; + } + if (strstr(str, "\\fD")) { + ly -= ch - (ch * 0.666) / 2 ; + ny += ch - (ch * 0.666) / 2; + } + } else { + /* Compute the four corners of the rotated and scaled text. Then + * define the raster needed to get all of the text in the box. + */ + int xc[4], yc[4]; + int i, tx, ty, xmin, xmax, ymin, ymax; + double coso, sino; + + coso = cos ((double)(angle * (double)(M_PI/180.0))); + sino = sin ((double)(angle * (double)(M_PI/180.0))); + + xc[0] = -cw / 2; /* LL corner */ + yc[0] = -ch / 2; + xc[1] = -cw / 2; /* UL corner */ + yc[1] = ch + ch / 2; + xc[2] = len + cw / 2; /* UR corner */ + yc[2] = ch + ch / 2; + xc[3] = len + cw / 2; /* LR corner */ + yc[3] = -ch / 2; + + if (strstr(str, "\fU")) + yc[1] = yc[2] = yc[1] + (ch + ch / 2); + if (strstr(str, "\fD")) + yc[0] = yc[3] = yc[1] - (ch + ch / 2); + + /* Rotate the bounding box. */ + for (i=0; i < 4; i++) { + tx = xc[i], ty = yc[i]; + xc[i] = tx * coso - ty * sino + x + 0.5; + yc[i] = tx * sino + ty * coso + y + 0.5; + } + + cdl_minmax (xc, 4, &xmin, &xmax); + cdl_minmax (yc, 4, &ymin, &ymax); + + lx = xmin - cw / 2, ly = ymin - ch / 2; + nx = xmax - xmin + cw / 2; + ny = ymax - ymin + ch / 2; +/*cdl_markBox (cdl, lx, ly, lx+nx, ly+ny, 0, 205);*/ + } + cdl_initMarkPos (mk, nx, ny, lx, ly); + + /* Get the pixel region we'll be marking. */ + pix = (uchar *) malloc (nx * ny); + if (cdl_getPixRegion (cdl, lx, ly, nx, ny, pix)) + return (ERR); + + /* Save the image pixels in the display list for erasure later. */ + mk->refpix = (uchar *) malloc (nx * ny); + mk->markpix = (uchar *) malloc (nx * ny); + bcopy (pix, mk->refpix, nx * ny); + cdl_insertMarker (cdl, DLTail[cdl->frame-1], mk); + + /* Edit the pixels with the requested color and save the raster. */ + cdl_doTextMarker (x, y, str, size, angle, color, w, mk->font, + pix, lx, ly, nx, ny); + bcopy (pix, mk->markpix, nx * ny); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) { + free ((char *)pix); + return (ERR); + } + + free ((char *)pix); + return (OK); +} + + +/* CDL_SETFONT -- Set the default font type. + */ + +#ifdef ANSI_FUNC + +void +cdl_setFont ( + CDLPtr cdl, + int font +) +#else + +void +cdl_setFont (cdl, font) +CDLPtr cdl; +int font; +#endif +{ + if (font == F_ROMAN) cdl->font = F_ROMAN; + else if (font == F_GREEK) cdl->font = F_GREEK; + else if (font == F_TIMES) cdl->font = F_TIMES; + else if (font == F_FUTURA) cdl->font = F_FUTURA; + else if (font == F_BOLD) + cdl_setTextWidth (cdl, cdl->textwidth+1); + else + fprintf (stderr, "Invalid font specification.\n"); +} + + +/* CDL_SETTEXTWIDTH -- Set the default text width. + */ + +#ifdef ANSI_FUNC + +void +cdl_setTextWidth ( + CDLPtr cdl, + int width +) +#else + +void +cdl_setTextWidth (cdl, width) +CDLPtr cdl; +int width; +#endif +{ + cdl->textwidth = (width > 0 ? width : 1); +} + + + +/* CDL_SETLINEWIDTH -- Set the default line width. + */ + +#ifdef ANSI_FUNC + +void +cdl_setLineWidth ( + CDLPtr cdl, + int width +) +#else + +void +cdl_setLineWidth (cdl, width) +CDLPtr cdl; +int width; +#endif +{ + cdl->linewidth = (width > 0 ? width : 1); +} + + +/* CDL_SETLINESTYLE -- Set the default line style. + */ + +#ifdef ANSI_FUNC + +void +cdl_setLineStyle ( + CDLPtr cdl, + int style +) +#else + +void +cdl_setLineStyle (cdl, style) +CDLPtr cdl; +int style; +#endif +{ + cdl->linestyle = (style >= 0 ? style : 0); +} + + +/* CDL_DELETEMARK -- Delete the overlay mark whose center is closest to + * the given position. + */ + +#ifdef ANSI_FUNC + +int +cdl_deleteMark ( + CDLPtr cdl, /* package ptr */ + int x, + int y /* marker position */ +) +#else + +int +cdl_deleteMark (cdl, x, y) +CDLPtr cdl; /* package ptr */ +int x, y; /* marker position */ +#endif +{ + MarkerPtr mk, next, back; + + if (cdl_debug) + printf ("[cdl_deleteMark] (%d,%d)\n", x, y); + + if (DLHead[cdl->frame-1] == (MarkerPtr) NULL) + return (OK); + + /* Get the marker closest to the given point. */ + mk = cdl_findNearest (DLHead[cdl->frame-1], x, y); + + /* Write the region back to the display. */ + if (cdl_writeSubRaster(cdl, mk->lx, mk->ly, mk->nx, mk->ny, mk->refpix)) + return (ERR); + + /* For point markers we may need to also delete an associated label. */ + if (mk->type == MK_POINT && mk->number > 0 && mk->next != NULL) { + next = mk->next; + if (cdl_writeSubRaster(cdl, next->lx, next->ly, + next->nx, next->ny, next->refpix)) + return (ERR); + cdl_removeMarker (cdl, next); + } else if (mk->type == MK_TEXT && mk->back != NULL) { + /* If it's a text marker, see if the previous on was a point + * with a label. + */ + back = mk->back; + if (back->type == MK_POINT && back->number > 0) { + if (cdl_writeSubRaster(cdl, back->lx, back->ly, + back->nx, back->ny, back->refpix)) + return (ERR); + cdl_removeMarker (cdl, back); + } + } + + /* Delete the marker from the display list. */ + cdl_removeMarker (cdl, mk); + + return (OK); +} + + +/* CDL_CLEAROVERLAY -- Erase all marks in the current display list. Work + * from the tail of the list so we handle overlapping marks correctly. + */ + +#ifdef ANSI_FUNC + +int +cdl_clearOverlay ( + CDLPtr cdl /* package ptr */ +) +#else + +int +cdl_clearOverlay (cdl) +CDLPtr cdl; /* package ptr */ +#endif +{ + MarkerPtr mk, back; + + if (cdl_debug) + printf ("[cdl_clearOverlay]\n"); + + /* To clear the overlay we simply walk the display list and delete + * each point. + */ + for (mk = DLTail[cdl->frame-1]; mk != (MarkerPtr) NULL; mk = back) { + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, mk->lx, mk->ly, mk->nx, mk->ny, + mk->refpix)) + return (ERR); + + /* Delete the marker from the display list. */ + back = mk->back; + cdl_removeMarker (cdl, mk); + } + DLHead[cdl->frame-1] = DLTail[cdl->frame-1] = (MarkerPtr) NULL; + + return (OK); +} + + +/* CDL_REDRAWOVERLAY -- Redraw all marks in the current display list. + */ + +#ifdef ANSI_FUNC + +int +cdl_redrawOverlay ( + CDLPtr cdl /* package ptr */ +) +#else + +int +cdl_redrawOverlay (cdl) +CDLPtr cdl; /* package ptr */ +#endif +{ + MarkerPtr mk; + + if (cdl_debug) + printf ("[cdl_redrawOverlay]\n"); + + /* Just walk the list redisplaying the markers. */ + for (mk = DLHead[cdl->frame-1]; mk != (MarkerPtr) NULL; mk = mk->next) + /* Write the region back to the display. */ + if (cdl_writeSubRaster (cdl, mk->lx, mk->ly, mk->nx, mk->ny, + mk->markpix)) + return (ERR); + + return (OK); +} + + +/* CDL_BEGINDLIST -- + */ + +#ifdef ANSI_FUNC + +void +cdl_beginDList ( + int frame /* frame number */ +) +#else + +void +cdl_beginDList (frame) +int frame; /* frame number */ +#endif +{ +/* + if (DLFlag[frame]) + error "Display list already open for frame %d"; +*/ +} + + +/* CDL_ENDDLIST -- + */ + +#ifdef ANSI_FUNC + +void +cdl_endDList ( + int frame, /* frame number */ + int flush /* flush on close */ +) +#else + +void +cdl_endDList (frame, flush) +int frame; /* frame number */ +int flush; /* flush on close */ +#endif +{ +} + + +/* CDL_CLEARDLIST -- + */ + +#ifdef ANSI_FUNC + +void +cdl_clearDList ( + int frame /* frame number */ +) +#else + +void +cdl_clearDList (frame) +int frame; /* frame number */ +#endif +{ +} + + +/* CDL_DRAWDLIST -- + */ + +#ifdef ANSI_FUNC + +void +cdl_drawDList ( + int frame /* frame number */ +) +#else + +void +cdl_drawDList (frame) +int frame; /* frame number */ +#endif +{ +} + + + +/* ------------------- + * PRIVATE PROCEDUURES + * ------------------- */ + + +/* CDL_GETPIXREGION -- Given a corner position and size, return a subraster + * of the image pixels in that region. + */ + +#ifdef ANSI_FUNC + +static int +cdl_getPixRegion ( + CDLPtr cdl, /* package ptr */ + int lx, + int ly, /* corner position */ + int nx, + int ny, /* corner position */ + uchar *ras /* subraster pixels */ +) +#else + +static int +cdl_getPixRegion (cdl, lx, ly, nx, ny, ras) +CDLPtr cdl; /* package ptr */ +int lx, ly; /* corner position */ +int nx, ny; /* corner position */ +uchar *ras; /* subraster pixels */ +#endif +{ + if (ras == NULL) + ras = (uchar *) malloc (nx * ny); + + /* Do a server query to get the pixels. */ + return (cdl_readSubRaster (cdl, lx, ly, nx, ny, &ras)); +} + + +/* CDL_DOPOINTMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doPointMark ( + int color, /* overlay color */ + int type, /* type of mark to draw */ + uchar *pix, /* edit region raster */ + int sz /* mark size */ +) +#else + +static void +cdl_doPointMark (color, type, pix, sz) +int color; /* overlay color */ +int type; /* type of mark to draw */ +uchar *pix; /* edit region raster */ +int sz; /* mark size */ +#endif +{ + register int i, j, k, npts, center, cpix, fill = 0; + int x, y, width, xp[4], yp[4]; + + /* Save the central pixel value, we don't overwrite that. */ + x = y = (sz / 2); + center = ((sz / 2) * sz) + (sz / 2); + cpix = pix[center]; + + /* Check flags */ + if (type & M_POINT) { + cpix = color; + pix[center] = cpix; + } + if (type & M_FILL) + fill++; + + /* Draw the types requested. */ + if (type & M_BOX) + cdl_doBoxMark (color, 1, L_SOLID, fill, pix, 0, 0, sz, sz); + + if (type & M_PLUS || type & M_STAR) { + j = (y * sz); + for (i=0; i < sz; i++) + pix[j+i] = color; + j = ((sz - 1) * sz) + x; + for (i=0; i < sz; i++, j -= sz) + pix[j] = color; + } + + if (type & M_HLINE || type & M_HBLINE) { + npts = (sz - (sz / 3)) / 2; + if (type & M_HBLINE) { + j = ((y - 1) * sz); + width = 3; + } else { + j = (y * sz); + width = 1; + } + for (k=0; k < width; k++, j += sz) { + for (i=0; i < npts; i++) { + pix[j+i] = color; + pix[j+sz-i-1] = color; + } + } + } + + if (type & M_VLINE || type & M_VBLINE) { + npts = (sz - (sz / 3)) / 2; + if (type & M_VBLINE) { + for (k=-1; k < 2; k++) { + j = ((sz - 1) * sz) + x; + for (i=0; i < npts; i++, j -= sz) { + pix[j+k] = color; + pix[(i*sz)+x+k] = color; + } + } + } else { + j = ((sz - 1) * sz) + x; + for (i=0; i < npts; i++, j -= sz) { + pix[j] = color; + pix[(i*sz)+x] = color; + } + } + } + + if (type & M_CROSS || type & M_STAR) { + for (i=0, j=((sz-1)*sz); i < sz; i++, j-=sz) { + pix[(i*sz)+i] = color; /* main diagonal */ + pix[j+i] = color; /* off diagonal */ + } + } + + if (type & M_DIAMOND) { + xp[0] = x - (sz/2); yp[0] = y; + xp[1] = x; yp[1] = y + (sz/2); + xp[2] = x + (sz/2); yp[2] = y; + xp[3] = x; yp[3] = y - (sz/2); + cdl_doPolygonMark (color, 1, L_SOLID, fill, xp, yp, 4, pix, + 0, 0, sz, sz, True); + pix[x] = color; + } + + if (type & M_CIRCLE) + cdl_doCircleMark(x, y, (sz/2)+1, color, 1, L_SOLID, fill, pix, + 0, 0, sz, sz); + + /* Restore the central pixel value, we don't usually overwrite that. + */ + if (!fill && !(type & M_POINT)) + pix[center] = cpix; +} + + +/* CDL_DOLINEMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doLineMark ( + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + uchar *pix, /* edit region raster */ + int xs, + int ys, + int xe, + int ye /* line endpoints */ +) +#else + +static void +cdl_doLineMark (color, width, style, pix, xs, ys, xe, ye) +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +uchar *pix; /* edit region raster */ +int xs, ys, xe, ye; /* line endpoints */ +#endif +{ + register int nx, ny, lx, ly; + + nx = ABS(xe-xs) + width + 1; + ny = ABS(ye-ys) + width + 1; + lx = min(xs,xe) - width/2 - 1; + ly = min(ys,ye) - width/2 - 1; + + /* Handle a line between arbitrary endpoints of any style. */ + if (style == L_SOLID || style >= L_HOLLOW) { + cdl_doLineInSubRas (pix, color, width, style, xs, xe, ys, ye, + lx, ly, nx ,ny); + } else { + int x[2], y[2]; + + switch (style) { + case L_DASHED: CLEAR_DASH_COUNT; break; + case L_DOTTED: CLEAR_DOT_COUNT; break; + case L_DOTDASH: CLEAR_DOTDASH_COUNT; break; + } + + x[0] = xs, x[1] = xe; + y[0] = ys, y[1] = ye; + cdl_doDashedLine (pix, color, width, style, x, y, 2, + lx, ly, nx ,ny); + } +} + + +/* CDL_DOBOXMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doBoxMark ( + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int fill, /* fill the box? */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +static void +cdl_doBoxMark (color, width, style, fill, pix, lx, ly, nx, ny) +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int fill; /* fill the box? */ +uchar *pix; /* edit region raster */ +int lx, ly; /* box corner */ +int nx, ny; /* box size */ +#endif +{ + register int i=0, j=0, k=0, np = (nx * ny); + + /* Edit the pixels with the requested color. */ + if (fill) { + /* Fill the entire rectangle with the color. */ + for (i=0; i < np ; i++) + pix[i] = color; + } else { + if (style == L_SOLID) { + /* Change just the borders of the box to requested color. */ + for (k=0; k < width; k++) + for (i=0, j = (ny-k-1) * nx; i < nx; i++, j++) + pix[(k*nx)+i] = pix[j] = color; + for (k=0; k < width; k++) + for (i=0+k, j = (nx-k-1); i < np; i+=nx, j+=nx) + pix[i] = pix[j] = color; + + } else if (style == L_HOLLOW) { + /* Change just the borders of the box to requested style. */ + for (k=0; k < HOLLOW_LINE_WIDTH; k++) + for (i=0, j = (ny-k-1) * nx; i < nx; i++, j++) + pix[(k*nx)+i] = pix[j] = (k == 2 ? 0 : color); + for (k=0; k < HOLLOW_LINE_WIDTH; k++) + for (i=0+k, j = (nx-k-1); i < np; i+=nx, j+=nx) + pix[i] = pix[j] = color; + + /* Redraw the center of the box to create the hollow. */ + for (i=3, j = (ny-3) * nx + 2; i < nx - 2; i++, j++) + pix[2*nx+i] = pix[j] = 0; + for (i=(2*nx) + 2, j = (nx-3); i < np - (2 * nx); i+=nx, j+=nx) + pix[i] = pix[2*nx+j] = 0; + + } else if (style == L_SHADOW) { + /* Change just the borders of the box to requested style. */ + for (k=0; k < SHADOW_LINE_WIDTH; k++) + for (i=0, j = (ny-k-1) * nx; i < nx; i++, j++) + pix[(k*nx)+i] = pix[j] = (k > 1 ? 0 : color); + for (k=0; k < SHADOW_LINE_WIDTH; k++) + for (i=(2*nx)+k, j = (3*nx-k-1); i < np-(2*nx); i+=nx,j+=nx) + pix[i] = pix[j] = (k > 1 ? 0 : color); + + } else { + int x[2], y[2], w = width, s = style; + + dash = 0, dot = 0, dotdash = 0; + +/* bottom */ x[0] = lx+width, y[0] = ly+w/2; + x[1] = lx+nx-width, y[1] = ly+w/2; + cdl_doDashedLine (pix, color, w, s, x, y, 2, lx, ly, nx, ny); + dash = 0, dot = 0, dotdash = 0; + +/* right */ x[0] = lx+nx-w/2-1, y[0] = ly+width; + x[1] = lx+nx-w/2-1, y[1] = ly+ny-width; + cdl_doDashedLine (pix, color, w, s, x, y, 2, lx, ly, nx, ny); + dash = 0, dot = 0, dotdash = 0; + +/* top */ x[0] = lx+nx-width, y[0] = ly+ny-w/2-1; + x[1] = lx+width, y[1] = ly+ny-w/2-1; + cdl_doDashedLine (pix, color, w, s, x, y, 2, lx, ly, nx, ny); + dash = 0, dot = 0, dotdash = 0; + +/* left */ x[0] = lx+w/2, y[0] = ly+ny-width; + x[1] = lx+w/2, y[1] = ly+width; + cdl_doDashedLine (pix, color, w, s, x, y, 2, lx, ly, nx, ny); + dash = 0, dot = 0, dotdash = 0; + } + } +} + + +/* CDL_DOPOLYGONMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doPolygonMark ( + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int fill, /* fill polygon */ + int *x, + int *y, /* coordinate arrays */ + int npts, /* npts to plot */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny, /* subraster size */ + int close /* close the polygon */ +) +#else + +static void +cdl_doPolygonMark (color, width, style, fill, x, y, npts, pix, lx, ly, nx, ny, close) +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int fill; /* fill polygon */ +int *x, *y; /* coordinate arrays */ +int npts; /* npts to plot */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* subraster size */ +int close; /* close the polygon */ +#endif +{ + register int i, nseg = (npts - 1); + + if (cdl_debug) + printf ("[cdl_doPolygonMark] npts=%d lx=%d ly=%d nseg=%d\n", + npts, lx, ly, nseg); + + /* For solid lines just draw the segments */ + if (style == L_SOLID || style >= L_HOLLOW) { + + /* Connect all the vertices. */ + if (style == L_HOLLOW) { + for (i=0; i < nseg; i++) + cdl_doLineInSubRas (pix, color, HOLLOW_LINE_WIDTH, L_SOLID, + x[i], x[i+1], y[i], y[i+1], lx, ly, nx, ny); + for (i=0; i < nseg; i++) + cdl_doLineInSubRas (pix, 0, 1, L_SOLID, + x[i], x[i+1], y[i], y[i+1], lx, ly, nx, ny); + } else { + for (i=0; i < nseg; i++) + cdl_doLineInSubRas (pix, color, width, style, x[i], x[i+1], + y[i], y[i+1], lx, ly, nx, ny); + } + + /* Now connect the last point to the first to close the polygon. */ + if (close) { + if (x[0] != x[npts] && y[0] != y[npts]) + if (style == L_HOLLOW) { + cdl_doLineInSubRas (pix, color, HOLLOW_LINE_WIDTH, + L_SOLID, x[0], x[nseg], y[0], y[nseg], + lx, ly, nx, ny); + cdl_doLineInSubRas (pix, 0, 1, L_SOLID, + x[0], x[nseg], y[0], y[nseg], lx, ly, nx, ny); + } else { + cdl_doLineInSubRas (pix, color, width, style, + x[0], x[nseg], y[0], y[nseg], lx, ly, nx, ny); + } + + /* Flood fill the polygon if requested. */ + if (fill) + cdl_fillArea (pix, nx, ny, color); + } + + } else { + switch (style) { + case L_DASHED: CLEAR_DASH_COUNT; break; + case L_DOTTED: CLEAR_DOT_COUNT; break; + case L_DOTDASH: CLEAR_DOTDASH_COUNT; break; + } + + if (close) { + register int i, *xp, *yp; + + xp = (int *) malloc ((npts+1) * sizeof(int)); + yp = (int *) malloc ((npts+1) * sizeof(int)); + for (i=0; i < npts; i++) { + xp[i] = x[i]; + yp[i] = y[i]; + } + xp[i] = x[0]; + yp[i] = y[0]; + cdl_doDashedLine (pix, color, width, style, xp, yp, npts+1, + lx, ly, nx ,ny); + + free ((char *) xp); + free ((char *) yp); + } else + cdl_doDashedLine (pix, color, width, style, x, y, npts, + lx, ly, nx ,ny); + } +} + + +/* CDL_DOCIRCLEMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doCircleMark ( + int x, + int y, /* center point */ + int radius, /* circle radius */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int fill, /* fill the box? */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +static void +cdl_doCircleMark (x, y, radius, color, width, style, fill, pix, lx, ly, nx, ny) +int x, y; /* center point */ +int radius; /* circle radius */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int fill; /* fill the box? */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* box size */ +#endif +{ + int xp[N_CIRCLE_PTS+1], yp[N_CIRCLE_PTS+1]; + + /* Get the coordinates for drawing the circle. */ + cdl_getCircleCoords (x, y, radius, xp, yp, N_CIRCLE_PTS); + + /* Connect the dots to draw the circle. */ + cdl_doPolygonMark (color, width, style, fill, xp, yp, N_CIRCLE_PTS, + pix, lx, ly, nx, ny, True); +} + + +/* CDL_DOCIRCANNULIMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doCircAnnuliMark ( + int x, + int y, /* center point */ + int radius, /* circle radius */ + int nannuli, /* No. of annuli */ + int sep, /* annulus separation */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +static void +cdl_doCircAnnuliMark(x, y, radius, nannuli, sep, color, width, style, pix, lx, ly, nx, ny) +int x, y; /* center point */ +int radius; /* circle radius */ +int nannuli; /* No. of annuli */ +int sep; /* annulus separation */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* box size */ +#endif +{ + register int i; + + /* For each annulus radius draw the circle. */ + for (i=0; i <= nannuli; i++) + cdl_doCircleMark (x, y, radius + (i* sep), color, width, style, + False, pix, lx, ly, nx, ny); +} + + +/* CDL_DOELLIPSEMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doEllipseMark ( + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int fill, /* fill the box? */ + int xc, + int yc, /* ellipse center */ + int xrad, + int yrad, /* semimajor axes */ + float ang, /* rotation angle */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +static void +cdl_doEllipseMark (color, width, style, fill, xc, yc, xrad, yrad, ang, pix,lx,ly,nx,ny) +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int fill; /* fill the box? */ +int xc, yc; /* ellipse center */ +int xrad, yrad; /* semimajor axes */ +float ang; /* rotation angle */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* box size */ +#endif +{ + int xp[N_ELLIPSE_PTS+1], yp[N_ELLIPSE_PTS+1]; + + /* Get the coordinates for drawing the ellipse. */ + cdl_getEllipseCoords (xc, yc, xrad, yrad, ang, xp, yp); + + /* Connect the dots to draw the ellipse. */ + cdl_doPolygonMark (color, width, style, fill, xp, yp, N_ELLIPSE_PTS, + pix, lx, ly, nx, ny, True); +} + + +/* CDL_DOELLIPANNULIMARK -- Edit a given raster with the requested mark. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doEllipAnnuliMark ( + int x, + int y, /* ellipse center */ + int xrad, + int yrad, /* semimajor axes */ + float ang, /* rotation angle */ + int nannuli, /* No. of annuli */ + int sep, /* annulus separation */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +static void +cdl_doEllipAnnuliMark(x, y, xrad, yrad, ang, nannuli, sep, color, width, + style, pix, lx, ly, nx, ny) +int x, y; /* ellipse center */ +int xrad, yrad; /* semimajor axes */ +float ang; /* rotation angle */ +int nannuli; /* No. of annuli */ +int sep; /* annulus separation */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* box size */ +#endif +{ + register int i, xr, yr; + + /* For each annulus compute the ellipse and draw it... */ + for (i=0; i <= nannuli; i++) { + xr = xrad + (i * sep); + yr = yrad + (i * sep); + cdl_doEllipseMark (color, width, style, False, x, y, xr, yr, ang, + pix, lx, ly, nx, ny); + } +} + + +/* CDL_DOTEXTMARKER -- Draw a text string to the display. + */ + +#ifdef ANSI_FUNC + +int +cdl_doTextMarker ( + int x, + int y, /* LL text position */ + char *string, /* string to draw */ + float txtsize, /* relative scale size */ + float angle, /* text rotation angle */ + int color, /* overlay color */ + int width, /* line width */ + int txtfont, /* text font */ + uchar *pix, /* edit region raster */ + int lx, + int ly, /* subraster corner */ + int nx, + int ny /* box size */ +) +#else + +int +cdl_doTextMarker (x,y,string,txtsize,angle,color,width,txtfont,pix,lx,ly,nx,ny) +int x, y; /* LL text position */ +char *string; /* string to draw */ +float txtsize; /* relative scale size */ +float angle; /* text rotation angle */ +int color; /* overlay color */ +int width; /* line width */ +int txtfont; /* text font */ +uchar *pix; /* edit region raster */ +int lx, ly; /* subraster corner */ +int nx, ny; /* box size */ +#endif +{ + char chr, *sp = string; + int mx, my, stroke, tab1, tab2, i, j, pen, len; + int x1, x2, y1, y2; + int oldfont, font, offset = 0; + register int w, cw, ch, cx, cy, ip; + float px, py, size = txtsize; + double coso, sino; + int bitupk(); + + font = oldfont = txtfont; + coso = cos ((double) (-angle * (double)(M_PI / 180.0))); + sino = sin ((double) (-angle * (double)(M_PI / 180.0))); + + /* Loop over each character in the string. */ + len = strlen (string); + x1 = cx = x; + y1 = cy = y; + + cw = CHARACTER_WIDTH * (size * FONT_SCALE) + FONT_SPACE; + ch = CHARACTER_HEIGHT * (size * FONT_SCALE); + for (j = 0; j < len && *sp; j++, sp++) { + +escape: + /* Check for an inline font escape. */ + if (*sp == '\\' && *(sp+1) == 'f') { + sp++; sp++; + if (*sp != 'P') + oldfont = font; + + switch (*sp) { + case 'B': + width = width + 1; + break; + case 'R': + font = F_ROMAN; + break; + case 'F': + font = F_FUTURA; + break; + case 'T': + font = F_TIMES; + break; + case 'G': + font = F_GREEK; + break; + case 'P': + if (width > 1) + width = width - 1; + font = oldfont; + break; + + /* Check for a super/subscript escape. */ + case 'U': + offset += ch - (ch * 0.666) / 2; + break; + case 'D': + offset -= ch - (ch * 0.666) / 2; + break; + } + sp++; + if (*sp == '\\') + goto escape; + } + + /* Adjust the size if we're doing sub/superscript. */ + if (offset != 0) + size = txtsize * 0.666; + else + size = txtsize; + + if (*sp < CHARACTER_START || *sp > CHARACTER_END) + chr = i = '?' - CHARACTER_START; + else + chr = i = *sp - CHARACTER_START; + + switch (font) { + case F_ROMAN: + tab1 = chridx[i] - 1; + tab2 = chridx[i+1] - 1; + break; + case F_GREEK: + tab1 = gchidx[i] - 1; + tab2 = gchidx[i+1] - 1; + break; + case F_TIMES: + tab1 = timidx[i] - 1; + tab2 = timidx[i+1] - 1; + break; + case F_FUTURA: + tab1 = futidx[i] - 1; + tab2 = futidx[i+1] - 1; + break; + } + + for (i=tab1; i <= tab2; i++) { + switch (font) { + case F_ROMAN: + stroke = chrtab[i]; break; + case F_GREEK: + stroke = gchtab[i]; break; + case F_TIMES: + stroke = timtab[i]; break; + case F_FUTURA: + stroke = futtab[i]; break; + } + px = (float) bitupk (stroke, COORD_X_START, COORD_X_LEN); + py = (float) bitupk (stroke, COORD_Y_START, COORD_Y_LEN); + pen = bitupk (stroke, COORD_PEN_START, COORD_PEN_LEN); + + /* Scale size of character. */ + px = px * (size * FONT_SCALE); + py = py * (size * FONT_SCALE) + offset; + + /* Shift and rotate. + */ + mx = cx + px * coso + py * sino; + my = cy - px * sino + py * coso; + + if (pen == 0) { + /* Move start point. */ + x1 = mx; + y1 = my; + } else { + /* Draw to this point and update. */ + x2 = mx; + y2 = my; + cdl_doLineInSubRas (pix, color, width, L_SOLID, + x1, x2, y1, y2, lx, ly, nx, ny); + x1 = x2; + y1 = y2; + } + } + + /* Update the character position. */ + ip = (int) chr; + switch (font) { + case F_ROMAN: + cx += cw * coso; + cy -= cw * sino; + + /* Now correct a bit to kludge a nice spacing. */ + if (index("il1:;.,!|'`", *sp)) { + cx -= FONT_SPACE * coso; + cy += FONT_SPACE * sino; + } else if (*sp == 'r') { + cx -= (FONT_SPACE - 2) * coso; + cy += (FONT_SPACE - 2) * sino; + } + break; + case F_GREEK: + w = (gchwid[ip] / 2) * (size * FONT_SCALE) + FONT_SPACE + 2; + cx += w * coso; + cy -= w * sino; + break; + case F_TIMES: + w = (timwid[ip] - 12) * (size * FONT_SCALE) + FONT_SPACE + 2; + cx += w * coso; + cy -= w * sino; + break; + case F_FUTURA: + w = (futwid[ip] / 2) * (size * FONT_SCALE) + FONT_SPACE + 2; + cx += w * coso; + cy -= w * sino; + break; + } + } + + return (OK); +} + + + + +/* ------------------------ + * Display List Procedures + * ------------------------*/ + + + +/* CDL_FREEDISPLAYLIST -- Free up the named display list. + */ + +#ifdef ANSI_FUNC + +int +cdl_freeDisplayList ( + CDLPtr cdl, /* package ptr */ + MarkerPtr head +) +#else + +int +cdl_freeDisplayList (cdl, head) +CDLPtr cdl; /* package ptr */ +MarkerPtr head; +#endif +{ + MarkerPtr mk; + + if (cdl_debug) + printf ("[cdl_freeDisplayList]\n"); + + /* Just walk the list freeing the markers. */ + for (mk = head; mk != (MarkerPtr) NULL; mk = mk->next) + cdl_removeMarker (cdl, mk); + + return (OK); +} + + +/* CDL_INSERTMARKER -- Insert a marker in the display list after the given + * entry. The display list is maintained as a doubly linked list of markers. + */ + +#ifdef ANSI_FUNC + +static void +cdl_insertMarker ( + CDLPtr cdl, /* package ptr */ + MarkerPtr back, /* insert point */ + MarkerPtr new /* marker to insert */ +) +#else + +static void +cdl_insertMarker (cdl, back, new) +CDLPtr cdl; /* package ptr */ +MarkerPtr back; /* insert point */ +MarkerPtr new; /* marker to insert */ +#endif +{ + MarkerPtr tmp; + + /* If the back pointer is null it means we're creating the head. */ + if (back == (MarkerPtr) NULL) { + DLHead[cdl->frame-1] = DLTail[cdl->frame-1] = new; + new->back = new->next = (MarkerPtr) NULL; + + } else { + /* Otherwise reset the pointers to insert the marker. */ + tmp = back->next; + back->next = new; + new->back = back; + + /* If the beck marker pointed at something, take care of that. */ + if (tmp) { + new->next = tmp; + tmp->back = new; + } else { + new->next = (MarkerPtr) NULL; + DLTail[cdl->frame-1] = new; + } + } +} + + +/* CDL_REMOVEMARKER -- Remove a marker from the display list. + */ + +#ifdef ANSI_FUNC + +static void +cdl_removeMarker ( + CDLPtr cdl, /* package ptr */ + MarkerPtr mk /* marker to delete */ +) +#else + +static void +cdl_removeMarker (cdl, mk) +CDLPtr cdl; /* package ptr */ +MarkerPtr mk; /* marker to delete */ +#endif +{ + if (mk->back) /* handle the back ptr */ + mk->back->next = mk->next; + else + DLHead[cdl->frame-1] = mk->next; + if (mk->next) /* handle the next ptr */ + mk->next->back = mk->back; + else + DLTail[cdl->frame-1] = mk->back; + + /* Now free up the marker and internal pointers. */ + if (mk->str) free ((uchar *) mk->str); + if (mk->refpix) free ((uchar *) mk->refpix); + if (mk->markpix) free ((uchar *) mk->markpix); + if (mk->xp) free ((uchar *) mk->xp); + if (mk->yp) free ((uchar *) mk->yp); + free ((MarkerPtr) mk); +} + + +/* CDL_FINDNEAREST -- Find the marker in the display list that is closest + * to the indicated point. For markers with a defined center we check the + * distance to the central point. For polylines and polygons we check for + * a vertex ir knot point that is closest. The marker is then returned. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_findNearest ( + MarkerPtr head, /* display list head */ + int x, + int y /* pixel coords */ +) +#else + +static MarkerPtr +cdl_findNearest (head, x, y) +MarkerPtr head; /* display list head */ +int x, y; /* pixel coords */ +#endif +{ + MarkerPtr mk, nearest; + register float dmin = 10.0e9, mk_dist, dist = 10.0e9, A, C, cx, cy; + register int i; + + if (head == (MarkerPtr) NULL) + return ((MarkerPtr) NULL); + + nearest = head; + for (mk = head; mk ; mk = mk->next) { + switch (mk->type) { + case MK_POLYLINE: + case MK_POLYGON: + /* Find the nearest point in the poly. */ + for (i=0; i < mk->npts; i++) { + mk_dist = sqrt ((double)(ABS(x - mk->x) * ABS(x - mk->x) + + ABS(y - mk->y) * ABS(y - mk->y)) ); + if (mk_dist < dmin) + dmin = mk_dist; + } + mk_dist = dmin; + break; + + case MK_BOX: + /* Select the box center closest to the point. */ + cx = (mk->xp[1] + mk->xp[0]) / 2; + cy = (mk->yp[1] + mk->yp[0]) / 2; + mk_dist = sqrt ((double)(ABS(x - cx) * ABS(x - cx) + + ABS(y - cy) * ABS(y - cy)) ); + break; + + case MK_LINE: + A = (float) ((mk->yp[1] - mk->yp[0]) / (mk->xp[1] - mk->xp[0])); + C = mk->yp[0] - A * x; + mk_dist = ABS( (A * x - y + C) / sqrt (A * A + 1)); + break; + + case MK_POINT: + case MK_CIRCLE: + case MK_CIRCANN: + case MK_ELLIPSE: + case MK_ELLIPANN: + case MK_TEXT: + /* Get the distance from the point to the center. */ + mk_dist = sqrt ((double)(ABS(x - mk->x) * ABS(x - mk->x) + + ABS(y - mk->y) * ABS(y - mk->y)) ); + } + if (mk_dist < dist) { + dist = mk_dist; + nearest = mk; + } + + if (cdl_debug) + printf ("Nearest: Marker type=%2d dist=%g mk_dist=%g N=%d\n", + mk->type, dist, mk_dist, nearest->type); + } + return (nearest); +} + + +/* CDL_PRINTDISPLAYLIST -- Print the display list to a file. + */ + +#ifdef ANSI_FUNC + +static void +cdl_printDisplayList ( + FILE *fd, /* file descriptor */ + MarkerPtr head /* display list head */ +) +#else + +static void +cdl_printDisplayList (fd, head) +FILE *fd; /* file descriptor */ +MarkerPtr head; /* display list head */ +#endif +{ + MarkerPtr mk; + + for (mk = head; mk ; mk = mk->next) { + switch (mk->type) { + case MK_POINT: printf ("point\t\t"); break; + case MK_LINE: printf ("line\t\t"); break; + case MK_BOX: printf ("box\t\t"); break; + case MK_POLYLINE: printf ("polyline\t\t"); break; + case MK_POLYGON: printf ("polygon\t\t"); break; + case MK_CIRCLE: printf ("circle\t\t"); break; + case MK_CIRCANN: printf ("circann\t\t"); break; + case MK_ELLIPSE: printf ("ellipse\t\t"); break; + case MK_ELLIPANN: printf ("ellipann\t\t"); break; + case MK_TEXT: printf ("text\t\t"); break; + } + printf ("mk=%d back=%10d next=%10d\n", + (int)mk, (int)mk->back, (int)mk->next); + } +} + + +/* CDL_INITPOINTMARKER -- Allocate and initialize the space for a point marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initPointMarker ( + int x, + int y, /* marker position */ + int number, /* if > 0, label value */ + int size, /* marker size (pixels) */ + int type, /* type to draw */ + int color /* marker color */ +) +#else + +static MarkerPtr +cdl_initPointMarker (x, y, number, size, type, color) +int x, y; /* marker position */ +int number; /* if > 0, label value */ +int size; /* marker size (pixels) */ +int type; /* type to draw */ +int color; /* marker color */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_POINT; + mk->x = x; + mk->y = y; + mk->number = number; + mk->size = size; + mk->pt_type = type; + mk->color = color; + return mk; +} + + + +/* CDL_INITPOINTLABELMARKER -- Allocate and initialize the space for a point + * with a text label marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initPointLabelMarker ( + int x, + int y, /* marker position */ + char *label, /* point label str */ + int size, /* marker size (pixels) */ + int type, /* type to draw */ + int color, /* marker color */ + int font /* label font */ +) +#else + +static MarkerPtr +cdl_initPointLabelMarker (x, y, label, size, type, color, font) +int x, y; /* marker position */ +char *label; /* point label str */ +int size; /* marker size (pixels) */ +int type; /* type to draw */ +int color; /* marker color */ +int font; /* label font */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_POINT; + mk->x = x; + mk->y = y; + mk->size = size; + mk->pt_type = type; + mk->color = color; + mk->font = font; + mk->str = (char *) malloc (strlen(label) + 1); + strcpy (mk->str, label); + return mk; +} + + +/* CDL_INITLINEMARKER -- Allocate and initialize the space for a line marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initLineMarker ( + int x1, + int y1, /* line start points */ + int x2, + int y2, /* line end points */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initLineMarker (x1, y1, x2, y2, color, width, style) +int x1, y1; /* line start points */ +int x2, y2; /* line end points */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line width */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_LINE; + mk->x = x1; + mk->y = y1; + mk->xp = (int *) malloc (2 * sizeof(int)); + mk->xp[0] = x1; + mk->xp[1] = x2; + mk->yp = (int *) malloc (2 * sizeof(int)); + mk->yp[0] = y1; + mk->yp[1] = y2; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITBOXMARKER -- Allocate and initialize the space for a box marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initBoxMarker ( + int lx, + int ly, /* LL corner points */ + int ux, + int uy, /* UR corner points */ + int fill, /* fill rectangle? */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initBoxMarker (lx, ly, ux, uy, fill, color, width, style) +int lx, ly; /* LL corner points */ +int ux, uy; /* UR corner points */ +int fill; /* fill rectangle? */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_BOX; + mk->x = lx; + mk->y = ly; + mk->xp = (int *) malloc (2 * sizeof(int)); + mk->xp[0] = lx; + mk->xp[1] = ux; + mk->yp = (int *) malloc (2 * sizeof(int)); + mk->yp[0] = ly; + mk->yp[1] = uy; + mk->fill = fill; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITPOLYLINEMARKER -- Allocate and initialize the space for a + * polyine marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initPolylineMarker ( + int *x, + int *y, /* vertex points */ + int npts, /* number of points */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initPolylineMarker (x, y, npts, color, width, style) +int *x, *y; /* vertex points */ +int npts; /* number of points */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_POLYLINE; + mk->xp = (int *) malloc (npts * sizeof(int)); + mk->yp = (int *) malloc (npts * sizeof(int)); + bcopy (x, mk->xp, npts * sizeof(int)); + bcopy (y, mk->yp, npts * sizeof(int)); + mk->x = mk->xp[0]; + mk->y = mk->yp[0]; + mk->npts = npts; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITPOLYGONMARKER -- Allocate and initialize the space for a + * polygon marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initPolygonMarker ( + int *x, + int *y, /* vertex points */ + int npts, /* number of corners */ + int fill, /* fill polygon? */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initPolygonMarker (x, y, npts, fill, color, width, style) +int *x, *y; /* vertex points */ +int npts; /* number of corners */ +int fill; /* fill polygon? */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_POLYGON; + mk->xp = (int *) malloc (npts * sizeof(int)); + mk->yp = (int *) malloc (npts * sizeof(int)); + bcopy (x, mk->xp, npts * sizeof(int)); + bcopy (y, mk->yp, npts * sizeof(int)); + mk->x = mk->xp[0]; + mk->y = mk->yp[0]; + mk->npts = npts; + mk->fill = fill; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITCIRCLEMARKER -- Allocate and initialize the space for a + * circle marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initCircleMarker ( + int x, + int y, /* center position */ + int radius, /* radius of circle */ + int fill, /* fill circle? */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initCircleMarker (x, y, radius, fill, color, width, style) +int x, y; /* center position */ +int radius; /* radius of circle */ +int fill; /* fill circle? */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_CIRCLE; + mk->x = x; + mk->y = y; + mk->radius = radius; + mk->fill = fill; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITCIRCANNMARKER -- Allocate and initialize the space for a + * circular annuli marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initCircAnnMarker ( + int x, + int y, /* center position */ + int radius, /* radius of 1st annulus*/ + int nannuli, /* no. of annuli */ + int sep, /* annuli sep (pixels) */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initCircAnnMarker (x, y, radius, nannuli, sep, color, width, style) +int x, y; /* center position */ +int radius; /* radius of 1st annulus*/ +int nannuli; /* no. of annuli */ +int sep; /* annuli sep (pixels) */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_CIRCANN; + mk->x = x; + mk->y = y; + mk->radius = radius; + mk->nannuli = nannuli; + mk->sep = sep; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITELLIPSEMARKER -- Allocate and initialize the space for a + * ellipse marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initEllipseMarker ( + int x, + int y, /* center position */ + int xrad, + int yrad, /* x and y radii */ + float ang, /* position angle (deg) */ + int fill, /* fill ellipse? */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initEllipseMarker (x, y, xrad, yrad, ang, fill, color, width, style) +int x, y; /* center position */ +int xrad, yrad; /* x and y radii */ +float ang; /* position angle (deg) */ +int fill; /* fill ellipse? */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_ELLIPSE; + mk->x = x; + mk->y = y; + mk->xrad = xrad; + mk->yrad = yrad; + mk->ang = ang; + mk->fill = fill; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITELLANNMARKER -- Allocate and initialize the space for a + * elliptical annuli marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initEllAnnMarker ( + int x, + int y, /* center position */ + int xrad, + int yrad, /* radius of 1st annulus*/ + float ang, /* rotation angle */ + int nannuli, /* no. of annuli */ + int sep, /* annuli sep (pixels) */ + int color, /* marker color */ + int width, /* line width */ + int style /* line style */ +) +#else + +static MarkerPtr +cdl_initEllAnnMarker (x, y, xrad, yrad, ang, nannuli, sep, color, width, style) +int x, y; /* center position */ +int xrad, yrad; /* radius of 1st annulus*/ +float ang; /* rotation angle */ +int nannuli; /* no. of annuli */ +int sep; /* annuli sep (pixels) */ +int color; /* marker color */ +int width; /* line width */ +int style; /* line style */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_ELLIPANN; + mk->x = x; + mk->y = y; + mk->xrad = xrad; + mk->yrad = yrad; + mk->ang = ang; + mk->nannuli = nannuli; + mk->sep = sep; + mk->color = color; + mk->linewidth = width; + mk->linestyle = style; + return mk; +} + + +/* CDL_INITTEXTMARKER -- Allocate and initialize the space for a text marker. + */ + +#ifdef ANSI_FUNC + +static MarkerPtr +cdl_initTextMarker ( + int x, + int y, /* marker position */ + char *string, /* string to draw */ + float size, /* marker size (pixels) */ + int color, /* marker color */ + int font, /* text font */ + int width /* line width */ +) +#else + +static MarkerPtr +cdl_initTextMarker (x, y, string, size, color, font, width) +int x, y; /* marker position */ +char *string; /* string to draw */ +float size; /* marker size (pixels) */ +int color; /* marker color */ +int font; /* text font */ +int width; /* line width */ +#endif +{ + MarkerPtr mk = (MarkerPtr) calloc (1, sizeof(struct Marker)); + + mk->type = MK_TEXT; + mk->x = x; + mk->y = y; + mk->txsize = size; + mk->color = color; + mk->font = font; + mk->textwidth = width; + mk->str = (char *) malloc (strlen(string) + 1); + strcpy (mk->str, string); + return mk; +} + + + +#ifdef ANSI_FUNC + +static void +cdl_initMarkPos (MarkerPtr mk, int nx, int ny, int lx, int ly) +#else + +static void +cdl_initMarkPos (mk, nx, ny, lx, ly) +MarkerPtr mk; +int nx, ny; +int lx, ly; +#endif +{ + mk->nx = nx; + mk->ny = ny; + mk->lx = lx; + mk->ly = ly; +} + + + +/* ------------------------ + * Misc. Utility Procedures + * ------------------------*/ + +/* CDL_DOLINEINSUBRAS -- Draw a line between two arbitrary endpoints in a + * subraster. Line widths and styles are passed through to specialized + # routines. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doLineInSubRas ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int x1, + int x2, + int y1, + int y2, /* line endpoints */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_doLineInSubRas (pix, color, width, style, x1, x2, y1, y2, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int x1, y1, x2, y2; /* line endpoints */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + if (style == L_SOLID || style >= L_HOLLOW) { + if (width == 1 && style == L_SOLID) + cdl_drawVector (pix, color, x1, x2, y1, y2, lx, ly, nx, ny); + else { + cdl_drawThickVector (pix, color, width, style, x1, x2, y1, y2, + lx, ly, nx, ny); + } + } else { + ; + } +} + + +/* CDL_DOLINEINSUBRAS -- Draw a line between two arbitrary endpoints in a + * subraster. Line widths and styles are passed through to specialized + # routines. + */ + +#ifdef ANSI_FUNC + +static void +cdl_doDashedLine ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int *x, + int *y, /* line vertices */ + int npts, /* number of vertices */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_doDashedLine (pix, color, width, style, x, y, npts, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int *x, *y; /* line vertices */ +int npts; /* number of vertices */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + register int i, nseg = (npts - 1); + + if (cdl_debug) + printf ("[cdl_doDashedLine] npts=%d lx=%d ly=%d nseg=%d style=%d\n", + npts, lx, ly, nseg, style); + + /* Connect all the vertices. */ + if (width == 1) { + for (i=0; i < nseg; i++) + cdl_drawDashVec (pix, color, style, x[i], x[i+1], + y[i], y[i+1], lx, ly, nx, ny); + } else { + for (i=0; i < nseg; i++) { + cdl_drawThickDashVec (pix, color, width, style, x[i], x[i+1], + y[i], y[i+1], lx, ly, nx, ny); + + /* Restore the dashed line counters so we get a smooth line */ + dash = p_dash, dot = p_dot, dotdash = p_dotdash; + } + } +} + + +/* CDL_DRAWTHICKVECTOR -- Draw a line between two arbitrary endpoints in a + * subraster. We draw multiple vectors to achieve the line thickness. + */ + +#ifdef ANSI_FUNC + +static void +cdl_drawThickVector ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int x1, + int x2, + int y1, + int y2, /* line endpoints */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_drawThickVector (pix, color, width, style, x1, x2, y1, y2, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int x1, y1, x2, y2; /* line endpoints */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + register int i, new_x = x2, new_y = y2, dx = 0, dy = 0; + register int xshift = 0, yshift = 0, w = width, col = color; + register int xx1, xx2, yy1, yy2, n = 0, sign = 1; + + if (abs (new_x - x1) > abs (new_y - y1)) + dx = 0, dy = 1; + else + dx = 1, dy = 0; + + if (style == L_HOLLOW) + w = HOLLOW_LINE_WIDTH; + else if (style == L_SHADOW) + w = SHADOW_LINE_WIDTH; + + for (i=1; i <= w; i++) { + xx1 = x1 + xshift; + yy1 = y1 + yshift; + xx2 = new_x + xshift; + yy2 = new_y + yshift; + + if (style == L_HOLLOW && i == 1) + col = 0; + else if ((style == L_SHADOW && i % 2 && dx) || + (style == L_SHADOW && !(i % 2) && dy)) + col = 0; + else + col = color; + + cdl_drawVector (pix, col, xx1, xx2, yy1, yy2, lx, ly, nx, ny); + + n = (i + 1 + 0.5) / 2; + sign = ((i % 2 == 0) ? 1 : -1); + if (x1 == x2) + xshift = sign * dx * n; + else if (y1 == y2) + yshift = sign * dy * n; + else { + xshift = sign * dx * n; + yshift = sign * dy * n; + } + } +} + + +/* CDL_DRAWVECTOR -- Draw a line between two arbitrary endpoints in a + * subraster. Endpoints are given in image coordinates along with the + * subraster boundary, we translate to subraster coords before marking the + * pixel. This allows us to get a subraster for a larger object such as + * polygon and use the line primitive to draw each vertex before writing + * back a single subraster rather than use the less efficient sequence of + * server I/O calls for each line segment. Uses Bresenham's algorithm to + * get a smoother line. + */ + +#ifdef ANSI_FUNC + +static void +cdl_drawVector ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int x1, + int x2, + int y1, + int y2, /* line endpoints */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_drawVector (pix, color, x1, x2, y1, y2, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int x1, y1, x2, y2; /* line endpoints */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + register int i, d, x, y; + register int ax, ay, sx, sy, dx, dy; + + /* Use a Bresenham algorith do draw the line. */ + dx = x2 - x1; ax = ABS(dx) << 1; sx = SGN(dx); + dy = y2 - y1; ay = ABS(dy) << 1; sy = SGN(dy); + x = x1; + y = y1; + if (ax > ay) { /* X span is dominant */ + for (d = ay - (ax >> 1); x != x2; x += sx, d += ay) { + i = max (((y-ly) * nx) + min(nx-1,(x-lx)), 0); + pix[i] = color; + if (d >= 0) { + y += sy; + d -= ax; + } + } + } else { /* Y span is dominant */ + for (d = ax - (ay >> 1); y != y2; y += sy, d += ax) { + i = max (((y-ly) * nx) + min(nx-1,(x-lx)), 0); + pix[i] = color; + if (d >= 0) { + x += sx; + d -= ay; + } + } + } + i = max (((y-ly) * nx) + min(nx-1,(x-lx)), 0); + pix[i] = color; +} + + +/* CDL_DRAWTHICKDASHVEC -- Draw a line between two arbitrary endpoints in + * a subraster. We draw multiple vectors to achieve the line thickness. + */ + +#ifdef ANSI_FUNC + +static void +cdl_drawThickDashVec ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int width, /* line width */ + int style, /* line style */ + int x1, + int x2, + int y1, + int y2, /* line endpoints */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_drawThickDashVec (pix, color, width, style, x1, x2, y1, y2, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int width; /* line width */ +int style; /* line style */ +int x1, y1, x2, y2; /* line endpoints */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + register int i, new_x = x2, new_y = y2, dx = 0, dy = 0; + register int xshift = 0, yshift = 0; + register int xx1, xx2, yy1, yy2, n = 0, sign = 1; + + if (abs (new_x - x1) > abs (new_y - y1)) + dx = 0, dy = 1; + else + dx = 1, dy = 0; + + switch (style) { + case L_DASHED: SAVE_DASH_COUNT; break; + case L_DOTTED: SAVE_DOT_COUNT; break; + case L_DOTDASH: SAVE_DOTDASH_COUNT; break; + } + + for (i=1; i <= width; i++) { + xx1 = x1 + xshift; + yy1 = y1 + yshift; + xx2 = new_x + xshift; + yy2 = new_y + yshift; + + cdl_drawDashVec (pix, color, style, xx1, xx2, yy1, yy2, + lx, ly, nx, ny); + + if (i == 1) { + /* Save the dashed line counters so we get a smooth line */ + p_dash = dash, p_dot = dot, p_dotdash = dotdash; + } + + switch (style) { + case L_DASHED: RESTORE_DASH_COUNT; break; + case L_DOTTED: RESTORE_DOT_COUNT; break; + case L_DOTDASH: RESTORE_DOTDASH_COUNT; break; + } + + n = (i + 1 + 0.5) / 2; + sign = ((i % 2 == 0) ? 1 : -1); + if (x1 == x2) + xshift = sign * dx * n; + else if (y1 == y2) + yshift = sign * dy * n; + else { + xshift = sign * dx * n; + yshift = sign * dy * n; + } + } +} + + +/* CDL_DRAWDASHVEC -- Draw a line between two arbitrary endpoints in a + * subraster. Endpoints are given in image coordinates along with the + * subraster boundary, we translate to subraster coords before marking the + * pixel. This allows us to get a subraster for a larger object such as + * polygon and use the line primitive to draw each vertex before writing + * back a single subraster rather than use the less efficient sequence of + * server I/O calls for each line segment. Uses Bresenham's algorithm to + * get a smoother line. + */ + +#ifdef ANSI_FUNC + +static void +cdl_drawDashVec ( + uchar *pix, /* edit region raster */ + int color, /* overlay color */ + int style, /* line style */ + int x1, + int x2, + int y1, + int y2, /* line endpoints */ + int lx, + int ly, /* subraster LL corner */ + int nx, + int ny /* subraster size */ +) +#else + +static void +cdl_drawDashVec (pix, color, style, x1, x2, y1, y2, lx, ly, nx, ny) +uchar *pix; /* edit region raster */ +int color; /* overlay color */ +int style; /* line style */ +int x1, y1, x2, y2; /* line endpoints */ +int lx, ly; /* subraster LL corner */ +int nx, ny; /* subraster size */ +#endif +{ + register int i, d, x, y; + register int ax, ay, sx, sy, dx, dy; + + /* Use a Bresenham algorith do draw the line. */ + dx = x2 - x1; ax = ABS(dx) << 1; sx = SGN(dx); + dy = y2 - y1; ay = ABS(dy) << 1; sy = SGN(dy); + x = x1; + y = y1; + if (ax > ay) { /* X span is dominant */ + for (d = ay - (ax >> 1); x != x2; x += sx, d += ay) { + i = ((y-ly) * nx) + min(nx-1,(x-lx)); + i = max (i, 0); + pix[i] = cdl_setpixel (pix[i], style, color); + if (d >= 0) { + y += sy; + d -= ax; + } + } + } else { /* Y span is dominant */ + for (d = ax - (ay >> 1); y != y2; y += sy, d += ax) { + i = ((y-ly) * nx) + min(nx-1,(x-lx)); + i = max (i, 0); + pix[i] = cdl_setpixel (pix[i], style, color); + if (d >= 0) { + x += sx; + d -= ay; + } + } + } +} + + +/* CDL_SETPIXEL -- Set the pixel to the desired color and keep track of + * which pixels have been changed so we get a dashed line effect. + */ + +#ifdef ANSI_FUNC + +static uchar +cdl_setpixel ( + uchar pix, /* input pixel */ + int style, /* line style */ + int color /* line color */ +) +#else + +static uchar +cdl_setpixel (pix, style, color) +uchar pix; /* input pixel */ +int style; /* line style */ +int color; /* line color */ +#endif +{ + /* If the current pixel is already set just ignore it. We need + * to do this so that when drawing many small segments in a poly- + * line (e.g. a circle) we don't increment the dash counters un- + * necessarily so we can maintain the spacing. + */ + if (pix == color) + return (pix); + + switch (style) { + case L_DASHED: + return ((DASH_PIXEL ? color : pix)); + case L_DOTTED: + return ((DOT_PIXEL ? color : pix)); + case L_DOTDASH: + return ((DOTDASH_PIXEL ? color : pix)); + } + + return (color); +} + +/* CDL_FILLAREA -- Scan the pixel array and fill the area enclosed by the + * given color, or replace with those pixels from the reference raster. + * We assume the area to be filled is a simple closed convex polygon. + */ + +#ifdef ANSI_FUNC + +static void +cdl_fillArea ( + uchar *pix, /* edit region raster */ + int nx, + int ny, /* subraster size */ + int color /* overlay color */ +) +#else + +static void +cdl_fillArea (pix, nx, ny, color) +uchar *pix; /* edit region raster */ +int nx, ny; /* subraster size */ +int color; /* overlay color */ +#endif +{ + register int i, j, l, r; + + for (i=0; i < ny; i++) { + l = r = 0; + + /* Find the left endpoint. */ + while (l < nx && pix[(i * nx) + l] != color) + l++; + if (l != nx) { + + /* Find the right endpoint. */ + r = nx - 1; + while (r > l && pix[(i * nx) + r] != color) + r--; + + if (r > l) { + /* Fill the area in between. */ + for (j=l; j <= r; j++) + pix[(i*nx)+j] = color; + } + } + } +} + + +/* CDL_GETCIRCLECOORDS -- Compute the coords for points needed to draw a + * circle of a given radius at the given center. + */ + +#ifdef ANSI_FUNC + +static void +cdl_getCircleCoords ( + int xcen, + int ycen, /* circle center */ + int radius, /* circle radius */ + int *x, + int *y, /* output coords */ + int npts /* number of coords */ +) +#else + +static void +cdl_getCircleCoords (xcen, ycen, radius, x, y, npts) +int xcen, ycen; /* circle center */ +int radius; /* circle radius */ +int *x, *y; /* output coords */ +int npts; /* number of coords */ +#endif +{ + register int i, count, xoff, yoff; + register int a1, a2, a3, b1, b2, b3, b4; + static double UnitCircleX[12] = { + -0.06540312923014, -0.19509032201613, + -0.32143946530316, -0.44228869021900, + -0.55557023301960, -0.65934581510007, + -0.75183980747898, -0.83146961230255, + -0.89687274153269, -0.94693012949511, + -0.98078528040323, -0.99785892323860 + }; + static double UnitCircleY[12] = { + -0.99785892323860, -0.98078528040323, + -0.94693012949511, -0.89687274153269, + -0.83146961230255, -0.75183980747898, + -0.65934581510007, -0.55557023301960, + -0.44228869021900, -0.32143946530316, + -0.19509032201613, -0.06540312923014 + }; + + + /* Set up array indexes for 8 fold symetry */ + /* 8 indexes radiating both ways from each of the four axes */ + a1 = npts / 4; /* (1 * cnt) / 4 */ + a2 = a1 + a1; /* (2 * cnt) / 4 */ + a3 = a2 + a1; /* (3 * cnt) / 4 */ + b1 = a1 - 1; + b2 = a2 - 1; + b3 = a3 - 1; + b4 = a3 + a1 - 1; /* (4 * cnt) / 4 - 1 */ + + /* Calculate points on circumference for 1/8th of circle */ + /* Apply to each of 8 pairs */ + count = npts / 8; + xcen -= 1; /* fix for mysterious off-by-one bug */ + for( i=0; i <= count; i++ ) { + xoff = UnitCircleX[i] * radius + 0.5; + yoff = UnitCircleY[i] * radius + 0.5; + x[i] = xcen + xoff; + y[i] = ycen + yoff; + x[a1+i] = xcen + yoff; + y[a1+i] = ycen - xoff; + x[a2+i] = xcen - xoff; + y[a2+i] = ycen - yoff; + x[a3+i] = xcen - yoff; + y[a3+i] = ycen + xoff; + x[b1-i] = xcen + yoff; + y[b1-i] = ycen + xoff; + x[b2-i] = xcen + xoff; + y[b2-i] = ycen - yoff; + x[b3-i] = xcen - yoff; + y[b3-i] = ycen - xoff; + x[b4-i] = xcen - xoff; + y[b4-i] = ycen + yoff; + } + /* Close the circle (end point same as starting point) */ + x[npts-1] = x[0]; + y[npts-1] = y[0]; +} + + +/* CDL_GETELLIPSECOORDS -- Compute the coords for points needed to draw a + * ellipse w/ given axes and angle at the desired center. + */ + +#ifdef ANSI_FUNC + +static void +cdl_getEllipseCoords ( + int xcen, + int ycen, /* ellipse center */ + int xradius, + int yradius, /* ellipse axes */ + float rotang, /* angle from X axis */ + int *x, + int *y /* output coords */ +) +#else + +static void +cdl_getEllipseCoords (xcen, ycen, xradius, yradius, rotang, x, y) +int xcen, ycen; /* ellipse center */ +int xradius, yradius; /* ellipse axes */ +float rotang; /* angle from X axis */ +int *x, *y; /* output coords */ +#endif +{ + int loop; + float xoff, yoff; + double rotsin, rotcos; + register int i; + register int x1, x2, y1, y2; + register int a2, b1, b3; + static double UnitEllipseX[16] = { + -0.04906767432742, -0.14673047445536, + -0.24298017990326, -0.33688985339222, + -0.42755509343028, -0.51410274419322, + -0.59569930449243, -0.67155895484702, + -0.74095112535496, -0.80320753148064, + -0.85772861000027, -0.90398929312344, + -0.94154406518302, -0.97003125319454, + -0.98917650996478, -0.99879545620517 + }; + static double UnitEllipseY[16] = { + -0.99879545620517, -0.98917650996478, + -0.97003125319454, -0.94154406518302, + -0.90398929312344, -0.85772861000027, + -0.80320753148064, -0.74095112535496, + -0.67155895484702, -0.59569930449243, + -0.51410274419322, -0.42755509343028, + -0.33688985339222, -0.24298017990326, + -0.14673047445536, -0.04906767432742 + }; + + /* Set up array indexes for 8 fold symetry */ + /* 4 indexes radiating both ways from each of the two axis rays */ + a2 = N_ELLIPSE_PTS / 2; + b1 = a2 - 1; + b3 = N_ELLIPSE_PTS - 1; + + rotsin = sin ((double) ((double)rotang * 0.017453293)); + rotcos = cos ((double) ((double)rotang * 0.017453293)); + + /* Recalculate points on circumference */ + /* Apply to each of 4 pairs */ + loop = N_ELLIPSE_PTS / 4; + for( i=0; i < loop; i++ ) { + /* Calculate ray lengths for orthogonal case */ + xoff = UnitEllipseX[i] * xradius; + yoff = UnitEllipseY[i] * yradius; + + /* Calculate offset of two points on the right (rotate) */ + x2 = (xoff * rotcos) + (yoff * rotsin) + 0.5; + y2 = (xoff * rotsin) - (yoff * rotcos) - 0.5; + x1 = (xoff * rotcos) - (yoff * rotsin) - 0.5; + y1 = (xoff * rotsin) + (yoff * rotcos) + 0.5; + x[i] = xcen + x1; + y[i] = ycen + y1; + x[a2+i] = xcen - x1; + y[a2+i] = ycen - y1; + x[b1-i] = xcen + x2; + y[b1-i] = ycen + y2; + x[b3-i] = xcen - x2; + y[b3-i] = ycen - y2; + } + /* Close the circle (end point same as starting point) */ + x[N_ELLIPSE_PTS-1] = x[0]; + y[N_ELLIPSE_PTS-1] = y[0]; +} + + +/* CDL_MINMAX -- Find the array extrema. */ + +#ifdef ANSI_FUNC + +static void +cdl_minmax ( + int *array, /* array to check */ + int npts, /* no of points */ + int *amin, + int *amax /* extremes */ +) +#else + +static void +cdl_minmax (array, npts, amin, amax) +int *array; /* array to check */ +int npts; /* no of points */ +int *amin, *amax; /* extremes */ +#endif +{ + register int i; + + *amin = *amax = array[0]; + for (i=1; i < npts; i++) { + if (*amin > array[i]) *amin = array[i]; + if (*amax < array[i]) *amax = array[i]; + } +} + + +/* CDL_STRLEN -- Find the length of a string to be drawn. */ + +#ifdef ANSI_FUNC + +static int +cdl_strlen ( +char *str, /* string to draw */ +float txtsize, /* string size */ +int txtfont /* font */ +) +#else + +static int +cdl_strlen (str, txtsize, txtfont) +char *str; /* string to draw */ +float txtsize; /* string size */ +int txtfont; /* font */ +#endif +{ + char chr, *sp = str; + int ip, oldfont, font = txtfont, offset = 0; + register int i, cw, ch, len; + float size = txtsize; + + /* Loop over each character in the string. */ + len = 0; + cw = CHARACTER_WIDTH * (size * FONT_SCALE) + FONT_SPACE; + ch = CHARACTER_HEIGHT * (size * FONT_SCALE); + for (; *sp; sp++) { + + /* Check for an inline font escape. */ + if (*sp == '\\' && *(sp+1) == 'f') { + sp++; sp++; + if (*sp != 'P') + oldfont = font; + + switch (*sp) { + case 'R': + font = F_ROMAN; break; + case 'F': + font = F_FUTURA; break; + case 'T': + font = F_TIMES; break; + case 'G': + font = F_GREEK; break; + case 'P': + font = oldfont; break; + + /* Check for a super/subscript escape. */ + case 'U': + offset += ch / 2; + break; + case 'D': + offset -= ch / 2; + break; + } + sp++; + } + + /* Adjust the size if we're doing sub/superscript. */ + if (offset != 0) + size = txtsize * 0.666; + else + size = txtsize; + + if (*sp < CHARACTER_START || *sp > CHARACTER_END) + chr = i = '?' - CHARACTER_START; + else + chr = i = *sp - CHARACTER_START; + + /* Update the character position. */ + ip = (int) chr; + switch (font) { + case F_ROMAN: + len += cw; + break; + case F_GREEK: + len += (gchwid[ip] / 2) * (size * FONT_SCALE) + FONT_SPACE + 2; + break; + case F_TIMES: + len += (timwid[ip] -12) * (size * FONT_SCALE) + FONT_SPACE + 2; + break; + case F_FUTURA: + len += (futwid[ip] / 2) * (size * FONT_SCALE) + FONT_SPACE + 2; + break; + } + } + return (len); +} + + +/* BITUPK -- Unpack an unsigned integer bit field from a longword. + */ + +unsigned bitmask[] = { 0, /* MACHDEP */ + 01, 03, 07, + 017, 037, 077, + 0177, 0377, 0777, + 01777, 03777, 07777, + 017777, 037777, 077777, + 0177777, 0377777, 0777777, + 01777777, 03777777, 07777777, + 017777777, 037777777, 077777777, + 0177777777, 0377777777, 0777777777, + 01777777777, 03777777777, 07777777777, + 017777777777, 037777777777 +}; + +#ifdef ANSI_FUNC + +static int +bitupk ( + unsigned int wordp, /* longword to be examined */ + int offset, /* one-indexed offset of first bit */ + int nbits /* number of bits to be set */ +) +#else + +static int +bitupk (wordp, offset, nbits) +unsigned int wordp; /* longword to be examined */ +int offset; /* one-indexed offset of first bit */ +int nbits; /* number of bits to be set */ +#endif +{ + return ((wordp >> (offset-1)) & bitmask[nbits]); +} + diff --git a/vendor/x11iraf/cdl/cdlspp.h b/vendor/x11iraf/cdl/cdlspp.h new file mode 100644 index 00000000..b3e78cae --- /dev/null +++ b/vendor/x11iraf/cdl/cdlspp.h @@ -0,0 +1,131 @@ + +# CDL_SPP.H -- Header file for the CDL SPP interface. Fortran compilers +# on various platforms may append one or more trailing underscores to +# symbol names, we'll use macros for the interface names and use defines +# to see what the symbol name is. + + +define FB_AUTO -1 # autoconfig the frame buffer + +# Types of greyscale transformations. +define CDL_UNITARY 0 # values map without change +define CDL_LINEAR 1 # linear mapping +define CDL_LOG 2 # logarithmic mapping + +# Overlay colors. +define C_BLACK 202 # static overlay color defs +define C_WHITE 203 +define C_RED 204 +define C_GREEN 205 +define C_BLUE 206 +define C_YELLOW 207 +define C_CYAN 208 +define C_MAGENTA 209 +define C_CORAL 210 +define C_MAROON 211 +define C_ORANGE 212 +define C_KHAKI 213 +define C_ORCHID 214 +define C_TURQUOISE 215 +define C_VIOLET 216 +define C_WHEAT 217 + +# Overlay point mark types. +define M_FILL 1 +define M_POINT 2 +define M_BOX 4 +define M_PLUS 8 +define M_CROSS 16 +define M_DIAMOND 32 +define M_CIRCLE 64 +define M_STAR 128 +define M_HLINE 256 +define M_VLINE 512 +define M_HBLINE 1024 +define M_VBLINE 2048 + +# Font types. +define F_ROMAN 0 +define F_GREEK 1 +define F_FUTURA 2 +define F_TIMES 3 +define F_BOLD 4 + +# Polyline attribute values. +define L_SOLID 0 +define L_DASHED 1 +define L_DOTTED 2 +define L_DOTDASH 3 +define L_HOLLOW 4 +define L_SHADOW 5 + + +# Map the SPP names to the symbols in the library. +define cdl_open cdopen_ +define cdl_displayPix cdsppx_ +define cdl_readCursor crdcur_ +define cdl_setCursor cscurs_ +define cdl_clearFrame cclfrm_ +define cdl_selectFB cselfb_ +define cdl_close cclose_ +define cdl_displayIRAF cdspir_ +define cdl_isIRAF cisirf_ +define cdl_readIRAF crdirf_ +define cdl_displayFITS cdspft_ +define cdl_isFITS cisfts_ +define cdl_readFITS crdfts_ +define cdl_compZScale ccmpzs_ +define cdl_zscaleImage czscim_ +define cdl_printPix cprpix_ +define cdl_printPixToFile cprpfl_ +define cdl_readImage crdimg_ +define cdl_readFrameBuffer crdfrb_ +define cdl_readSubRaster crsubr_ +define cdl_writesubRaster cwsubr_ +define cdl_setWCS cstwcs_ +define cdl_setFBConfig csfbcf_ +define cdl_getFBConfig cgfbcf_ +define cdl_lookupFBSize clkfbs_ +define cdl_setFrame csfram_ +define cdl_setZTrans csztrn_ +define cdl_setZScale cszscl_ +define cdl_setSample cssamp_ +define cdl_setSampleLines cssaml_ +define cdl_setContrast cscntr_ +define cdl_setName csname_ +define cdl_setTitle cstitl_ +define cdl_getWCS cgtwcs_ +define cdl_getFrame cgfram_ +define cdl_getZTrans cgztrn_ +define cdl_getZScale cgzscl_ +define cdl_getSample cgsamp_ +define cdl_getSampleLines cgsmpl_ +define cdl_getContrast cgcntr_ +define cdl_getName cgname_ +define cdl_getTitle cgtitl_ +define cdl_mapFrame cmapfr_ +define cdl_markCoordsFile cmkcfl_ +define cdl_markPoint cmkpnt_ +define cdl_markPointLabel cmkpnl_ +define cdl_markLine cmklin_ +define cdl_markBox cmkbox_ +define cdl_markPolyline cmkpln_ +define cdl_markPolygon cmkpgn_ +define cdl_markCircle cmkcrc_ +define cdl_markCircAnnuli cmkcan_ +define cdl_markEllipse cmkell_ +define cdl_markEllipAnnuli cmkela_ +define cdl_markText cmktxt_ +define cdl_setFont csfont_ +define cdl_setLineWidth cslwid_ +define cdl_setLineStyle cslsty_ +define cdl_setTextWidth cstwid_ +define cdl_deleteMark cdelmk_ +define cdl_clearOverlay cclrov_ +define cdl_redrawOverlay crdrov_ +define cdl_setDebug cstdbg_ +define cdl_setMapping cstmap_ +define cdl_getMapping cgtmap_ +define cdl_queryMap cqrmap_ + + diff --git a/vendor/x11iraf/cdl/cdlzscale.c b/vendor/x11iraf/cdl/cdlzscale.c new file mode 100644 index 00000000..e7881ef2 --- /dev/null +++ b/vendor/x11iraf/cdl/cdlzscale.c @@ -0,0 +1,688 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + + +/* + * ZSCALE -- Compute the optimal Z1, Z2 (range of greyscale values to be + * displayed) of an image. For efficiency a statistical subsample of an image + * is used. The pixel sample evenly subsamples the image in x and y. The + * entire image is used if the number of pixels in the image is smaller than + * the desired sample. + * + * The sample is accumulated in a buffer and sorted by greyscale value. + * The median value is the central value of the sorted array. The slope of a + * straight line fitted to the sorted sample is a measure of the standard + * deviation of the sample about the median value. Our algorithm is to sort + * the sample and perform an iterative fit of a straight line to the sample, + * using pixel rejection to omit gross deviants near the endpoints. The fitted + * straight line is the transfer function used to map image Z into display Z. + * If more than half the pixels are rejected the full range is used. The slope + * of the fitted line is divided by the user-supplied contrast factor and the + * final Z1 and Z2 are computed, taking the origin of the fitted line at the + * median value. + */ + +#define MIN_NPIXELS 5 /* smallest permissible sample */ +#define MAX_REJECT 0.5 /* max frac. of pixels to be rejected */ +#define GOOD_PIXEL 0 /* use pixel in fit */ +#define BAD_PIXEL 1 /* ignore pixel in all computations */ +#define REJECT_PIXEL 2 /* reject pixel after a bit */ +#define KREJ 2.5 /* k-sigma pixel rejection factor */ +#define MAX_ITERATIONS 5 /* maximum number of fitline iterations */ + +#undef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#undef mod +#define mod(a,b) ((a) % (b)) +#undef nint +#define nint(a) ((int)(a + 0.5)) +#undef abs +#define abs(a) ((a) >= 0 ? (a) : -(a)) + + +extern int cdl_debug; + +#ifdef ANSI_FUNC + +void cdl_zscale(unsigned char *im, int nx, int ny, int bitpix, float *z1, float *z2, float contrast, int opt_size, int len_stdline); +int sampleImage(unsigned char *im, int bitpix, float **sample, int nx, int ny, int optimal_size, int len_stdline); + +static void subSample(float *a, float *b, int npix, int step); +int fitLine(float *data, int npix, float *zstart, float *zslope, float krej, int ngrow, int maxiter); +static void flattenData(float *data, float *flat, float *x, int npix, double +z0, double dz); +int computeSigma(float *a, char *badpix, int npix, double *mean, double *sigma); +int rejectPixels(float *data, float *flat, float *normx, char *badpix, int npix, double *sumxsqr, double *sumxz, double *sumx, double *sumz, double threshold, int ngrow); +int floatCompare(float *i, float *j); + +#else + +int rejectPixels(), computeSigma(); +int sampleImage(), fitLine(), floatCompare(); + +static void flattenData(); +static void subSample(); + +#endif + +/* Compatibility hacks. */ +#ifdef AUX + +#ifdef ANSI_FUNC +void * memmove (void *a, const void *b, size_t n) +#else +void *memmove(a,b,n) void *a; const void *b; size_t n; +#endif + + { bcopy(b,a,n); } + +#else + +#if defined(sun) && !defined(SYSV) + +#ifdef ANSI_FUNC +void * memmove (void *a, void *b, int n) +#else +void *memmove(a,b,n) void *a, *b; int n; +#endif + + { bcopy(b,a,n); } +#endif +#endif + + + +/* CDL_ZSCALE -- Sample the image and compute optimal Z1 and Z2 values. + */ + +#ifdef ANSI_FUNC + +void +cdl_zscale ( + unsigned char *im, /* image data to be sampled */ + int nx, + int ny, /* image dimensions */ + int bitpix, /* bits per pixel */ + float *z1, + float *z2, /* output min and max greyscale values */ + float contrast, /* adj. to slope of transfer function */ + int opt_size, /* desired number of pixels in sample */ + int len_stdline /* optimal number of pixels per line */ +) +#else + +void +cdl_zscale (im, nx, ny, bitpix, z1, z2, contrast, opt_size, len_stdline) + +unsigned char *im; /* image data to be sampled */ +int nx, ny; /* image dimensions */ +int bitpix; /* bits per pixel */ +float *z1, *z2; /* output min and max greyscale values */ +float contrast; /* adj. to slope of transfer function */ +int opt_size; /* desired number of pixels in sample */ +int len_stdline; /* optimal number of pixels per line */ +#endif +{ + register int npix, minpix, ngoodpix, center_pixel, ngrow; + float zmin, zmax, median; + float zstart, zslope; + float *sample = NULL, *left = NULL; + + + if (cdl_debug) + printf ("[cdl_zscale] %dx%d-%d cont=%g optsz=%d len=%d\n", + nx, ny, bitpix, contrast, opt_size, len_stdline); + + /* Subsample the image. */ + npix = sampleImage((unsigned char *)im, bitpix, &sample, nx, ny, + opt_size, len_stdline); + + /* Sort the sample, compute the minimum, maximum, and median pixel + * values. + */ + qsort (sample, npix, sizeof (float), floatCompare); + zmin = *sample; + zmax = *(sample+npix-1); + + /* The median value is the average of the two central values if there + * are an even number of pixels in the sample. + */ + center_pixel = max (1, (npix + 1) / 2); + left = &(sample[center_pixel - 1]); + if (mod (npix, 2) == 1 || center_pixel >= npix) + median = *left; + else + median = (*left + *(left+1)) / 2; + + /* Fit a line to the sorted sample vector. If more than half of the + * pixels in the sample are rejected give up and return the full range. + * If the user-supplied contrast factor is not 1.0 adjust the scale + * accordingly and compute Z1 and Z2, the y intercepts at indices 1 and + * npix. + */ + minpix = max (MIN_NPIXELS, (int) (npix * MAX_REJECT)); + ngrow = max (1, nint (npix * .01)); + ngoodpix = fitLine (sample, npix, &zstart, &zslope, + KREJ, ngrow, MAX_ITERATIONS); + + if (ngoodpix < minpix) { + *z1 = zmin; + *z2 = zmax; + } else { + if (contrast > 0) + zslope = zslope / contrast; + *z1 = max (zmin, median - (center_pixel - 1) * zslope); + *z2 = min (zmax, median + (npix - center_pixel) * zslope); + } + + if (cdl_debug) { + printf("[cdl_zscale] zmin=%g zmax=%g left=%g median=%g\n", + zmin, zmax, *left, median); + printf("[cdl_zscale] minpix=%d ngrow=%d ngoodpix=%d\n", + minpix, ngrow, ngoodpix); + printf("[cdl_zscale] zslope=%g center_pix=%d z1=%g z2=%g\n", + zslope, center_pixel, *z1, *z2); + } + + /* Clean up. */ + free ((float *)sample); +} + + +/* sampleImage -- Extract an evenly gridded subsample of the pixels from + * a two-dimensional image into a one-dimensional vector. + */ + +#ifdef ANSI_FUNC + +int +sampleImage ( + unsigned char *im, /* image to be sampled */ + int bitpix, /* bits per pixel in image */ + float **sample, /* output vector containing the sample */ + int nx, + int ny, /* image dimensions */ + int optimal_size, /* desired number of pixels in sample */ + int len_stdline /* optimal number of pixels per line */ +) +#else + +int +sampleImage (im, bitpix, sample, nx, ny, optimal_size, len_stdline) + +unsigned char *im; /* image to be sampled */ +int bitpix; /* bits per pixel in image */ +float **sample; /* output vector containing the sample */ +int nx, ny; /* image dimensions */ +int optimal_size; /* desired number of pixels in sample */ +int len_stdline; /* optimal number of pixels per line */ +#endif +{ + register int i; + int ncols, nlines, col_step, line_step, maxpix, line; + int opt_npix_per_line, npix_per_line, npix = 0; + int opt_nlines_in_sample, min_nlines_in_sample, max_nlines_in_sample; + float *op = NULL, *row = NULL; + int *ipix = NULL; + float *fpix = NULL; + double *dpix = NULL; + short *spix = NULL; + char *bpix = NULL; + + + ncols = nx; + nlines = ny; + + /* Compute the number of pixels each line will contribute to the sample, + * and the subsampling step size for a line. The sampling grid must + * span the whole line on a uniform grid. + */ + opt_npix_per_line = max (1, min (ncols, len_stdline)); + col_step = max (2, (ncols + opt_npix_per_line-1) / opt_npix_per_line); + npix_per_line = max (1, (ncols + col_step-1) / col_step); + if (cdl_debug) + printf ("[sampleImage] opt_npix/line=%d col_step=%d n/line=%d\n", + opt_npix_per_line, col_step, npix_per_line); + + /* Compute the number of lines to sample and the spacing between lines. + * We must ensure that the image is adequately sampled despite its + * size, hence there is a lower limit on the number of lines in the + * sample. We also want to minimize the number of lines accessed when + * accessing a large image, because each disk seek and read is ex- + * pensive. The number of lines extracted will be roughly the sample + * size divided by len_stdline, possibly more if the lines are very + * short. + */ + min_nlines_in_sample = max (1, optimal_size / len_stdline); + opt_nlines_in_sample = max(min_nlines_in_sample, min(nlines, + (optimal_size + npix_per_line-1) / npix_per_line)); + line_step = max (2, nlines / (opt_nlines_in_sample)); + max_nlines_in_sample = (nlines + line_step-1) / line_step; + if (cdl_debug) + printf ("[sampleImage] nl_in_samp=%d/%d opt_nl/samp=%d lstep=%d\n", + min_nlines_in_sample, opt_nlines_in_sample, line_step, + max_nlines_in_sample); + + /* Allocate space for the output vector. Buffer must be freed by our + * caller. + */ + maxpix = npix_per_line * max_nlines_in_sample; + *sample = (float *) malloc (maxpix * sizeof (float)); + row = (float *) malloc (nx * sizeof (float)); + + /* Extract the vector. */ + op = *sample; + for (line = (line_step + 1)/2; line < nlines; line+=line_step) { + /* Load a row of float values from the image */ + switch (bitpix) { + case 8: + bpix = (char *) &im[(line-1) * nx * sizeof(char)]; + for (i=0; i < nx; i++) + row[i] = (float) bpix[i]; + break; + case 16: + spix = (short *) &im[(line-1) * nx * sizeof(short)]; + for (i=0; i < nx; i++) + row[i] = (float) spix[i]; + break; + case 32: + ipix = (int *) &im[(line-1) * nx * sizeof(int)]; + for (i=0; i < nx; i++) + row[i] = (float) ipix[i]; + break; + case -32: + fpix = (float *) &im[(line-1) * nx * sizeof(float)]; + for (i=0; i < nx; i++) + row[i] = (float) fpix[i]; + break; + case -64: + dpix = (double *) &im[(line-1) * nx * sizeof(double)]; + for (i=0; i < nx; i++) + row[i] = (float) dpix[i]; + break; + } + + subSample (row, op, npix_per_line, col_step); + op += npix_per_line; + npix += npix_per_line; + if (npix > maxpix) + break; + } + + free ((float *)row); + return (npix); +} + + +/* subSample -- Subsample an image line. Extract the first pixel and + * every "step"th pixel thereafter for a total of npix pixels. + */ + +#ifdef ANSI_FUNC + +static void +subSample (float *a, float *b, int npix, int step) +#else + +static void +subSample (a, b, npix, step) +float *a; +float *b; +int npix, step; +#endif +{ + register int ip, i; + + if (step <= 1) + memmove (b, a, npix); + else { + ip = 0; + for (i=0; i < npix; i++) { + b[i] = a[ip]; + ip += step; + } + } +} + + +/* fitLine -- Fit a straight line to a data array of type real. This is + * an iterative fitting algorithm, wherein points further than ksigma from the + * current fit are excluded from the next fit. Convergence occurs when the + * next iteration does not decrease the number of pixels in the fit, or when + * there are no pixels left. The number of pixels left after pixel rejection + * is returned as the function value. + */ + +#ifdef ANSI_FUNC + +int +fitLine ( + float *data, /* data to be fitted */ + int npix, /* number of pixels before rejection */ + float *zstart, /* Z-value of pixel data[1] (output) */ + float *zslope, /* dz/pixel (output) */ + float krej, /* k-sigma pixel rejection factor */ + int ngrow, /* number of pixels of growing */ + int maxiter /* max iterations */ +) +#else + +int +fitLine (data, npix, zstart, zslope, krej, ngrow, maxiter) + +float *data; /* data to be fitted */ +int npix; /* number of pixels before rejection */ +float *zstart; /* Z-value of pixel data[1] (output) */ +float *zslope; /* dz/pixel (output) */ +float krej; /* k-sigma pixel rejection factor */ +int ngrow; /* number of pixels of growing */ +int maxiter; /* max iterations */ +#endif +{ + int i, ngoodpix, last_ngoodpix, minpix, niter; + double xscale, z0, dz, o_dz, x, z, mean, sigma, threshold; + double sumxsqr, sumxz, sumz, sumx, rowrat; + float *flat, *normx; + char *badpix; + + if (npix <= 0) + return (0); + else if (npix == 1) { + *zstart = data[1]; + *zslope = 0.0; + return (1); + } else + xscale = 2.0 / (npix - 1); + + /* Allocate a buffer for data minus fitted curve, another for the + * normalized X values, and another to flag rejected pixels. + */ + flat = (float *) malloc (npix * sizeof (float)); + normx = (float *) malloc (npix * sizeof (float)); + badpix = (char *) calloc (npix, sizeof(char)); + + /* Compute normalized X vector. The data X values [1:npix] are + * normalized to the range [-1:1]. This diagonalizes the lsq matrix + * and reduces its condition number. + */ + for (i=0; i<npix; i++) + normx[i] = i * xscale - 1.0; + + /* Fit a line with no pixel rejection. Accumulate the elements of the + * matrix and data vector. The matrix M is diagonal with + * M[1,1] = sum x**2 and M[2,2] = ngoodpix. The data vector is + * DV[1] = sum (data[i] * x[i]) and DV[2] = sum (data[i]). + */ + sumxsqr = 0; + sumxz = 0; + sumx = 0; + sumz = 0; + + for (i=0; i<npix; i++) { + x = normx[i]; + z = data[i]; + sumxsqr = sumxsqr + (x * x); + sumxz = sumxz + z * x; + sumz = sumz + z; + } + + /* Solve for the coefficients of the fitted line. */ + z0 = sumz / npix; + dz = o_dz = sumxz / sumxsqr; + + /* Iterate, fitting a new line in each iteration. Compute the flattened + * data vector and the sigma of the flat vector. Compute the lower and + * upper k-sigma pixel rejection thresholds. Run down the flat array + * and detect pixels to be rejected from the fit. Reject pixels from + * the fit by subtracting their contributions from the matrix sums and + * marking the pixel as rejected. + */ + ngoodpix = npix; + minpix = max (MIN_NPIXELS, (int) (npix * MAX_REJECT)); + + for (niter=0; niter < maxiter; niter++) { + last_ngoodpix = ngoodpix; + + /* Subtract the fitted line from the data array. */ + flattenData (data, flat, normx, npix, z0, dz); + + /* Compute the k-sigma rejection threshold. In principle this + * could be more efficiently computed using the matrix sums + * accumulated when the line was fitted, but there are problems with + * numerical stability with that approach. + */ + ngoodpix = computeSigma (flat, badpix, npix, &mean, &sigma); + threshold = sigma * krej; + + /* Detect and reject pixels further than ksigma from the fitted + * line. + */ + ngoodpix = rejectPixels (data, flat, normx, + badpix, npix, &sumxsqr, &sumxz, &sumx, &sumz, threshold, + ngrow); + + /* Solve for the coefficients of the fitted line. Note that after + * pixel rejection the sum of the X values need no longer be zero. + */ + if (ngoodpix > 0) { + rowrat = sumx / sumxsqr; + z0 = (sumz - rowrat * sumxz) / (ngoodpix - rowrat * sumx); + dz = (sumxz - z0 * sumx) / sumxsqr; + } + + if (ngoodpix >= last_ngoodpix || ngoodpix < minpix) + break; + } + + /* Transform the line coefficients back to the X range [1:npix]. */ + *zstart = z0 - dz; + *zslope = dz * xscale; + if (abs(*zslope) < 0.001) + *zslope = o_dz * xscale; + + free ((float *)flat); + free ((float *)normx); + free ((char *)badpix); + return (ngoodpix); +} + + +/* flattenData -- Compute and subtract the fitted line from the data array, + * returned the flattened data in FLAT. + */ + +#ifdef ANSI_FUNC + +static void +flattenData ( + float *data, /* raw data array */ + float *flat, /* flattened data (output) */ + float *x, /* x value of each pixel */ + int npix, /* number of pixels */ + double z0, + double dz /* z-intercept, dz/dx of fitted line */ +) +#else + +static void +flattenData (data, flat, x, npix, z0, dz) +float *data; /* raw data array */ +float *flat; /* flattened data (output) */ +float *x; /* x value of each pixel */ +int npix; /* number of pixels */ +double z0, dz; /* z-intercept, dz/dx of fitted line */ +#endif +{ + register int i; + + for (i=0; i < npix; i++) + flat[i] = data[i] - (x[i] * dz + z0); +} + + +/* computeSigma -- Compute the root mean square deviation from the + * mean of a flattened array. Ignore rejected pixels. + */ + +#ifdef ANSI_FUNC + +int +computeSigma ( + float *a, /* flattened data array */ + char *badpix, /* bad pixel flags (!= 0 if bad pixel) */ + int npix, + double *mean, + double *sigma /* (output) */ +) +#else + +int +computeSigma (a, badpix, npix, mean, sigma) + +float *a; /* flattened data array */ +char *badpix; /* bad pixel flags (!= 0 if bad pixel) */ +int npix; +double *mean, *sigma; /* (output) */ +#endif +{ + float pixval; + int i, ngoodpix = 0; + double sum = 0.0, sumsq = 0.0, temp; + + /* Accumulate sum and sum of squares. */ + for (i=0; i < npix; i++) + if (badpix[i] == GOOD_PIXEL) { + pixval = a[i]; + ngoodpix = ngoodpix + 1; + sum = sum + pixval; + sumsq = sumsq + pixval * pixval; + } + + /* Compute mean and sigma. */ + switch (ngoodpix) { + case 0: + *mean = INDEF; + *sigma = INDEF; + break; + case 1: + *mean = sum; + *sigma = INDEF; + break; + default: + *mean = sum / (double) ngoodpix; + temp = sumsq / (double) (ngoodpix-1) - + (sum*sum) / (double) (ngoodpix*(ngoodpix - 1)); + if (temp < 0) /* possible with roundoff error */ + *sigma = 0.0; + else + *sigma = sqrt (temp); + } + + return (ngoodpix); +} + + +/* rejectPixels -- Detect and reject pixels more than "threshold" greyscale + * units from the fitted line. The residuals about the fitted line are given + * by the "flat" array, while the raw data is in "data". Each time a pixel + * is rejected subtract its contributions from the matrix sums and flag the + * pixel as rejected. When a pixel is rejected reject its neighbors out to + * a specified radius as well. This speeds up convergence considerably and + * produces a more stringent rejection criteria which takes advantage of the + * fact that bad pixels tend to be clumped. The number of pixels left in the + * fit is returned as the function value. + */ + +#ifdef ANSI_FUNC + +int +rejectPixels ( + float *data, /* raw data array */ + float *flat, /* flattened data array */ + float *normx, /* normalized x values of pixels */ + char *badpix, /* bad pixel flags (!= 0 if bad pixel) */ + int npix, + double *sumxsqr, + double *sumxz, + double *sumx, + double *sumz,/* matrix sums */ + double threshold, /* threshold for pixel rejection */ + int ngrow /* number of pixels of growing */ +) +#else + +int +rejectPixels (data, flat, normx, badpix, npix, + sumxsqr, sumxz, sumx, sumz, threshold, ngrow) + +float *data; /* raw data array */ +float *flat; /* flattened data array */ +float *normx; /* normalized x values of pixels */ +char *badpix; /* bad pixel flags (!= 0 if bad) */ +int npix; +double *sumxsqr,*sumxz,*sumx,*sumz; /* matrix sums */ +double threshold; /* threshold for pixel rejection */ +int ngrow; /* number of pixels of growing */ +#endif +{ + int ngoodpix, i, j; + float residual, lcut, hcut; + double x, z; + + ngoodpix = npix; + lcut = -threshold; + hcut = threshold; + + for (i=0; i < npix; i++) { + if (badpix[i] == BAD_PIXEL) + ngoodpix = ngoodpix - 1; + else { + residual = flat[i]; + if (residual < lcut || residual > hcut) { + /* Reject the pixel and its neighbors out to the growing + * radius. We must be careful how we do this to avoid + * directional effects. Do not turn off thresholding on + * pixels in the forward direction; mark them for rejection + * but do not reject until they have been thresholded. + * If this is not done growing will not be symmetric. + */ + for (j=max(0,i-ngrow); j < min(npix,i+ngrow); j++) { + if (badpix[j] != BAD_PIXEL) { + if (j <= i) { + x = (double) normx[j]; + z = (double) data[j]; + *sumxsqr = *sumxsqr - (x * x); + *sumxz = *sumxz - z * x; + *sumx = *sumx - x; + *sumz = *sumz - z; + badpix[j] = BAD_PIXEL; + ngoodpix = ngoodpix - 1; + } else + badpix[j] = REJECT_PIXEL; + } + } + } + } + } + + return (ngoodpix); +} + + +#ifdef ANSI_FUNC + +int +floatCompare (float *i, float *j) +#else + +int floatCompare (i,j) +float *i, *j; +#endif +{ + return ((*i <= *j) ? -1 : 1); +} diff --git a/vendor/x11iraf/cdl/comm.c b/vendor/x11iraf/cdl/comm.c new file mode 100644 index 00000000..a155bc76 --- /dev/null +++ b/vendor/x11iraf/cdl/comm.c @@ -0,0 +1,789 @@ +#include <stdio.h> +#include <sys/errno.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + + +/* + * COMMUNICATIONS INTERFACE -- The communications interface handles all the + * low-level communications with the server. It implements only the subset + * of the IIS protocol used by XImtool, SAOtng and SAOimage, not the entire + * IIS protocol. It may be swapped out for another protocol in the future + * without affecting the tasks which use it as long as the basic steps re- + * quired for image display are the same. + * + * com_writeData (fdout, x, y, pix, nbytes) + * com_readData (fdin, x, y, &pix, &bytes) + * com_writeSubraster (fdout, x, y, pix, nx, ny) + * com_readSubraster (fdin, x, y, &pix, &nx, &ny) + * com_readCursor (fdin, fdout, sample, &x, &y, &wcs, &key) + * com_setCursor (fdout, x, y, wcs) + * com_setFBConfig (fdout, configno) + * com_setFrame (fdout, frame) + * com_writeWCS (fdout, buffer, nbytes, version) + * com_readWCS (fdin, fdout, &buffer, &nbytes, &version) + * com_eraseFrame (fdout) + * com_wcsVersion (fdin, fdout) + * + * We do not actually display images here, all we do is send the individual + * set frame, write a data chunk, etc commands. The caller is responsible for + * coordinating these calls into a legal sequence for image display. + * All routines return 0 if successfull and 1 otherwise. + */ + +/* Function prototypes */ +#ifdef __STDC__ +#include <stddef.h> +#include <stdlib.h> +#endif + + +/* Command definitions */ +#define MEMORY 01 /* frame buffer i/o */ +#define LUT 02 /* lut i/o */ +#define FEEDBACK 05 /* used for frame clears */ +#define IMCURSOR 020 /* logical image cursor */ +#define WCS 021 /* used to set WCS */ + +#define PACKED 0040000 +#define IMC_SAMPLE 0040000 +#define COMMAND 0100000 +#define IIS_WRITE 0400000 +#define IIS_READ 0100000 + + + +/* IIS header packet structure. DO NOT CHANGE. */ +typedef struct { + short tid; /* transfer id */ + short thingct; /* thing count */ + short subunit; /* subunit */ + short checksum; /* check sum */ + short x, y, z, t; /* registers */ +} iis_hdr; + + +static int frame = 1, fbconfig = 1; +static int com_debug = 0; +extern int errno; + +#ifdef ANSI_FUNC + +static int com_whdr(int fd, int tid, int subunit, int thingct, int x, int y, int z, int t); +static int com_write(int fd, char *buf, int nbytes); +static int com_read(int fd, char *buf, int maxbytes, int *nbytes); + +#else + +static int com_whdr(), com_write(), com_read(); + +#endif + + + +/* COM_WRITEDATA -- Write a block of data to the display. This does not + * display the entire image, it just writes an array of pixels to the server. + */ + +#ifdef ANSI_FUNC + +int +com_writeData ( + int fd, /* connection file descriptor */ + short x, + short y, /* corner of array */ + uchar *pix, /* pixel array */ + int nbytes /* number of bytes write */ +) +#else + +int +com_writeData (fd, x, y, pix, nbytes) +int fd; /* connection file descriptor */ +short x, y; /* corner of array */ +uchar *pix; /* pixel array */ +int nbytes; /* number of bytes write */ +#endif +{ + int status = 0; + + /* Send the IIS command for a data write. */ + if (com_whdr (fd, IIS_WRITE | PACKED, MEMORY, -nbytes, x, y, + 1<<(frame-1), 0)) { + if (com_debug >= 2) + printf ("com_writeData: error return from header write.\n"); + return (ERR); + } + + /* Send the pixels. */ + status = com_write (fd, (char *)pix, nbytes); + if (status && com_debug >= 2) + printf ("com_writeData: error return from data write.\n"); + return (status); +} + + +/* COM_READDATA -- Read a block of data at a given location from the + * display. + */ + +#ifdef ANSI_FUNC + +int +com_readData ( + int fdin, + int fdout, /* connection file descriptors */ + short x, + short y, /* corner of readout */ + uchar *pix, /* output pixel array */ + int *npix /* number of bytes read */ +) +#else + +int +com_readData (fdin, fdout, x, y, pix, npix) +int fdin, fdout; /* connection file descriptors */ +short x, y; /* corner of readout */ +uchar *pix; /* output pixel array */ +int *npix; /* number of bytes read */ +#endif +{ + int status = 0, nb = 0, n = *npix; + + /* Send the IIS command for a data read. */ + if (com_whdr (fdout, IIS_READ | PACKED, MEMORY, -(*npix), x, y, + 1<<(frame-1), 0)) { + if (com_debug >= 2) + printf ("com_readData: error return from header read.\n"); + return (ERR); + } + + /* Get the pixels. */ + if (pix == NULL) + pix = (uchar *) malloc ((unsigned) *npix); + + while (nb < *npix) { + status = com_read (fdin, (char *)pix+nb, n, &n); + if (status && com_debug >= 2) { + printf ("com_readData: error return from data read.\n"); + return (ERR); + } + nb += n; + n = *npix - nb; + } + return (OK); +} + + +/* COM_WRITESUBRASTER -- Write a block of data to the display. This does not + * display the entire image, it just writes an array of pixels to the server. + */ + +#ifdef ANSI_FUNC + +int +com_writeSubraster ( + int fd, /* connection file descriptor */ + short x, + short y, /* corner of array */ + uchar *pix, /* pixel array */ + int nx, int ny /* number of bytes write at pos */ +) +#else + +int +com_writeSubraster (fd, x, y, pix, nx, ny) +int fd; /* connection file descriptor */ +short x, y; /* corner of array */ +uchar *pix; /* pixel array */ +int nx, ny; /* number of bytes write at pos */ +#endif +{ + int status = 0; + int nbytes = (nx * ny); + + /* Send the IIS command for a data write. */ + if (com_whdr (fd, IIS_WRITE | PACKED, MEMORY, -nbytes, x, y, + 1<<(frame-1), nx)) { + if (com_debug >= 2) + printf ("com_writeData: error return from header write.\n"); + return (ERR); + } + + /* Send the pixels. */ + status = com_write (fd, (char *)pix, nbytes); + if (status && com_debug >= 2) + printf ("com_writeData: error return from data write.\n"); + return (status); +} + + +/* COM_READSUBRASTER -- Read a block of data at a given location from the + * display. + */ + +#ifdef ANSI_FUNC + +int +com_readSubraster ( + int fdin, + int fdout, /* connection file descriptors */ + short x, + short y, /* corner of readout */ + uchar *pix, /* output pixel array */ + int nx, ny /* number of bytes read */ +) +#else + +int +com_readSubraster (fdin, fdout, x, y, pix, nx, ny) +int fdin, fdout; /* connection file descriptors */ +short x, y; /* corner of readout */ +uchar *pix; /* output pixel array */ +int nx, ny; /* number of bytes read */ +#endif +{ + int status = 0, nb = 0, n, npix = (nx * ny); + + /* Send the IIS command for a data read. */ + n = npix; + if (com_whdr (fdout, IIS_READ | PACKED, MEMORY, -npix, x, y, + 1<<(frame-1), nx)) { + if (com_debug >= 2) + printf ("com_readData: error return from header read.\n"); + return (ERR); + } + + /* Get the pixels. */ + if (pix == NULL) + pix = (uchar *) malloc ((unsigned) npix); + + /* + */ + while (nb < npix) { + status = com_read (fdin, (char *)pix+nb, n, &n); + if (status && com_debug >= 2) { + printf ("com_readData: error return from data read.\n"); + return (ERR); + } + nb += n; + n = npix - nb; + } + return (OK); +} + + + +/* COM_READCURSOR -- Read the current cursor position. If sample is set the + * value of the cursor is returned immediately, otherwise the read + * is blocked until the user hits a key. + */ + +#ifdef ANSI_FUNC + +int +com_readCursor ( + int fdin, + int fdout, /* connection file descriptors */ + int sample, /* sample cursor or block */ + float *x, + float *y, /* output cursor coords */ + int *wcs, /* WCS of cursor read */ + char *key /* keystroke hit */ +) +#else + +int +com_readCursor (fdin, fdout, sample, x, y, wcs, key) +int fdin, fdout; /* connection file descriptors */ +int sample; /* sample cursor or block */ +float *x, *y; /* output cursor coords */ +int *wcs; /* WCS of cursor read */ +char *key; /* keystroke hit */ +#endif +{ + char buf[SZ_IMCURVAL]; + int status = 0, n = SZ_IMCURVAL, octal = 0; + + /* Send the IIS command for a cursor read. */ + if (com_whdr (fdout, (IIS_READ | (sample ? IMC_SAMPLE : 0)), IMCURSOR, + 0, 0, 0, *wcs, 0)) { + if (com_debug >= 2) + printf ("com_readCursor: error return from header read.\n"); + return (ERR); + } + + /* Read back the ascii string and extract the cursor position. */ + buf[0] = '\0'; + if (com_read (fdin, buf, n, &n)) + return (ERR); + + *key = (char)NULL; + status = sscanf (buf, "%f %f %d %c", x, y, wcs, key); + if (*key == '\\') { /* fixup octal char read */ + status = sscanf (buf, "%f %f %d \\%o", x, y, wcs, &octal); + *key = octal; + } + + if (status == 0 && strncmp (buf, "EOF", 3) == 0) { + *x = *y = 0.0; + *key = EOF; + } + if ((status != 4) && com_debug >= 2) { + printf ("com_readCursor: error return from data read.\n"); + return (ERR); + } + return ((int) *key); +} + + +/* COM_SETCURSOR -- Set the image cursor position. + */ + +#ifdef ANSI_FUNC + +int +com_setCursor ( + int fd, /* connection file descriptor */ + int x, + int y, /* cursor coords */ + int wcs /* cursor wcs */ +) +#else + +int +com_setCursor (fd, x, y, wcs) +int fd; /* connection file descriptor */ +int x, y; /* cursor coords */ +int wcs; /* cursor wcs */ +#endif +{ + /* Pack up IIS command to set cursor */ + if (com_whdr (fd, IIS_WRITE, IMCURSOR, 0, x, y, wcs, 0)) { + if (com_debug >= 2) + printf ("com_writeCursor: error return from header write.\n"); + return (ERR); + } + return (OK); +} + + +/* COM_SETFBCONFIG -- Set the frame buffer configuration number. This is + * passed to the server in a WCS set command so we'll just save it for now. + */ + +#ifdef ANSI_FUNC + +int +com_setFBConfig ( + int fd, /* connection file descriptor */ + int configno /* fb configuration number */ +) +#else + +int +com_setFBConfig (fd, configno) +int fd; /* connection file descriptor */ +int configno; /* fb configuration number */ +#endif +{ + fbconfig = configno; + return (OK); +} + + +/* COM_SETFRAME -- Set the current display frame. + */ + +#ifdef ANSI_FUNC + +int +com_setFrame ( + int fd, /* connection file descriptor */ + int frame_num /* frame number */ +) +#else + +int +com_setFrame (fd, frame_num) +int fd; /* connection file descriptor */ +int frame_num; /* frame number */ +#endif +{ + short status = 0, fr = 0; + + frame = frame_num; + fr = 1 << (frame_num-1); + + /* Send the IIS command to select a frame. */ + if (com_whdr (fd, IIS_WRITE, LUT | COMMAND, -1, 0, 0, 0, 0)) { + if (com_debug >= 2) + printf ("com_setFrame: error return from header write.\n"); + return (ERR); + } + + /* Send the frame info. */ + status = com_write (fd, (char *)&fr, sizeof(short)); + if (status && com_debug >= 2) { + printf ("com_setFrame: error return from data write.\n"); + return (ERR); + } + return (status); +} + + +/* COM_WRITEWCS -- Send the (linear) WCS to the server. + */ + +#ifdef ANSI_FUNC + +int +com_writeWCS ( + int fd, /* connection file descriptor */ + char *buffer, /* wcs buffer string */ + int nbytes, /* nbytes to transmit */ + int version /* iis version type */ +) +#else + +int +com_writeWCS (fd, buffer, nbytes, version) +int fd; /* connection file descriptor */ +char *buffer; /* wcs buffer string */ +int nbytes; /* nbytes to transmit */ +int version; /* iis version type */ +#endif +{ + char wcs_info[SZ_WCSBUF]; + int status = 0; + short x = 0, y = 0, z = (1 << (frame-1)), t = (fbconfig - 1); + + /* Send the IIS header to set a WCS. */ + if (version == 0) { + /* Do the old-style WCS read. Set registers and size.*/ + x = 0, y = 0, z = (1 << (frame-1)), t = (fbconfig - 1); + } else { + /* Do the new-style WCS read. Set registers and size.*/ + x = 1, y = 0, z = (1 << (frame-1)), t = (fbconfig - 1); + } + + /* Send the setWcs header. */ + if (com_whdr (fd, IIS_WRITE|PACKED, WCS, -nbytes, x, y, z, t)) { + if (com_debug >= 2) + printf ("com_writeWCS: error return from header write.\n"); + return (ERR); + } + + /* Send the wcs info. */ + if (com_write (fd, buffer, nbytes)) { + if (com_debug >= 2) + printf ("com_writeWCS: error return from data write.\n"); + return (ERR); + } + return (OK); +} + + +/* COM_READWCS -- Read the (linear) WCS from the server. + */ + +#ifdef ANSI_FUNC + +int +com_readWCS ( + int fdin, + int fdout, /* connection file descriptors */ + char *buffer, /* wcs string buffer */ + int *nbytes, /* length of string */ + int wcs, /* requested WCS number */ + int version /* iis version number */ +) +#else + +int +com_readWCS (fdin, fdout, buffer, nbytes, wcs, version) +int fdin, fdout; /* connection file descriptors */ +char *buffer; /* wcs string buffer */ +int *nbytes; /* length of string */ +int wcs; /* requested WCS number */ +int version; /* iis version number */ +#endif +{ + int nread, tokens, len; + short x, y, z, t; + char wcs_info[SZ_WCSBUF]; + + + /* Set registers and size. Note that 'version' and 'wcs' will + * be zero when using the old WCS protocols. + */ + x = version; + y = 0; + z = (1 << (frame-1)); + t = wcs; + len = (version == 0) ? SZ_OLD_WCSBUF : SZ_WCSBUF; + + /* Send the WCS query string. */ + if (com_whdr (fdout, IIS_READ, WCS, 0, x, y, z, t)) { + if (com_debug >= 2) + printf ("com_readWCS: error return from header read.\n"); + return (ERR); + } + + /* Read the reply string. */ + if (com_read (fdin, wcs_info, len, &nread)) { + if (com_debug >= 2) + printf ("com_readWCS: error return from data read.\n"); + return (ERR); + } + + /* Copy the data string to the return buffer. */ + *nbytes = nread; + strncpy (buffer, wcs_info, nread); + + return (OK); +} + + +/* COM_ERASEFRAME -- Clear the current frame. + */ + +#ifdef ANSI_FUNC + +int +com_eraseFrame ( + int fd /* connection file descriptor */ +) +#else + +int +com_eraseFrame (fd) +int fd; /* connection file descriptor */ +#endif +{ + /* Send IIS command to erase. */ + if (com_whdr (fd, IIS_WRITE+(fbconfig-1), FEEDBACK, 0, 0, 0, + 1<<(frame-1), 0)) { + if (com_debug >= 2) + printf ("com_eraseFrame: error return from header write.\n"); + return (ERR); + } + return (OK); +} + + +/* COM_WCSVERSION -- Determine the server WCS version. + */ + +#ifdef ANSI_FUNC + +int +com_wcsVersion ( + int fdin, /* connection file descriptor */ + int fdout /* connection file descriptor */ +) +#else + +int +com_wcsVersion (fdin, fdout) +int fdin; /* connection file descriptor */ +int fdout; /* connection file descriptor */ +#endif +{ + char wcstext[SZ_OLD_WCSBUF]; + int n = SZ_OLD_WCSBUF, status = 0, version = 0; + short x = 1, y = 1, z = (1 << (frame-1)), t = 0; + + + /* Send IIS command to return the WCS version (subunitof getWCS) */ + if (com_whdr (fdout, IIS_READ, WCS, 0, x, y, z, t)) { + if (com_debug >= 2) + printf ("com_eraseFrame: error return from header write.\n"); + return (0); + } + + /* Read the reply string. */ + status = com_read (fdin, wcstext, SZ_OLD_WCSBUF, &n); + if (status && com_debug >= 2) { + printf ("com_wcsVersion: error return from version read.\n"); + return (0); + } + + /* Decode the version from the WCS text. */ + if (strncmp (wcstext, "version=", 8) == 0) { + if (sscanf (wcstext, "version=%d", &version) < 1) + version = 0; + } else + version = 0; + + return (version); +} + + + + +/*------------------ + PRIVATE PROCEDURES + ------------------*/ + + +/* COM_WHDR -- Load and send the IIS header packet given the structure elements. + */ + +#ifdef ANSI_FUNC + +static int +com_whdr ( + int fd, /* connection file descriptor */ + int tid, /* thing ID */ + int subunit, /* subunit */ + int thingct, /* thing count */ + int x, + int y, + int z, + int t /* registers */ +) +#else + +static int +com_whdr (fd, tid, subunit, thingct, x, y, z, t) +int fd; /* connection file descriptor */ +int tid; /* thing ID */ +int subunit; /* subunit */ +int thingct; /* thing count */ +int x, y, z, t; /* registers */ +#endif +{ + iis_hdr iis; + int sum = 0; + + /* Load the structure. */ + iis.tid = (short) tid; + iis.subunit = (short) subunit; + iis.thingct = (short) thingct; + iis.checksum = (short) 0; + iis.x = (short) x; + iis.y = (short) y; + iis.z = (short) z; + iis.t = (short) t; + + /* Compute the checksum. */ + sum = iis.tid + iis.subunit + iis.thingct + iis.checksum + + iis.x + iis.y + iis.z + iis.t; + iis.checksum = 0177777 - sum; + + if (com_debug) { + printf ( + "subunit=%06o tid=%06o nbytes=%7d x=%05o y=%05o z=%05o t=%05o\n", + iis.subunit & 077, + iis.tid, + (!(iis.tid & PACKED) ? (-iis.thingct * 2) : (-iis.thingct)), + iis.x & 0177777, + iis.y & 0177777, + iis.z & 0177777, + iis.t & 0177777); + (void) fflush (stdout); + } + + /* Send the header and return the success code. */ + return (com_write(fd, (char *)&iis, sizeof(iis))); +} + + +/* COM_WRITE -- Asynchronous write of data to the server. Write exactly + * nbytes bytes from the buffer to the server. + */ + +#ifdef ANSI_FUNC + +static int +com_write ( + int fd, /* connection file descriptor */ + char *buf, /* buffer to write */ + int nbytes /* number of bytes to write */ +) +#else + +static int +com_write (fd, buf, nbytes) +int fd; /* connection file descriptor */ +char *buf; /* buffer to write */ +int nbytes; /* number of bytes to write */ +#endif +{ + int n = 0, total = 0, maxbytes = nbytes; + char *ip = (char *)buf; + + for (total=0; total < nbytes; total += n, ip += n) { + n = nbytes - total; + if (maxbytes) + n = min (maxbytes, n); + if ((n = write (fd, ip, n)) <= 0) + return (ERR); + } + return (OK); +} + + +/* COM_READ -- Read data from the server. Try to read at most maxbytes bytes + * from the server into the buffer, return the number of bytes actually read. + */ + +#ifdef ANSI_FUNC + +static int +com_read ( + int fd, /* connection file descriptor */ + char *buf, /* buffer to write */ + int maxbytes, /* max number of bytes to read */ + int *nbytes /* number of bytes actually read*/ +) +#else + +static int +com_read (fd, buf, maxbytes, nbytes) +int fd; /* connection file descriptor */ +char *buf; /* buffer to write */ +int maxbytes; /* max number of bytes to read */ +int *nbytes; /* number of bytes actually read*/ +#endif +{ + int nread; + int nleft = maxbytes; + char *ptr = buf; + + *nbytes = 0; + while (nleft > 0) { + if ( (nread = read(fd, ptr, nleft)) < 0) { + if (errno == EINTR) + nread = 0; /* and call read() again */ + else + return (ERR); + } else if (nread == 0) + break; /* EOF */ + + nleft -= nread; + ptr += nread; + *nbytes += nread; + } + return (OK); +} + + +/* COM_SETDEBUG -- Set the state of the debug flag. + */ + +#ifdef ANSI_FUNC + +int +com_setDebug (int state) +#else + +int +com_setDebug (state) +int state; +#endif +{ + com_debug = state; + return (OK); +} diff --git a/vendor/x11iraf/cdl/configure b/vendor/x11iraf/cdl/configure new file mode 100755 index 00000000..00d3283f --- /dev/null +++ b/vendor/x11iraf/cdl/configure @@ -0,0 +1,49 @@ +#!/bin/csh -f +# +# Configuration script to produce Makefiles for various platforms. +# This *is not* an GNU autoconf-generated script, just a cheap imitation +# with minimal requirements. + + +# Determine platform architecture. +setenv OS `uname` +setenv OSVERSION `uname -r | cut -c1` + +if ($OS == "SunOS" && $OSVERSION == 5) then + cat Makefile.generic | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -DSOLARIS/g' > Makefile + cat examples/Makefile.generic | \ + sed -e 's/LDLIBS =/LDLIBS = -lnsl -lsocket/g' > examples/Makefile + cat test/Makefile.generic | \ + sed -e 's/LDLIBS =/LDLIBS = -lnsl -lsocket/g' > test/Makefile +else if ($OS == "OSF1") then + cat Makefile.generic | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -DOSF1/g' > Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +else if ($OS == "ULTRIX") then + cat Makefile.generic | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -DULTRIX/g' > Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +else if ($OS == "AUX") then + cat Makefile.generic | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -DAUX/g' > Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +else if ($OS == "HP-UX") then + cat Makefile.generic | \ + sed -e 's/ranlib/echo/g' | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -D_NO_US_/g' > Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +else if ($OS == "AIX") then + cat Makefile.generic | \ + sed -e 's/EXTRA_CFLAGS =/EXTRA_CFLAGS = -D_NO_US_/g' > Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +else + cp Makefile.generic Makefile + cp examples/Makefile.generic examples/Makefile + cp test/Makefile.generic test/Makefile +endif diff --git a/vendor/x11iraf/cdl/doc/RELEASE-1.6.NOTES b/vendor/x11iraf/cdl/doc/RELEASE-1.6.NOTES new file mode 100644 index 00000000..18c5399e --- /dev/null +++ b/vendor/x11iraf/cdl/doc/RELEASE-1.6.NOTES @@ -0,0 +1,168 @@ + + README FOR CLIENT DISPLAY LIBRARY (CDL) V1.6 + Updated March 1998 + +-------------------------------------------------------------------------- +21 Feb 1997 Initial V1.0 Release +04 Mar 1998 V1.6 Upgrade Release + +See also the post-distribution notes at the end of this file. These are +continually updated after the release as any problems are encountered. +-------------------------------------------------------------------------- + + +1. INTRODUCTION +================ + The Client Display Library (CDL) is a host interface for C or +Fortran programs allowing them to display images or overlay graphics to +display servers such as XImtool or SAOimage / SAOtng. High-level +procedures allow IRAF or FITS images to be displayed simply, other +routines permit access to all other server functions (e.g. cursor and +image readback, frame selection, etc). The library also features a number +of functions for doing image overlay graphics; supported graphics +primitives include numerous point shapes, lines, circles, ellipses, +polygons, annular shapes, and text. + + +1.1 WHAT'S NEW IN THIS RELEASE +------------------------------- + + The initial CDL release provided most of the functionality required +for image display or graphic overlay clients, since then a number of new +features have crept in that were needed. The V1.6 version number reflects +the stop-n-start nature of this work, more work is planned but a release of +the new version is long overdue. New features include: + + - Support for the new V2.11 IRAF OIF image format + - A prototype SPP language binding + - Full ANSI C function prototype support + - Support for variable line widths + - A selection of "dashed" line styles for polyline/polygon markers + - A selection of text fonts including + ROMAN FUTURA TIMES + GREEK BOLD + - Sub/Superscripting text + - In-line font changes + - Support for text line widths + - A "virtual" display server that may also be used as a 'proxy' + server providing an image display "tee" functionality + - Numerous bug fixes + +See the CDL Reference Guide in the 'doc' subdirectory for details on new +features. + +1.2 THINGS TO WATCH OUT FOR +---------------------------- + + The V1.6 release contains two small interface changes which may +cause problems, otherwise the new library should work seemlessly with +existing applications. The interface changes involve the routines + + cdl_readIRAF() and cdl_readFITS() + +These routines now have an extra 'title' argument to return the title string +from the image which allows the hi-level display routines to include this +information in the WCS string. This argument is a character pointer and +affects the Fortran and SPP bindings as well. See the Reference Guide for +additional information. + + New features such as line styles and text fonts have been well-tested +but the use of ANSI prototypes and the SPP binding have only been minimally +exercised. Anyone finding a problem with these features should send a bug +report the iraf@noao.edu help address, we can probably provide a quick fix +for most bugs. + + +2. Documentation and Example Applications +========================================== + + Documentation for the package is located in the 'doc' subdirectory +as both TROFF source and Postscript. The reference manual covers each of +the routines available in the library and contains a summary of the interface +as well as code samples. + Working programs are also included in the 'examples' subdirectory. +Users may find it easier to start by modifying these programs for a particular +need (e.g. add a new command for marking, an option for overlaying points +from a file, etc) before starting an application from scratch to become fam- +iliar with the library. + Fortran programmers should consult the reference manual for information +on array passing in the CDL. In particular, while the CDL can be used from +IMFORT programs special care needs to be taken when displaying arrays read +using the IMFORT routines. + + +3. Building the Package +======================== + + The CDL package relies on the Imake facility to generate the make- +files needed to compile the package. To build the CDL use the following +command: + + % xmkmf # build the parent Makefile + % make World # compile it all + +There is no supported "make install" option, all files will be left in the +CDL working directory following the World build. Users of the package +must either build the library and install the lib and include files by hand +in their final destination, or use compiler "-I" and "-L" flags to find the +files when compiling clients. + As an alternative for sites that don't have Imake installed or who +encounter problems you can try the generic makefiles provided. To use these +simply do + + % configure # create the makefiles + % make World # compile it all + + Programs using the CDL will need one of three include files depending +on the language interface being used: the "cdl.h" file for C programs, the +"cdlftn.inc" file for Fortran programs, or the "cdlspp.h" file for SPP tasks. +The C and SPP include files is required, the Fortran include file is optional +and just defines symbolic names for various constants. Fortran programmers +not using the cdlftn.inc file should see to Reference Manual for values of +symbolic constants. The library file to be linked is "libcdl.a", all programs +using the CDL must also link with the system math library. + +**************************************************************************** +***** NOTE: Solaris users will also need to include "-lnsl -lsocket" ***** +***** when linking programs to include the socket interfaces. ***** +**************************************************************************** + + +4. Reporting Problems +====================== + + Each of the CDL functions has been tested individually but there is +no practical way to test how various combinations of routines may be used +in any given application so bugs are inevitable. If you think you've found +a bug, have a suggestion for future enhancements, or just have a question +about how something works, contact + + iraf@noao.edu + +Messages may also be posted to the adass.iraf.programming newsgroup so that +others may benefit from the exchange. If you're not familiar with the ADASS +newsgroup hierarchy send a message + + irafinfo@iraf.noao.edu + +with the one-line message "get iraf newsgroups" in the body of the message +for more information. A small code sample demonstrating the problem would +help greatly in finding the solution. Debugging output for the package may +be enabled by defining a unix CDL_DEBUG environment variable. For example + + % setenv CDL_DEBUG 0 # minimal debug output + % setenv CDL_DEBUG 1 # CDL and IMD debug info + % setenv CDL_DEBUG 2 # print it all + +Send this output along with the code sample. An FAQ may be added later if +needed. + + +Mike Fitzpatrick +NOAO/IRAF Project +March 1998 + + +Post-Distribution Notes +======================= + diff --git a/vendor/x11iraf/cdl/doc/cdlref.ms b/vendor/x11iraf/cdl/doc/cdlref.ms new file mode 100644 index 00000000..da05ee1f --- /dev/null +++ b/vendor/x11iraf/cdl/doc/cdlref.ms @@ -0,0 +1,2637 @@ +.RP +.de us +\\$1\l'|0\(ul' +.. +.TL +A Reference Guide for the IRAF Client Display Library (CDL) +.AU +Michael Fitzpatrick +.AI +NOAO/IRAF Group +.sp 0.5 +February 1997 +.sp 0.5 +\fIRevised: August 2001\fR +\fICurrent Version: CDL V1.8\fR + +.AB +The Client Display Library (CDL) is a host interface for C, Fortran or SPP +programs allowing them to display images or overlay graphics to display +servers such as \fIXImtool\fR, \fIDS9\fR, or \fISAOimage / SAOtng\fR. +High-level procedures allow IRAF or FITS images to be displayed simply, other +routines permit access to all other server functions (e.g. cursor and image +readback, frame selection, etc). The library also features a number of +functions for doing image overlay graphics; supported graphics primitives +include numerous point shapes, lines, circles, ellipses, polygons, annular +shapes, and text. +.AE + +.pn 1 +.bp +.ce +.ps +3 +\fBContents\fR +.ps -3 +.sp 2 +1\h'|0.25i'\fBIntroduction\fP\l'|5.6i.'\0\01 +.sp 0.5 +2\h'|0.25i'\fBGetting Started\fP\l'|5.6i.'\0\01 +.sp 0.5 +3\h'|0.25i'\fBServer Connections\fP\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.1\h'|0.75i'Domain Sockets\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.2\h'|0.75i'Named FIFO Pipes\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.3\h'|0.75i'Inet Sockets\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.4\h'|0.75i'User-Defined Connections\l'|5.6i.'\0\03 +.sp 0.5 +4\h'|0.25i'\fBImage Display\fP\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.1\h'|0.75i'Overview of the Display Process\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.2\h'|0.75i'Displaying IRAF Images\l'|5.6i.'\0\04 +.br +\h'|0.25i'4.3\h'|0.75i'Displaying FITS Images\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.4\h'|0.75i'Displaying Raw Pixels\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.5\h'|0.75i'Frame Selection\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.6\h'|0.75i'Clearing the Display\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.7\h'|0.75i'Frame Buffer Selection\l'|5.6i.'\0\06 +.br +\h'|0.4i'4.7.1\h'|0.95i'Automatic Selection\l'|5.6i.'\0\06 +.br +\h'|0.4i'4.7.2\h'|0.95i'The Frame Buffer Configuration File\l'|5.6i.'\0\06 +.br +\h'|0.25i'4.8\h'|0.75i'Image WCS Description\l'|5.6i.'\0\07 +.br +\h'|0.4i'4.8.1\h'|0.95i'Image Mappings\l'|5.6i.'\0\07 +.br +\h'|0.25i'4.9\h'|0.75i'Image Colormaps\l'|5.6i.'\0\08 +.br +\h'|0.4i'4.9.1\h'|0.95i'Imtool Color Model\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.10\h'|0.75i'ZScale Intensity Mapping\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.11\h'|0.75i'Image Hardcopy\l'|5.6i.'\010 +.br +\h'|0.25i'4.12\h'|0.75i'Image Cursor\l'|5.6i.'\010 +.br +\h'|0.4i'4.12.1\h'|0.95i'Cursor Sampling\l'|5.6i.'\011 +.br +\h'|0.25i'4.13\h'|0.75i'Image Readout\l'|5.6i.'\011 +.br +\h'|0.25i'4.14\h'|0.75i'Subraster I/O\l'|5.6i.'\011 +.sp 0.5 +5\h'|0.25i'\fBGraphics Overlay\fP\l'|5.6i.'\011 +.br +\h'|0.25i'5.1\h'|0.75i'Marker Coordinates\l'|5.6i.'\011 +.br +\h'|0.25i'5.2\h'|0.75i'Mapping a Previously Displayed Image\l'|5.6i.'\011 +.br +\h'|0.25i'5.3\h'|0.75i'Marking a Coordinate File\l'|5.6i.'\012 +.br +\h'|0.25i'5.4\h'|0.75i'Marker Colors\l'|5.6i.'\012 +.br +\h'|0.25i'5.5\h'|0.75i'Marker Types\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.1\h'|0.95i'Point\l'|5.6i.'\013 +.br +\h'|0.4i'5.5.2\h'|0.95i'Line\l'|5.6i.'\013 +.br +\h'|0.4i'5.5.3\h'|0.95i'Box\l'|5.6i.'\013 +.br +\h'|0.4i'5.5.4\h'|0.95i'Circle\l'|5.6i.'\013 +.br +\h'|0.4i'5.5.5\h'|0.95i'Polyline\l'|5.6i.'\014 +.br +\h'|0.4i'5.5.6\h'|0.95i'Polygon\l'|5.6i.'\014 +.br +\h'|0.4i'5.5.7\h'|0.95i'Ellipse\l'|5.6i.'\014 +.br +\h'|0.4i'5.5.8\h'|0.95i'Circular Annuli\l'|5.6i.'\014 +.br +\h'|0.4i'5.5.9\h'|0.95i'Elliptical Annuli\l'|5.6i.'\014 +.br +\h'|0.4i'5.5.10\h'|0.95i'Text\l'|5.6i.'\014 +.br +\h'|0.25i'5.6\h'|0.75i'Text Fonts\l'|5.6i.'\015 +.br +\h'|0.4i'5.6.1\h'|0.95i'In-line Font Changes\l'|5.6i.'\015 +.br +\h'|0.25i'5.7\h'|0.75i'Line Widths and Styles\l'|5.6i.'\015 +.br +\h'|0.25i'5.8\h'|0.75i'Deleting Markers\l'|5.6i.'\016 +.br +\h'|0.4i'5.8.1\h'|0.95i'Individual Markers\l'|5.6i.'\016 +.br +\h'|0.4i'5.8.2\h'|0.95i'The Entire Overlay\l'|5.6i.'\016 +.br +\h'|0.25i'5.9\h'|0.75i'Redrawing the Overlay\l'|5.6i.'\016 +.sp 0.5 +6\h'|0.25i'\fBANSI C Function Prototypes\fP\l'|5.6i.'\017 +.sp 0.5 +7\h'|0.25i'\fBFortran Language Binding Notes\fP\l'|5.6i.'\017 +.sp 0.5 +8\h'|0.25i'\fBSPP Language Binding Notes\fP\l'|5.6i.'\018 +.sp 0.5 +9\h'|0.25i'\fBIIS Protocol Description\fP\l'|5.6i.'\018 +.sp 0.5 +10\h'|0.25i'\fBVXIMTOOL Proxy/Display Server Usage\fP\l'|5.6i.'\019 +.sp 0.5 +11\h'|0.25i'\fBC Interface Summary\fP\l'|5.6i.'\021 +.sp 0.5 +12\h'|0.25i'\fBC Example Tasks\fP\l'|5.6i.'\023 +.br +\h'|0.25i'12.1\h'|0.75i'Display Example\l'|5.6i.'\023 +.br +\h'|0.25i'12.2\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\027 +.br +\h'|0.25i'12.3\h'|0.75i'Image Mosaic Example\l'|5.6i.'\031 +.sp 0.5 +13\h'|0.25i'\fBFortran Interface Summary\fP\l'|5.6i.'\033 +.sp 0.5 +14\h'|0.25i'\fBFortran Example Tasks\fP\l'|5.6i.'\035 +.br +\h'|0.25i'14.1\h'|0.75i'Display Example\l'|5.6i.'\035 +.br +\h'|0.25i'14.2\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\036 +.sp 0.5 +15\h'|0.25i'\fBSPP Interface Summary\fP\l'|5.6i.'\038 +.pn 1 + +.NH +Introduction +.LP + For more than a decade IRAF has used a \fIdisplay server\fR as the +primary means for image display. IRAF client tasks connect to the server +and send or read data using a modification of the IIS Model 70 protocol, +originally through named fifo pipes but more recently using unix domain +or inet sockets. The advantage to this approach was that IRAF client tasks +could make use of the image display functionality without duplicating +the code needed for actually displaying the image. The longtime disadvantage +was that the IIS protocol used was arcane and undocumented and therefore +largely unavailable to applications outside of the IRAF project. The +Client Display Library (CDL) provides a public C and Fortran interface for +displaying images and overlay graphics that is independent of the underlying +protocol used. +.LP + Unlike the interface used by IRAF applications, the CDL is meant to +provide an easy-to-use, fully featured interface for applications that can +be easily evolved for future display servers, communications schemes, or +display functionality. Indeed, the CDL is independent of IRAF itself (as +are the display servers) so display tasks can be written for any discipline +or application. +.LP + While this guide assumes programs are written in C, Fortran programmers +should find the translation straightforward by referring to the Fortran +interface summary. The package source files include example tasks as does +this guide; users with problems, questions, or bug reports are encouraged to +contact \fIiraf@noao.edu\fR. A small code sample demonstrating the problem +would be very helpful in finding a solution to any reported problems. + +.NH +Getting Started +.LP + All C programs must include the header file \fB"cdl.h"\fR in order +to get package definitions for constants such as colors and structure +definitions used. The Fortran interface does not \fIrequire\fR anything +similar, however for fortran compilers which support an \f(CWinclude\fR +directive a \fBcdlftn.inc\fR file may be used to define symbolic constants +passed to procedures, this file must be included by each procedure using the +CDL. Fortran programs not using this file must pass in the constants +explicitly, needed values are found throughout this manual. C procedures +which return an integer value will return a positive number to indicate an +error has occurred and print an error message, otherwise zero is returned. +.LP + The \fBcdl_open()\fR procedure is used to establish a connection +to the server and initialize the package, it returns a CDL structure pointer +that is passed to other CDL procedures. For C programs this means +a separate pointer may be maintained for each server connection, the Fortran +interface is limited to only one server connection per process since the +pointer is maintained internally. The connection is terminated using the +\fBcdl_close()\fR procedure. Between these two calls may be any combination +of CDL procedure calls for doing image display or overlay graphics. +.LP + For example, the simplest possible program for displaying an IRAF +image would look something like: +.sp 0.5 +.nf + \f(CW#include "cdl.h" + + main (int argc, char *argv[]) + { + CDLPtr cdl = cdl_open ((char *)0); + cdl_displayIRAF (cdl, argv[1], 1, 1, 1, 1); + cdl_close (cdl); + }\fR +.fi +.sp 0.5 +.LP +This program displays band one of an image named on the command line to the +server in frame one using the default 512x512 frame buffer, zscaling the +pixels to 8-bit values automatically. No error checking is performed to verify +that a connection was established or that the argument is a valid IRAF image. +Most programs will be more complex than this but it should be clear that +image display from client applications is a now trivial operation. + +.us "Synopsis" +.sp 0.5 +.nf + \f(CW#include "cdl.h"\fR + + \f(CWCDLPtr cdl_open (char *imtdev)\fR + \f(CWvoid cdl_close (CDLPtr cdl)\fR +.fi + +.NH +Server Connections +.LP + The \fBcdl_open()\fR procedure takes a single argument specifying the +type of connection to make to the server, this routine also initializes +the CDL package. If this is a NULL pointer the CDL will attempt to first +connect on a unix domain socket, if that fails the standard IRAF /dev/imt1* +fifo pipes are tried. The syntax for the \fIimtdev\fR argument is as follows: +.sp 0.5 + \f(CW<domain> : <address>\fR +.sp 0.5 +.LP +where <domain> is one of "\fBinet\fR" (internet tcp/ip socket), "\fBunix\fR" +(unix domain socket) or "\fBfifo\fR" (named pipe). The form of the address +depends upon the domain, as illustrated in the examples below. The address +field may contain up to two "%d" fields. If present, the user's UID will be +substituted (e.g. "unix:/tmp/.IMT%d"). The default connection if no imtdev +is specified is "unix:/tmp/.IMT%d", failing that a connection is attempted +on the /dev/imt1[io] named fifo pipes. +.NH 2 +Domain Sockets +.LP + Domain sockets are sockets created on the local host. The connection +is usually faster than an inet socket and comparable to a fifo. If the +socket name is specified with a '%d' field the client can be assured of a +unique socket name for each user allowing multiple clients to be run on the +same host by different users. +.LP +.us "Example" +.sp 0.5 +.nf +\f(CW + /* Connection to a local host using socket domain socket. */ + if ((cdl = cdl_open ("unix:/tmp/.IMT%d")) == NULL) { + fprintf (stderr, "cannot open domain socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Named FIFO Pipes +.LP + This is the traditional approach, and the only one supported by +SAOimage (although recent versions contain support for sockets). Any named +fifo pipe may be used, the syntax for the \fIimtdev\fR string in this case is +.sp 0.5 + \fBfifo:\f(CW<input_fifo>\fB:\f(CW<output_fifo>\fR +.sp 0.5 +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using named fifo pipes. */ + if ((cdl = cdl_open ("fifo:/dev/imt1i:/dev/imt1o")) == NULL) { + fprintf (stderr, "cannot open fifo pipe connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Inet Sockets +.LP + Inet sockets are connections between hosts via a tcp/ip socket. +This permits connecting to the server over a remote network connection +anywhere on the Internet. +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } + + /* Connection to a remote internet host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137:foo.bar.edu")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +User-Defined Connections +.LP + Since IRAF V2.10.3 client tasks have been able to use an \fBIMTDEV\fR +unix environment variable to set the connection type, the syntax of this +variable is the same as described above. If the \fIcdl_open()\fR procedure +is called with a NULL pointer the IMTDEV environment variable will +automatically be checked. To explicitly use this (or any other) variable +in the client task the \fIcdl_open()\fR procedure may be called as +e.g. +.sp 0.5 +.nf + \f(CWif ((cdl = cdl_open (getenv("IMTDEV"))) == NULL) { + fprintf (stderr, "cannot open server connection\\n"); + exit (1); + }\fR +.fi +.NH +Image Display +.NH 2 +Overview of the Display Process +.LP + Basic image display is done most easily using the high-level +\fBcdl_displayIRAF()\fR, \fBcdl_displayFITS()\fR and \fBcdl_displayPix()\fR +procedures. These routines automatically define an image WCS and mapping, +clear the frame, set the frame buffer configuration and center the image +in the display. For most applications these are all that will be needed, +but the \fBcdl_writeSubRaster()\fR procedure can also be used to display an +image. For example, to display one image in a mosaic or other cases where +the task needs low-level access to position the image or write raw pixel +values. +.LP + In these cases it is the responsibility of the client program to +prepare the server for display. The basic steps involved in displaying an +image include +.sp 0.5 +.TS +center; +lB lB +- - +l lI. +Operation CDL Procedure +Selecting the frame cdl_setFrame() +Clear the frame cdl_clearFrame() +Select the frame buffer configuration cdl_selectFB() +Set the frame buffer configuration cdl_setFBConfig() +Scale the image pixels to 201 display values cdl_zscaleImage() +Compute the raster placement in the frame buffer +Construct a \fInode!path\fR image path +Set the image mapping cdl_setMapping() +Define the image WCS +Set the image WCS cdl_setWCS() +Write the pixels to the display cdl_writeSubRaster() +.TE +.sp 0.5 +In cases like a mosaic display, obviously some steps (e.g. clearing the +frame, selecting the configuration, etc) will only need to be done once. +XImtool V1.3 and later version support multiple WCSs in a single frame +so each piece of the mosaic should define a mapping and an independent +WCS. The last step in the display here should be a single WCS for the +entire mosaic such as "\fIdetector coordinates\fR", without this the +coordinates used by default will be based on the last WCS sent to the +display. Servers which do not support mappings will just ignore the +mapping information, but may still require a frame buffer WCS for other +tasks to operate correctly. For simple displays of single images, the +high-level routines handle all of these steps automatically, they are +included here as checklist of what must be considered when using the CDL +for low-level display. +.NH 2 +Displaying IRAF Images +.LP + The \fBcdl_displayIRAF()\fR procedure can be used to display an +IRAF OIF format image (i.e. images with a \fI.imh\fR extension) by +simply passing in the image name. Pixel files for the image must be +accessible from the local machine but can be in any directory, the HDR$ +syntax for the imdir is also recognized. Images may be three dimensional, +the \fIband\fR argument is used to select the image band to be displayed. +The \fIframe\fR and \fIfbconfig\fR arguments select the frame and frame +buffer size respectively, the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the \fIzscale\fR flag is greater than zero +the image will automatically be converted to 8-bit values using the zscale +mapping algorithm. The function returns a positive value if the image +cannot be accessed or displayed for any reason, an error message will be +printed. +.LP + The \fIcdl_isIRAF()\fR procedure returns a positive value if the +filename argument is recognized as an IRAF image, it does not check whether +the pixel file can be successfully accessed. For simply reading the pixels +from an IRAF image the \fBcdl_readIRAF()\fR procedure may be used. The +function returns a zero value and sets the output pixel array, image +dimensions and pixel size if successful, otherwise the function returns a +positive value. Note that +the output pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayIRAF (CDLPtr cdl, char *fname, int band, + int frame, int fbconfig, int zscale)\fR + \f(CWint cdl_isIRAF (char *fname)\fR + \f(CWint cdl_readIRAF (char *fname, int band, uchar **pix, + int *nx, int *ny, int *bitpix, char *title)\fR +.fi +.NH 2 +Displaying FITS Images +.LP + The \fBcdl_displayFITS()\fR procedure can be used to display a +\fIsimple\fR FITS image by name. A "simple" FITS file is assumed to be +one containing a single image and having no extensions. Other types of +FITS files may of course be displayed but the client will have to use other +means to import the pixels. FITS image extensions may be supported in a future +release of the CDL. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, +the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. The function +returns a positive value if the image cannot be accessed or displayed for +any reason, an error message will be printed. +.LP + The \fIcdl_isFITS()\fR procedure returns a positive value if the +filename argument is recognized as a simple FITS image. For simply reading +the image pixels the \fBcdl_readFITS()\fR procedure may be used. The +output pixel array, image dimensions and pixel size are returned if +successful otherwise the function returns a positive value. Note that +the returned pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayFITS (CDLPtr cdl, char *fname, int frame, + int fbconfig, int zscale)\fR + \f(CWint cdl_isFITS (char *fname)\fR + \f(CWint cdl_readFITS (char *fname, uchar **pix, int *nx, int *ny, + int *bitpix, char *title)\fR +.fi +.NH 2 +Displaying Raw Pixels +.LP + The \fBcdl_displayPix()\fR procedure can be used to display an +arbitrary array of pixels of any size. The \fInx\fR and \fIny\fR arguments +are the raster dimensions, and \fIbitpix\fR is the pixel size and has the +same meaning as the FITS BITPIX keyword. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, +the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. + +.us "Synopsis" +.nf + \f(CWint cdl_displayPix (CDLPtr cdl, uchar *pix, int nx, int ny, + int bitpix, int frame, int fbconfig, int zscale)\fR +.fi +.NH 2 +Frame Selection +.LP + Frame selection is normally done as an argument to one of the display +procedures, however frames may be explicitly selected using the +\fBcdl_setFrame()\fR procedure. This allows client programs to essentially +"blink" frames independently, as long as the server supports multiple frames. +The \fBcdl_getFrame()\fR procedure may be used to get the current frame +set in the server. + +.us "Synopsis" +.nf + \f(CWvoid cdl_setFrame (CDLPtr cdl, int frame)\fR + \f(CWvoid cdl_getFrame (CDLPtr cdl, int *frame)\fR +.fi +.NH 2 +Clearing the Display +.LP + The current display frame may be explicitly cleared using the +\fBcdl_clearFrame()\fR procedure. The frame is also cleared prior to +displaying new images by the procedures \fBcdl_displayPix()\fR, +\fBcdl_displayFITS()\fR, and \fBcdl_displayIRAF()\fR. + +.us "Synopsis" +.nf + \f(CWint cdl_clearFrame (CDLPtr cdl)\fR +.fi +.NH 2 +Frame Buffer Selection +.LP + The default frame buffer used is 512x512, other sizes may be +selected using the \fBcdl_setFBConfig()\fR procedure. To set the frame +buffer size the client passes the frame buffer number as defined in +the frame buffer configuration file (see below) while setting the image +WCS. It is important to note that the frame buffer isn't actually changed +in the server until a subsequent \fBcdl_setWCS()\fR call, either directly +or through some other procedure which sets the WCS (e.g. one of the display +procedures). +.LP + To get the size of the currently defined frame buffer the user +may call the \fBcdl_getFBConfig()\fR procedure. This returns not only +the current configuration number, but the size as well. To get the size +and any arbitrary configuration without actually setting it, the +\fBcdl_lookupFBSize()\fR procedure may be used. Any configuration not actually +defined in the frame buffer configuration file is returned as the default +512x512 size. + +.us "Synopsis" +.nf + \f(CWvoid cdl_setFBConfig (CDLPtr cdl, int configno)\fR + \f(CWvoid cdl_getFBConfig (CDLPtr cdl, int *configno, int *width, + int *height, int *nframes)\fR + \f(CWvoid cdl_lookupFBSize (CDLPtr cdl, int configno, int *width, + int *height, int *nframes)\fR +.fi +.NH 3 +Automatic Selection +.LP + The \fBcdl_selectFB()\fR procedure may be used to select the most +appropriate frame buffer to use for a given image size. If possible a frame +buffer the same size as the image will be used, otherwise one that is +larger will be chosen. Rather than simply selecting the first configuration +larger than the image, the procedure searches the entire configuration file +selecting the one with the least empty space in both dimensions. If the +\fIreset\fR flag is non-zero this frame is set automatically by the +procedure, otherwise the selected dimension is simply returned to the +calling program. In either case the new frame buffer will not take effect +until a new WCS is defined for the frame. + +.us "Synopsis" +.nf + \f(CWvoid cdl_selectFB (CDLPtr cdl, int nx, int ny, int *fb, + int *w, int *h, int *nf, int reset) +.fi +.NH 3 +The Frame Buffer Configuration File +.LP + The size of the frame buffer is not passed directly to the server +since this is not part of the communications protocol used. Instead, the +frame buffer number is sent as part of the WCS header packet. So that +both the server and client can know that a particular frame buffer number +corresponds to a specific size, a \fIframe buffer configuration file\fR +is used which both the client and server read. +.LP + The default configuration file is /usr/local/lib/imtoolrc, this can +be overridden by defining an \fBIMTOOLRC\fR environment variable naming +the file to be used, or by creating a .imtoolrc file in your home directory. +Since the server must also read the same file, this must be done before +starting both the client and server applications. +.LP +The format of the frame buffer configuration file is +.sp 0.5 + \fIconfigno nframes width height [extra fields]\fP +.sp 0.5 +e.g. +.sp 0.5 + 1 2 512 512 + 2 2 800 800 + 3 1 1024 1024 # comment + : : : : + +At most 128 frame buffer sizes may be defined, each configuration may define +up to 4 frames, configuration numbers need not be sequential but should be +in ascending order. +.NH 2 +Image WCS Description +.LP + The image WCS is defined using the \fBcdl_setWCS()\fR procedure. The +WCS defines a mapping between any linear coordinate system and the image +pixels, for our purposes we will discuss how the WCS is used to map the frame +buffer pixels to image coordinates. It is passed to the server in a string +of the form: +.sp 0.5 +.nf + \fIname\fR - \fItitle\fR\\n + a b c d tx ty z1 z2 zt +.fi +.sp 0.2 +where: +.sp 0.2 + \fBX\fR' = a * \fBX\fR + c * \fBY\fR + tx + \fBY\fR' = b * \fBX\fR + d * \fBY\fR + ty + +The terms \fIa, b, c\fR, and \fId\fR define a rotation of the WCS wrt the +pixel (i.e. frame buffer) +coordinates, the \fItx\fR and \fIty\fR values are translation terms relative +to the upper-left corner of the display. The +remaining three values define the intensity mapping of the display pixels; +\fIz1\fR is the minimum pixel value used in the transformation, \fIz2\fR is +the maximum value, and \fIzt\fR defines the type of transformation used (0 for +none, 1 for linear, 2 for log10). +.LP + The WCS may be set explicitly by the calling program or a default +appropriate for the image will be set automatically by the high-level +display procedures, otherwise a WCS for the frame buffer is defined +(i.e. returned coordinates are frame buffer coords). As an example of how +the WCS is defined, the default WCS for an image \fIIMX\fR x \fIIMY\fR +pixels in a frame buffer \fIFBX\fR x \fIFBY\fR pixels is defined as +.sp 0.5 +.nf +\f(CW a = 1.0; /* no rotation */ + b = 0.0; + c = 0.0; + d = -1.0; + tx = (\fIIMX\f(CW / 2) - (\fIFBX\f(CW / 2) + 1; /* center in FB */ + ty = (\fIFBY\f(CW / 2) + (\fIIMY\f(CW / 2); + z1 = z1; /* zscale values */ + z2 = z2; + zt = 1;\fR +.fi + +.us "Synopsis" +.nf + \f(CWint cdl_setWCS (CDLPtr cdl, char *name, char *title, + float a, float b, float c, float d, float tx, float ty, + float z1, float z2, int zt)\fR + \f(CWint cdl_getWCS (CDLPtr cdl, char *name, char *title, + float *a, float *b, float *c, float *d, float *tx, float *ty, + float *z1, float *z2, int *zt)\fR +.fi +.NH 3 +Image Mappings +.LP + Beginning with \fBX11IRAF V1.3\fR the \fIXImtool\fR display server +has had the ability to use multiple world coordinate systems in a frame +(e.g. subrasters of a mosaic display). To do this, the \fBIRAF\fR and +\fBCDL\fR display interfaces were modified to pass in extra information +with the WCS string to define the mapping of the image pixels to the frame +buffer pixels. This extra information allows the XImtool to know when the +cursor in within one of the image subrasters and compute coordinates +appropriately. (See the \fIXImtool\fR documentation for details on how +this is done exactly). +.LP + The CDL will automatically determine when the connection is first +established whether the server is aware of this new mapping information. +Calls to send or receive mapping data will be ignored for servers which are +not aware of the extra data in the string. For servers which can use the +mappings, and where a mapping has been provided, the WCS string now looks +like +.sp 0.5 +.nf + \fIname\fR - \fItitle\fR\\n + a b c d tx ty z1 z2 zt\\n + \fBregion_name sx sy snx sny dx dy dnx dny\\n + object_ref\R +.fi +.sp 0.5 +where the new parameters are defined to be: +.sp 0.2 +.TS +center; +lB lI. +region_name User-defined name for the region. +sx, sy, snx, sny Source rect in the object. +dx, dy, dnx, dny Destination rect in the display frame buffer. +object_ref Full node!/path image specification. +.TE +The \fIobject_ref\fR should be a complete node!path specification to the +image including any image section or extension. This is needed by the +XImtool coordinate/pixel plug-in to map the same image as was displayed by +the client. The path and node are required to ensure the image will be +found properly. The \fIregion_name\fR can be anything such as \fIimage\fR, +\fIsubraster1\fR, or \fIccd3\fR. The purpose of this field is to provide +some named value for the mapping that may be useful to other client programs +needing to access the mapping. \fISource\fR coordinates refer to the image +pixels, \fIdestination\fR coordinates refer to the frame buffer. +.LP + Because we did not wish to change any of the existing interfaces, +mappings must be set prior to the \fBcdl_setWCS()\fR call using the +\fBcdl_setMapping()\fR procedure. The mapping is stored until the WCS is +actually sent. Similarly, a mapping may be retrieved \fIafter\fR a +\fBcdl_getWCS()\fR call using the \fBcdl_getMapping()\fR procedure to +return the values read with the last WCS retrieval. Since there can at +times be more than one WCS in a frame, it's also possible to query the +mapping for a particular WCS by number (e.g. the WCS number returned in a +cursor read) using the \fIcdl_queryMap()\fR procedure. See the sample +programs in the appendices for examples of how these procedures might be +called. + +.us "Synopsis" +.nf + \f(CWint cdl_getMapping(CDLPtr cdl, char *region, + float *sx, float *sy, int *snx, int *sny, + int *dx, int *dy, int *dnx, int *dny, char *ref); + \f(CWint cdl_setMapping(CDLPtr cdl, char *region, + float sx, float sy, int snx, int sny, + int dx, int dy, int dnx, int dny, char *ref); + \f(CWint cdl_queryMap(CDLPtr cdl, int wcs, char *region, + float *sx, float *sy, int *snx, int *sny, + int *dx, int *dy, int *dnx, int *dny, char *objref); +.fi + +.NH 2 +Image Colormaps +.LP + The IIS protocol used does not permit the downloading of user-defined +colormaps, all images are loaded as raw grayscale values according to the +XImtool colormap model used by currently supported servers. All images +containing private colormaps or more than the 201 grayscale values defined +by the Imtool colormap model must either convert the image to 8-bit +grayscale values by calling the CDL zscale procedures (\fBcdl_computeZscale()\fR +and \fBcdl_zscaleImage()\fR) or scale the images in client code with +user LUTs. The CDL zscale procedures scale image to 201 grayscale values +so that they are displayed to the full 8-bit range, user LUT +transformations or user code for converting to grayscale from a private +colormap procedures should do the same. +.NH 3 +Imtool Color Model +.LP + The IMTOOL color model defines at most 201 grayscale values for use in +displaying the image, a set of 16 static colors are also defined for overlay +graphics. Pixel values sent to the server should be already scaled to this +model, i.e. the image pixels should be scaled to the range 1-200, values +above this will either represent the overlay colors or will wrap around to +8-bit values. The CDL zscale procedures will automatically scale +arbitrary pixel values to use this color model, the overlay procedures +assume color values are defined for the static color range 201-217 but any +8-bit value may be used. +.LP + A summary of the color model values is included below: +.TS +center; +lB lB cB cB lB lB +l l c c l l. +Color Description Color Description +0 Background 208 Cyan +1 - 200 Image data 209 Magenta +201 Cursor (white) 210 Coral +202 Background (black) 211 Maroon +203 White 212 Orange +204 Red 213 Khaki +205 Green 214 Orchid +206 Blue 215 Turquoise +207 Yellow 216 Violet +217 Wheat 218-255 undefined +.TE +.NH 2 +ZScale Intensity Mapping +.LP + Since most display servers are only capable of displaying 8-bit pixel +values, images with more than 8-bits per pixel must be scaled prior to +display. For linear transformations this is typically done using a simple +conversion of the image min/max values to the 256 grayscale values, however +this doesn't produce very good results when most pixel values are near one +of the extremes (usually the image min for astronomical images). To solve +this IRAF uses a \fIzscale\fR mapping algorithm where a sampling grid is used +to approximate the image min/max values rather than computing it directly, +a line is then fit to these sample pixels to determine the optimal +transformation to the display values. This is not only more efficient but +maps the most common pixel values to the display range producing a better image. +.LP + The CDL has several routines for doing the same transformation: the +\fIcdl_computeZscale()\fR procedure is used to compute the optimal \fIz1\fR +and \fIz2\fR +values (the min/max used for the zscale transform) for an image of any pixel +size. The \fIbitpix\fR argument is the number of bits-per-pixel for the input +array and has the same meaning as for the FITS \fIBITPIX\fR keyword. To then +transform the image using these values (or user-defined values) the +\fIcdl_zscaleImage()\fR procedure is used. The input pixels are modified by +this procedure but the array is not reallocated to the smaller size needed by +an 8-bit array. The \fBcdl_setSample()\fR and \fBcdl_setSampleLines()\fR +procedures can be used to change the sampling grid and number of sample +points (the default is 600 points on 5 lines). The \fBcdl_setContrast()\fR +procedure can be used to change the default contrast adjustment to the slope +used in the transformation (the default is 0.25). If a value of zero is +given then the minimum and maximum of the intensity sample is used as the +z1/z2 value. +.LP + Each of the CDL display procedures has a \fIzscale\fR flag to +automatically scale the pixels prior to display. Applications wishing to +set their own z1/z2 values will need to call the zscale procedures and +disable this flag. By default cdl_zscaleImage() will use a linear transform, +the \fBcdl_setZTrans()\fR procedure may be used to change this. Acceptable +values are \fBCDL_UNITARY\fR (zero) for a unitary transform, \fBCDL_LINEAR\fR +(one) for a linear transform, or \fBCDL_LOG\fR (two) for a log10 transform. + +.us "Synopsis" +.nf + \f(CWvoid cdl_computeZscale (CDLPtr cdl, uchar *pix, int nx, + int ny, int bitpix, float *z1, float *z2)\fR + \f(CWvoid cdl_zscaleImage (CDLPtr cdl, uchar **pix, int nx, + int ny, int bitpix, float z1, float z2)\fR + + \f(CWvoid cdl_setZTrans (CDLPtr cdl, int ztrans)\fR + \f(CWvoid cdl_getZTrans (CDLPtr cdl, int *ztrans)\fR + \f(CWvoid cdl_setZScale (CDLPtr cdl, float z1, float z2)\fR + \f(CWvoid cdl_getZScale (CDLPtr cdl, float *z1, float *z2)\fR + + \f(CWvoid cdl_setSample (CDLPtr cdl, int nsample)\fR + \f(CWvoid cdl_setSampleLines (CDLPtr cdl, int nlines)\fR + \f(CWvoid cdl_setContrast (CDLPtr cdl, float contrast)\fR + \f(CWvoid cdl_getSample (CDLPtr cdl, int *nsample)\fR + \f(CWvoid cdl_getSampleLines (CDLPtr cdl, int *nlines)\fR + \f(CWvoid cdl_getContrast (CDLPtr cdl, float *contrast)\fR + +.fi +.NH 2 +Image Hardcopy +.LP + While most servers include some hardcopy capability of their own the +CDL provides two procedures for creating hardcopy images from the client +(e.g. for a batch processing application). The client will typically read +back the entire image, frame buffer, of just a subraster and pass those +pixels to the print procedure. Images will be written as Pseudocolor +Postscript (to preserve the overlay marker colors) and may be disposed to +a file using the \fBcdl_printPixToFile()\fR procedure or to any command string +accepting input from \fIstdin\fR (typically just an 'lpr' command) by using +the \fBcdl_printPix()\fR procedure. + +.us "Synopsis" +.nf + \f(CWint cdl_printPix (CDLPtr cdl, char *cmd, uchar *pix, int nx, + int ny, int annotate)\fR + \f(CWint cdl_printPixToFile (CDLPtr cdl, char *fname, uchar *pix, + int nx, int ny, int annotate)\fR +.fi +.NH 2 +Image Cursor +.LP + The image cursor is read using the \fBcdl_readCursor()\fR procedure. +The returned value is the cursor \fI(x,y)\fR position as floating point value +in terms of the currently define image WCS. Note that this position must +be converted to integer if it is to be used in one of the marker procedures. + +.us "Synopsis" +.nf + \f(CWint cdl_readCursor (CDLPtr cdl, int sample, float *x, + float *y, int *wcs, char *key)\fR +.fi + +The \fIwcs\fR argument is defined as + +.nf + wcs = frame * 100 + wcs_number +.fi + +(where wcs_number=0 for frame buffer coords and 1 for image coords). So, +you can get the frame as simply + +.nf + frame = (int) (wcs / 100) +.fi + +.NH 3 +Cursor Sampling +.LP + If the cdl_readCursor() \fIsample\fR flag is non-zero the \fIlogical +image cursor\fR position is returned immediately, otherwise the display server +will wait for a keystroke before returning the cursor position. The logical +image cursor is the last value set by a \fIcdl_setCursor()\fR call or the last +value returned by a \fIcdl_readCursor()\fR call. When sampling the cursor +position the keystroke value is undefined. +.NH 2 +Image Readout +.LP + The CDL maintains an internal knowledge of where an image has been +positioned if it was displayed using one of the \fIcdl_display*\fR procedures. +The \fBcdl_readImage()\fR procedure may be used to read back the entire image +pixels from the server ignoring the region of the frame buffer outside of +the image, the \fBcdl_readFrameBuffer()\fR procedure will read back the +contents of the entire frame buffer. The dimensions of the array are returned +in the \fInx\fR and \fIny\fR arguments. + +.us "Synopsis" +.nf + \f(CWint cdl_readImage (CDLPtr cdl, uchar **pix, int *nx, + int *ny)\R + \f(CWint cdl_readFrameBuffer (CDLPtr cdl, uchar **pix, + int *nx, int *ny)\R +.fi +.NH 2 +Subraster I/O +.LP + The \fBcdl_writeSubRaster()\fR procedure is used to write an arbitrary +raster to any location in the display. Similarly the +\fBcdl_readSubRaster()\fR procedure is used to read back an arbitrary raster. +When an image has previously been displayed the subraster position is given +in image coordinates (e.g. when writing a subregion of edited pixels), +otherwise the position is in frame buffer coordinates (e.g. to display +multiple images per frame you should use the cdl_writeSubRaster() call). +See the section on \fIMarker Coordinates\fR for further explanation of the +coordinate systems used. + +.us "Synopsis" +.nf + \f(CWint cdl_writeSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar *pix)\fR + \f(CWint cdl_readSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar **pix)\fR +.fi +.NH +Graphics Overlay +.NH 2 +Marker Coordinates +.LP + All marker positions are assumed to be image pixel coordinates, +although there is no requirement that the position be on the image itself. +When an image WCS is defined (using the CDL display procedures or explicitly) +the origin of the coordinates used shifts from the frame buffer lower-left +to the lower-left of the image as displayed in the frame. Negative +positions are allowed and will either refer to empty pixels if the frame +buffer is larger than the image, or pixels outside the frame buffer +boundaries. Raster I/O requests will be clipped to the frame buffer +endpoints, a request completely outside the frame buffer is an error. +.NH 2 +Mapping a Previously Displayed Image +.LP + Ideally any application wishing to draw markers on an image will have +also displayed that image, however the \fBcdl_mapFrame()\fR procedure may +be used to map the requested frame for marker overlay. It does this by +reading the WCS defined for that frame and assumes an image has been +displayed and centered in the frame buffer, then resets the internal CDL +image position. For this reason it should not be used when multiple image +mappings have been displayed to a frame unless the marker overlay can be +done reliably using the last WCS displayed to the frame buffer. +If no image has been displayed the frame buffer is mapped +directly. This can be used for example to map an empty frame for displaying +just the markers without an image, or for mapping another frame's WCS for +use on the current display. The frame is not changed by the procedure call +however the current WCS \fIis\fR changed. + +.us "Synopsis" +.nf + \f(CWint cdl_mapFrame (CDLPtr cdl, int frame)\fR +.fi +.NH 2 +Marking a Coordinate File +.LP + Since a common function for programs will be to mark a list of +coordinates, the high-level \fBcdl_markCoordsFile()\fR procedure is +provided to make this easier. The input parameters include a filename +expected to contain a set of (x,y) points (real or integer), and arguments +specifying the point type, size and color to draw. If the \fIlabel\fR +argument is positive each marker point will be labeled with it's relative +number in the file. The size, type and color arguments all have the same +meaning as for the \fBcdl_markPoint()\fR procedure described below. + +.us "Synopsis" +.nf + \f(CWint cdl_markCoordsFile (CDLPtr cdl, char *fname, int type, + int size, int color, int label)\fR +.fi +.NH 2 +Marker Colors +.LP + Markers may be drawn using any 8-bit value, in order to use the +static overlay colors the color must be in the range 201-217 (see above for +notes on the XImtool color model). The "\fIcdl.h\fR" include file +for C programs, the "\fIcdlftn.inc\fR" include for fortran programs, +or the "\fIcdlspp.h\fR" include for SPP programs, defines the following +symbolic constants for each of the static overlay colors: +.sp 0.5 +.TS +center; +lB l c c lB l. +C_BLACK 202 C_CORAL 210 +C_WHITE 203 C_MAROON 211 +C_RED 204 C_ORANGE 212 +C_GREEN 205 C_KHAKI 213 +C_BLUE 206 C_ORCHID 214 +C_YELLOW 207 C_TURQUOISE 215 +C_CYAN 208 C_VIOLET 216 +C_MAGENTA 209 C_WHEAT 217 +.TE +.NH 2 +Marker Types +.LP + Currently supported marker types include: \fI +.TS +center; +l l l l l. +Point Line Box Polyline Polygon +Circle Circular Annuli Ellipse Elliptical Annuli Text +.TE +.LP + \fRThe "\fIcdl.h\fR" include file for C programs, the +"\fIcdlftn.inc\fR" include for fortran programs, or the "\fIcdlspp.h\fR" +include file SPP programs, defines the following symbolic constants for +each of the defined \fIPoint\fR marker types: +.TS +center; +lB r c c lB r. +M_FILL 1 M_CIRCLE 64 +M_POINT 2 M_STAR 128 +M_BOX 4 M_HLINE 256 +M_PLUS 8 M_VLINE 512 +M_CROSS 16 M_HBLINE 1024 +M_DIAMOND 32 M_VBLINE 2048 +.TE +.LP + Point markers are drawn using the \fBcdl_markPoint()\fR procedure, +point types may be logically \fIOR\fR'd to create composite markers, closed +shapes such as a circles, diamonds, or squares may be \fIOR\fR'd with the +M_FILL flag to flood-fill the point with the current overlay color. +.NH 3 +Point +.LP + The \fBcdl_markPoint()\fR procedure is used to mark a specific point +on the image using one of the marker types listed above. The marker is +centered at the coordinates specified by the \fIx\fR and \fIy\fR arguments, +\fItype\fR is an integer flag indicating what kind of marker to draw and +may be a composite type by logically ORing two or more marker types. +\fISize\fR is the width and height of the marker measured in pixel unxits, +and \fIcolor\fR is the color used to draw the marker. If the \fInumber\fR +argument is greater than zero that number will be drawn next to the point +as a label, creating text labels for point markers can be done using the +\fIcdl_markPointLabel\fR procedure. +.LP + Most marker names are fairly obvious but several are worth special +mention: The M_DIAMOND, M_CIRCLE and M_BOX marker types may be logically +\fIOR\fRed with the M_FILL flag to produce a filled marker type. Unless +\fIOR\fRd with the M_POINT flag all point markers will leave the center +pixel unchanged. The M_HLINE and M_VLINE markers are most useful in +astronomical applications to mark an individual star, they are horizontal +and vertical lines respectively with a gap in the middle third of the marker +(the M_HBLINE and M_VBLINE are identical but with a width of 3 pixels). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPoint (CDLPtr cdl, int x, int y, int number, + int size, int type, int color)\fR + \f(CWint cdl_markPointLabel (CDLPtr cdl, int x, int y, char *label + int size, int type, int color)\fR +.fi +.NH 3 +Line +.LP + The \fBcdl_markLine()\fR procedure is used to draw a line of the +specified color between points (\fIxs,ys\fR) and (\fIxe,ye\fR). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markLine (CDLPtr cdl, int xs, int ys, int xe, int ye, + int color)\fR +.fi +.NH 3 +Box +.LP + The \fBcdl_markBox()\fR procedure is used to draw a box of the +specified color with endpoints specified by (\fIlx,ly\fR) and (\fIux,uy\fR). +If the \fIfill\fR flag is set the box will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markBox (CDLPtr cdl, int lx, int ly, int ux, int uy, + int fill, int color)\fR +.fi +.NH 3 +Circle +.LP + The \fBcdl_markCircle()\fR procedure is used to draw a circle of the +specified color with a center at (\fIx,y\fR) and radius \fIradius\fR. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircle (CDLPtr cdl, int x, int y, int radius, + int fill, int color)\fR +.fi +.NH 3 +Polyline +.LP + The \fBcdl_markPolyline()\fR procedure is used to draw a line +connecting the \fInpts\fR points specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolyline (CDLPtr cdl, int *xpts, int *ypts, + int npts, int color)\fR +.fi +.NH 3 +Polygon +.LP + The \fBcdl_markPolygon()\fR procedure is used to draw a closed +polygon consisting of \fInpts\fR vertices specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. The last point in the array +will automatically be connected to the first point by the procedure. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolygon (CDLPtr cdl, int *xpts, int *ypts, + int npts, int fill, int color)\fR +.fi +.NH 3 +Ellipse +.LP + The \fBcdl_markEllipse()\fR procedure is used to draw an ellipse of the +specified color with a center at (\fIx,y\fR) and semimajor-axis \fIxrad\fR +and semiminor-axis \fIyrad\fR pixels long. A rotation angle for the ellipse +may be specified by passing a non-zero \fIangle\fR argument, the angle is +measured in degrees from the positive x-axis. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipse (CDLPtr cdl, int x, int y, int xrad, + int yrad, float ang, int fill, int color)\fR +.fi +.NH 3 +Circular Annuli +.LP + The \fBcdl_markCircAnnuli()\fR procedure is used to draw +\fInannuli\fR circles separated by \fIsep\fR pixels each. The circle is +centered at (\fIx,y\fR) with an initial radius of \fIradius\fR pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircAnnuli (CDLPtr cdl, int x, int y, int radius, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Elliptical Annuli +.LP + The \fBcdl_markEllipAnnuli()\fR procedure is used to draw +\fInannuli\fR ellipses separated by \fIsep\fR pixels each. The ellipse is +centered at (\fIx,y\fR) with an initial semimajor and semiminor axis +specified by the \fIxrad\fR and \fIyrad\fR arguments. Each ellipse will +be optionally rotate by an \fIangle\fR degrees as measured from the positive +x-axis. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipAnnuli (CDLPtr cdl, x, y, xrad, yrad, ang, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Text +.LP + The \fBcdl_markText()\fR procedure is used to draw a text string +specified by \fIstr\fR argument with an initial position at (\fIx,y\fR) +and optionally rotated by \fIangle\fR degrees as measured from the positive +x-axis. The default \fIsize\fR is 1.0 and is approximately a 6x13 font, +the font size may be scaled by any fractional amount. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markText (CDLPtr cdl, int x, int y, char *str, + float size, float angle, int color)\fR +.fi +.NH 2 +Text Fonts +.LP + The \fBcdl_setFont()\fR procedure is used to choose between one +of four available fonts as the text marker default: Roman, Greek, Futura, +Bold and Times respectively. By default the Roman font will be used. +The width of the lines used to draw the text may also be set. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWvoid cdl_setFont (CDLPtr cdl, int font)\fR + \f(CWvoid cdl_setTextWidth (CDLPtr cdl, int width)\fR +.fi +.sp 0.5 +A complete listing of the Greek character mappings can be found in the +file 'greek.ps' in the 'doc' subdirectory of the CDL distribution. + The \fIRoman\fR font is the font implemented in the original version +of the CDL and works well for most applications. Both the \fIGreek\fR and +\fITimes\fR fonts are hi-resolution fonts which work best for larger frame +buffers but can produce publication quality text. The \fIFutura\fR font +is a simpler font which can produce better results than the default on small +size frame buffers. A \fIBold\fR font automatically increases the text line +width by one pixel over the current setting and may be used with any font. +.NH 3 +In-Line Font Changes +.LP + Text markers are drawn using the font selected with +the \fIcdl_setFont()\fR +routine, however fonts may be change within a string itself (e.g. to set +a Greek character) using a \\f escape sequence. The escape is followed +by the character 'R' to set a Roman font, 'G' for Greek, 'F' for +futura, 'B' for bold +and 'T' for Times. Any number of escapes are permitted within a string, +the font change will remain in effect until it is changed, or the end of +string at which point any subsequent strings will again be drawn with the +default font. Additionally a 'P' in the escape sequence will change the +font to the one previously used, whatever that may be. +.LP + The CDL also supports a sub/superscripting of text which can only +be done with the font escapes. In this case the escape character followed by +a 'U' produces a superscript and a 'D' produces a subscript. The changes may +be nested permitting several levels of sub/superscripts, these escapes may +also be used in conjunction with a font change to cause the sub/superscript +to be drawn with a different font. A superscript escape will remain in +effect until the end of the string or a \\fD escape is seen. Similarly a +subscript remains in effect until the end of the string of a \\fU escape. +Sub/superscripted text is drawn using a smaller font size, there is presently +no way to specify a different size for the sub/superscripted text. +.TS +center; +cb s +l l. +Summary of Font Escapes +.sp 0.5 +\\\\fR change to Roman font +\\\\fG change to Greek font +\\\\fF change to Futura font +\\\\fT change to Times font +\\\\fB change to bold font +\\\\fP change to previous font +\\\\fU begin relative superscripted text +\\\\fD begin relative subscripted text +.TE +.NH 2 +Line Widths and Styles +.LP + The \fBcdl_setLineWidth()\fR procedure can be used to set the line +width used to draw polygon or polyline markers, point markers will not +be affected. The \fBcdl_setLineStyle()\fR procedure is used to set a line +style other than solid. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWvoid cdl_setLineWidth (CDLPtr cdl, int width)\fR + \f(CWvoid cdl_setLineStyle (CDLPtr cdl, int style)\fR +.fi +.LP + \fRThe "\fIcdl.h\fR" include file for C programs, the +"\fIcdlftn.inc\fR" include for fortran programs, or the "\fIcdlspp.h\fR" +include file SPP programs, defines the following symbolic constants for +each of the defined line styles: +.TS +center; +lB r c c lB r. +L_SOLID 0 L_DASHED 1 +L_DOTTED 2 L_DOTDASH 3 +L_HOLLOW 4 L_SHADOW 5 +.TE +.LP + The \fIhollow\fR line style is drawn with a linewidth of five pixels, +two pixels of color, a black line, and two pixels of color. It is best +used when the marker will traverse extreme changes in brightness, due to the +thickness of the line it may work best with larger frame buffers. The +\fIshadow\fR linestyle is drawn as two pixels of color and two pixels of black +and should be used for similar brightness variations, however it effectively +shows up as a line only two pixels wide and may be preferred for medium or +smaller frame buffers. +.LP + The three dashed linestyles are drawn using "gap" spacings of 5 +pixels in between line segments. Whether or not these gaps are resolved +depends on the size of the frame buffer being used and the magnification +used in the display server. By default they should resolve completely +using frame buffers up to 1024x1024 pixels, or magnification factors +displaying 1024x1024 pixels. If larger sizes are needed the image should +be subsampled prior to display to maintain the marker resolution needed +for these linestyles. + +.NH 2 +Deleting Markers +.LP + When markers are drawn the underlying subraster is first saved to +an internal structure, erasure is done by simply redisplaying the saved +raster. Problems can arise however when markers overlap; when deleting a +marker that is \fIunder\fR another marker the original pixels can overwrite +the pixels of the marker on top. This is an unfortunate side effect of the +simple scheme used in this version of the package, users can call the +\fBcdl_redrawOverlay()\fR procedure to help clean up any artifacts left +behind. +.NH 3 +Individual Markers +.LP + The \fBcdl_deleteMark()\fR procedure is used to delete a single +marker from the display(). The (\fIx,y\fR) argument is either the center +position of the marker if that is know by the application, more typically +it will be an approximate position. In the latter case the marker whose +center is closest to this position will be deleted. For markers with no +defined center the distance used to decide if the marker should be +deleted is the distance from the argument position to the edge of the +marker. For example, distance from a box or polygon is measured as the +distance from to one of the sides, for text it is the distance to the +start of the text string. There is no way to \fIun\fRdelete a marker other +than to redraw it. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_deleteMark (CDLPtr cdl, int x, int y)\fR +.fi +.NH 3 +The Entire Overlay +.LP + To erase all markers currently displayed use the +\fBcdl_clearOverlay()\fR procedure. Markers are erased in the reverse order +they were drawn to help reduce the chance that overlaying markers will leave +stray pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_clearOverlay (CDLPtr cdl)\fR +.fi +.NH 2 +Redraw +.LP + The \fBcdl_redrawOverlay()\fR procedure can be used to redraw all +markers currently in the display list. This is sometimes needed when +subraster I/O procedures are used to redisplay subregions and overwrite +existing markers. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_redrawOverlay (CDLPtr cdl)\fR +.fi +.NH +ANSI C Function Prototypes +.LP + The current release of CDL provides full ANSI C function prototypes +for all public and private procedures. By default these will not be used +even on systems with native ANSI compilers, however. +To make use of the CDL prototypes users will +need to define the macro \fBCDL_ANSIC\fR either when compiling the program +(using the -D option to the compiler), +or as a definition in the program source preceding the 'cdl.h' include +directive. +.LP + For example, +.sp 0.5 +.nf + \f(CW#define CDL_ANSIC + #include "cdl.h" + : + main (int argc, char **argv) + :\fR +.fi +.sp 0.5 +or when compiling using something like +.sp 0.5 +.nf + \f(CWcc -DCDL_ANSIC client.c libcdl.a -lm\fR +.fi +.sp 0.5 + Note that when using CDL_ANSIC to build the client program it is +also required that the CDL itself be built in the same way to avoid +confusing FPE errors. Similarly, when building client tasks that \fIdo +not\fR +use CDL_ANSIC you must use a version of the library that has not been +compiled with prototypes. +.LP + The reason is that the float args to the CDL procedures in the +library, or in your task calls, are +promoted to doubles when compiling those procedures, but may only be passed as +floats in your code (or as double where the CDL is expecting float). +This means the argument stack is off by 4 bytes for each float arg and +the values interpreted by the CDL procedure will be corrupted. +If you're going to use the prototypes you'll +need to edit the CDL Imakefile to define "-DCDL_ANSIC" in the EXTRA_DEFINES +so it will use the prototypes and everything will line up. You will then +need to rebuild the libcdl.a as well as relink your program. +.NH +Fortran Language Binding Notes +.LP + The Fortran language binding routines are implemented in C but +should be accessible from any fortran program as though they were real +fortran subroutines. The calling sequences are the same as with the C +library routines with the following exceptions: +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All Fortran functions are +implemented as subroutines. +.IP +\(bu The procedure names are the same except that \fIcdl_\fR has been +replaced with \fIcf\fR in the fortran binding. If your compiler is +case-sensitive then use all lower case letters. +.LP +The binding has been tested on a number of different platforms without +problems. The procedure names haven't been restricted to the traditional +6-character fortran names since most modern compilers can handle longer +names, if yours isn't one of them contact \fIiraf@noao.edu\fR for help +in changing the names. +.LP + Since the CDL is implemented as a set of C routines, the one aspect +that cannot be overlooked in the fortran binding is the between Fortran and +C storage order for arrays. In most cases this will not be a problem since +the CDL routines are just passing around pointers even if they live for a +short while in a fortran program. The problem comes when using the fortran +program to read the arrays, for example in using the array returned by the +\fBcfreadIRAF()\fR procedure, or when passing in arrays for display that +originated in the user's fortran code. In these cases the array \fBmust\fR +be transposed to be interpreted correctly. It was assumed that in most +applications arrays returned by CDL procedures would be immediately passed +to other CDL procedures so having the binding routines +transpose the array to/from +Fortran storage order was unnecessarily inefficient. This may be changed in +later releases if required. + +.NH +SPP Language Binding Notes +.LP + The SPP language binding is experimental and is intended to provide +a way to quickly prototype tasks, it should not be used in production code +as it may not be as portable as the rest of the task. In essence this +binding is a layer on top of the Fortran binding since most IRAF platforms +still use Fortran as the intermediate code. The calling sequences are the +same as with the Fortran library routines with the following caveats: +.IP +\(bu The 'cdlspp.h' SPP include file is required by all files which call +CDL routines. The binding names are actually SPP macros to resolve the +current 6 character limit on procedure names. +.IP +\(bu All character string arguments must be dimensioned to at least SZ_FNAME +characters in length. +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All SPP functions are +implemented as subroutines. +.IP +\(bu On HPUX or IBM RS6000 systems the 'cdlspp.h' file must be edited to +remove the trailing underscores from the procedure name macros. This is +because on these platforms the fortran compiler will not append an +underscore to the SPP symbols as it does on other platforms. + +.NH +IIS Protocol Description +.LP + The communications protocol used by the CDL and servers such as +\fIXImtool\fR and \fISAOimage\fR, is a slightly modified version of that used +by the IIS Model 70. All operations are initiated by sending a header +packet containing a \fIthing id\fR (tid) and \fIsubunit\fR selecting the +function to be performed, optionally followed by data up to 32K bytes long. +The IIS header packet used is defined as +.nf + \f(CWstruct iism70 { + short tid; + short thingct; + short subunit; + short checksum; + short x, y, z; + short t; + };\fR +.fi + +The \fIthing count\fR field contains the negative number of bytes of data +that will be sent following the header packet. The IIS header checksum is +computed as +.nf +\f(CW + checksum = 0177777 - (tid + subunit + thingct + x + y + z + t); +\fR +.fi +The four IIS registers are set differently depending on the operation, a +summary of the header packets for each operation is summarized below. + +.KS +.ce 1 +\fBIIS Header Packet Summary\fR +.TS +tab(:); +c c c c c c c c c. +:TID:Subunit:Tct:X:Y:Z:T:Data +.T& +l | l | l | c | c | c | l | l | l |. +:_:_:_:_:_:_:_:_ +Read Data:IIS_READ\fB|\fPPACKED:MEMORY:-NB:x:y:fr:-:NB +Write Data:IIS_WRITE\fB|\fPPACKED:MEMORY:-NB:x:y:fr:-:NB +Read Cursor:IIS_READ:IMCURSOR:-:-:-:-:-:- +Write Cursor:IIS_WRITE:IMCURSOR:-:x:y:wcs:-:- +Set Frame:IIS_WRITE:LUT\fB|\fPCOMMAND:-1:-:-:-:-:2 +Erase Frame:IIS_WRITE \fB|\fP fb:FEEDBACK:-:-:-:fr:-:- + +Old Write WCS:IIS_WRITE\fB|\fPPACKED:WCS:-N:-:-:fr:fb:320 +Old Read WCS:IIS_READ:WCS:-:-:-:fr:wcs:320 + +WCS Version?:IIS_READ:WCS:-:1:1:-:-:320 +WCS by Number?:IIS_READ:WCS:-:1:-:fr:wcs:1024 +New Write WCS:IIS_WRITE\fB|\fPPACKED:WCS:-N:1:-:fr:fb:1024 +New Read WCS:IIS_READ:WCS:-:1:-:fr:wcs:1024 +:_:_:_:_:_:_:_:_ +.TE +.KE +.TS +l l l. +Where NB = number of bytes expected or written + x = x position of operation in frame buffer coords + y = y position of operation in frame buffer coords + fr = frame number (passed as bitflag (i.e. 1, 2 ,4 8, etc) + fb = frame buffer config number (zero indexed) + N = length of WCS string + wcs = WCS number (usually zero) + Data = the number of bytes of data to be read or written following the header packet. + + IIS_WRITE = 0400000 + IIS_READ = 0100000 + COMMAND = 0100000 + PACKED = 0040000 + IMC_SAMPLE = 0040000 + + MEMORY = 001 + LUT = 002 + FEEDBACK = 005 + IMCURSOR = 020 + WCS = 021 +.TE +.LP +TID fields can be logically OR'd with the PACKED flag indicating the number +of data bytes is exactly \fIthingct\fR bytes long, otherwise \fIthingct\fR +must be specified as half the number of data bytes. In a cursor read, if +the IIS_READ flag is OR'd with IMC_SAMPLE the logical cursor position (i.e. +the last value read or set) is returned immediately, otherwise the server +will wait for a keystroke to be hit before returning a string containing the +(x,y) position, wcs of the read, and the keystroke. When setting the frame +you must send a short integer in the data containing the frame selected. + +.NH +VXIMTOOL Proxy/Display Server Usage +.LP +\fIVXIMTOOL\fR is a image display server process much like \fIXIMTOOL\fR, +except that all it normally does is respond to datastream requests +to read and write to internal frame buffers maintained as arrays in memory. +Multiple frame buffers and frame buffer configurations are supported. It +can be used to debug CDL programs by printing out the +protocol packets received, or can simply be used as a dummy server in cases +where no image display is really needed. By enabling the \fI-proxy\fR +flag the server can also be used to repeat the datastream requests to a +list of other servers, effectively splitting the image display to a number +of other servers. See the \fIvximtool\fR man page for details on other +command-line arguments and usage. +.LP +The program was originally intended as a debugging tool, either in the +development of CDL clients directly or in cases where the display may +need to go to separate screens as part of a larger project. For example, +engineers may wish to "eavesdrop" on the system by viewing images displayed +by CDL clients used as part of a data acquisition system. It can also be +used as a memory-only display server for CDL clients which need to be run +in the background as part of a pipeline processing system requiring a +frame buffer for image marking. +.LP +In proxy mode the program acts as a relay for the IIS datastream packets, +sending image data, frame requests, etc. to a list of other servers specified +on the command line. The effect of this is to allow a client to display to +this program which then re-displays to each of the other named servers. +Of course CDL clients can also do this internally by opening multiple +connections, using \fIvximtool\fR in proxy mode adds the functionality to +programs which may use this feature only ocasionally. A maximum of 8 servers +may be named, they may be either on the local host or a remote machine +and connections can be established using either fifos or sockets. See +above or the \fIvximtool\fR man page for details on how to specify the +server connection. +.LP +The current implementation has a few restrictions users should keep in mind: +.IP +\(bu The time to display an image or perform any output operation scales +with the number of connected hosts. Each IIS packet is forwarded to each +host in turn before processing the next input packet, and connection over a slow +network will delay the entire process. +.IP +\(bu Cursor and image readback are done by sending the request \fIonly\fR to +the first server named on the command line. This is done to avoid forcing +a cursor mode on all servers which cannot be terminated when a response is +received from only one server, and means that the first server named should +be the one used to control interactive sessions. The remaining servers +however can still respond to cursor requests from other applications +connected to that server on another channel. +.IP +\(bu All named servers must be running prior to starting the proxy server. +The connection to the remote servers is established when this task is first +run and if no server is running that connection will be ignored. The task will +exit if no remote servers can be found for display. +.IP +\(bu Any connected server that shuts down while the proxy server is running +is likely to cause the program to crash on the next display. +.bp +.NH +C Interface Summary +.LP +.in 0.5i +#include "\fBcdl.h\fR" +.in -0.5i + +.TS +center; +r l. +CDLPtr \fBcdl_open\fR (imtdev) +int \fBcdl_displayPix\fR (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) +char \fBcdl_readCursor\fR (cdl, sample, x, y, wcs, key) +int \fBcdl_setCursor\fR (cdl, x, y, wcs) +int \fBcdl_setWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +int \fBcdl_getWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +void \fBcdl_setFrame\fR (cdl, frame) +int \fBcdl_clearFrame\fR (cdl) +void \fBcdl_close\fR (cdl) + +int \fBcdl_setMapping\fR (cdl, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +int \fBcdl_getMapping\fR (cdl, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +int \fBcdl_queryMap\fR (cdl, wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref) + +int \fBcdl_displayIRAF\fR (cdl, fname, band, frame, fbconfig, zscale) +int \fBcdl_isIRAF\fR (fname) +int \fBcdl_readIRAF\fR (fname, band, pix, nx, ny, bitpix, title) + +int \fBcdl_displayFITS\fR (cdl, fname, frame, fbconfig, zscale) +int \fBcdl_isFITS\fR (fname) +int \fBcdl_readFITS\fR (fname, pix, nx, ny, bitpix, title) + +void \fBcdl_computeZscale\fR (cdl, pix, nx, ny, bitpix, z1, z2) +void \fBcdl_zscaleImage\fR (cdl, pix, nx, ny, bitpix, z1, z2) + +int \fBcdl_printPix\fR (cdl, cmd, pix, nx, ny, annotate) +int \fBcdl_printPixToFile\fR (cdl, fname, pix, nx, ny, annotate) + +int \fBcdl_readImage\fR (cdl, pix, nx, ny) +int \fBcdl_readFrameBuffer\fR (cdl, pix, nx, ny) +int \fBcdl_readSubRaster\fR (cdl, lx, ly, nx, ny, pix) +int \fBcdl_writeSubRaster\fR (cdl, lx, ly, nx, ny, pix) + +void \fBcdl_selectFB\fR (cdl, nx, ny, fb, w, h, nf, reset) +void \fBcdl_setFBConfig\fR (cdl, configno) +void \fBcdl_getFBConfig\fR (cdl, configno, w, h, nf) +void \fBcdl_lookupFBSize\fR (cdl, configno, w, h, nf) + +void \fBcdl_setZTrans\fR (cdl, ztrans) +void \fBcdl_setZScale\fR (cdl, z1, z2) +void \fBcdl_setSample\fR (cdl, nsample) +void \fBcdl_setSampleLines\fR (cdl, nlines) +void \fBcdl_setContrast\fR (cdl, contrast) +void \fBcdl_setName\fR (cdl, imname) +void \fBcdl_setTitle\fR (cdl, imtitle) + +void \fBcdl_getFrame\fR (cdl, frame) +void \fBcdl_getZTrans\fR (cdl, ztrans) +void \fBcdl_getZScale\fR (cdl, z1, z2) +void \fBcdl_getSample\fR (cdl, nsample) +void \fBcdl_getSampleLines\fR (cdl, nlines) +void \fBcdl_getContrast\fR (cdl, contrast) +void \fBcdl_getName\fR (cdl, imname) +void \fBcdl_getTitle\fR (cdl, imtitle) + +int \fBcdl_mapFrame\fR (cdl, frame) +int \fBcdl_markCoordsFile\fR (cdl, fname, type, size, color, label) +int \fBcdl_markPoint\fR (cdl, x, y, number, size, type, color) +int \fBcdl_markPointLabel\fR (cdl, x, y, label, size, type, color) +int \fBcdl_markLine\fR (cdl, xs, ys, xe, ye, color) +int \fBcdl_markBox\fR (cdl, lx, ly, ux, uy, fill, color) +int \fBcdl_markPolygon\fR (cdl, xarray, yarray, npts, fill, color) +int \fBcdl_markPolyline\fR (cdl, xarray, yarray, npts, color) +int \fBcdl_markCircle\fR (cdl, x, y, radius, fill, color) +int \fBcdl_markCircAnnuli\fR (cdl, x, y, radius, nannuli, sep, color) +int \fBcdl_markEllipse\fR (cdl, x, y, xrad, yrad, rotang, fill, color) +int \fBcdl_markEllipAnnuli\fR (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) +int \fBcdl_markText\fR (cdl, x, y, str, size, angle, color) +int \fBcdl_setFont\fR (cdl, font) +int \fBcdl_setTextWidth\fR (cdl, width) +int \fBcdl_setLineWidth\fR (cdl, width) +int \fBcdl_setLineStyle\fR (cdl, style) +int \fBcdl_deleteMark\fR (cdl, x, y) +int \fBcdl_clearOverlay\fR (cdl) +int \fBcdl_redrawOverlay\fR (cdl) +.TE + +.bp +.NH +C Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include "cdl.h" + +/* \fIDISPLAY -- Example task to display an image as a command-line task. + * This task is meant to show three ways the CDL can be used to display + * an image, see the code comments for a description of each method. + * + * Examples: + * To display a simple IRAF or FITS file: + * % ./display -frame 2 image.imh + * % ./display image.fits + * + * To display a FITS file as a raw image: + * % ./display -nx 512 -ny 512 -depth 16 -hskip 5760 -raw dpix.fits + * + * Usage: + * display [-depth N] [-fits] [-frame N] [-fbconfig N] [-hskip N] + * [-iraf] [-nozscale] [-nx N] [-ny N] [-raw] [-zscale] file\fP + */ + +#define NONE -1 +#define IRAF 0 +#define FITS 1 +#define RAW 2 + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname, title[128]; + int i, status = 0, frame = 1, fbconfig = 0, zscale = 1; + int format = NONE, nx = 0, ny = 0, depth = 8, hskip = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strcmp (argv[i], "-depth") == 0) depth = atoi (argv[++i]); + else if (strcmp (argv[i], "-fits") == 0) format = FITS; + else if (strcmp (argv[i], "-frame") == 0) frame = atoi (argv[++i]); + else if (strcmp (argv[i], "-fbconfig") == 0) fbconfig = atoi (argv[++i]); + else if (strcmp (argv[i], "-hskip") == 0) hskip = atoi (argv[++i]); + else if (strcmp (argv[i], "-iraf") == 0) format = IRAF; + else if (strcmp (argv[i], "-nozscale") == 0) zscale = 0; + else if (strcmp (argv[i], "-nx") == 0) nx = atoi (argv[++i]); + else if (strcmp (argv[i], "-ny") == 0) ny = atoi (argv[++i]); + else if (strcmp (argv[i], "-raw") == 0) format = RAW; + else if (strcmp (argv[i], "-zscale") == 0) zscale = 1; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + fname = argv[argc-1]; + + /* \fIMETHOD 1: Displays the image using the high-level format display + * call. Display as an IRAF image if the option was set indicating + * this is the format, otherwise test the file to see if it is anyway.\fP + */ + if (format == IRAF || (format == NONE && \fBcdl_isIRAF\fP (fname))) { + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, FB_AUTO, zscale); + + /* \fIMETHOD 2: Uses the CDL procedure for getting image pixels from + * a known format, minimal work required to display an image. The + * point here is that you can use this method to process the image + * yourself prior to display, e.g. subsample the pixels, apply a user + * LUT, etc but still use the CDL to get the raw image and do the + * display.\fP + */ + } else if (format == FITS || (format == NONE && \fBcdl_isFITS\fP (fname))) { + + /* \fIGet the FITS image pixels, exit w/ an error status if something + * went wrong, the procedure will print what that was.\fP + */ + if (\fBcdl_readFITS\fP (fname, &pix, &nx, &ny, &depth, title)) { + \fBcdl_close\fP (cdl); /* \fIclose the package\fP */ + exit (1); /* \fIexit w/ error code\fP */ + } + + /* \fINow select a frame buffer large enough for the image. The + * fbconfig number is passed in the WCS packet, but the display + * call below will compute the correct WCS for the image and + * transmit that prior to display, all we're doing here is + * setting up the FB to be used.\fP + */ + if (fbconfig == 0) + \fBcdl_selectFB\fP (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 0); + + /* \fILastly, display the pixels to the requested frame, do any + * zscaling requested using the CDL procedure.\fP + */ + status = \fBcdl_displayPix\fP (cdl, pix, nx, ny, depth, frame, + fbconfig, zscale); + + /* \fIMETHOD 3: Displays an image of raw pixels. The client code is + * responsible for reading the image and calling all the procedures + * needed for image display, initialize the frame, zscaling pix, etc. + * While we assume a simple raster format in this program, the user + * code can read a compressed image format such as GIF, mosaic multiple + * images for display as a single image, or just about anything that + * produces a raster for display. The intent here is to show all the + * lowest level calls needed for displaying the image.\fP + */ + } else if (format == RAW) { + FILE *fd; + int lx, ly; + + if (nx == 0 || ny == 0) { + fprintf (stderr, "No size given for raw data.\\n"); + exit (1); + } + + /* \fIOpen the image file if we can.\fP */ + if (fd = fopen (fname, "r")) { + + /* \fISeek to the offset specified.\fP */ + lseek (fileno(fd), (off_t) hskip, SEEK_SET); + + /* \fIAllocate the pixel pointer and read the data.\fP */ + pix = (unsigned char *) malloc (nx * ny * (depth / 8)); + fread (pix, depth/8, nx * ny, fd); + + /* \fIIf we're zscaling and depth is more than 8-bits, do that.\fP */ + if (zscale && depth > 8) { + \fBcdl_computeZscale\fP (cdl, pix, nx, ny, depth, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, nx, ny, depth, z1, z2); + } + + /* \fINow select a frame buffer large enough for the image. + * We'll ask that this be reset but the change won't go to + * the server until we send in the WCS below.\fP + */ + \fBcdl_selectFB\fP (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 1); + + /* \fICompute the image placement so it's centered in the frame, + * but note the cdl_writeSubRaster() routine can place an + * arbitrary raster anywhere in the frame buffer.\fP + lx = (fb_w / 2) - (nx / 2); + ly = fb_h - ((fb_h / 2) + (ny / 2)); + + /* \fISet the mapping we'll send with the WCS which must be + * called before the cdl_setWCS() call since the data is sent + * with the WCS and not as a separate call.\fP + * + * \fRFirst we must compose a node!path prefix for the image.\fP */ + */ + gethostname (node, 512); + (void) getcwd (path, 512); + if (*fname == '/') + (void) sprintf (path_prefix, "%s!%s", node, fname); + else + (void) sprintf (path_prefix, "%s!%s/%s", node, path, fname); + + \fBcdl_setMapping\fP (cdl, "image", 0., 0., nx, ny, lx, ly, nx, ny, + path_prefix); + + /* \fIFor the WCS we assume a simple linear transform where the + * image is Y-flipped, the (x,y) translation is computed so + * it is correct for an frame buffer >= than the image size.\fP + */ + \fBcdl_setWCS\fP (cdl, fname, "", 1., 0., 0., -1., + (float) (nx / 2) - (fb_w / 2) + 1, /* \fIX trans.\fP */ + (float) (fb_h / 2) + (ny / 2), /* \fIY trans.\fP */ + z1, z2, CDL_LINEAR); /* \fIZ transform\fP */ + + /* \fIFinally, display the pixels.\fP */ + if (\fBcdl_writeSubRaster\fR (cdl, lx, ly, nx, ny, pix)) + status = 1; + } else + status = 1; + } else { + if (access (fname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image does not exist.\\n", fname); + status = 1; + } + + /* \fINow just free the pixel pointer to clean up.\fP */ + if (pix) + free ((unsigned char *) pix); + \fBcdl_close\fP (cdl); /* \fIclose the package\fP */ + exit (status); +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Interactive Graphics Overlay Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include <math.h> +#include "cdl.h" + +/* \fI + * TVMARK -- Example task for displaying an marking images. This program + * can be used to either display an image and overlay points defined in + * a coordinate file, map an existing display frame for marking, or option- + * ally enter a cursor command loop after either of these providing other + * marking capability. All options support minimum match. + * + * Examples: + * % tvmark dpix.fits + * % tvmark -coords coords -color 205 dpix.fits + * % tvmark -frame 2 + * % tvmark -coords coords -interactive dpix.fits + * + * Usage: + * tvmark [-frame N] [-fbconfig N] [-coords <file>] [-size N] [-color N] + * [-nolabel] [-fill] [-interactive] [image]\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, *cfname = NULL; + int i, status = 0, fill = 0, frame = 1, fb = FB_AUTO, zscale = 1; + int color = 201, label = 1, size = 9, interactive = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp(argv[i], "-color",4) == 0) color = atoi (argv[++i]); + else if (strncmp(argv[i], "-coords",4) == 0) cfname = argv[++i]; + else if (strncmp(argv[i], "-fbconfig",3) == 0) fb = atoi (argv[++i]); + else if (strncmp(argv[i], "-fill",4) == 0) fill = 1; + else if (strncmp(argv[i], "-frame",3) == 0) frame = atoi (argv[++i]); + else if (strncmp(argv[i], "-interactive",4) == 0) interactive = 1; + else if (strncmp(argv[i], "-nolabel",4) == 0) label = 0; + else if (strncmp(argv[i], "-nozscale",4) == 0) zscale = 0; + else if (strncmp(argv[i], "-size",2) == 0) size = atoi (argv[++i]); + else + fname = argv[i]; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIIf an image was specified display it first, otherwise assume the + * image has already been loaded in the frame and mark that.\fP + */ + if (fname) { + if (\fBcdl_isIRAF\fP (fname)) + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, fb, zscale); + else if (\fBcdl_isFITS\fP (fname)) + status = \fBcdl_displayFITS\fP (cdl, fname, frame, fb, zscale); + else { + if (access (cfname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image doesn't exist.\\n", fname); + status = 1; + } + if (status) goto err_; + } else { + + /* \fIIf we've requested a special frame buffer, set it now.\fP */ + if (fb > 0) + \fBcdl_setFBConfig\fP (cdl, fb); + + /* \fIMap the current display frame for use as an image.\fP */ + \fBcdl_mapFrame\fP (cdl, frame); + } + + /* \fIIf a coordinate file was specified read the file and mark those + * coords with points.\fP + */ + if (cfname) + \fBcdl_markCoordsFile\fP (cdl, cfname, M_STAR, size, color, label); + + /* \fILastly, start up an interactive cursor loop if needed.\fP */ + if (interactive) + tvmInteractive (cdl, label, fill, color, size); + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} + +/* \fITVMINTERACTIVE -- Process commands interactively.\fP */ + +tvmInteractive (cdl, label, fill, color, size) +CDLPtr cdl; +int label, fill, color, size; +{ + float angle = 0.0, rx, ry, txsize = 1.; + int nx, ny, i, x, y, x2, y2, wcs; + int number=1, radius=11, xrad=11, yrad=6, nannuli=3, sep=5; + char key, cmd[SZ_NAME], str[SZ_NAME]; + unsigned char *pix; + + /* \fIProcess commands until a 'q' keystroke is hit.\fP */ + while (\fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key) != 'q') { + x = (int) (rx + 0.5); /* \fIconvert to int pixels\fP */ + y = (int) (ry + 0.5); + + switch (key) { + case ':': /* \fIprocess a colon command\fP */ + putchar (':'); + gets (str); + for (i=0; str[i] != ' ' && str[i]; i++) + cmd[i] = str[i]; + cmd[i++] = '\0'; + + if (strcmp (cmd, "angle") == 0) angle = atof (&str[i]); + else if (strcmp (cmd, "color") == 0) color = atoi (&str[i]); + else if (strcmp (cmd, "fill") == 0) fill = atoi (&str[i]); + else if (strcmp (cmd, "number") == 0) number = atoi (&str[i]); + else if (strcmp (cmd, "nannuli") == 0) nannuli = atoi (&str[i]); + else if (strcmp (cmd, "label") == 0) label = atoi (&str[i]); + else if (strcmp (cmd, "sep") == 0) sep = atoi (&str[i]); + else if (strcmp (cmd, "size") == 0) size = atoi (&str[i]); + else if (strcmp (cmd, "txsize") == 0) txsize = atof (&str[i]); + else if (strcmp (cmd, "xrad") == 0) xrad = atoi (&str[i]); + else if (strcmp (cmd, "yrad") == 0) yrad = atoi (&str[i]); + else if (strcmp (cmd, "print") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPix\fP (cdl, NULL, pix, nx, ny, 1); + } else if (strcmp (cmd, "snap") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPixToFile\fP (cdl, &str[i], pix, nx, ny, 1); + } else if (strcmp (cmd, "status") == 0) { + printf ("angle = %-5.3g\tcolor = %d\t", angle, color); + printf ("fill = %-5d\tnumber = %d\\n", fill, number); + printf ("nannuli = %-5d\tsep = %d\t", nannuli, sep); + printf ("size = %-5d\ttxsize = %g\\n", size, txsize); + printf ("xrad = %-5d\tyrad = %d\t", xrad, yrad); + printf ("label = %-5d\\n", label); + } + break; + + case '?': + /* ......\fIhelp procedures\fP */ + break; + + case 'p': /* \fIplus mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_PLUS, color); + break; + case 'x': /* \fIcross mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CROSS, color); + break; + case '.': /* \fIpoint mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_POINT, color); + break; + case '*': /* \fIstar mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_STAR, color); + break; + case '_': /* \fIhoriz dash mark\fP*/ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_HBLINE, color); + break; + case '|': /* \fIvert dash mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_VBLINE, color); + break; + case 'o': /* \fIcircle mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CIRCLE|fill, color); + break; + case 's': /* \fIsquare mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_BOX|fill, color); + break; + case 'v': /* \fIdiamond mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_DIAMOND|fill, color); + break; + + case 'b': /* \fIBox\fP */ + printf ("Hit another key to define the box...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markBox\fP (cdl, x, y, x2, y2, fill, color); + break; + case 'c': /* \fICircle\fP */ + printf ("Hit another key to set radius ...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + radius = (int) sqrt ((double) ((x2-x)*(x2-x) + (y2-y)*(y2-y))); + \fBcdl_markCircle\fP (cdl, x, y, radius, fill, color); + break; + case 'd': /* \fIDelete marker\fP */ + \fBcdl_deleteMark\fP (cdl, x, y); + break; + case 'e': /* \fIEllipse\fP */ + \fBcdl_markEllipse\fP (cdl, x, y, xrad, yrad, angle, fill, color); + break; + case 'l': /* \fILine\fP */ + printf ("Hit another key to set line endpoint...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markLine\fP (cdl, x, y, x2, y2, color); + break; + case 't': /* \fIText string\fP */ + printf ("Text string: "); + gets (str); + \fBcdl_markText\fP (cdl, x, y, str, txsize, angle, color); + break; + case 'C': /* \fICircular annuli\fP*/ + \fBcdl_markCircAnnuli\fP (cdl, x, y, radius, nannuli, sep, color); + break; + case 'D': /* \fIDelete all markers\fP*/ + \fBcdl_clearOverlay\fP (cdl); + break; + case 'E': /* \fIElliptical annuli\fP*/ + \fBcdl_markEllipAnnuli\fP (cdl, x, y, xrad, yrad, angle, nannuli, sep, color); + break; + default: + break; + } + } +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Image Mosaic Example +.LP +.in 0.5i +.ps -2 +.vs -2 +.nf +#include <stdio.h> +#include <unistd.h> +#\fBinclude "cdl.h"\fP + +/* \fIMOSAIC -- Example task to mosaic several images on a display. Demonstrates + * usage of low-level routines for complex display operations.\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, title[128]; + int i, j, k, status=0, label=0, frame=1, fb=FB_AUTO, zscale=1; + int sample=1, pad=0, col=204, imx, imy, bitpix, nimages, nim; + int ii, xinit, rowx, rowy, nnx, nny, fb_w, fb_h, nf, mx, my, nx, ny; + float z1, z2; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp (argv[i], "-fbconfig",3) == 0) fb=atoi(argv[++i]); + else if (strncmp (argv[i],"-frame",3) == 0) frame=atoi(argv[++i]); + else if (strncmp (argv[i],"-color",3) == 0) col=atoi(argv[++i]); + else if (strncmp (argv[i],"-label",4) == 0) label=1; + else if (strncmp (argv[i],"-nozscale",4) == 0) zscale=0; + else if (strncmp (argv[i],"-nx",3) == 0) nx=atoi(argv[++i]); + else if (strncmp (argv[i],"-ny",3) == 0) ny=atoi(argv[++i]); + else if (strncmp (argv[i],"-pad",4) == 0) pad=atoi(argv[++i]); + else if (strncmp (argv[i],"-sample",4) == 0) sample=atoi(argv[++i]); + else + break; + } + } + nimages = argc - i; + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIClear the frame to begin.\fP */ + (void) \fBcdl_clearFrame\fP (cdl); + + /* \fILoop over each of the images in the list.\fP */ + nim = rowx = rowy = nnx = nny = 0; + for (k=0; k < ny && nim < nimages; k++) { + rowy += nny + pad; + for (rowx = xinit, j=0; j < nx && nim < nimages; j++) { + + /* \fIGet the image name for display.\fP */ + fname = argv[i++]; + + /* \fIFigure out what kind of image it is and get the pixels.\fP */ + if (cdl_isIRAF (fname)) + status = \fBcdl_readIRAF\fP (fname, 1, &pix, &imx, &imy, &bitpix, title); + else if (cdl_isFITS (fname)) + status = \fBcdl_readFITS\fP (fname, &pix, &imx, &imy, &bitpix, title); + else { + fprintf(stderr, "'%s': unknown or nonexistant image.\\n", fname); + status = 1; + } + if (status) goto err_; + + /* \fICompute subsampled image size.\fP */ + if (sample > 1) + nnx = imx / sample, nny = imy / sample; + else + nnx = imx, nny = imy; + + /* \fIUnless we asked for a specific FB size find one large enough + * to handle the mosaic. We don't check to be sure what's + * returned is really large enough.\fP + */ + if (nim == 0 && fb == FB_AUTO) + \fBcdl_selectFB\fP (cdl, nx*nnx+(pad*(nx-1)), ny*nny+(pad*(ny-1)), &fb, &fb_w, &fb_h, &nf, 1); + else { + \fBcdl_setFBConfig\fP (cdl, fb); + \fBcdl_lookupFBSize\fP (cdl, fb, &fb_w, &fb_h, &nf); + } + + /* \fIDefine a WCS for the frame.\fP */ + \fBcdl_setWCS\fP (cdl, "image mosaic", title, 1., 0., 0., -1., 0., (float) ny*imy+(pad*(ny+1)), 1., 255., 1); + + /* \fIThe first time through figure out the placement so the + * entire mosaic is centered in the frame.\fP + */ + if (nim == 0) { + mx = (nx * nnx) + pad * (nx-1); + my = (ny * nny) + pad * (ny-1); + rowy = (fb_h - my) / 2; + xinit = rowx = (fb_w - mx) / 2; + } + + /* \fICompute the zscaled imaged pixels.\fP */ + if (zscale) { + \fBcdl_computeZscale\fP (cdl, pix, imx ,imy, bitpix, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, imx ,imy, bitpix, z1, z2); + } + + /* \fISubsample the image if requested.\fP */ + if (sample > 1) { + int l, m, n=0; + for (l=0; l < imy; l+=sample) + for (m=0; m < imx; m+=sample) + pix[n++] = pix[(l*imx)+m]; + } + + /* \fIWrite the image to the frame buffer.\fP */ + if (\fBcdl_writeSubRaster\fP (cdl, rowx, rowy, nnx, nny, pix)) goto err_; + + /* \fIDraw the image name as a label.\fP */ + if (label) \fBcdl_markText\fP (cdl, rowx+10, rowy+10, fname, 1., 0., col); + + nim++; rowx += nnx + pad; + } + } + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} +.fi +.vs +2 +.ps +2 +.in -0.5i + +.bp +.NH +Fortran Interface Summary +.LP +.in 0.5i +include "\fBcdlftn.inc\fR" +.in -0.5i + +.TS +center; +r l. +\fBcfopen\fR (imtdev, ier) +\fBcfdisplayPix\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBcfreadCursor\fR (sample, x, y, key, ier) +\fBcfsetCursor\fR (x, y, wcs, ier) +\fBcfsetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfgetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfsetFrame\fR (frame) +\fBcfclearFrame\fR (ier) +\fBcfclose\fR () + +\fBcfsetMapping\fR (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier) +\fBcfgetMapping\fR (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier) +\fBcfqueryMap\fR (wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref, ier) + +\fBcfdisplayIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBcfisIRAF\fR (fname, isiraf) +\fBcfreadIRAF\fR (fname, band, pix, nx, ny, bitpix, title, ier) + +\fBcfdisplayFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBcfisFITS\fR (fname, isfits) +\fBcfreadFITS\fR (fname, pix, nx, ny, bitpix, title, ier) + +\fBcfcomputeZscale\fR (pix, nx, ny, bitpix, z1, z2) +\fBcfzscaleImage\fR (pix, nx, ny, bitpix, z1, z2) + +\fBcfprintPix\fR (cmd, pix, nx, ny, annotate, ier) +\fBcfprintPixToFile\fR (fname, pix, nx, ny, annotate, ier) + +\fBcfreadImage\fR (pix, nx, ny, ier) +\fBcfreadFrameBuffer\fR (pix, nx, ny, ier) +\fBcfreadSubRaster\fR (lx, ly, nx, ny, pix, ier) +\fBcfwriteSubRaster\fR (lx, ly, nx, ny, pix, ier) + +\fBcfselectFB\fR (nx, ny, fb, w, h, nf, reset) +\fBcfsetFBConfig\fR (configno) +\fBcfgetFBConfig\fR (configno, w, h, nf) +\fBcflookupFBSize\fR (configno, w, h, nf) + +\fBcfsetZTrans\fR (ztrans) +\fBcfsetZScale\fR (z1, z2) +\fBcfsetSample\fR (nsample) +\fBcfsetSampleLines\fR (nlines) +\fBcfsetContrast\fR (contrast) +\fBcfsetName\fR (imname) +\fBcfsetTitle\fR (imtitle) + +\fBcfgetFrame\fR (frame) +\fBcfgetZTrans\fR (ztrans) +\fBcfgetZScale\fR (z1, z2) +\fBcfgetSample\fR (nsample) +\fBcfgetSampleLines\fR (nlines) +\fBcfgetContrast\fR (contrast) +\fBcfgetName\fR (imname) +\fBcfgetTitle\fR (imtitle) + +\fBcfmapFrame\fR (frame, ier) +\fBcfmarkPoint\fR (x, y, number, size, type, color, ier) +\fBcfmarkcoordsfile\fR (fname, type, size, color, label, ier) +\fBcfmarkPointLabel\fR (x, y, label, size, type, color, ier) +\fBcfmarkLine\fR (xs, ys, xe, ye, color, ier) +\fBcfmarkBox\fR (lx, ly, ux, uy, fill, color, ier) +\fBcfmarkPolygon\fR (xarray, yarray, npts, fill, color, ier) +\fBcfmarkPolyline\fR (xarray, yarray, npts, color, ier) +\fBcfmarkCircle\fR (x, y, radius, fill, color, ier) +\fBcfmarkCircAnnuli\fR (x, y, radius, nannuli, sep, color, ier) +\fBcfmarkEllipse\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBcfmarkEllipAnnuli\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBcfmarkText\fR (x, y, str, size, angle, color, ier) +\fBcfsetfont\fR (font) +\fBcfsettextwidth\fR (width) +\fBcfsetlwidth\fR (width) +\fBcfsetlstyle\fR (style) +\fBcfdeleteMark\fR (x, y, ier) +\fBcfclearOverlay\fR (ier) +\fBcfredrawOverlay\fR (ier) +.TE +.bp +.NH +Fortran Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ======================================================================== +C FDISPLAY -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for displaying images. +C ======================================================================== + + PROGRAM FDISPLAY + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + if (ier .gt. 0) then + write (*,*) 'open: Error return from CDL' + goto 999 + endif + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fIUnrecognized image, punt and exit.\fP + write (*,*) 'Unrecognized image format' + endif + endif + +C \fIClean up and exit.\fP +999 continue + call \fBcfclose\fP (ier) + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH 2 +Interactive Graphics Overlay Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ========================================================================== +C FTVMARK -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for doing graphics overlay. No +C checking of the error flag is done here for space considerations. +C ========================================================================== + + PROGRAM FTVMARK + include "\fBcdlftn.inc\fP" + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fINo valid image given, so map the current display for marking.\fP + call \fBcfmapFrame\fP (iframe) + endif + endif + +C \fINow that we've got an image displayed or mapped, enter a cursor loop to mark the image. \fP + call markInteractive () + +C \fIClean up and exit\fP +999 continue + call \fBcfclose\fP (ier) + end + +C \fIMARKINTERACTIVE -- Subroutine for processing the cursor loop.\fP + subroutine markInteractive () + include "\fBcdlftn.inc\fP" + real angle, rx, ry, txsize + integer nx, ny, x, y, x2, y2, fill, size, color + integer number, radius, xrad, yrad, nannuli, sep + character key + character*64 cmd, str + +C \fIAllocate a 1024x1024 array for pixels. \fP + character pix(1048576) + +C \fI....Initialize the local parameters to use\fP + +C \fIRead a cursor keystroke telling us what to do.\fP +10 call \fBcfreadCursor\fP (0, rx, ry, key, ier) + +C \fIRound the real cursor position to integer pixel positions.\fP + x = nint (rx + 0.5) + y = nint (ry + 0.5) + +C \fICheck the keystroke and take the appropriate action.\fP +C \fIColon Commands\fP + if (key .eq. ':') then +C \fIRead a three character command and value field and process the colon command\fP + read (*,'(A3, i4)') cmd, ival + if (cmd(1:3) .eq. 'ang') then + angle = real (ival) + else if (cmd(1:3) .eq. 'col') then + color = ival + else if (cmd(1:3) .eq. 'fil') then + fill = ival +\fI : + ....and so on to set local variables + :\fR + else if (cmd(1:3) .eq. 'pri') then +C \fIPrint contents of the current frame buffer\fP + call \fBcfreadFrameBuffer\fP (pix, nx, ny, ier) + call \fBcfprintPix\fP ("lpr", pix, nx, ny, 1, ier) + else if (cmd(1:3) .eq. 'sta') then + \fI....print out the status (value) of variables\fP + endif + +C \fIPoint Markers\fP + else if (key .eq. 'p') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_PLUS, color, ier) + else if (key .eq. 'x') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_CROSS, color, ier) + else if (key .eq. '_') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_HBLINE, color, ier) + else if (key .eq. 'o') then +C \fIExample of a filled point marker \fP + call \fBcfmarkPoint\fP (x, y, 1, size, or(M_CIRCLE,fill), color, ier) +\fI : + ....and so on to set other types of point markers\fR + +C \fIOther Markers\fP + else if (key .eq. 'b') then + print '("Hit another key to define the box ....")' + call \fBcfreadCursor\fP (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + call \fBcfmarkBox\fP (x, y, x2, y2, fill, color, ier) + else if (key .eq. 'd') then + call \fBcfdeleteMark\fP (x, y, ier) + else if (key .eq. 'e') then + call \fBcfmarkEllipse\fP (x, y, xrad, yrad, angle, fill, color, ier) + else if (key .eq. 't') then + print '("Text string: ", $)' + read (*,'(A64)') str + call \fBcfmarkText\fP (x, y, str, txsize, angle, color, ier) +\fI : + ....and so on to set other types of markers\fR + +C \fIQuit\fP + else if (key .eq. 'q') then + goto 998 + endif + +C \fILoop back until we want to quit\fP + goto 10 +998 continue + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH +SPP Interface Summary +.LP +.in 0.5i +#include "\fBcdlspp.h\fR" +.in -0.5i + +.TS +center; +r l. +\fBcdl_open\fR (imtdev, ier) +\fBcdl_displayPix\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBcdl_readCursor\fR (sample, x, y, wcs, key, ier) +\fBcdl_setCursor\fR (x, y, wcs, ier) +\fBcdl_setWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcdl_getWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcdl_setFrame\fR (frame) +\fBcdl_clearFrame\fR (ier) +\fBcdl_close\fR () + +\fBcdl_setMapping\fR (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier) +\fBcdl_getMapping\fR (region, sx,sy,snx,sny, dx,dy,dnx,dny, ref, ier) +\fBcdl_queryMap\fR (wcs, region, sx,sy,snx,sny, dx,dy,dnx,dny, objref, ier) + +\fBcdl_displayIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBcdl_isIRAF\fR (fname, isiraf) +\fBcdl_readIRAF\fR (fname, band, pix, nx, ny, bitpix, title, ier) + +\fBcdl_displayFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBcdl_isFITS\fR (fname, isfits) +\fBcdl_readFITS\fR (fname, pix, nx, ny, bitpix, title, ier) + +\fBcdl_computeZscale\fR (pix, nx, ny, bitpix, z1, z2) +\fBcdl_zscaleImage\fR (pix, nx, ny, bitpix, z1, z2) + +\fBcdl_printPix\fR (cmd, pix, nx, ny, annotate, ier) +\fBcdl_printPixToFile\fR (fname, pix, nx, ny, annotate, ier) + +\fBcdl_readImage\fR (pix, nx, ny, ier) +\fBcdl_readFrameBuffer\fR (pix, nx, ny, ier) +\fBcdl_readSubRaster\fR (lx, ly, nx, ny, pix, ier) +\fBcdl_writeSubRaster\fR (lx, ly, nx, ny, pix, ier) + +\fBcdl_selectFB\fR (nx, ny, fb, w, h, nf, reset) +\fBcdl_setFBConfig\fR (configno) +\fBcdl_getFBConfig\fR (configno, w, h, nf) +\fBcdl_lookupFBSize\fR (configno, w, h, nf) + +\fBcdl_setZTrans\fR (ztrans) +\fBcdl_setZScale\fR (z1, z2) +\fBcdl_setSample\fR (nsample) +\fBcdl_setSampleLines\fR (nlines) +\fBcdl_setContrast\fR (contrast) +\fBcdl_setName\fR (imname) +\fBcdl_setTitle\fR (imtitle) + +\fBcdl_getFrame\fR (frame) +\fBcdl_getZTrans\fR (ztrans) +\fBcdl_getZScale\fR (z1, z2) +\fBcdl_getSample\fR (nsample) +\fBcdl_getSampleLines\fR (nlines) +\fBcdl_getContrast\fR (contrast) +\fBcdl_getName\fR (imname) +\fBcdl_getTitle\fR (imtitle) + +\fBcdl_mapFrame\fR (frame, ier) +\fBcdl_markCoordsFile\fR (fname, type, size, color, label, ier) +\fBcdl_markPoint\fR (x, y, number, size, type, color, ier) +\fBcdl_markPointLabel\fR (x, y, label, size, type, color, ier) +\fBcdl_markLine\fR (xs, ys, xe, ye, color, ier) +\fBcdl_markBox\fR (lx, ly, ux, uy, fill, color, ier) +\fBcdl_markPolygon\fR (xarray, yarray, npts, fill, color, ier) +\fBcdl_markPolyline\fR (xarray, yarray, npts, color, ier) +\fBcdl_markCircle\fR (x, y, radius, fill, color, ier) +\fBcdl_markCircAnnuli\fR (x, y, radius, nannuli, sep, color, ier) +\fBcdl_markEllipse\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBcdl_markEllipAnnuli\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBcdl_markText\fR (x, y, str, size, angle, color, ier) +\fBcdl_setFont\fR (font) +\fBcdl_setTextWidth\fR (width) +\fBcdl_setLineWidth\fR (width) +\fBcdl_setLineStyle\fR (style) +\fBcdl_deleteMark\fR (x, y, ier) +\fBcdl_clearOverlay\fR (ier) +\fBcdl_redrawOverlay\fR (ier) +\fBcdl_setDebug\fR (level) +.TE diff --git a/vendor/x11iraf/cdl/doc/cdlref.ms-V1.0 b/vendor/x11iraf/cdl/doc/cdlref.ms-V1.0 new file mode 100644 index 00000000..52f4fafa --- /dev/null +++ b/vendor/x11iraf/cdl/doc/cdlref.ms-V1.0 @@ -0,0 +1,2297 @@ +.RP +.de us +\\$1\l'|0\(ul' +.. +.TL +A Reference Guide for the IRAF Client Display Library (CDL) +.AU +Michael Fitzpatrick +.AI +NOAO/IRAF Group +.sp 0.5 +February 1997 +.sp 0.5 +\fIRevised September 1997\fR + +.AB +The Client Display Library (CDL) is a host interface for C or Fortran +programs allowing them to display images or overlay graphics to display +servers such as \fIXImtool\fR or \fISAOimage / SAOtng\fR. High-level +procedures allow IRAF or FITS images to be displayed simply, other +routines permit access to all other server functions (e.g. cursor and image +readback, frame selection, etc). The library also features a number of +functions for doing image overlay graphics; supported graphics primitives +include numerous point shapes, lines, circles, ellipses, polygons, annular +shapes, and text. +.AE + +.pn 1 +.bp +.ce +.ps +3 +\fBContents\fR +.ps -3 +.sp 2 +1.\h'|0.25i'\fBIntroduction\fP\l'|5.6i.'\0\01 +.sp 0.5 +2.\h'|0.25i'\fBGetting Started\fP\l'|5.6i.'\0\01 +.sp 0.5 +3.\h'|0.25i'\fBServer Connections\fP\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.1.\h'|0.75i'Domain Sockets\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.2.\h'|0.75i'Named FIFO Pipes\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.3.\h'|0.75i'Inet Sockets\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.4.\h'|0.75i'User-Defined Connections\l'|5.6i.'\0\03 +.sp 0.5 +4.\h'|0.25i'\fBImage Display\fP\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.1.\h'|0.75i'Overview of the Display Process\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.2.\h'|0.75i'Displaying IRAF Images\l'|5.6i.'\0\04 +.br +\h'|0.25i'4.3.\h'|0.75i'Displaying FITS Images\l'|5.6i.'\0\04 +.br +\h'|0.25i'4.4.\h'|0.75i'Displaying Raw Pixels\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.5.\h'|0.75i'Frame Selection\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.6.\h'|0.75i'Clearing the Display\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.7.\h'|0.75i'Frame Buffer Selection\l'|5.6i.'\0\05 +.br +\h'|0.5i'4.7.1.\h'|0.9i'Automatic Selection\l'|5.6i.'\0\06 +.br +\h'|0.5i'4.7.2.\h'|0.9i'The Frame Buffer Configuration File\l'|5.6i.'\0\06 +.br +\h'|0.25i'4.8.\h'|0.75i'Image WCS Description\l'|5.6i.'\0\06 +.br +\h'|0.25i'4.9.\h'|0.75i'Image Colormaps\l'|5.6i.'\0\07 +.br +\h'|0.5i'5.2.1.\h'|0.9i'Imtool Color Model\l'|5.6i.'\0\07 +.br +\h'|0.25i'4.10.\h'|0.75i'ZScale Intensity Mapping\l'|5.6i.'\0\08 +.br +\h'|0.25i'4.11.\h'|0.75i'Image Hardcopy\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.12.\h'|0.75i'Image Cursor\l'|5.6i.'\0\09 +.br +\h'|0.5i'4.13.1.\h'|0.9i'Cursor Sampling\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.14.\h'|0.75i'Image Readout\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.15.\h'|0.75i'Subraster I/O\l'|5.6i.'\0\09 +.sp 0.5 +5.\h'|0.25i'\fBGraphics Overlay\fP\l'|5.6i.'\010 +.br +\h'|0.25i'5.1.\h'|0.75i'Marker Coordinates\l'|5.6i.'\010 +.br +\h'|0.5i'5.1.1.\h'|0.9i'Mapping a Previously Displayed Image\l'|5.6i.'\010 +.br +\h'|0.25i'5.2.\h'|0.75i'Marker Colors\l'|5.6i.'\010 +.br +\h'|0.25i'5.3.\h'|0.75i'Marker Types\l'|5.6i.'\010 +.br +\h'|0.5i'5.3.1.\h'|0.9i'Point\l'|5.6i.'\011 +.br +\h'|0.5i'5.3.2.\h'|0.9i'Line\l'|5.6i.'\011 +.br +\h'|0.5i'5.3.3.\h'|0.9i'Box\l'|5.6i.'\011 +.br +\h'|0.5i'5.3.4.\h'|0.9i'Circle\l'|5.6i.'\011 +.br +\h'|0.5i'5.3.5.\h'|0.9i'Polyline\l'|5.6i.'\012 +.br +\h'|0.5i'5.3.6.\h'|0.9i'Polygon\l'|5.6i.'\012 +.br +\h'|0.5i'5.3.7.\h'|0.9i'Ellipse\l'|5.6i.'\012 +.br +\h'|0.5i'5.3.8.\h'|0.9i'Circular Annuli\l'|5.6i.'\012 +.br +\h'|0.5i'5.3.9.\h'|0.9i'Elliptical Annuli\l'|5.6i.'\012 +.br +\h'|0.5i'5.3.10.\h'|0.9i'Text\l'|5.6i.'\012 +.br +\h'|0.5i'5.4.\h'|0.9i'Text Fonts\l'|5.6i.'\013 +.br +\h'|0.5i'5.5.1.\h'|0.9i'In-line Font Changes\l'|5.6i.'\013 +.br +\h'|0.25i'5.5.\h'|0.75i'Deleting Markers\l'|5.6i.'\013 +.br +\h'|0.5i'5.5.1.\h'|0.9i'Individual Markers\l'|5.6i.'\013 +.br +\h'|0.5i'5.5.2.\h'|0.9i'The Entire Overlay\l'|5.6i.'\014 +.br +\h'|0.25i'5.6.\h'|0.75i'Redrawing the Overlay\l'|5.6i.'\014 +.sp 0.5 +6.\h'|0.25i'\fBFortran Language Binding Notes\fP\l'|5.6i.'\014 +.sp 0.5 +7.\h'|0.25i'\fBSPP Language Binding Notes\fP\l'|5.6i.'\014 +.sp 0.5 +8.\h'|0.25i'\fBIIS Protocol Description\fP\l'|5.6i.'\015 +.sp 0.5 +9.\h'|0.25i'\fBC Interface Summary\fP\l'|5.6i.'\017 +.sp 0.5 +10.\h'|0.25i'\fBC Example Tasks\fP\l'|5.6i.'\019 +.br +\h'|0.25i'10.1.\h'|0.75i'Display Example\l'|5.6i.'\019 +.br +\h'|0.25i'10.2.\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\022 +.br +\h'|0.25i'10.3.\h'|0.75i'Image Mosaic Example\l'|5.6i.'\026 +.sp 0.5 +11.\h'|0.25i'\fBFortran Interface Summary\fP\l'|5.6i.'\028 +.sp 0.5 +12.\h'|0.25i'\fBFortran Example Tasks\fP\l'|5.6i.'\030 +.br +\h'|0.25i'12.1.\h'|0.75i'Display Example\l'|5.6i.'\030 +.br +\h'|0.25i'12.2.\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\031 +.sp 0.5 +13.\h'|0.25i'\fBSPP Interface Summary\fP\l'|5.6i.'\033 +.pn 1 + +.NH +Introduction +.LP + For more than a decade IRAF has used a \fIdisplay server\fR as the +primary means for image display. IRAF client tasks connect to the server +and send or read data using a modification of the IIS Model 70 protocol, +originally through named fifo pipes but more recently using unix domain +or inet sockets. The advantage to this approach was that IRAF client tasks +could make use of the image display functionality without duplicating +the code needed for actually displaying the image. The longtime disadvantage +was that the IIS protocol used was arcane and undocumented and therefore +largely unavailable to applications outside of the IRAF project. The +Client Display Library (CDL) provides a public C and Fortran interface for +displaying images and overlay graphics that is independent of the underlying +protocol used. +.LP + Unlike the interface used by IRAF applications, the CDL is meant to +provide an easy-to-use, fully featured interface for applications that can +be easily evolved for future display servers, communications schemes, or +display functionality. Indeed, the CDL is independent of IRAF itself (as +are the display servers) so display tasks can be written for any discipline +or application. +.LP + While this guide assumes programs are written in C, Fortran programmers +should find the translation straightforward by referring to the Fortran +interface summary. The package source files include example tasks as does +this guide; users with problems, questions, or bug reports are encouraged to +contact \fIiraf@noao.edu\fR. A small code sample demonstrating the problem +would be very helpful in finding a solution to any reported problems. + +.NH +Getting Started +.LP + All C programs must include the header file \fB"cdl.h"\fR in order +to get package definitions for constants such as colors and structure +definitions used. The Fortran interface does not \fIrequire\fR anything +similar, however for fortran compilers which support an \f(CWinclude\fR +directive a \fBcdlftn.inc\fR file may be used to define symbolic constants +passed to procedures, this file must be included by each procedure using the +CDL. Fortran programs not using this file must pass in the constants +explicitly, needed values are found throughout this manual. C procedures +which return an integer value will return a positive number to indicate an +error has occured and print an error message, otherwise zero is returned. +.LP + The \fBcdl_open()\fR procedure is used to establish a connection +to the server and initialize the package, it returns a CDL structure pointer +that is passed to other CDL procedures. For C programs this means +a separate pointer may be maintained for each server connection, the Fortran +interface is limited to only one server connection per process since the +pointer is maintained internally. The connection is terminated using the +\fBcdl_close()\fR procedure. Between these two calls may be any combination +of CDL procedure calls for doing image display or overlay graphics. +.LP + For example, the simplest possible program for displaying an IRAF +image would look something like: +.sp 0.5 +.nf + \f(CW#include "cdl.h" + + main (int argc, char *argv[]) + { + CDLPtr cdl = cdl_open ((char *)0); + cdl_displayIRAF (cdl, argv[1], 1, 1, 1, 1); + cdl_close (cdl); + }\fR +.fi +.sp 0.5 +.LP +This program displays band one of an image named on the command line to the +server in frame one using the default 512x512 frame buffer, zscaling the +pixels to 8-bit values automatically. No error checking is performed to verify +that a connection was established or that the argument is a valid IRAF image. +Most programs will be more complex than this but it should be clear that +image display from client applications is a now trivial operation. + +.us "Synopsis" +.sp 0.5 +.nf + \f(CW#include "cdl.h"\fR + + \f(CWCDLPtr cdl_open (char *imtdev)\fR + \f(CWvoid cdl_close (CDLPtr cdl)\fR +.fi + +.NH +Server Connections +.LP + The \fBcdl_open()\fR procedure takes a single argument specifying the +type of connection to make to the server, this routine also initializes +the CDL package. If this is a NULL pointer the CDL will attempt to first +connect on a unix domain socket, if that fails the standard IRAF /dev/imt1* +fifo pipes are tried. The syntax for the \fIimtdev\fR argument is as follows: +.sp 0.5 + \f(CW<domain> : <address>\fR +.sp 0.5 +.LP +where <domain> is one of "\fBinet\fR" (internet tcp/ip socket), "\fBunix\fR" +(unix domain socket) or "\fBfifo\fR" (named pipe). The form of the address +depends upon the domain, as illustrated in the examples below. The address +field may contain up to two "%d" fields. If present, the user's UID will be +substituted (e.g. "unix:/tmp/.IMT%d"). The default connection if no imtdev +is specified is "unix:/tmp/.IMT%d", failing that a connection is attempted +on the /dev/imt1[io] named fifo pipes. +.NH 2 +Domain Sockets +.LP + Domain sockets are sockets created on the local host. The connection +is usually faster than an inet socket and comparable to a fifo. If the +socket name is specified with a '%d' field the client can be assured of a +unique socket name for each user allowing multiple clients to be run on the +same host by different users. +.LP +.us "Example" +.sp 0.5 +.nf +\f(CW + /* Connection to a local host using socket domain socket. */ + if ((cdl = cdl_open ("unix:/tmp/.IMT%d")) == NULL) { + fprintf (stderr, "cannot open domain socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Named FIFO Pipes +.LP + This is the traditional approach, and the only one supported by +SAOimage (although recent versions contain support for sockets). Any named +fifo pipe may be used, the syntax for the \fIimtdev\fR string in this case is +.sp 0.5 + \fBfifo:\f(CW<input_fifo>\fB:\f(CW<output_fifo>\fR +.sp 0.5 +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using named fifo pipes. */ + if ((cdl = cdl_open ("fifo:/dev/imt1i:/dev/imt1o")) == NULL) { + fprintf (stderr, "cannot open fifo pipe connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Inet Sockets +.LP + Inet sockets are connections between hosts via a tcp/ip socket. +This permits connecting to the server over a remote network connection +anywhere on the Internet. +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } + + /* Connection to a remote internet host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137:foo.bar.edu")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +User-Defined Connections +.LP + Since IRAF V2.10.3 client tasks have been able to use an \fBIMTDEV\fR +unix environment variable to set the connection type, the syntax of this +variable is the same as described above. If the \fIcdl_open()\fR procedure +is called with a NULL pointer the IMTDEV environment variable will +automatically be checked. To explicitly use this variable in the client +task the \fIcdl_open()\fR procedure may be called as +e.g. +.sp 0.5 +.nf + \f(CWif ((cdl = cdl_open (getenv("IMTDEV"))) == NULL) { + fprintf (stderr, "cannot open server connection\\n"); + exit (1); + }\fR +.fi +.NH +Image Display +.NH 2 +Overview of the Display Process +.LP + Basic image display is done most easily using the high-level +\fBcdl_displayIRAF()\fR, \fBcdl_displayFITS()\fR and \fBcdl_displayPix()\fR +procedures. These routines automaticaly define an image WCS, clear the +frame, set the frame buffer and center the image in the display. For most +applications these are all that will be needed, but the +\fBcdl_writeSubRaster()\fR procedure can also be used to display an image. +For example, to display one image in a mosaic or other cases where +the task needs low-level access to position the image or write raw pixel +values. +.LP + In these cases it is the responsibility of the client program to +prepare the server for display. The basic steps involed in displaying an +image include +.sp 0.5 +.TS +center; +lB lB +- - +l lI. +Operation CDL Procedure +Selecting the frame cdl_setFrame() +Clear the frame cdl_clearFrame() +Select the frame buffer configuration cdl_selectFB() +Set the frame buffer configuration cdl_setFBConfig() +Scale the image pixels to 201 display values cdl_zscaleImage() +Define the image WCS +Set the image WCS cdl_setWCS() +Compute the raster placement in the frame buffer +Write the pixels to the display cdl_writeSubRaster() +.TE +.sp 0.5 +In cases like a mosaic display obviously clearing the frame will only need +to be done once and a single WCS for the mosaic should be defined. For +simple display the high-level routines handle all of these steps for you, they +are included here as checklist of what must be considered when using the CDL +for low-level display. +.NH 2 +Displaying IRAF Images +.LP + The \fBcdl_displayIRAF()\fR procedure can be used to display an IRAF +OIF format image (i.e. images with a \fI.imh\fR extension) by simply +passing in the image name. Pixel files for the +image must be accessible from the local machine but can be in any directory, +the HDR$ syntax for the imdir is also recognized. Images may be three +dimensional, the +\fIband\fR argument is used to select the image band to be displayed. +The \fIframe\fR and \fIfbconfig\fR arguments select the frame and frame buffer +size respectively, if the \fIzscale\fR flag is greater than zero the image +will automatically be converted to 8-bit values using the zscale mapping +algorithm. The function returns a positive value if the image cannot +be accessed or displayed for any reason, an error message will be printed. +.LP + The \fIcdl_isIRAF()\fR procedure returns a positive value if the +filename argument is recognized as an IRAF image, it does not check whether +the pixel file can be successfully accessed. For simply reading the pixels +from an IRAF image the \fBcdl_readIRAF()\fR procedure may be used. The +function returns a zero value and sets the output pixel array, image +dimensions and pixel size if successful, otherwise the function returns a +positive value. Note that +the output pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayIRAF (CDLPtr cdl, char *fname, int band, + int frame, int fbconfig, int zscale)\fR + \f(CWint cdl_isIRAF (char *fname)\fR + \f(CWint cdl_readIRAF (char *fname, int band, uchar **pix, + int *nx, int *ny, int *bitpix)\fR +.fi +.NH 2 +Displaying FITS Images +.LP + The \fBcdl_displayFITS()\fR procedure can be used to display a +\fIsimple\fR FITS image by name. A "simple" FITS file is assumed to be +one containing a single image and having no extensions. Other types of +FITS files may of course be displayed but the client will have to use other +means to import the pixels. FITS image extensions may be supported in a future +release of the CDL. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, if the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. The function +returns a positive value if the image cannot be accessed or displayed for +any reason, an error message will be printed. +.LP + The \fIcdl_isFITS()\fR procedure returns a positive value if the +filename argument is recognized as a simple FITS image. For simply reading +the image pixels the \fBcdl_readFITS()\fR procedure may be used. The +output pixel array, image dimensions and pixel size are returned if +successful otherwise the function returns a positive value. Note that +the returned pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayFITS (CDLPtr cdl, char *fname, int frame, + int fbconfig, int zscale)\fR + \f(CWint cdl_isFITS (char *fname)\fR + \f(CWint cdl_readFITS (char *fname, uchar **pix, int *nx, int *ny, + int *bitpix)\fR +.fi +.NH 2 +Displaying Raw Pixels +.LP + The \fBcdl_displayPix()\fR procedure can be used to display an +arbitrary array of pixels of any size. The \fInx\fR and \fIny\fR arguments +are the raster dimensions, and \fIbitpix\fR is the pixel size and has the +same meaning as the FITS BITPIX keyword. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, if the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. + +.us "Synopsis" +.nf + \f(CWint cdl_displayPix (CDLPtr cdl, uchar *pix, int nx, int ny, + int bitpix, int frame, int fbconfig, int zscale)\fR +.fi +.NH 2 +Frame Selection +.LP + Frame selection is normally done as an argument to one of the display +procedures, however frames may be explicitly selected using the +\fBcdl_setFrame()\fR procedure. This allows client programs to essentially +"blink" frames independently, as long as the server supports multiple frames. + +.us "Synopsis" +.nf + \f(CWvoid cdl_getFrame (CDLPtr cdl, int frame)\fR +.fi +.NH 2 +Clearing the Display +.LP + The current display frame may be explicitly cleared using the +\fBcdl_clearFrame()\fR procedure. The frame is also cleared prior to +displaying new images by the procedures \fBcdl_displayPix()\fR, +\fBcdl_displayFITS()\fR, and \fBcdl_displayIRAF()\fR. + +.us "Synopsis" +.nf + \f(CWint cdl_clearFrame (CDLPtr cdl)\fR +.fi +.NH 2 +Frame Buffer Selection +.LP + The default frame buffer used is 512x512, other sizes may be +selected using the \fBcdl_setFBConfig()\fR procedure. To set the frame +buffer size the client passes the frame buffer number as defined in +the frame buffer configuration file (see below) while setting the image +WCS. It is important to note that the frame buffer isn't actually changed +in the server +until a subsequent \fBcdl_setWCS()\fR call, either directly or through +some other procedure which sets the WCS (e.g. one of the display procedures). +.LP + To get the size of the currently defined frame buffer the user +may call the \fBcdl_getFBConfig()\fR procedure. This returns not only +the current configuration number, but the size as well. To get the size +and any arbitrary configuration without actually setting it, the +\fBcdl_lookupFBSize()\fR procedure may be used. Any configuration not actually +defined in the frame buffer configuration file is returned as the default +512x512 size. + +.us "Synopsis" +.nf + \f(CWvoid cdl_setFBConfig (CDLPtr cdl, int configno)\fR + \f(CWvoid cdl_getFBConfig (CDLPtr cdl, int *configno, int *width, + int *height, int *nframes)\fR + \f(CWvoid cdl_lookupFBSize (CDLPtr cdl, int configno, int *width, + int *height, int *nframes)\fR +.fi +.NH 3 +Automatic Selection +.LP + The \fBcdl_selectFB()\fR procedure may be used to select the most +appropriate frame buffer to use for a given image size. If possible a frame +buffer the same size as the image will be used, otherwise one that is +larger will be chosen. Rather than simply selecting the first configuration +larger than the image, the procedure searches the entire configuration file +selecting the one with the least empty space in both dimensions. If the +\fIreset\fR flag is non-zero this frame is set automatically by the +procedure, otherwise the selected dimension is simply returned to the +calling program. In either case the new frame buffer will not take effect +until a new WCS is defined for the frame. + +.us "Synopsis" +.nf + \f(CWvoid cdl_selectFB (CDLPtr cdl, int nx, int ny, int *fb, + int *w, int *h, int *nf, int reset) +. +.NH 3 +The Frame Buffer Configuration File +.LP + The size of the frame buffer is not passed directly to the server +since this is not part of the communications protocol used. Instead, the +frame buffer number is sent as part of the WCS header packet. So that +both the server and client can know that a particular frame buffer number +corresponds to a specific size, a \fIframe buffer configuration file\fR +is used which both the client and server read. +.LP + The default configuration file is /usr/local/lib/imtoolrc, this can +be overridden by defining an \fBIMTOOLRC\fR environment variable naming +the file to be used, or by creating a .imtoolrc file in your home directory. +Since the server must also read the same file, this must be done before +starting both the client and server applications. +.LP +The format of the frame buffer configuration file is +.sp 0.5 + \fIconfigno nframes width height [extra fields]\fP +.sp 0.5 +e.g. +.sp 0.5 + 1 2 512 512 + 2 2 800 800 + 3 1 1024 1024 # comment + : : : : + +At most 128 frame buffer sizes may be defined, each configuration may define +up to 4 frames, configuration numbers need not be sequential but should be +in ascending order. +.NH 2 +Image WCS Description +.LP + The image WCS is defined using the \fBcdl_setWCS()\fR procedure. The +WCS defines a mapping between any linear coordinate system and the image +pixels, for our purposes we will discuss how the WCS is used to map the frame +buffer pixels to image coordinates. It is passed to the server in a string +of the form: +.sp 0.5 + Image_Name_String\\n a b c d tx ty z1 z2 zt +.sp 0.2 +where: +.sp 0.2 + X' = a*X + c*Y + tx + Y' = b*X + d*Y + ty + +The terms \fIa, b, c\fR, and \fId\fR define a rotation of the WCS wrt the pixel +coordinates, the \fItx\fR and \fIty\fR values are translation terms. The +remaining three values define the intensity mapping of the display pixels; +\fIz1\fR is the minimum pixel value used in the transformation, \fIz2\fR is +the maximum value, and \fIzt\fR defines the type of transformation used (0 for +none, 1 for linear, 2 for log10). +.LP + The WCS may be set explicitly by the calling program or a default +appropriate for the image will be set automatically by the high-level +display procedures, otherwise a WCS for the +frame buffer is defined (i.e. returned coordinates are frame buffer coords). +As an example of how the WCS is defined, the default WCS for an image +IMX x IMY pixels in a frame buffer FBX x FBY pixels is defined as +.sp 0.5 +.nf +\f(CW a = 1.0; /* no rotation */ + b = 0.0; + c = 0.0; + d = -1.0; + tx = (IMX / 2) - (FBX / 2) + 1; /* center in FB */ + ty = (FBY / 2) + (IMY / 2); + z1 = z1; /* zscale values */ + z2 = z2; + zt = 1;\fR +.fi + +.us "Synopsis" +.nf + \f(CWint cdl_setWCS (CDLPtr cdl, char *name, char *title, + float a, float b, float c, float d, float tx, float ty, + float z1, float z2, int zt)\fR + \f(CWint cdl_getWCS (CDLPtr cdl, char *name, char *title, + float *a, float *b, float *c, float *d, float *tx, float *ty, + float *z1, float *z2, int *zt)\fR +.fi +.NH 2 +Image Colormaps +.LP + The IIS protocol used does not permit the downloading of user-defined +colormaps, all images are loaded as raw grayscale values according to the +XImtool colormap model used by currently supported servers. All images +containing private colormaps or more than the 201 grayscale values defined +by the Imtool colormap model must either convert the image to 8-bit +grayscale values by calling the CDL zscale procedures (\fBcdl_computeZscale()\fR +and \fBcdl_zscaleImage()\fR) or scale the images in client code with +user LUTs. The CDL zscale procedures scale image to 201 grayscale values +so that they are displayed to the full 8-bit range, user LUT +transformations or user code for converting to grayscale from a private +colormap procedures should do the same. +.NH 3 +Imtool Color Model +.LP + The IMTOOL color model defines at most 201 grayscale values for use in +displaying the image, a set of 16 static colors are also defined for overlay +graphics. Pixel values sent to the server should be already scaled to this +model, i.e. the image pixels should be scaled to the range 1-200, values +above this will either represent the overlay colors or will wrap around to +8-bit values. The CDL zscale procedures will automatically scale +arbitrary pixel values to use this color model, the overlay procedures +assume color values are defined for the static color range 201-217 but any +8-bit value may be used. +.LP + A summary of the color model values is included below: +.TS +center; +lB lB cB cB lB lB +l l c c l l. +Color Description Color Description +0 Background 208 Cyan +1 - 200 Image data 209 Magenta +201 Cursor (white) 210 Coral +202 Background (black) 211 Maroon +203 White 212 Orange +204 Red 213 Khaki +205 Green 214 Orchid +206 Blue 215 Turquoise +207 Yellow 216 Violet +217 Wheat 218-255 undefined +.TE +.NH 2 +ZScale Intensity Mapping +.LP + Since most display servers are only capable of displaying 8-bit pixel +values, images with more than 8-bits per pixel must be scaled prior to +display. For linear transformations this is typically done using a simple +conversion of the image min/max values to the 256 grayscale values, however +this doesn't produce very good results when most pixel values are near one +of the extremes (usually the image min for astronomical images). To solve +this IRAF uses a \fIzscale\fR mapping algorithm where a sampling grid is used +to approximate the image min/max values rather than computing it directly, +a line is then fit to these sample pixels to determine the optimal +transformation to the display values. This is not only more efficient but +maps the most common pixel values to the display range producing a better image. +.LP + The CDL has several routines for doing the same transformation: the +\fIcdl_computeZscale()\fR procedure is used to compute the optimal \fIz1\fR +and \fIz2\fR +values (the min/max used for the zscale transform) for an image of any pixel +size. The \fIbitpix\fR argument is the number of bits-per-pixel for the input +array and has the same meaning as for the FITS \fIBITPIX\fR keyword. To then +transform the image using these values (or user-defined values) the +\fIcdl_zscaleImage()\fR procedure is used. The input pixels are modified by +this procedure but the array is not reallocated to the smaller size needed by +an 8-bit array. The \fBcdl_setSample()\fR and \fBcdl_setSampleLines()\fR +procedures can be used to change the sampling grid and number of sample +points (the default is 600 points on 5 lines). The \fBcdl_setContrast()\fR +procedure can be used to change the default contrast adjustment to the slope +used in the transformation (the default is 0.25). If a value of zero is +given then the minimum and maximum of the intensity sample is used as the +z1/z2 value. +.LP + Each of the CDL display procedures has a \fIzscale\fR flag to +automatically scale the pixels prior to display. Applications wishing to +set their own z1/z2 values will need to call the zscale procedures and +disable this flag. By default cdl_zscaleImage() will use a linear transform, +the \fBcdl_setZTrans()\fR procedure may be used to change this. Acceptable +values are \fBCDL_UNITARY\fR (zero) for a unitary transform, \fBCDL_LINEAR\fR +(one) for a linear transform, or \fBCDL_LOG\fR (two) for a log10 transform. + +.us "Synopsis" +.nf + \f(CWvoid cdl_computeZscale (CDLPtr cdl, uchar *pix, int nx, + int ny, int bitpix, float *z1, float *z2)\fR + \f(CWvoid cdl_zscaleImage (CDLPtr cdl, uchar **pix, int nx, + int ny, int bitpix, float z1, float z2)\fR + + \f(CWvoid cdl_setZTrans (CDLPtr cdl, int ztrans)\fR + \f(CWvoid cdl_getZTrans (CDLPtr cdl, int *ztrans)\fR + \f(CWvoid cdl_setZScale (CDLPtr cdl, float z1, float z2)\fR + \f(CWvoid cdl_getZScale (CDLPtr cdl, float *z1, float *z2)\fR + + \f(CWvoid cdl_setSample (CDLPtr cdl, int nsample)\fR + \f(CWvoid cdl_setSampleLines (CDLPtr cdl, int nlines)\fR + \f(CWvoid cdl_setContrast (CDLPtr cdl, float contrast)\fR + \f(CWvoid cdl_getSample (CDLPtr cdl, int *nsample)\fR + \f(CWvoid cdl_getSampleLines (CDLPtr cdl, int *nlines)\fR + \f(CWvoid cdl_getContrast (CDLPtr cdl, float *contrast)\fR + +.fi +.NH 2 +Image Hardcopy +.LP + While most servers include some hardcopy capability of their own the +CDL provides two procedures for creating hardcopy images from the client +(e.g. for a batch processing application). The client will typically read +back the entire image, frame buffer, of just a subraster and pass those +pixels to the print procedure. Images will be written as Pseudocolor +Postscript (to preserve the overlay marker colors) and may be disposed to +a file using the \fBcdl_printPixToFile()\fR procedure or to any command string +accepting input from \fIstdin\fR (typically just an 'lpr' command) by using +the \fBcdl_printPix()\fR procedure. + +.us "Synopsis" +.nf + \f(CWint cdl_printPix (CDLPtr cdl, char *cmd, uchar *pix, int nx, + int ny, int annotate)\fR + \f(CWint cdl_printPixToFile (CDLPtr cdl, char *fname, uchar *pix, + int nx, int ny, int annotate)\fR +.fi +.NH 2 +Image Cursor +.LP + The image cursor is read using the \fBcdl_readCursor()\fR procedure. +The returned value is the cursor \fI(x,y)\fR position as floating point value +in terms of the currently define image WCS. Note that this position must +be converted to integer if it is to be used in one of the marker procedures. + +.us "Synopsis" +.nf + \f(CWint cdl_readCursor (CDLPtr cdl, int sample, float *x, + float *y, char *key)\fR +.fi +.NH 3 +Cursor Sampling +.LP + If the cdl_readCursor() \fIsample\fR flag is non-zero the \fIlogical +image cursor\fR position is returned immediately, otherwise the display server +will wait for a keystroke before returning the cursor position. The logical +image cursor is the last value set by a \fIcdl_setCursor()\fR call or the last +value returned by a \fIbcdl_readCursor()\fR call. When sampling the cursor +position the keystroke value is undefined. +.NH 2 +Image Readout +.LP + The CDL maintains an internal knowledge of where an image has been +positioned if it was displayed using one of the \fIcdl_display*\fR procedures. +The \fBcdl_readImage()\fR procedure may be used to read back the entire image +pixels from the server ignoring the region of the frame buffer outside of +the image, the \fBcdl_readFrameBuffer()\fR procedure will read back the +contents of the entire frame buffer. The dimensions of the array are returned +in the \fInx\fR and \fIny\fR arguments. + +.us "Synopsis" +.nf + \f(CWint cdl_readImage (CDLPtr cdl, uchar **pix, int *nx, + int *ny)\R + \f(CWint cdl_readFrameBuffer (CDLPtr cdl, uchar **pix, + int *nx, int *ny)\R +.fi +.NH 2 +Subraster I/O +.LP + The \fBcdl_writeSubRaster()\fR procedure is used to write an arbitrary +raster to any location in the display. Similarly the +\fBcdl_readSubRaster()\fR procedure is used to read back an arbitrary raster. +When an image has previously been displayed the subraster position is given +in image coordinates (e.g. when writing a subregion of edited pixels), +otherwise the position is in frame buffer coordinates (e.g. to display +multiple images per frame you should use the cdl_writeSubRaster() call). +See the section on \fIMarker Coordinates\fR for further explanation of the +coordinate systems used. + +.us "Synopsis" +.nf + \f(CWint cdl_writeSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar *pix)\fR + \f(CWint cdl_readSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar **pix)\fR +.fi +.NH +Graphics Overlay +.NH 2 +Marker Coordinates +.LP + All marker positions are assumed to be image pixel coordinates, +although there is no requirement that the position be on the image itself. +When an image WCS is defined (using the CDL display procedures or explicitly) +the origin of the coordinates used shifts from the frame buffer lower-left +to the lower-left of the image as displayed in the frame. Negative +positions are allowed and will either refer to empty pixels if the frame +buffer is larger than the image, or pixels outside the frame buffer +boundaries. Raster I/O requests will be clipped to the frame buffer +endpoints, a request completely outside the frame buffer is an error. +.NH 3 +Mapping a Previously Displayed Image +.LP + Ideally any application wishing to draw markers on an image will have +also displayed that image, however the \fBcdl_mapFrame()\fR procedure may +be used to map the requested frame for marker overlay. It does this by +reading the WCS defined for that frame and assumes an image has been +displayed and centered in the frame buffer, then resets the internal CDL +image position. If no image has been displayed the frame buffer is mapped +directly. This can be used for example to map an empty frame for displaying +just the markers without an image, or for mapping another frame's WCS for +use on the current display. The frame is not changed by the procedure call +however the current WCS \fIis\fR changed. + +.us "Synopsis" +.nf + \f(CWint cdl_mapFrame (CDLPtr cdl, int frame)\fR +.fi +.NH 2 +Marker Colors +.LP + Markers may be drawn using any 8-bit value, in order to use the +static overlay colors the color must be in the range 201-217 (see above for +notes on the XImtool color model). The "\fIcdl.h\fR" include file +for C programs, or the "\fIcdlftn.inc\fR" include for fortran programs, +defines the following symbolic constants for each of the static overlay colors: +.sp 0.5 +.TS +center; +lB l c c lB l. +C_BLACK 202 C_CORAL 210 +C_WHITE 203 C_MAROON 211 +C_RED 204 C_ORANGE 212 +C_GREEN 205 C_KHAKI 213 +C_BLUE 206 C_ORCHID 214 +C_YELLOW 207 C_TURQUOISE 215 +C_CYAN 208 C_VIOLET 216 +C_MAGENTA 209 C_WHEAT 217 +.TE +.NH 2 +Marker Types +.LP + Currently supported marker types include: \fI +.TS +center; +l l l l l. +Point Line Box Polyline Polygon +Circle Circular Annuli Ellipse Elliptical Annuli Text +.TE +.LP + \fRThe "\fIcdl.h\fR" include file for C programs, or the +"\fIcdlftn.inc\fR" include for fortran programs, defines the following +symbolic constants for each of the defined \fIPoint\fR marker types: +.TS +center; +lB r c c lB r. +M_FILL 1 M_CIRCLE 64 +M_POINT 2 M_STAR 128 +M_BOX 4 M_HLINE 256 +M_PLUS 8 M_VLINE 512 +M_CROSS 16 M_HBLINE 1024 +M_DIAMOND 32 M_VBLINE 2048 +.TE +.LP + Point markers are drawn using the \fBcdl_markPoint()\fR procedure, +point types may be logically \fIOR\fR'd to create composite markers, closed +shapes such as a circles, diamonds, or squares may be \fIOR\fR'd with the +M_FILL flag to flood-fill the point with the current overlay color. +.NH 3 +Point +.LP + The \fBcdl_markPoint()\fR procedure is used to mark a specific point +on the image using one of the marker types listed above. The marker is +centered at the coordinates specified by the \fIx\fR and \fIy\fR arguments, +\fItype\fR is an integer flag indicating what kind of marker to draw and +may be a composite type by logically ORing two or more marker types. +\fISize\fR is the width and height of the marker measured in pixel unxits, +and \fIcolor\fR is the color used to draw the marker. If the \fInumber\fR +argument is greater than zero that number will be drawn next to the point +as a label, +creating text labels for point markers can bedone using the +\fIcdl_markPointLabel\fR procedure. +.LP + Most marker names are fairly obvious but several are worth special +mention: The M_DIAMOND, M_CIRCLE and M_BOX marker types may be logically +\fIOR\fRed with the M_FILL flag to produce a filled marker type. Unless +\fIOR\fRd with the M_POINT flag all point markers will leave the center +pixel unchanged. The M_HLINE and M_VLINE markers are most useful in +astronomical applications to mark an individual star, they are horizontal +and vertical lines respectively with a gap in the middle third of the marker +(the M_HBLINE and M_VBLINE are identical but with a width of 3 pixels). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPoint (CDLPtr cdl, int x, int y, int number, + int size, int type, int color)\fR + \f(CWint cdl_markPoint (CDLPtr cdl, int x, int y, char *label + int size, int type, int color)\fR +.fi +.NH 3 +Line +.LP + The \fBcdl_markLine()\fR procedure is used to draw a line of the +specified color between points (\fIxs,ys\fR) and (\fIxe,ye\fR). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markLine (CDLPtr cdl, int xs, int ys, int xe, int ye, + int color)\fR +.fi +.NH 3 +Box +.LP + The \fBcdl_markBox()\fR procedure is used to draw a box of the +specified color with endpoints specified by (\fIlx,ly\fR) and (\fIux,uy\fR). +If the \fIfill\fR flag is set the box will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markBox (CDLPtr cdl, int lx, int ly, int ux, int uy, + int fill, int color)\fR +.fi +.NH 3 +Circle +.LP + The \fBcdl_markCircle()\fR procedure is used to draw a circle of the +specified color with a center at (\fIx,y\fR) and radius \fIradius\fR. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircle (CDLPtr cdl, int x, int y, int radius, + int fill, int color)\fR +.fi +.NH 3 +Polyline +.LP + The \fBcdl_markPolyline()\fR procedure is used to draw a line +connecting the \fInpts\fR points specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolyline (CDLPtr cdl, int *xpts, int *ypts, + int npts, int color)\fR +.fi +.NH 3 +Polygon +.LP + The \fBcdl_markPolygon()\fR procedure is used to draw a closed +polygon consisting of \fInpts\fR vertices specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. The last point in the array +will automatically be connected to the first point by the procedure. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolygon (CDLPtr cdl, int *xpts, int *ypts, + int npts, int fill, int color)\fR +.fi +.NH 3 +Ellipse +.LP + The \fBcdl_markEllipse()\fR procedure is used to draw an ellipse of the +specified color with a center at (\fIx,y\fR) and semimajor-axis \fIxrad\fR +and semiminor-axis \fIyrad\fR pixels long. A rotation angle for the ellipse +may be specified by passing a non-zero \fIangle\fR argument, the angle is +measured in degrees from the positive x-axis. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipse (CDLPtr cdl, int x, int y, int xrad, + int yrad, float ang, int fill, int color)\fR +.fi +.NH 3 +Circular Annuli +.LP + The \fBcdl_markCircAnnuli()\fR procedure is used to draw +\fInannuli\fR circles separated by \fIsep\fR pixels each. The circle is +centered at (\fIx,y\fR) with an initial radius of \fIradius\fR pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircAnnuli (CDLPtr cdl, int x, int y, int radius, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Elliptical Annuli +.LP + The \fBcdl_markEllipAnnuli()\fR procedure is used to draw +\fInannuli\fR ellipses separated by \fIsep\fR pixels each. The ellipse is +centered at (\fIx,y\fR) with an initial semimajor and semiminor axis +specified by the \fIxrad\fR and \fIyrad\fR arguments. Each ellipse will +be optionally rotate by an \fIangle\fR degrees as measured from the positive +x-axis. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipAnnuli (CDLPtr cdl, x, y, xrad, yrad, ang, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Text +.LP + The \fBcdl_markText()\fR procedure is used to draw a text string +specified by \fIstr\fR argument with an initial position at (\fIx,y\fR) +and optionally rotated by \fIangle\fR degrees as measured from the positive +x-axis. The default \fIsize\fR is 1.0 and is approximately a 6x13 font, +the font size may be scaled by any fractional amount. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markText (CDLPtr cdl, int x, int y, char *str, + float size, float angle, int color)\fR +.fi +.NH 2 +Text Fonts +.LP + The \fBcdl_setFont()\fR procedure is used to choose between one +of four available fonts as the text marker default: Roman, Greek, Futura, +and Times respectively. By default the Roman font will be used. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWvoid cdl_setFont (CDLPtr cdl, int font)\fR +.fi +A complete listing of the Greek character mappings can be found in the file +'greek.ps' in the 'doc' subdirectory of the CDL distribution. +.NH 3 +In-Line Font Changes +.LP + Text markers are drawn using the font selected with the cdl_setFont() +routine, however fonts may be change within a string itself (e.g. to set +a Greek character) using a \\f escape sequence. The escape is followed +by the character 'R' to set a Roman font, 'G' for Greek, 'F' for futura +and 'T' for Times. Any number of escapes are permitted within a string, +the font change will remain in effect until it is changed, or the end of +string at which point any subsequent strings will again be drawn with the +default font. Additionally a 'P' in the escape sequence will change the +font to the one previously used, whatever that may be. +.LP + The CDL also supports a sub/superscripting of text which is also +done with the font escapes. In this case the escape character followed by a +'U' produces a superscript and a 'D' produces a subscript. The changes may +be nested permitting several levels of sub/superscripts, these escapes may +also be used in conjustion with a font change to cause the sub/superscript +to be drawn with a different font. A superscript escape will remain in +effect until the end of the string or a \\fD escape is seen. Similary a +subscript remains in effect until the end of the string of a \\fU escape. +.TS +center; +c s +l l. +Summary of Font Escapes +.sp 0.5 +\\\\fR change to Roman font +\\\\fG change to Greek font +\\\\fF change to Futura font +\\\\fT change to Times font +\\\\fP change to previous font +\\\\fU begin superscripted text +\\\\fD begin subscripted text +.TE +.NH 2 +Deleting Markers +.LP + When markers are drawn the underlying subraster is first saved to +an internal structure, erasure is done by simply redisplaying the saved +raster. Problems can arise however when markers overlap; when deleting a +marker that is \fIunder\fR another marker the original pixels can overwrite +the pixels of the marker on top. This is an unfortunate side effect of the +simple scheme used in this version of the package, users can call the +\fBcdl_redrawOverlay()\fR procedure to help clean up any artifacts left +behind. +.NH 3 +Individual Markers +.LP + The \fBcdl_deleteMark()\fR procedure is used to delete a single +marker from the display(). The (\fIx,y\fR) argument is either the center +position of the marker if that is know by the application, more typically +it will be an approximate position. In the latter case the marker whose +center is closest to this position will be deleted. For markers with no +defined center the distance used to decide if the marker should be +deleted is the distance from the argument position to the edge of the +marker. For example, distance from a box or polygon is measured as the +distance from to one of the sides, for text it is the distance to the +start of the text string. There is no way to \fIun\fRdelete a marker other +than to redraw it. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_deleteMark (CDLPtr cdl, int x, int y)\fR +.fi +.NH 3 +The Entire Overlay +.LP + To erase all markers currently displayed use the +\fBcdl_clearOverlay()\fR procedure. Markers are erased in the reverse order +they were drawn to help reduce the chance that overlaying markers will leave +stray pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_clearOverlay (CDLPtr cdl)\fR +.fi +.NH 2 +Redraw +.LP + The \fBcdl_redrawOverlay()\fR procedure can be used to redraw all +markers currently in the display list. This is sometimes needed when +subraster I/O procedures are used to redisplay subregions and overwrite +existing markers. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_redrawOverlay (CDLPtr cdl)\fR +.fi +.NH +Fortran Language Binding Notes +.LP + The Fortran languange binding routines are implemented in C but +should be accessible from any fortran program as though they were real +fortran subroutines. The calling sequences are the same as with the C +library routines with the following exceptions: +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All Fortran functions are +implemented as subroutines. +.IP +\(bu The procedure names are the same except that \fIcdl_\fR has been +replaced with \fIcf\fR in the fortran binding. If your compiler is +case-sensitive then use all lower case letters. +.LP +The binding has been tested on a number of different platforms without +problems. The procedure names haven't been restricted to the traditional +6-character fortran names since most modern compilers can handle longer +names, if yours isn't one of them contact \fIiraf@noao.edu\fR for help +in changing the names. +.LP + Since the CDL is implemented as a set of C routines, the one aspect +that cannot be overlooked in the fortran binding is the between Fortran and +C storage order for arrays. In most cases this will not be a problem since +the CDL routines are just passing around pointers even if they live for a +short while in a fortran program. The problem comes when using the fortran +program to read the arrays, for example in using the array returned by the +\fBcfreadIRAF()\fR procedure, or when passing in arrays for display that +originated in the user's fortran code. In these cases the array \fBmust\fR +be transposed to be interpreted correctly. It was assumed that in most +applications arrays returned by CDL procedures would be immediately passed +to other CDL procedures so having the binding routines +transpose the array to/from +Fortran storage order was unnecessarily inefficient. This may be changed in +later releases if required. + +.NH +SPP Language Binding Notes +.LP + The SPP language binding is experimental and is intended to provide +a way to quickly prototype tasks, it should not be used in production code +as it may not be as portable as the rest of the task. In essence this +binding is layer on top of the Fortran binding since most IRAF platforms +still use Fortran as the intermediate code. The calling sequences are the +same as with the Fortran library routines with the following caveats: +.IP +\(bu The 'cdlspp.h' SPP include file is required by all files which call +CDL routines. The binding names are actually SPP macros to resolve the +current 6 character limit on procedure name. +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All SPP functions are +implemented as subroutines. +.IP +\(bu The procedure names are the same except that they are all upper case +and the \fIcdl_\fR has been replaced with \fICDS_\fR in the SPP binding. The +upper case is required. + +.NH +IIS Protocol Description +.LP + The communications protocol used by the CDL and servers such as +\fIXImtool\fR and \fISAOimage\fR, is a slightly modified version of that used +by the IIS Model 70. All operations are initiated by sending a header +packet containing a \fIthing id\fR (tid) and \fIsubunit\fR selecting the +function to be performed, optionally followed by data up to 32K bytes long. +The IIS header packet used is defined as +.nf + \f(CWstruct iism70 { + short tid; + short thingct; + short subunit; + short checksum; + short x, y, z; + short t; + };\fR +.fi + +The \fIthing count\fR field contains the negative number of bytes of data +that will be sent following the header packet. The IIS header checksum is +computed as +.nf +\f(CW + checksum = 0177777 - (tid + subunit + thingct + x + y + z + t); +\fR +.fi +The four IIS registers are set differently depending on the operation, a +summary of the header packets for each operation is summarized below. + +.ce 1 +\fBIIS Header Packet Summary\fR +.TS +tab(:); +c c c c c c c c c. +:TID:Subunit:Thingct:X:Y:Z:T:Data +.T& +l | l | l | c | c | c | l | l | l |. +:_:_:_:_:_:_:_:_ +Read Data:IIS_READ\fB|\fPPACKED:MEMORY:-nbytes:x:y:frame:-:nbytes +Write Data:IIS_WRITE\fB|\fPPACKED:MEMORY:-nbytes:x:y:frame:-:nbytes +Read Cursor:IIS_READ:IMCURSOR:-:-:-:-:-:- +Write Cursor:IIS_WRITE:IMCURSOR:-:x:y:wcs:-:- +Set Frame:IIS_WRITE:LUT\fB|\fPCOMMAND:-1:-:-:-:-:2 +Write WCS:IIS_WRITE\fB|\fPPACKED:WCS:-N:-:-:frame:fb:N +Read WCS:IIS_READ:WCS:-:-:-:-:-:320 +Erase Frame:IIS_WRITE \fB|\fP fb:FEEDBACK:-:-:-:frame:-:- +:_:_:_:_:_:_:_:_ +.TE +.TS +l l l. +Where nbytes = number of bytes expected or written + x = x postion of operation in frame buffer coords + y = y postion of operation in frame buffer coords + frame = frame number (passed as bitflag (i.e. 1, 2 ,4 8, etc) + fb = frame buffer config number (zero indexed) + N = length of WCS string + wcs = WCS number (usually zero) + Data = the number of bytes of data to be read or written following the header packet. + + IIS_WRITE = 0400000 + IIS_READ = 0100000 + COMMAND = 0100000 + PACKED = 0040000 + IMC_SAMPLE = 0040000 + + MEMORY = 001 + LUT = 002 + FEEDBACK = 005 + IMCURSOR = 020 + WCS = 021 +.TE +.LP +TID fields can be logically OR'd with the PACKED flag indicating the number +of data bytes is exactly \fIthingct\fR bytes long, otherwise \fIthingct\fR +must be specified as half the number of data bytes. In a cursor read, if +the IIS_READ flag is OR'd with IMC_SAMPLE the logical cursor position (i.e. +the last value read or set) is returned immediately, otherwise the server +will wait for a keystroke to be hit before returning a string containing the +(x,y) position, wcs of the read, and the keystroke. When setting the frame +you must send a short integer in the data containing the frame selected. +.bp +.NH +C Interface Summary +.LP +.in 0.5i +#include "\fBcdl.h\fR" +.in -0.5i + +.TS +center; +r l. +CDLPtr \fBcdl_open\fR (imtdev) +int \fBcdl_displayPix\fR (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) +char \fBcdl_readCursor\fR (cdl, sample, x, y, key) +int \fBcdl_setCursor\fR (cdl, x, y, wcs) +int \fBcdl_setWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +int \fBcdl_getWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +void \fBcdl_setFrame\fR (cdl, frame) +int \fBcdl_clearFrame\fR (cdl) +void \fBcdl_close\fR (cdl) + +int \fBcdl_displayIRAF\fR (cdl, fname, band, frame, fbconfig, zscale) +int \fBcdl_isIRAF\fR (fname) +int \fBcdl_readIRAF\fR (fname, band, pix, nx, ny, bitpix) + +int \fBcdl_displayFITS\fR (cdl, fname, frame, fbconfig, zscale) +int \fBcdl_isFITS\fR (fname) +int \fBcdl_readFITS\fR (fname, pix, nx, ny, bitpix) + +void \fBcdl_computeZscale\fR (cdl, pix, nx, ny, bitpix, z1, z2) +void \fBcdl_zscaleImage\fR (cdl, pix, nx, ny, bitpix, z1, z2) + +int \fBcdl_printPix\fR (cdl, cmd, pix, nx, ny, annotate) +int \fBcdl_printPixToFile\fR (cdl, fname, pix, nx, ny, annotate) + +int \fBcdl_readImage\fR (cdl, pix, nx, ny) +int \fBcdl_readFrameBuffer\fR (cdl, pix, nx, ny) +int \fBcdl_readSubRaster\fR (cdl, lx, ly, nx, ny, pix) +int \fBcdl_writeSubRaster\fR (cdl, lx, ly, nx, ny, pix) + +void \fBcdl_selectFB\fR (cdl, nx, ny, fb, w, h, nf, reset) +void \fBcdl_setFBConfig\fR (cdl, configno) +void \fBcdl_getFBConfig\fR (cdl, configno, w, h, nf) +void \fBcdl_lookupFBSize\fR (cdl, configno, w, h, nf) + +void \fBcdl_setZTrans\fR (cdl, ztrans) +void \fBcdl_setZScale\fR (cdl, z1, z2) +void \fBcdl_setSample\fR (cdl, nsample) +void \fBcdl_setSampleLines\fR (cdl, nlines) +void \fBcdl_setContrast\fR (cdl, contrast) +void \fBcdl_setName\fR (cdl, imname) +void \fBcdl_setTitle\fR (cdl, imtitle) + +void \fBcdl_getFrame\fR (cdl, frame) +void \fBcdl_getZTrans\fR (cdl, ztrans) +void \fBcdl_getZScale\fR (cdl, z1, z2) +void \fBcdl_getSample\fR (cdl, nsample) +void \fBcdl_getSampleLines\fR (cdl, nlines) +void \fBcdl_getContrast\fR (cdl, contrast) +void \fBcdl_getName\fR (cdl, imname) +void \fBcdl_getTitle\fR (cdl, imtitle) + +int \fBcdl_mapFrame\fR (cdl, frame) +int \fBcdl_markPoint\fR (cdl, x, y, number, size, type, color) +int \fBcdl_markPointLabel\fR (cdl, x, y, label, size, type, color) +int \fBcdl_markLine\fR (cdl, xs, ys, xe, ye, color) +int \fBcdl_markBox\fR (cdl, lx, ly, ux, uy, fill, color) +int \fBcdl_markPolygon\fR (cdl, xarray, yarray, npts, fill, color) +int \fBcdl_markPolyline\fR (cdl, xarray, yarray, npts, color) +int \fBcdl_markCircle\fR (cdl, x, y, radius, fill, color) +int \fBcdl_markCircAnnuli\fR (cdl, x, y, radius, nannuli, sep, color) +int \fBcdl_markEllipse\fR (cdl, x, y, xrad, yrad, rotang, fill, color) +int \fBcdl_markEllipAnnuli\fR (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) +int \fBcdl_markText\fR (cdl, x, y, str, size, angle, color) +int \fBcdl_deleteMark\fR (cdl, x, y) +int \fBcdl_clearOverlay\fR (cdl) +int \fBcdl_redrawOverlay\fR (cdl) +.TE + +.bp +.NH +C Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include "cdl.h" + +/* \fIDISPLAY -- Example task to display an image as a command-line task. + * This task is meant to show three ways the CDL can be used to display + * an image, see the code comments for a description of each method. + * + * Examples: + * To display a simple IRAF or FITS file: + * % ./display -frame 2 image.imh + * % ./display image.fits + * + * To display a FITS file as a raw image: + * % ./display -nx 512 -ny 512 -depth 16 -hskip 5760 -raw dpix.fits + * + * Usage: + * display [-depth N] [-fits] [-frame N] [-fbconfig N] [-hskip N] + * [-iraf] [-nozscale] [-nx N] [-ny N] [-raw] [-zscale] file\fP + */ + +#define NONE -1 +#define IRAF 0 +#define FITS 1 +#define RAW 2 + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname; + int i, status = 0, frame = 1, fbconfig = 0, zscale = 1; + int format = NONE, nx = 0, ny = 0, depth = 8, hskip = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strcmp (argv[i], "-depth") == 0) depth = atoi (argv[++i]); + else if (strcmp (argv[i], "-fits") == 0) format = FITS; + else if (strcmp (argv[i], "-frame") == 0) frame = atoi (argv[++i]); + else if (strcmp (argv[i], "-fbconfig") == 0) fbconfig = atoi (argv[++i]); + else if (strcmp (argv[i], "-hskip") == 0) hskip = atoi (argv[++i]); + else if (strcmp (argv[i], "-iraf") == 0) format = IRAF; + else if (strcmp (argv[i], "-nozscale") == 0) zscale = 0; + else if (strcmp (argv[i], "-nx") == 0) nx = atoi (argv[++i]); + else if (strcmp (argv[i], "-ny") == 0) ny = atoi (argv[++i]); + else if (strcmp (argv[i], "-raw") == 0) format = RAW; + else if (strcmp (argv[i], "-zscale") == 0) zscale = 1; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + fname = argv[argc-1]; + + /* \fIMETHOD 1: Displays the image using the high-level format display + * call. Display as an IRAF image if the option was set indicating + * this is the format, otherwise test the file to see if it is anyway.\fP + */ + if (format == IRAF || (format == NONE && \fBcdl_isIRAF\fP (fname))) { + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, FB_AUTO, zscale); + + /* \fIMETHOD 2: Uses the CDL procedure for getting image pixels from + * a known format, minimal work required to display an image. The + * point here is that you can use this method to process the image + * yourself prior to display, e.g. subsample the pixels, apply a user + * LUT, etc but still use the CDL to get the raw image and do the + * display.\fP + */ + } else if (format == FITS || (format == NONE && \fBcdl_isFITS\fP (fname))) { + + /* \fIGet the FITS image pixels, exit w/ an error status if something + * went wrong, the procedure will print what that was.\fP + */ + if (\fBcdl_readFITS\fP (fname, &pix, &nx, &ny, &depth)) { + \fBcdl_close\fP (cdl); /* close the package */ + exit (1); /* exit w/ error code */ + } + + /* \fINow select a frame buffer large enough for the image. The + * fbconfig number is passed in the WCS packet, but the display + * call below will compute the correct WCS for the image and + * transmit that prior to display, all we're doing here is + * setting up the FB to be used.\fP + */ + if (fbconfig == 0) + cdl_selectFB (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 0); + + /* \fILastly, display the pixels to the requested frame, do any + * zscaling requested using the CDL procedure.\fP + */ + status = \fBcdl_displayPix\fP (cdl, pix, nx, ny, depth, frame, + fbconfig, zscale); + + /* \fIMETHOD 3: Displays an image of raw pixels. The client code is + * responsible for reading the image and calling all the procedures + * needed for image display, initialize the frame, zscaling pix, etc. + * While we assume a simple raster format in this program, the user + * code can read a compressed image format such as GIF, mosaic multiple + * images for display as a single image, or just about anything that + * produces a raster for display. The intent here is to show all the + * lowest level calls needed for displaying the image.\fP + */ + } else if (format == RAW) { + FILE *fd; + int lx, ly; + + if (nx == 0 || ny == 0) { + fprintf (stderr, "No size given for raw data.\\n"); + exit (1); + } + + /* \fIOpen the image file if we can.\fP */ + if (fd = fopen (fname, "r")) { + + /* \fISeek to the offset specified.\fP */ + lseek (fileno(fd), (off_t) hskip, SEEK_SET); + + /* \fIAllocate the pixel pointer and read the data.\fP */ + pix = (unsigned char *) malloc (nx * ny * (depth / 8)); + fread (pix, depth/8, nx * ny, fd); + + /* \fIIf we're zscaling and depth is more than 8-bits, do that.\fP */ + if (zscale && depth > 8) { + \fBcdl_computeZscale\fP (cdl, pix, nx, ny, depth, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, nx, ny, depth, z1, z2); + } + + /* \fINow select a frame buffer large enough for the image. We'll + * ask that this be reset but the change won't go to the server + * until we send in a WCS, so compute that as well. For the + * WCS we assume a simple linear transform where the image is + * Y-flipped, the (x,y) translation is computed so it is correct + * for an frame buffer >= than the image size.\fP + */ + \fBcdl_selectFB\fP(cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf,1); + \fBcdl_setWCS\fP (cdl, fname, NULL, 1., 0., 0., -1., + (float) (nx / 2) - (fb_w / 2) + 1, /* \fIX trans.\fP */ + (float) (fb_h / 2) + (ny / 2), /* \fIY trans.\fP */ + z1, z2, CDL_LINEAR); /* \fIZ transform\fP */ + + /* \fISelect and clear the requested frame prior to display.\fP */ + \fBcdl_setFrame\fP (cdl, frame); + \fBcdl_clearFrame\fP (cdl); + + /* \fINow display the pixels. We'll compute the image placement + * ourselves and write the image as a raw subraster of the frame + * buffer. In this case we'll center the image, but the CDL + * cdl_writeSubRaster() procedure can be used to write arbitrary + * rasters at any point in the frame buffer.\fP + */ + lx = (fb_w / 2) - (nx / 2); + ly = fb_h - ((fb_h / 2) + (ny / 2)); + status = \fBcdl_writeSubRaster\fP (cdl, lx, ly, nx, ny, pix); + } else + status = 1; + } else { + if (access (fname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image does not exist.\\n", fname); + status = 1; + } + + /* \fINow just free the pixel pointer to clean up.\fP */ + if (pix) + free ((unsigned char *) pix); + \fBcdl_close\fP (cdl); /* \fIclose the package\fP */ + exit (status); +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Interactive Graphics Overlay Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include <math.h> +#include "cdl.h" + +/* \fI + * TVMARK -- Example task for displaying an marking images. This program + * can be used to either display an image and overlay points defined in + * a coordinate file, map an existing display frame for marking, or option- + * ally enter a cursor command loop after either of these providing other + * marking capability. All options support minimum match. + * + * Examples: + * % tvmark dpix.fits + * % tvmark -coords coords -color 205 dpix.fits + * % tvmark -frame 2 + * % tvmark -coords coords -interactive dpix.fits + * + * Usage: + * tvmark [-frame N] [-fbconfig N] [-coords <file>] [-size N] [-color N] + * [-nolabel] [-fill] [-interactive] [image]\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, *cfname = NULL; + int i, status = 0, fill = 0, frame = 1, fb = FB_AUTO, zscale = 1; + int color = 201, label = 1, size = 9, interactive = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp(argv[i], "-color",4) == 0) color = atoi (argv[++i]); + else if (strncmp(argv[i], "-coords",4) == 0) cfname = argv[++i]; + else if (strncmp(argv[i], "-fbconfig",3) == 0) fb = atoi (argv[++i]); + else if (strncmp(argv[i], "-fill",4) == 0) fill = 1; + else if (strncmp(argv[i], "-frame",3) == 0) frame = atoi (argv[++i]); + else if (strncmp(argv[i], "-interactive",4) == 0) interactive = 1; + else if (strncmp(argv[i], "-nolabel",4) == 0) label = 0; + else if (strncmp(argv[i], "-nozscale",4) == 0) zscale = 0; + else if (strncmp(argv[i], "-size",2) == 0) size = atoi (argv[++i]); + else + fname = argv[i]; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIIf an image was specified display it first, otherwise assume the + * image has already been loaded in the frame and mark that.\fP + */ + if (fname) { + if (\fBcdl_isIRAF\fP (fname)) + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, fb, zscale); + else if (\fBcdl_isFITS\fP (fname)) + status = \fBcdl_displayFITS\fP (cdl, fname, frame, fb, zscale); + else { + if (access (cfname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image doesn't exist.\\n", fname); + status = 1; + } + if (status) goto err_; + } else { + + /* \fIIf we've requested a special frame buffer, set it now.\fP */ + if (fb > 0) + \fBcdl_setFBConfig\fP (cdl, fb); + + /* \fIMap the current display frame for use as an image.\fP */ + \fBcdl_mapFrame\fP (cdl, frame); + } + + /* \fIIf a coordinate file was specified read the file and mark those + * coords with points.\fP + */ + if (cfname) { + if (access (cfname, F_OK) == 0) { + FILE *fp; + int i, x, y; + + if (fp = fopen (cfname, "r")) { + /* \fIThe coord file is assumed to be simply a file containing + * (x,y) pairs, one per line. Scan the file and mark each + * point. We do no bounds checking to see if the coords + * are correct for the frame, marker type is fixed.\fP + */ + i = 1; + while (fscanf (fp, "%d %d", &x, &y) != EOF) { + if (label) + \fBcdl_markPoint\fP (cdl, x, y, i++, size, M_STAR, color); + else + \fBcdl_markPoint\fP (cdl, x, y, 0, size, M_STAR, color); + } + + } else + fprintf (stderr, "cannot open coord file '%s'.\\n", cfname); + } else + fprintf (stderr, "'%s': coord file doesn't exist, ignoring.\\n", cfname); + } + + /* \fILastly, start up an interactive cursor loop if needed.\fP */ + if (interactive) + tvmInteractive (cdl, label, fill, color, size); + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} + +/* \fITVMINTERACTIVE -- Process commands interactively.\fP */ + +tvmInteractive (cdl, label, fill, color, size) +CDLPtr cdl; +int label, fill, color, size; +{ + float angle = 0.0, rx, ry, txsize = 1.; + int nx, ny, i, x, y, x2, y2; + int number=1, radius=11, xrad=11, yrad=6, nannuli=3, sep=5; + char key, cmd[SZ_NAME], str[SZ_NAME]; + unsigned char *pix; + + /* \fIProcess commands until a 'q' keystrke is hit.\fP */ + while (\fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &key) != 'q') { + x = (int) (rx + 0.5); /* \fIconvert to int pixels\fP */ + y = (int) (ry + 0.5); + + switch (key) { + case ':': /* \fIprocess a colon command\fP */ + putchar (':'); + gets (str); + for (i=0; str[i] != ' ' && str[i]; i++) + cmd[i] = str[i]; + cmd[i++] = '\0'; + + if (strcmp (cmd, "angle") == 0) angle = atof (&str[i]); + else if (strcmp (cmd, "color") == 0) color = atoi (&str[i]); + else if (strcmp (cmd, "fill") == 0) fill = atoi (&str[i]); + else if (strcmp (cmd, "number") == 0) number = atoi (&str[i]); + else if (strcmp (cmd, "nannuli") == 0) nannuli = atoi (&str[i]); + else if (strcmp (cmd, "label") == 0) label = atoi (&str[i]); + else if (strcmp (cmd, "sep") == 0) sep = atoi (&str[i]); + else if (strcmp (cmd, "size") == 0) size = atoi (&str[i]); + else if (strcmp (cmd, "txsize") == 0) txsize = atof (&str[i]); + else if (strcmp (cmd, "xrad") == 0) xrad = atoi (&str[i]); + else if (strcmp (cmd, "yrad") == 0) yrad = atoi (&str[i]); + else if (strcmp (cmd, "print") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPix\fP (cdl, NULL, pix, nx, ny, 1); + } else if (strcmp (cmd, "snap") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPixToFile\fP (cdl, &str[i], pix, nx, ny, 1); + } else if (strcmp (cmd, "status") == 0) { + printf ("angle = %-5.3g\tcolor = %d\t", angle, color); + printf ("fill = %-5d\tnumber = %d\\n", fill, number); + printf ("nannuli = %-5d\tsep = %d\t", nannuli, sep); + printf ("size = %-5d\ttxsize = %g\\n", size, txsize); + printf ("xrad = %-5d\tyrad = %d\t", xrad, yrad); + printf ("label = %-5d\\n", label); + } + break; + + case '?': + /* ......\fIhelp procedures\fP */ + break; + + case 'p': /* \fIplus mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_PLUS, color); + break; + case 'x': /* \fIcross mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CROSS, color); + break; + case '.': /* \fIpoint mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_POINT, color); + break; + case '*': /* \fIstar mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_STAR, color); + break; + case '_': /* \fIhoriz dash mark\fP*/ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_HBLINE, color); + break; + case '|': /* \fIvert dash mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_VBLINE, color); + break; + case 'o': /* \fIcircle mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CIRCLE|fill, color); + break; + case 's': /* \fIsquare mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_BOX|fill, color); + break; + case 'v': /* \fIdiamond mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_DIAMOND|fill, color); + break; + + case 'b': /* \fIBox\fP */ + printf ("Hit another key to define the box...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markBox\fP (cdl, x, y, x2, y2, fill, color); + break; + case 'c': /* \fICircle\fP */ + printf ("Hit another key to set radius ...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + radius = (int) sqrt ((double) ((x2-x)*(x2-x) + (y2-y)*(y2-y))); + \fBcdl_markCircle\fP (cdl, x, y, radius, fill, color); + break; + case 'd': /* \fIDelete marker\fP */ + \fBcdl_deleteMark\fP (cdl, x, y); + break; + case 'e': /* \fIEllipse\fP */ + \fBcdl_markEllipse\fP (cdl, x, y, xrad, yrad, angle, fill, color); + break; + case 'l': /* \fILine\fP */ + printf ("Hit another key to set line endpoint...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markLine\fP (cdl, x, y, x2, y2, color); + break; + case 't': /* \fIText string\fP */ + printf ("Text string: "); + gets (str); + \fBcdl_markText\fP (cdl, x, y, str, txsize, angle, color); + break; + case 'C': /* \fICircular annuli\fP*/ + \fBcdl_markCircAnnuli\fP (cdl, x, y, radius, nannuli, sep, color); + break; + case 'D': /* \fIDelete all markers\fP*/ + \fBcdl_clearOverlay\fP (cdl); + break; + case 'E': /* \fIElliptical annuli\fP*/ + \fBcdl_markEllipAnnuli\fP (cdl, x, y, xrad, yrad, angle, nannuli, sep, color); + break; + default: + break; + } + } +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Image Mosaic Example +.LP +.in 0.5i +.ps -2 +.vs -2 +.nf +#include <stdio.h> +#include <unistd.h> +#\fBinclude "cdl.h"\fP + +/* \fIMOSAIC -- Example task to mosaic several images on a display. Demonstrates + * usage of low-level routines for complex display operations.\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL; + int i, j, k, status=0, label=0, frame=1, fb=FB_AUTO, zscale=1; + int sample=1, pad=0, col=204, imx, imy, bitpix, nimages, nim; + int ii, xinit, rowx, rowy, nnx, nny, fb_w, fb_h, nf, mx, my, nx, ny; + float z1, z2; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp (argv[i], "-fbconfig",3) == 0) fb=atoi(argv[++i]); + else if (strncmp (argv[i],"-frame",3) == 0) frame=atoi(argv[++i]); + else if (strncmp (argv[i],"-color",3) == 0) col=atoi(argv[++i]); + else if (strncmp (argv[i],"-label",4) == 0) label=1; + else if (strncmp (argv[i],"-nozscale",4) == 0) zscale=0; + else if (strncmp (argv[i],"-nx",3) == 0) nx=atoi(argv[++i]); + else if (strncmp (argv[i],"-ny",3) == 0) ny=atoi(argv[++i]); + else if (strncmp (argv[i],"-pad",4) == 0) pad=atoi(argv[++i]); + else if (strncmp (argv[i],"-sample",4) == 0) sample=atoi(argv[++i]); + else + break; + } + } + nimages = argc - i; + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIClear the frame to begin.\fP */ + (void) \fBcdl_clearFrame\fP (cdl); + + /* \fILoop over each of the images in the list.\fP */ + nim = rowx = rowy = nnx = nny = 0; + for (k=0; k < ny && nim < nimages; k++) { + rowy += nny + pad; + for (rowx = xinit, j=0; j < nx && nim < nimages; j++) { + + /* \fIGet the image name for display.\fP */ + fname = argv[i++]; + + /* \fIFigure out what kind of image it is and get the pixels.\fP */ + if (cdl_isIRAF (fname)) + status = \fBcdl_readIRAF\fP (fname, 1, &pix, &imx, &imy, &bitpix); + else if (cdl_isFITS (fname)) + status = \fBcdl_readFITS\fP (fname, &pix, &imx, &imy, &bitpix); + else { + fprintf(stderr, "'%s': unknown or nonexistant image.\\n", fname); + status = 1; + } + if (status) goto err_; + + /* \fICompute subsampled image size.\fP */ + if (sample > 1) + nnx = imx / sample, nny = imy / sample; + else + nnx = imx, nny = imy; + + /* \fIUnless we asked for a specific FB size find one large enough + * to handle the mosaic. We don't check to be sure what's + * returned is really large enough.\fP + */ + if (nim == 0 && fb == FB_AUTO) + \fBcdl_selectFB\fP (cdl, nx*nnx+(pad*(nx-1)), ny*nny+(pad*(ny-1)), &fb, &fb_w, &fb_h, &nf, 1); + else { + \fBcdl_setFBConfig\fP (cdl, fb); + \fBcdl_lookupFBSize\fP (cdl, fb, &fb_w, &fb_h, &nf); + } + + /* \fIDefine a WCS for the frame.\fP */ + \fBcdl_setWCS\fP (cdl, "image mosaic", "", 1., 0., 0., -1., 0., (float) ny*imy+(pad*(ny+1)), 1., 255., 1); + + /* \fIThe first time through figure out the placement so the + * entire mosaic is centered in the frame.\fP + */ + if (nim == 0) { + mx = (nx * nnx) + pad * (nx-1); + my = (ny * nny) + pad * (ny-1); + rowy = (fb_h - my) / 2; + xinit = rowx = (fb_w - mx) / 2; + } + + /* \fICompute the zscaled imaged pixels.\fP */ + if (zscale) { + \fBcdl_computeZscale\fP (cdl, pix, imx ,imy, bitpix, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, imx ,imy, bitpix, z1, z2); + } + + /* \fISubsample the image if requested.\fP */ + if (sample > 1) { + int l, m, n=0; + for (l=0; l < imy; l+=sample) + for (m=0; m < imx; m+=sample) + pix[n++] = pix[(l*imx)+m]; + } + + /* \fIWrite the image to the frame buffer.\fP */ + if (\fBcdl_writeSubRaster\fP (cdl, rowx, rowy, nnx, nny, pix)) goto err_; + + /* \fIDraw the image name as a label.\fP */ + if (label) \fBcdl_markText\fP (cdl, rowx+10, rowy+10, fname, 1., 0., col); + + nim++; rowx += nnx + pad; + } + } + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} +.fi +.vs +2 +.ps +2 +.in -0.5i + +.bp +.NH +Fortran Interface Summary +.LP +.in 0.5i +include "\fBcdlftn.inc\fR" +.in -0.5i + +.TS +center; +r l. +\fBcfopen\fR (imtdev, ier) +\fBcfdisplayPix\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBcfreadCursor\fR (sample, x, y, key, ier) +\fBcfsetCursor\fR (x, y, wcs, ier) +\fBcfsetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfgetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfsetFrame\fR (frame) +\fBcfclearFrame\fR (ier) +\fBcfclose\fR () + +\fBcfdisplayIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBcfisIRAF\fR (fname, isiraf) +\fBcfreadIRAF\fR (fname, band, pix, nx, ny, bitpix, ier) + +\fBcfdisplayFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBcfisFITS\fR (fname, isfits) +\fBcfreadFITS\fR (fname, pix, nx, ny, bitpix, ier) + +\fBcfcomputeZscale\fR (pix, nx, ny, bitpix, z1, z2) +\fBcfzscaleImage\fR (pix, nx, ny, bitpix, z1, z2) + +\fBcfprintPix\fR (cmd, pix, nx, ny, annotate, ier) +\fBcfprintPixToFile\fR (fname, pix, nx, ny, annotate, ier) + +\fBcfreadImage\fR (pix, nx, ny, ier) +\fBcfreadFrameBuffer\fR (pix, nx, ny, ier) +\fBcfreadSubRaster\fR (lx, ly, nx, ny, pix, ier) +\fBcfwriteSubRaster\fR (lx, ly, nx, ny, pix, ier) + +\fBcfselectFB\fR (nx, ny, fb, w, h, nf, reset) +\fBcfsetFBConfig\fR (configno) +\fBcfgetFBConfig\fR (configno, w, h, nf) +\fBcflookupFBSize\fR (configno, w, h, nf) + +\fBcfsetZTrans\fR (ztrans) +\fBcfsetZScale\fR (z1, z2) +\fBcfsetSample\fR (nsample) +\fBcfsetSampleLines\fR (nlines) +\fBcfsetContrast\fR (contrast) +\fBcfsetName\fR (imname) +\fBcfsetTitle\fR (imtitle) + +\fBcfgetFrame\fR (frame) +\fBcfgetZTrans\fR (ztrans) +\fBcfgetZScale\fR (z1, z2) +\fBcfgetSample\fR (nsample) +\fBcfgetSampleLines\fR (nlines) +\fBcfgetContrast\fR (contrast) +\fBcfgetName\fR (imname) +\fBcfgetTitle\fR (imtitle) + +\fBcfmapFrame\fR (frame, ier) +\fBcfmarkPoint\fR (x, y, number, size, type, color, ier) +\fBcfmarkPointLabel\fR (x, y, label, size, type, color, ier) +\fBcfmarkLine\fR (xs, ys, xe, ye, color, ier) +\fBcfmarkBox\fR (lx, ly, ux, uy, fill, color, ier) +\fBcfmarkPolygon\fR (xarray, yarray, npts, fill, color, ier) +\fBcfmarkPolyline\fR (xarray, yarray, npts, color, ier) +\fBcfmarkCircle\fR (x, y, radius, fill, color, ier) +\fBcfmarkCircAnnuli\fR (x, y, radius, nannuli, sep, color, ier) +\fBcfmarkEllipse\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBcfmarkEllipAnnuli\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBcfmarkText\fR (x, y, str, size, angle, color, ier) +\fBcfsetfont\fR (font) +\fBcfdeleteMark\fR (x, y, ier) +\fBcfclearOverlay\fR (ier) +\fBcfredrawOverlay\fR (ier) +.TE +.bp +.NH +Fortran Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ======================================================================== +C FDISPLAY -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for displaying images. +C ======================================================================== + + PROGRAM FDISPLAY + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + if (ier .gt. 0) then + write (*,*) 'open: Error return from CDL' + goto 999 + endif + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fIUnrecognized image, punt and exit.\fP + write (*,*) 'Unrecognized image format' + endif + endif + +C \fIClean up and exit.\fP +999 continue + call \fBcfclose\fP (ier) + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH 2 +Interactive Graphics Overlay Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ========================================================================== +C FTVMARK -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for doing graphics overlay. No +C checking of the error flag is done here for space considerations. +C ========================================================================== + + PROGRAM FTVMARK + include "\fBcdlftn.inc\fP" + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fINo valid image given, so map the current display for marking.\fP + call \fBcfmapFrame\fP (iframe) + endif + endif + +C \fINow that we've got an image displayed or mapped, enter a cursor loop to mark the image. \fP + call markInteractive () + +C \fIClean up and exit\fP +999 continue + call \fBcfclose\fP (ier) + end + +C \fIMARKINTERACTIVE -- Subroutine for processing the cursor loop.\fP + subroutine markInteractive () + include "\fBcdlftn.inc\fP" + real angle, rx, ry, txsize + integer nx, ny, x, y, x2, y2, fill, size, color + integer number, radius, xrad, yrad, nannuli, sep + character key + character*64 cmd, str + +C \fIAllocate a 1024x1024 array for pixels. \fP + character pix(1048576) + +C \fI....Initialize the local parameters to use\fP + +C \fIRead a cursor keystroke telling us what to do.\fP +10 call \fBcfreadCursor\fP (0, rx, ry, key, ier) + +C \fIRound the real cursor position to integer pixel positions.\fP + x = nint (rx + 0.5) + y = nint (ry + 0.5) + +C \fICheck the keystroke and take the appropriate action.\fP +C \fIColon Commands\fP + if (key .eq. ':') then +C \fIRead a three character command and value field and process the colon command\fP + read (*,'(A3, i4)') cmd, ival + if (cmd(1:3) .eq. 'ang') then + angle = real (ival) + else if (cmd(1:3) .eq. 'col') then + color = ival + else if (cmd(1:3) .eq. 'fil') then + fill = ival +\fI : + ....and so on to set local variables + :\fR + else if (cmd(1:3) .eq. 'pri') then +C \fIPrint contents of the current frame buffer\fP + call \fBcfreadFrameBuffer\fP (pix, nx, ny, ier) + call \fBcfprintPix\fP ("lpr", pix, nx, ny, 1, ier) + else if (cmd(1:3) .eq. 'sta') then + \fI....print out the status (value) of variables\fP + endif + +C \fIPoint Markers\fP + else if (key .eq. 'p') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_PLUS, color, ier) + else if (key .eq. 'x') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_CROSS, color, ier) + else if (key .eq. '_') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_HBLINE, color, ier) + else if (key .eq. 'o') then +C \fIExample of a filled point marker \fP + call \fBcfmarkPoint\fP (x, y, 1, size, or(M_CIRCLE,fill), color, ier) +\fI : + ....and so on to set other types of point markers\fR + +C \fIOther Markers\fP + else if (key .eq. 'b') then + print '("Hit another key to define the box ....")' + call \fBcfreadCursor\fP (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + call \fBcfmarkBox\fP (x, y, x2, y2, fill, color, ier) + else if (key .eq. 'd') then + call \fBcfdeleteMark\fP (x, y, ier) + else if (key .eq. 'e') then + call \fBcfmarkEllipse\fP (x, y, xrad, yrad, angle, fill, color, ier) + else if (key .eq. 't') then + print '("Text string: ", $)' + read (*,'(A64)') str + call \fBcfmarkText\fP (x, y, str, txsize, angle, color, ier) +\fI : + ....and so on to set other types of markers\fR + +C \fIQuit\fP + else if (key .eq. 'q') then + goto 998 + endif + +C \fILoop back until we want to quit\fP + goto 10 +998 continue + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH +SPP Interface Summary +.LP +.in 0.5i +#include "\fBcdlspp.h\fR" +.in -0.5i + +.TS +center; +r l. +\fBCDS_OPEN\fR (imtdev, ier) +\fBCDS_DISPLAYPIX\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBCDS_READCURSOR\fR (sample, x, y, key, ier) +\fBCDS_SETCURSOR\fR (x, y, wcs, ier) +\fBCDS_SETWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBCDS_GETWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBCDS_SETFRAME\fR (frame) +\fBCDS_CLEARFRAME\fR (ier) +\fBCDS_CLOSE\fR () + +\fBCDS_DISPLAYIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBCDS_ISIRAF\fR (fname, isiraf) +\fBCDS_READIRAF\fR (fname, band, pix, nx, ny, bitpix, ier) + +\fBCDS_DISPLAYFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBCDS_ISFITS\fR (fname, isfits) +\fBCDS_READFITS\fR (fname, pix, nx, ny, bitpix, ier) + +\fBCDS_COMPUTEZSCALE\fR (pix, nx, ny, bitpix, z1, z2) +\fBCDS_ZSCALEIMAGE\fR (pix, nx, ny, bitpix, z1, z2) + +\fBCDS_PRINTPIX\fR (cmd, pix, nx, ny, annotate, ier) +\fBCDS_PRINTPIXTOFILE\fR (fname, pix, nx, ny, annotate, ier) + +\fBCDS_READIMAGE\fR (pix, nx, ny, ier) +\fBCDS_READFRAMEBUFFER\fR (pix, nx, ny, ier) +\fBCDS_READSUBRASTER\fR (lx, ly, nx, ny, pix, ier) +\fBCDS_WRITESUBRASTER\fR (lx, ly, nx, ny, pix, ier) + +\fBCDS_SELECTFB\fR (nx, ny, fb, w, h, nf, reset) +\fBCDS_SETFBCONFIG\fR (configno) +\fBCDS_GETFBCONFIG\fR (configno, w, h, nf) +\fBCDS_LOOKUPFBSIZE\fR (configno, w, h, nf) + +\fBCDS_SETZTRANS\fR (ztrans) +\fBCDS_SETZSCALE\fR (z1, z2) +\fBCDS_SETSAMPLE\fR (nsample) +\fBCDS_SETSAMPLELINES\fR (nlines) +\fBCDS_SETCONTRAST\fR (contrast) +\fBCDS_SETNAME\fR (imname) +\fBCDS_SETTITLE\fR (imtitle) + +\fBCDS_GETFRAME\fR (frame) +\fBCDS_GETZTRANS\fR (ztrans) +\fBCDS_GETZSCALE\fR (z1, z2) +\fBCDS_GETSAMPLE\fR (nsample) +\fBCDS_GETSAMPLELINES\fR (nlines) +\fBCDS_GETCONTRAST\fR (contrast) +\fBCDS_GETNAME\fR (imname) +\fBCDS_GETTITLE\fR (imtitle) + +\fBCDS_MAPFRAME\fR (frame, ier) +\fBCDS_MARKPOINT\fR (x, y, number, size, type, color, ier) +\fBCDS_MARKPOINTLABEL\fR (x, y, label, size, type, color, ier) +\fBCDS_MARKLINE\fR (xs, ys, xe, ye, color, ier) +\fBCDS_MARKBOX\fR (lx, ly, ux, uy, fill, color, ier) +\fBCDS_MARKPOLYGON\fR (xarray, yarray, npts, fill, color, ier) +\fBCDS_MARKPOLYLINE\fR (xarray, yarray, npts, color, ier) +\fBCDS_MARKCIRCLE\fR (x, y, radius, fill, color, ier) +\fBCDS_MARKCIRCANNULI\fR (x, y, radius, nannuli, sep, color, ier) +\fBCDS_MARKELLIPSE\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBCDS_MARKELLIPANNULI\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBCDS_MARKTEXT\fR (x, y, str, size, angle, color, ier) +\fBCDS_SETFONT\fR (font) +\fBCDS_DELETEMARK\fR (x, y, ier) +\fBCDS_CLEAROVERLAY\fR (ier) +\fBCDS_REDRAWOVERLAY\fR (ier) +.TE diff --git a/vendor/x11iraf/cdl/doc/cdlref.ms-V1.6 b/vendor/x11iraf/cdl/doc/cdlref.ms-V1.6 new file mode 100644 index 00000000..a97147be --- /dev/null +++ b/vendor/x11iraf/cdl/doc/cdlref.ms-V1.6 @@ -0,0 +1,2512 @@ +.RP +.de us +\\$1\l'|0\(ul' +.. +.TL +A Reference Guide for the IRAF Client Display Library (CDL) +.AU +Michael Fitzpatrick +.AI +NOAO/IRAF Group +.sp 0.5 +February 1997 +.sp 0.5 +\fIRevised March 1998\fR + +.AB +The Client Display Library (CDL) is a host interface for C, Fortran or SPP +programs allowing them to display images or overlay graphics to display +servers such as \fIXImtool\fR or \fISAOimage / SAOtng\fR. High-level +procedures allow IRAF or FITS images to be displayed simply, other +routines permit access to all other server functions (e.g. cursor and image +readback, frame selection, etc). The library also features a number of +functions for doing image overlay graphics; supported graphics primitives +include numerous point shapes, lines, circles, ellipses, polygons, annular +shapes, and text. +.AE + +.pn 1 +.bp +.ce +.ps +3 +\fBContents\fR +.ps -3 +.sp 2 +1\h'|0.25i'\fBIntroduction\fP\l'|5.6i.'\0\01 +.sp 0.5 +2\h'|0.25i'\fBGetting Started\fP\l'|5.6i.'\0\01 +.sp 0.5 +3\h'|0.25i'\fBServer Connections\fP\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.1\h'|0.75i'Domain Sockets\l'|5.6i.'\0\02 +.br +\h'|0.25i'3.2\h'|0.75i'Named FIFO Pipes\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.3\h'|0.75i'Inet Sockets\l'|5.6i.'\0\03 +.br +\h'|0.25i'3.4\h'|0.75i'User-Defined Connections\l'|5.6i.'\0\03 +.sp 0.5 +4\h'|0.25i'\fBImage Display\fP\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.1\h'|0.75i'Overview of the Display Process\l'|5.6i.'\0\03 +.br +\h'|0.25i'4.2\h'|0.75i'Displaying IRAF Images\l'|5.6i.'\0\04 +.br +\h'|0.25i'4.3\h'|0.75i'Displaying FITS Images\l'|5.6i.'\0\04 +.br +\h'|0.25i'4.4\h'|0.75i'Displaying Raw Pixels\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.5\h'|0.75i'Frame Selection\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.6\h'|0.75i'Clearing the Display\l'|5.6i.'\0\05 +.br +\h'|0.25i'4.7\h'|0.75i'Frame Buffer Selection\l'|5.6i.'\0\05 +.br +\h'|0.4i'4.7.1\h'|0.95i'Automatic Selection\l'|5.6i.'\0\06 +.br +\h'|0.4i'4.7.2\h'|0.95i'The Frame Buffer Configuration File\l'|5.6i.'\0\06 +.br +\h'|0.25i'4.8\h'|0.75i'Image WCS Description\l'|5.6i.'\0\06 +.br +\h'|0.25i'4.9\h'|0.75i'Image Colormaps\l'|5.6i.'\0\07 +.br +\h'|0.4i'4.9.1\h'|0.95i'Imtool Color Model\l'|5.6i.'\0\07 +.br +\h'|0.25i'4.10\h'|0.75i'ZScale Intensity Mapping\l'|5.6i.'\0\08 +.br +\h'|0.25i'4.11\h'|0.75i'Image Hardcopy\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.12\h'|0.75i'Image Cursor\l'|5.6i.'\0\09 +.br +\h'|0.4i'4.12.1\h'|0.95i'Cursor Sampling\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.13\h'|0.75i'Image Readout\l'|5.6i.'\0\09 +.br +\h'|0.25i'4.14\h'|0.75i'Subraster I/O\l'|5.6i.'\0\09 +.sp 0.5 +5\h'|0.25i'\fBGraphics Overlay\fP\l'|5.6i.'\010 +.br +\h'|0.25i'5.1\h'|0.75i'Marker Coordinates\l'|5.6i.'\010 +.br +\h'|0.25i'5.2\h'|0.75i'Mapping a Previously Displayed Image\l'|5.6i.'\010 +.br +\h'|0.25i'5.3\h'|0.75i'Marking a Coordinate File\l'|5.6i.'\010 +.br +\h'|0.25i'5.4\h'|0.75i'Marker Colors\l'|5.6i.'\010 +.br +\h'|0.25i'5.5\h'|0.75i'Marker Types\l'|5.6i.'\011 +.br +\h'|0.4i'5.5.1\h'|0.95i'Point\l'|5.6i.'\011 +.br +\h'|0.4i'5.5.2\h'|0.95i'Line\l'|5.6i.'\011 +.br +\h'|0.4i'5.5.3\h'|0.95i'Box\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.4\h'|0.95i'Circle\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.5\h'|0.95i'Polyline\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.6\h'|0.95i'Polygon\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.7\h'|0.95i'Ellipse\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.8\h'|0.95i'Circular Annuli\l'|5.6i.'\012 +.br +\h'|0.4i'5.5.9\h'|0.95i'Elliptical Annuli\l'|5.6i.'\013 +.br +\h'|0.4i'5.5.10\h'|0.95i'Text\l'|5.6i.'\013 +.br +\h'|0.25i'5.6\h'|0.75i'Text Fonts\l'|5.6i.'\013 +.br +\h'|0.4i'5.6.1\h'|0.95i'In-line Font Changes\l'|5.6i.'\013 +.br +\h'|0.25i'5.7\h'|0.75i'Line Widths and Styles\l'|5.6i.'\014 +.br +\h'|0.25i'5.8\h'|0.75i'Deleting Markers\l'|5.6i.'\014 +.br +\h'|0.4i'5.8.1\h'|0.95i'Individual Markers\l'|5.6i.'\014 +.br +\h'|0.4i'5.8.2\h'|0.95i'The Entire Overlay\l'|5.6i.'\015 +.br +\h'|0.25i'5.9\h'|0.75i'Redrawing the Overlay\l'|5.6i.'\015 +.sp 0.5 +6\h'|0.25i'\fBANSI C Function Prototypes\fP\l'|5.6i.'\015 +.sp 0.5 +7\h'|0.25i'\fBFortran Language Binding Notes\fP\l'|5.6i.'\015 +.sp 0.5 +8\h'|0.25i'\fBSPP Language Binding Notes\fP\l'|5.6i.'\015 +.sp 0.5 +9\h'|0.25i'\fBIIS Protocol Description\fP\l'|5.6i.'\016 +.sp 0.5 +10\h'|0.25i'\fBVXIMTOOL Proxy/Display Server Usage\fP\l'|5.6i.'\018 +.sp 0.5 +11\h'|0.25i'\fBC Interface Summary\fP\l'|5.6i.'\019 +.sp 0.5 +12\h'|0.25i'\fBC Example Tasks\fP\l'|5.6i.'\021 +.br +\h'|0.25i'12.1\h'|0.75i'Display Example\l'|5.6i.'\021 +.br +\h'|0.25i'12.2\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\024 +.br +\h'|0.25i'12.3\h'|0.75i'Image Mosaic Example\l'|5.6i.'\028 +.sp 0.5 +13\h'|0.25i'\fBFortran Interface Summary\fP\l'|5.6i.'\030 +.sp 0.5 +14\h'|0.25i'\fBFortran Example Tasks\fP\l'|5.6i.'\032 +.br +\h'|0.25i'14.1\h'|0.75i'Display Example\l'|5.6i.'\032 +.br +\h'|0.25i'14.2\h'|0.75i'Interactive Graphics Overlay Example\l'|5.6i.'\033 +.sp 0.5 +15\h'|0.25i'\fBSPP Interface Summary\fP\l'|5.6i.'\035 +.pn 1 + +.NH +Introduction +.LP + For more than a decade IRAF has used a \fIdisplay server\fR as the +primary means for image display. IRAF client tasks connect to the server +and send or read data using a modification of the IIS Model 70 protocol, +originally through named fifo pipes but more recently using unix domain +or inet sockets. The advantage to this approach was that IRAF client tasks +could make use of the image display functionality without duplicating +the code needed for actually displaying the image. The longtime disadvantage +was that the IIS protocol used was arcane and undocumented and therefore +largely unavailable to applications outside of the IRAF project. The +Client Display Library (CDL) provides a public C and Fortran interface for +displaying images and overlay graphics that is independent of the underlying +protocol used. +.LP + Unlike the interface used by IRAF applications, the CDL is meant to +provide an easy-to-use, fully featured interface for applications that can +be easily evolved for future display servers, communications schemes, or +display functionality. Indeed, the CDL is independent of IRAF itself (as +are the display servers) so display tasks can be written for any discipline +or application. +.LP + While this guide assumes programs are written in C, Fortran programmers +should find the translation straightforward by referring to the Fortran +interface summary. The package source files include example tasks as does +this guide; users with problems, questions, or bug reports are encouraged to +contact \fIiraf@noao.edu\fR. A small code sample demonstrating the problem +would be very helpful in finding a solution to any reported problems. + +.NH +Getting Started +.LP + All C programs must include the header file \fB"cdl.h"\fR in order +to get package definitions for constants such as colors and structure +definitions used. The Fortran interface does not \fIrequire\fR anything +similar, however for fortran compilers which support an \f(CWinclude\fR +directive a \fBcdlftn.inc\fR file may be used to define symbolic constants +passed to procedures, this file must be included by each procedure using the +CDL. Fortran programs not using this file must pass in the constants +explicitly, needed values are found throughout this manual. C procedures +which return an integer value will return a positive number to indicate an +error has occurred and print an error message, otherwise zero is returned. +.LP + The \fBcdl_open()\fR procedure is used to establish a connection +to the server and initialize the package, it returns a CDL structure pointer +that is passed to other CDL procedures. For C programs this means +a separate pointer may be maintained for each server connection, the Fortran +interface is limited to only one server connection per process since the +pointer is maintained internally. The connection is terminated using the +\fBcdl_close()\fR procedure. Between these two calls may be any combination +of CDL procedure calls for doing image display or overlay graphics. +.LP + For example, the simplest possible program for displaying an IRAF +image would look something like: +.sp 0.5 +.nf + \f(CW#include "cdl.h" + + main (int argc, char *argv[]) + { + CDLPtr cdl = cdl_open ((char *)0); + cdl_displayIRAF (cdl, argv[1], 1, 1, 1, 1); + cdl_close (cdl); + }\fR +.fi +.sp 0.5 +.LP +This program displays band one of an image named on the command line to the +server in frame one using the default 512x512 frame buffer, zscaling the +pixels to 8-bit values automatically. No error checking is performed to verify +that a connection was established or that the argument is a valid IRAF image. +Most programs will be more complex than this but it should be clear that +image display from client applications is a now trivial operation. + +.us "Synopsis" +.sp 0.5 +.nf + \f(CW#include "cdl.h"\fR + + \f(CWCDLPtr cdl_open (char *imtdev)\fR + \f(CWvoid cdl_close (CDLPtr cdl)\fR +.fi + +.NH +Server Connections +.LP + The \fBcdl_open()\fR procedure takes a single argument specifying the +type of connection to make to the server, this routine also initializes +the CDL package. If this is a NULL pointer the CDL will attempt to first +connect on a unix domain socket, if that fails the standard IRAF /dev/imt1* +fifo pipes are tried. The syntax for the \fIimtdev\fR argument is as follows: +.sp 0.5 + \f(CW<domain> : <address>\fR +.sp 0.5 +.LP +where <domain> is one of "\fBinet\fR" (internet tcp/ip socket), "\fBunix\fR" +(unix domain socket) or "\fBfifo\fR" (named pipe). The form of the address +depends upon the domain, as illustrated in the examples below. The address +field may contain up to two "%d" fields. If present, the user's UID will be +substituted (e.g. "unix:/tmp/.IMT%d"). The default connection if no imtdev +is specified is "unix:/tmp/.IMT%d", failing that a connection is attempted +on the /dev/imt1[io] named fifo pipes. +.NH 2 +Domain Sockets +.LP + Domain sockets are sockets created on the local host. The connection +is usually faster than an inet socket and comparable to a fifo. If the +socket name is specified with a '%d' field the client can be assured of a +unique socket name for each user allowing multiple clients to be run on the +same host by different users. +.LP +.us "Example" +.sp 0.5 +.nf +\f(CW + /* Connection to a local host using socket domain socket. */ + if ((cdl = cdl_open ("unix:/tmp/.IMT%d")) == NULL) { + fprintf (stderr, "cannot open domain socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Named FIFO Pipes +.LP + This is the traditional approach, and the only one supported by +SAOimage (although recent versions contain support for sockets). Any named +fifo pipe may be used, the syntax for the \fIimtdev\fR string in this case is +.sp 0.5 + \fBfifo:\f(CW<input_fifo>\fB:\f(CW<output_fifo>\fR +.sp 0.5 +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using named fifo pipes. */ + if ((cdl = cdl_open ("fifo:/dev/imt1i:/dev/imt1o")) == NULL) { + fprintf (stderr, "cannot open fifo pipe connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +Inet Sockets +.LP + Inet sockets are connections between hosts via a tcp/ip socket. +This permits connecting to the server over a remote network connection +anywhere on the Internet. +.LP +.us "Example" +.sp 0.5 +.nf + \f(CW/* Connection to a local host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } + + /* Connection to a remote internet host using socket 5137. */ + if ((cdl = cdl_open ("inet:5137:foo.bar.edu")) == NULL) { + fprintf (stderr, "cannot open inet socket connection\\n"); + exit (1); + } \fR +.fi +.NH 2 +User-Defined Connections +.LP + Since IRAF V2.10.3 client tasks have been able to use an \fBIMTDEV\fR +unix environment variable to set the connection type, the syntax of this +variable is the same as described above. If the \fIcdl_open()\fR procedure +is called with a NULL pointer the IMTDEV environment variable will +automatically be checked. To explicitly use this (or any other) variable +in the client task the \fIcdl_open()\fR procedure may be called as +e.g. +.sp 0.5 +.nf + \f(CWif ((cdl = cdl_open (getenv("IMTDEV"))) == NULL) { + fprintf (stderr, "cannot open server connection\\n"); + exit (1); + }\fR +.fi +.NH +Image Display +.NH 2 +Overview of the Display Process +.LP + Basic image display is done most easily using the high-level +\fBcdl_displayIRAF()\fR, \fBcdl_displayFITS()\fR and \fBcdl_displayPix()\fR +procedures. These routines automatically define an image WCS, clear the +frame, set the frame buffer and center the image in the display. For most +applications these are all that will be needed, but the +\fBcdl_writeSubRaster()\fR procedure can also be used to display an image. +For example, to display one image in a mosaic or other cases where +the task needs low-level access to position the image or write raw pixel +values. +.LP + In these cases it is the responsibility of the client program to +prepare the server for display. The basic steps involved in displaying an +image include +.sp 0.5 +.TS +center; +lB lB +- - +l lI. +Operation CDL Procedure +Selecting the frame cdl_setFrame() +Clear the frame cdl_clearFrame() +Select the frame buffer configuration cdl_selectFB() +Set the frame buffer configuration cdl_setFBConfig() +Scale the image pixels to 201 display values cdl_zscaleImage() +Define the image WCS +Set the image WCS cdl_setWCS() +Compute the raster placement in the frame buffer +Write the pixels to the display cdl_writeSubRaster() +.TE +.sp 0.5 +In cases like a mosaic display obviously clearing the frame will only need +to be done once and a single WCS for the mosaic should be defined. For +simple display the high-level routines handle all of these steps for you, they +are included here as checklist of what must be considered when using the CDL +for low-level display. +.NH 2 +Displaying IRAF Images +.LP + The \fBcdl_displayIRAF()\fR procedure can be used to display an + IRAF OIF format image (i.e. images with a \fI.imh\fR extension) by +simply passing in the image name. Pixel files for the image must be +accessible from the local machine but can be in any directory, the HDR$ +syntax for the imdir is also recognized. Images may be three dimensional, +the \fIband\fR argument is used to select the image band to be displayed. +The \fIframe\fR and \fIfbconfig\fR arguments select the frame and frame +buffer size respectively, the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the \fIzscale\fR flag is greater than zero +the image will automatically be converted to 8-bit values using the zscale +mapping algorithm. The function returns a positive value if the image +cannot be accessed or displayed for any reason, an error message will be +printed. +.LP + The \fIcdl_isIRAF()\fR procedure returns a positive value if the +filename argument is recognized as an IRAF image, it does not check whether +the pixel file can be successfully accessed. For simply reading the pixels +from an IRAF image the \fBcdl_readIRAF()\fR procedure may be used. The +function returns a zero value and sets the output pixel array, image +dimensions and pixel size if successful, otherwise the function returns a +positive value. Note that +the output pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayIRAF (CDLPtr cdl, char *fname, int band, + int frame, int fbconfig, int zscale)\fR + \f(CWint cdl_isIRAF (char *fname)\fR + \f(CWint cdl_readIRAF (char *fname, int band, uchar **pix, + int *nx, int *ny, int *bitpix, char *title)\fR +.fi +.NH 2 +Displaying FITS Images +.LP + The \fBcdl_displayFITS()\fR procedure can be used to display a +\fIsimple\fR FITS image by name. A "simple" FITS file is assumed to be +one containing a single image and having no extensions. Other types of +FITS files may of course be displayed but the client will have to use other +means to import the pixels. FITS image extensions may be supported in a future +release of the CDL. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, +the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. The function +returns a positive value if the image cannot be accessed or displayed for +any reason, an error message will be printed. +.LP + The \fIcdl_isFITS()\fR procedure returns a positive value if the +filename argument is recognized as a simple FITS image. For simply reading +the image pixels the \fBcdl_readFITS()\fR procedure may be used. The +output pixel array, image dimensions and pixel size are returned if +successful otherwise the function returns a positive value. Note that +the returned pixel values may need to be scaled before they can be displayed. + +.us "Synopsis" +.nf + \f(CWint cdl_displayFITS (CDLPtr cdl, char *fname, int frame, + int fbconfig, int zscale)\fR + \f(CWint cdl_isFITS (char *fname)\fR + \f(CWint cdl_readFITS (char *fname, uchar **pix, int *nx, int *ny, + int *bitpix, char *title)\fR +.fi +.NH 2 +Displaying Raw Pixels +.LP + The \fBcdl_displayPix()\fR procedure can be used to display an +arbitrary array of pixels of any size. The \fInx\fR and \fIny\fR arguments +are the raster dimensions, and \fIbitpix\fR is the pixel size and has the +same meaning as the FITS BITPIX keyword. The \fIframe\fR and \fIfbconfig\fR +arguments select the frame and frame buffer size respectively, +the special symbolic value \fBFB_AUTO\fR may be +used for the \fIfbconfig\fR argument to have the procedure automatically +select the frame buffer most appropriate for the image size. +If the +\fIzscale\fR flag is greater than zero the image will automatically be +converted to 8-bit values using the zscale mapping algorithm. + +.us "Synopsis" +.nf + \f(CWint cdl_displayPix (CDLPtr cdl, uchar *pix, int nx, int ny, + int bitpix, int frame, int fbconfig, int zscale)\fR +.fi +.NH 2 +Frame Selection +.LP + Frame selection is normally done as an argument to one of the display +procedures, however frames may be explicitly selected using the +\fBcdl_setFrame()\fR procedure. This allows client programs to essentially +"blink" frames independently, as long as the server supports multiple frames. +The \fBcdl_getFrame()\fR procedure may be used to get the current frame +set in the server. + +.us "Synopsis" +.nf + \f(CWvoid cdl_setFrame (CDLPtr cdl, int frame)\fR + \f(CWvoid cdl_getFrame (CDLPtr cdl, int *frame)\fR +.fi +.NH 2 +Clearing the Display +.LP + The current display frame may be explicitly cleared using the +\fBcdl_clearFrame()\fR procedure. The frame is also cleared prior to +displaying new images by the procedures \fBcdl_displayPix()\fR, +\fBcdl_displayFITS()\fR, and \fBcdl_displayIRAF()\fR. + +.us "Synopsis" +.nf + \f(CWint cdl_clearFrame (CDLPtr cdl)\fR +.fi +.NH 2 +Frame Buffer Selection +.LP + The default frame buffer used is 512x512, other sizes may be +selected using the \fBcdl_setFBConfig()\fR procedure. To set the frame +buffer size the client passes the frame buffer number as defined in +the frame buffer configuration file (see below) while setting the image +WCS. It is important to note that the frame buffer isn't actually changed +in the server +until a subsequent \fBcdl_setWCS()\fR call, either directly or through +some other procedure which sets the WCS (e.g. one of the display procedures). +.LP + To get the size of the currently defined frame buffer the user +may call the \fBcdl_getFBConfig()\fR procedure. This returns not only +the current configuration number, but the size as well. To get the size +and any arbitrary configuration without actually setting it, the +\fBcdl_lookupFBSize()\fR procedure may be used. Any configuration not actually +defined in the frame buffer configuration file is returned as the default +512x512 size. + +.us "Synopsis" +.nf + \f(CWvoid cdl_setFBConfig (CDLPtr cdl, int configno)\fR + \f(CWvoid cdl_getFBConfig (CDLPtr cdl, int *configno, int *width, + int *height, int *nframes)\fR + \f(CWvoid cdl_lookupFBSize (CDLPtr cdl, int configno, int *width, + int *height, int *nframes)\fR +.fi +.NH 3 +Automatic Selection +.LP + The \fBcdl_selectFB()\fR procedure may be used to select the most +appropriate frame buffer to use for a given image size. If possible a frame +buffer the same size as the image will be used, otherwise one that is +larger will be chosen. Rather than simply selecting the first configuration +larger than the image, the procedure searches the entire configuration file +selecting the one with the least empty space in both dimensions. If the +\fIreset\fR flag is non-zero this frame is set automatically by the +procedure, otherwise the selected dimension is simply returned to the +calling program. In either case the new frame buffer will not take effect +until a new WCS is defined for the frame. + +.us "Synopsis" +.nf + \f(CWvoid cdl_selectFB (CDLPtr cdl, int nx, int ny, int *fb, + int *w, int *h, int *nf, int reset) +. +.NH 3 +The Frame Buffer Configuration File +.LP + The size of the frame buffer is not passed directly to the server +since this is not part of the communications protocol used. Instead, the +frame buffer number is sent as part of the WCS header packet. So that +both the server and client can know that a particular frame buffer number +corresponds to a specific size, a \fIframe buffer configuration file\fR +is used which both the client and server read. +.LP + The default configuration file is /usr/local/lib/imtoolrc, this can +be overridden by defining an \fBIMTOOLRC\fR environment variable naming +the file to be used, or by creating a .imtoolrc file in your home directory. +Since the server must also read the same file, this must be done before +starting both the client and server applications. +.LP +The format of the frame buffer configuration file is +.sp 0.5 + \fIconfigno nframes width height [extra fields]\fP +.sp 0.5 +e.g. +.sp 0.5 + 1 2 512 512 + 2 2 800 800 + 3 1 1024 1024 # comment + : : : : + +At most 128 frame buffer sizes may be defined, each configuration may define +up to 4 frames, configuration numbers need not be sequential but should be +in ascending order. +.NH 2 +Image WCS Description +.LP + The image WCS is defined using the \fBcdl_setWCS()\fR procedure. The +WCS defines a mapping between any linear coordinate system and the image +pixels, for our purposes we will discuss how the WCS is used to map the frame +buffer pixels to image coordinates. It is passed to the server in a string +of the form: +.sp 0.5 + Image_Name_String\\n a b c d tx ty z1 z2 zt +.sp 0.2 +where: +.sp 0.2 + X' = a*X + c*Y + tx + Y' = b*X + d*Y + ty + +The terms \fIa, b, c\fR, and \fId\fR define a rotation of the WCS wrt the pixel +coordinates, the \fItx\fR and \fIty\fR values are translation terms. The +remaining three values define the intensity mapping of the display pixels; +\fIz1\fR is the minimum pixel value used in the transformation, \fIz2\fR is +the maximum value, and \fIzt\fR defines the type of transformation used (0 for +none, 1 for linear, 2 for log10). +.LP + The WCS may be set explicitly by the calling program or a default +appropriate for the image will be set automatically by the high-level +display procedures, otherwise a WCS for the +frame buffer is defined (i.e. returned coordinates are frame buffer coords). +As an example of how the WCS is defined, the default WCS for an image +IMX x IMY pixels in a frame buffer FBX x FBY pixels is defined as +.sp 0.5 +.nf +\f(CW a = 1.0; /* no rotation */ + b = 0.0; + c = 0.0; + d = -1.0; + tx = (IMX / 2) - (FBX / 2) + 1; /* center in FB */ + ty = (FBY / 2) + (IMY / 2); + z1 = z1; /* zscale values */ + z2 = z2; + zt = 1;\fR +.fi + +.us "Synopsis" +.nf + \f(CWint cdl_setWCS (CDLPtr cdl, char *name, char *title, + float a, float b, float c, float d, float tx, float ty, + float z1, float z2, int zt)\fR + \f(CWint cdl_getWCS (CDLPtr cdl, char *name, char *title, + float *a, float *b, float *c, float *d, float *tx, float *ty, + float *z1, float *z2, int *zt)\fR +.fi +.NH 2 +Image Colormaps +.LP + The IIS protocol used does not permit the downloading of user-defined +colormaps, all images are loaded as raw grayscale values according to the +XImtool colormap model used by currently supported servers. All images +containing private colormaps or more than the 201 grayscale values defined +by the Imtool colormap model must either convert the image to 8-bit +grayscale values by calling the CDL zscale procedures (\fBcdl_computeZscale()\fR +and \fBcdl_zscaleImage()\fR) or scale the images in client code with +user LUTs. The CDL zscale procedures scale image to 201 grayscale values +so that they are displayed to the full 8-bit range, user LUT +transformations or user code for converting to grayscale from a private +colormap procedures should do the same. +.NH 3 +Imtool Color Model +.LP + The IMTOOL color model defines at most 201 grayscale values for use in +displaying the image, a set of 16 static colors are also defined for overlay +graphics. Pixel values sent to the server should be already scaled to this +model, i.e. the image pixels should be scaled to the range 1-200, values +above this will either represent the overlay colors or will wrap around to +8-bit values. The CDL zscale procedures will automatically scale +arbitrary pixel values to use this color model, the overlay procedures +assume color values are defined for the static color range 201-217 but any +8-bit value may be used. +.LP + A summary of the color model values is included below: +.TS +center; +lB lB cB cB lB lB +l l c c l l. +Color Description Color Description +0 Background 208 Cyan +1 - 200 Image data 209 Magenta +201 Cursor (white) 210 Coral +202 Background (black) 211 Maroon +203 White 212 Orange +204 Red 213 Khaki +205 Green 214 Orchid +206 Blue 215 Turquoise +207 Yellow 216 Violet +217 Wheat 218-255 undefined +.TE +.NH 2 +ZScale Intensity Mapping +.LP + Since most display servers are only capable of displaying 8-bit pixel +values, images with more than 8-bits per pixel must be scaled prior to +display. For linear transformations this is typically done using a simple +conversion of the image min/max values to the 256 grayscale values, however +this doesn't produce very good results when most pixel values are near one +of the extremes (usually the image min for astronomical images). To solve +this IRAF uses a \fIzscale\fR mapping algorithm where a sampling grid is used +to approximate the image min/max values rather than computing it directly, +a line is then fit to these sample pixels to determine the optimal +transformation to the display values. This is not only more efficient but +maps the most common pixel values to the display range producing a better image. +.LP + The CDL has several routines for doing the same transformation: the +\fIcdl_computeZscale()\fR procedure is used to compute the optimal \fIz1\fR +and \fIz2\fR +values (the min/max used for the zscale transform) for an image of any pixel +size. The \fIbitpix\fR argument is the number of bits-per-pixel for the input +array and has the same meaning as for the FITS \fIBITPIX\fR keyword. To then +transform the image using these values (or user-defined values) the +\fIcdl_zscaleImage()\fR procedure is used. The input pixels are modified by +this procedure but the array is not reallocated to the smaller size needed by +an 8-bit array. The \fBcdl_setSample()\fR and \fBcdl_setSampleLines()\fR +procedures can be used to change the sampling grid and number of sample +points (the default is 600 points on 5 lines). The \fBcdl_setContrast()\fR +procedure can be used to change the default contrast adjustment to the slope +used in the transformation (the default is 0.25). If a value of zero is +given then the minimum and maximum of the intensity sample is used as the +z1/z2 value. +.LP + Each of the CDL display procedures has a \fIzscale\fR flag to +automatically scale the pixels prior to display. Applications wishing to +set their own z1/z2 values will need to call the zscale procedures and +disable this flag. By default cdl_zscaleImage() will use a linear transform, +the \fBcdl_setZTrans()\fR procedure may be used to change this. Acceptable +values are \fBCDL_UNITARY\fR (zero) for a unitary transform, \fBCDL_LINEAR\fR +(one) for a linear transform, or \fBCDL_LOG\fR (two) for a log10 transform. + +.us "Synopsis" +.nf + \f(CWvoid cdl_computeZscale (CDLPtr cdl, uchar *pix, int nx, + int ny, int bitpix, float *z1, float *z2)\fR + \f(CWvoid cdl_zscaleImage (CDLPtr cdl, uchar **pix, int nx, + int ny, int bitpix, float z1, float z2)\fR + + \f(CWvoid cdl_setZTrans (CDLPtr cdl, int ztrans)\fR + \f(CWvoid cdl_getZTrans (CDLPtr cdl, int *ztrans)\fR + \f(CWvoid cdl_setZScale (CDLPtr cdl, float z1, float z2)\fR + \f(CWvoid cdl_getZScale (CDLPtr cdl, float *z1, float *z2)\fR + + \f(CWvoid cdl_setSample (CDLPtr cdl, int nsample)\fR + \f(CWvoid cdl_setSampleLines (CDLPtr cdl, int nlines)\fR + \f(CWvoid cdl_setContrast (CDLPtr cdl, float contrast)\fR + \f(CWvoid cdl_getSample (CDLPtr cdl, int *nsample)\fR + \f(CWvoid cdl_getSampleLines (CDLPtr cdl, int *nlines)\fR + \f(CWvoid cdl_getContrast (CDLPtr cdl, float *contrast)\fR + +.fi +.NH 2 +Image Hardcopy +.LP + While most servers include some hardcopy capability of their own the +CDL provides two procedures for creating hardcopy images from the client +(e.g. for a batch processing application). The client will typically read +back the entire image, frame buffer, of just a subraster and pass those +pixels to the print procedure. Images will be written as Pseudocolor +Postscript (to preserve the overlay marker colors) and may be disposed to +a file using the \fBcdl_printPixToFile()\fR procedure or to any command string +accepting input from \fIstdin\fR (typically just an 'lpr' command) by using +the \fBcdl_printPix()\fR procedure. + +.us "Synopsis" +.nf + \f(CWint cdl_printPix (CDLPtr cdl, char *cmd, uchar *pix, int nx, + int ny, int annotate)\fR + \f(CWint cdl_printPixToFile (CDLPtr cdl, char *fname, uchar *pix, + int nx, int ny, int annotate)\fR +.fi +.NH 2 +Image Cursor +.LP + The image cursor is read using the \fBcdl_readCursor()\fR procedure. +The returned value is the cursor \fI(x,y)\fR position as floating point value +in terms of the currently define image WCS. Note that this position must +be converted to integer if it is to be used in one of the marker procedures. + +.us "Synopsis" +.nf + \f(CWint cdl_readCursor (CDLPtr cdl, int sample, float *x, + float *y, int *wcs, char *key)\fR +.fi + +The \fIwcs\fR argument is defined as + +.nf + wcs = frame * 100 + wcs_number +.fi + +(where wcs_number=0 for frame buffer coords and 1 for image coords). So, +you can get the frame as simply + +.nf + frame = (int) (wcs / 100) +.fi + +.NH 3 +Cursor Sampling +.LP + If the cdl_readCursor() \fIsample\fR flag is non-zero the \fIlogical +image cursor\fR position is returned immediately, otherwise the display server +will wait for a keystroke before returning the cursor position. The logical +image cursor is the last value set by a \fIcdl_setCursor()\fR call or the last +value returned by a \fIcdl_readCursor()\fR call. When sampling the cursor +position the keystroke value is undefined. +.NH 2 +Image Readout +.LP + The CDL maintains an internal knowledge of where an image has been +positioned if it was displayed using one of the \fIcdl_display*\fR procedures. +The \fBcdl_readImage()\fR procedure may be used to read back the entire image +pixels from the server ignoring the region of the frame buffer outside of +the image, the \fBcdl_readFrameBuffer()\fR procedure will read back the +contents of the entire frame buffer. The dimensions of the array are returned +in the \fInx\fR and \fIny\fR arguments. + +.us "Synopsis" +.nf + \f(CWint cdl_readImage (CDLPtr cdl, uchar **pix, int *nx, + int *ny)\R + \f(CWint cdl_readFrameBuffer (CDLPtr cdl, uchar **pix, + int *nx, int *ny)\R +.fi +.NH 2 +Subraster I/O +.LP + The \fBcdl_writeSubRaster()\fR procedure is used to write an arbitrary +raster to any location in the display. Similarly the +\fBcdl_readSubRaster()\fR procedure is used to read back an arbitrary raster. +When an image has previously been displayed the subraster position is given +in image coordinates (e.g. when writing a subregion of edited pixels), +otherwise the position is in frame buffer coordinates (e.g. to display +multiple images per frame you should use the cdl_writeSubRaster() call). +See the section on \fIMarker Coordinates\fR for further explanation of the +coordinate systems used. + +.us "Synopsis" +.nf + \f(CWint cdl_writeSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar *pix)\fR + \f(CWint cdl_readSubRaster (CDLPtr cdl, int lx, int ly, int nx, + int ny, uchar **pix)\fR +.fi +.NH +Graphics Overlay +.NH 2 +Marker Coordinates +.LP + All marker positions are assumed to be image pixel coordinates, +although there is no requirement that the position be on the image itself. +When an image WCS is defined (using the CDL display procedures or explicitly) +the origin of the coordinates used shifts from the frame buffer lower-left +to the lower-left of the image as displayed in the frame. Negative +positions are allowed and will either refer to empty pixels if the frame +buffer is larger than the image, or pixels outside the frame buffer +boundaries. Raster I/O requests will be clipped to the frame buffer +endpoints, a request completely outside the frame buffer is an error. +.NH 2 +Mapping a Previously Displayed Image +.LP + Ideally any application wishing to draw markers on an image will have +also displayed that image, however the \fBcdl_mapFrame()\fR procedure may +be used to map the requested frame for marker overlay. It does this by +reading the WCS defined for that frame and assumes an image has been +displayed and centered in the frame buffer, then resets the internal CDL +image position. If no image has been displayed the frame buffer is mapped +directly. This can be used for example to map an empty frame for displaying +just the markers without an image, or for mapping another frame's WCS for +use on the current display. The frame is not changed by the procedure call +however the current WCS \fIis\fR changed. + +.us "Synopsis" +.nf + \f(CWint cdl_mapFrame (CDLPtr cdl, int frame)\fR +.fi +.NH 2 +Marking a Coordinate File +.LP + Since a common function for programs will be to mark a list of +coordinates, the high-level \fBcdl_markCoordsFile()\fR procedure is +provided to make this easier. The input parameters include a filename +expected to contain a set of (x,y) points (real or integer), and arguments +specifying the point type, size and color to draw. If the \fIlabel\fR +argument is positive each marker point will be labeled with it's relative +number in the file. The size, type and color arguments all have the same +meaning as for the \fBcdl_markPoint()\fR procedure described below. + +.us "Synopsis" +.nf + \f(CWint cdl_markCoordsFile (CDLPtr cdl, char *fname, int type, + int size, int color, int label)\fR +.fi +.NH 2 +Marker Colors +.LP + Markers may be drawn using any 8-bit value, in order to use the +static overlay colors the color must be in the range 201-217 (see above for +notes on the XImtool color model). The "\fIcdl.h\fR" include file +for C programs, the "\fIcdlftn.inc\fR" include for fortran programs, +or the "\fIcdlspp.h\fR" include for SPP programs, defines the following +symbolic constants for each of the static overlay colors: +.sp 0.5 +.TS +center; +lB l c c lB l. +C_BLACK 202 C_CORAL 210 +C_WHITE 203 C_MAROON 211 +C_RED 204 C_ORANGE 212 +C_GREEN 205 C_KHAKI 213 +C_BLUE 206 C_ORCHID 214 +C_YELLOW 207 C_TURQUOISE 215 +C_CYAN 208 C_VIOLET 216 +C_MAGENTA 209 C_WHEAT 217 +.TE +.NH 2 +Marker Types +.LP + Currently supported marker types include: \fI +.TS +center; +l l l l l. +Point Line Box Polyline Polygon +Circle Circular Annuli Ellipse Elliptical Annuli Text +.TE +.LP + \fRThe "\fIcdl.h\fR" include file for C programs, the +"\fIcdlftn.inc\fR" include for fortran programs, or the "\fIcdlspp.h\fR" +include file SPP programs, defines the following symbolic constants for +each of the defined \fIPoint\fR marker types: +.TS +center; +lB r c c lB r. +M_FILL 1 M_CIRCLE 64 +M_POINT 2 M_STAR 128 +M_BOX 4 M_HLINE 256 +M_PLUS 8 M_VLINE 512 +M_CROSS 16 M_HBLINE 1024 +M_DIAMOND 32 M_VBLINE 2048 +.TE +.LP + Point markers are drawn using the \fBcdl_markPoint()\fR procedure, +point types may be logically \fIOR\fR'd to create composite markers, closed +shapes such as a circles, diamonds, or squares may be \fIOR\fR'd with the +M_FILL flag to flood-fill the point with the current overlay color. +.NH 3 +Point +.LP + The \fBcdl_markPoint()\fR procedure is used to mark a specific point +on the image using one of the marker types listed above. The marker is +centered at the coordinates specified by the \fIx\fR and \fIy\fR arguments, +\fItype\fR is an integer flag indicating what kind of marker to draw and +may be a composite type by logically ORing two or more marker types. +\fISize\fR is the width and height of the marker measured in pixel unxits, +and \fIcolor\fR is the color used to draw the marker. If the \fInumber\fR +argument is greater than zero that number will be drawn next to the point +as a label, creating text labels for point markers can be done using the +\fIcdl_markPointLabel\fR procedure. +.LP + Most marker names are fairly obvious but several are worth special +mention: The M_DIAMOND, M_CIRCLE and M_BOX marker types may be logically +\fIOR\fRed with the M_FILL flag to produce a filled marker type. Unless +\fIOR\fRd with the M_POINT flag all point markers will leave the center +pixel unchanged. The M_HLINE and M_VLINE markers are most useful in +astronomical applications to mark an individual star, they are horizontal +and vertical lines respectively with a gap in the middle third of the marker +(the M_HBLINE and M_VBLINE are identical but with a width of 3 pixels). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPoint (CDLPtr cdl, int x, int y, int number, + int size, int type, int color)\fR + \f(CWint cdl_markPointLabel (CDLPtr cdl, int x, int y, char *label + int size, int type, int color)\fR +.fi +.NH 3 +Line +.LP + The \fBcdl_markLine()\fR procedure is used to draw a line of the +specified color between points (\fIxs,ys\fR) and (\fIxe,ye\fR). +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markLine (CDLPtr cdl, int xs, int ys, int xe, int ye, + int color)\fR +.fi +.NH 3 +Box +.LP + The \fBcdl_markBox()\fR procedure is used to draw a box of the +specified color with endpoints specified by (\fIlx,ly\fR) and (\fIux,uy\fR). +If the \fIfill\fR flag is set the box will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markBox (CDLPtr cdl, int lx, int ly, int ux, int uy, + int fill, int color)\fR +.fi +.NH 3 +Circle +.LP + The \fBcdl_markCircle()\fR procedure is used to draw a circle of the +specified color with a center at (\fIx,y\fR) and radius \fIradius\fR. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircle (CDLPtr cdl, int x, int y, int radius, + int fill, int color)\fR +.fi +.NH 3 +Polyline +.LP + The \fBcdl_markPolyline()\fR procedure is used to draw a line +connecting the \fInpts\fR points specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolyline (CDLPtr cdl, int *xpts, int *ypts, + int npts, int color)\fR +.fi +.NH 3 +Polygon +.LP + The \fBcdl_markPolygon()\fR procedure is used to draw a closed +polygon consisting of \fInpts\fR vertices specified by the \fIxpts\fR and +\fIypts\fR array in the desired \fIcolor\fR. The last point in the array +will automatically be connected to the first point by the procedure. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markPolygon (CDLPtr cdl, int *xpts, int *ypts, + int npts, int fill, int color)\fR +.fi +.NH 3 +Ellipse +.LP + The \fBcdl_markEllipse()\fR procedure is used to draw an ellipse of the +specified color with a center at (\fIx,y\fR) and semimajor-axis \fIxrad\fR +and semiminor-axis \fIyrad\fR pixels long. A rotation angle for the ellipse +may be specified by passing a non-zero \fIangle\fR argument, the angle is +measured in degrees from the positive x-axis. +If the \fIfill\fR flag is set the circle will be filled with the marker color. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipse (CDLPtr cdl, int x, int y, int xrad, + int yrad, float ang, int fill, int color)\fR +.fi +.NH 3 +Circular Annuli +.LP + The \fBcdl_markCircAnnuli()\fR procedure is used to draw +\fInannuli\fR circles separated by \fIsep\fR pixels each. The circle is +centered at (\fIx,y\fR) with an initial radius of \fIradius\fR pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markCircAnnuli (CDLPtr cdl, int x, int y, int radius, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Elliptical Annuli +.LP + The \fBcdl_markEllipAnnuli()\fR procedure is used to draw +\fInannuli\fR ellipses separated by \fIsep\fR pixels each. The ellipse is +centered at (\fIx,y\fR) with an initial semimajor and semiminor axis +specified by the \fIxrad\fR and \fIyrad\fR arguments. Each ellipse will +be optionally rotate by an \fIangle\fR degrees as measured from the positive +x-axis. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markEllipAnnuli (CDLPtr cdl, x, y, xrad, yrad, ang, + int nannuli, int sep, int color)\fR +.fi +.NH 3 +Text +.LP + The \fBcdl_markText()\fR procedure is used to draw a text string +specified by \fIstr\fR argument with an initial position at (\fIx,y\fR) +and optionally rotated by \fIangle\fR degrees as measured from the positive +x-axis. The default \fIsize\fR is 1.0 and is approximately a 6x13 font, +the font size may be scaled by any fractional amount. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_markText (CDLPtr cdl, int x, int y, char *str, + float size, float angle, int color)\fR +.fi +.NH 2 +Text Fonts +.LP + The \fBcdl_setFont()\fR procedure is used to choose between one +of four available fonts as the text marker default: Roman, Greek, Futura, +Bold and Times respectively. By default the Roman font will be used. +The width of the lines used to draw the text may also be set. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWvoid cdl_setFont (CDLPtr cdl, int font)\fR + \f(CWvoid cdl_setTextWidth (CDLPtr cdl, int width)\fR +.fi +.sp 0.5 +A complete listing of the Greek character mappings can be found in the +file 'greek.ps' in the 'doc' subdirectory of the CDL distribution. + The \fIRoman\fR font is the font implemented in the original version +of the CDL and works well for most applications. Both the \fIGreek\fR and +\fITimes\fR fonts are hi-resolution fonts which work best for larger frame +buffers but can produce publication quality text. The \fIFutura\fR font +is a simpler font which can produce better results than the default on small +size frame buffers. A \fIBold\fR font automatically increases the text line +width by one pixel over the current setting and may be used with any font. +.NH 3 +In-Line Font Changes +.LP + Text markers are drawn using the font selected with +the \fIcdl_setFont()\fR +routine, however fonts may be change within a string itself (e.g. to set +a Greek character) using a \\f escape sequence. The escape is followed +by the character 'R' to set a Roman font, 'G' for Greek, 'F' for +futura, 'B' for bold +and 'T' for Times. Any number of escapes are permitted within a string, +the font change will remain in effect until it is changed, or the end of +string at which point any subsequent strings will again be drawn with the +default font. Additionally a 'P' in the escape sequence will change the +font to the one previously used, whatever that may be. +.LP + The CDL also supports a sub/superscripting of text which can only +be done with the font escapes. In this case the escape character followed by +a 'U' produces a superscript and a 'D' produces a subscript. The changes may +be nested permitting several levels of sub/superscripts, these escapes may +also be used in conjunction with a font change to cause the sub/superscript +to be drawn with a different font. A superscript escape will remain in +effect until the end of the string or a \\fD escape is seen. Similarly a +subscript remains in effect until the end of the string of a \\fU escape. +Sub/superscripted text is drawn using a smaller font size, there is presently +no way to specify a different size for the sub/superscripted text. +.TS +center; +cb s +l l. +Summary of Font Escapes +.sp 0.5 +\\\\fR change to Roman font +\\\\fG change to Greek font +\\\\fF change to Futura font +\\\\fT change to Times font +\\\\fB change to bold font +\\\\fP change to previous font +\\\\fU begin relative superscripted text +\\\\fD begin relative subscripted text +.TE +.NH 2 +Line Widths and Styles +.LP + The \fBcdl_setLineWidth()\fR procedure can be used to set the line +width used to draw polygon or polyline markers, point markers will not +be affected. The \fBcdl_setLineStyle()\fR procedure is used to set a line +style other than solid. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWvoid cdl_setLineWidth (CDLPtr cdl, int width)\fR + \f(CWvoid cdl_setLineStyle (CDLPtr cdl, int style)\fR +.fi +.LP + \fRThe "\fIcdl.h\fR" include file for C programs, the +"\fIcdlftn.inc\fR" include for fortran programs, or the "\fIcdlspp.h\fR" +include file SPP programs, defines the following symbolic constants for +each of the defined line styles: +.TS +center; +lB r c c lB r. +L_SOLID 0 L_DASHED 1 +L_DOTTED 2 L_DOTDASH 3 +L_HOLLOW 4 L_SHADOW 5 +.TE +.LP + The \fIhollow\fR line style is drawn with a linewidth of five pixels, +two pixels of color, a black line, and two pixels of color. It is best +used when the marker will traverse extreme changes in brightness, due to the +thickness of the line it may work best with larger frame buffers. The +\fIshadow\fR linestyle is drawn as two pixels of color and two pixels of black +and should be used for similar brightness variations, however it effectively +shows up as a line only two pixels wide and may be preferred for medium or +smaller frame buffers. +.LP + The three dashed linestyles are drawn using "gap" spacings of 5 +pixels in between line segments. Whether or not these gaps are resolved +depends on the size of the frame buffer being used and the magnification +used in the display server. By default they should resolve completely +using frame buffers up to 1024x1024 pixels, or magnification factors +displaying 1024x1024 pixels. If larger sizes are needed the image should +be subsampled prior to display to maintain the marker resolution needed +for these linestyles. + +.NH 2 +Deleting Markers +.LP + When markers are drawn the underlying subraster is first saved to +an internal structure, erasure is done by simply redisplaying the saved +raster. Problems can arise however when markers overlap; when deleting a +marker that is \fIunder\fR another marker the original pixels can overwrite +the pixels of the marker on top. This is an unfortunate side effect of the +simple scheme used in this version of the package, users can call the +\fBcdl_redrawOverlay()\fR procedure to help clean up any artifacts left +behind. +.NH 3 +Individual Markers +.LP + The \fBcdl_deleteMark()\fR procedure is used to delete a single +marker from the display(). The (\fIx,y\fR) argument is either the center +position of the marker if that is know by the application, more typically +it will be an approximate position. In the latter case the marker whose +center is closest to this position will be deleted. For markers with no +defined center the distance used to decide if the marker should be +deleted is the distance from the argument position to the edge of the +marker. For example, distance from a box or polygon is measured as the +distance from to one of the sides, for text it is the distance to the +start of the text string. There is no way to \fIun\fRdelete a marker other +than to redraw it. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_deleteMark (CDLPtr cdl, int x, int y)\fR +.fi +.NH 3 +The Entire Overlay +.LP + To erase all markers currently displayed use the +\fBcdl_clearOverlay()\fR procedure. Markers are erased in the reverse order +they were drawn to help reduce the chance that overlaying markers will leave +stray pixels. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_clearOverlay (CDLPtr cdl)\fR +.fi +.NH 2 +Redraw +.LP + The \fBcdl_redrawOverlay()\fR procedure can be used to redraw all +markers currently in the display list. This is sometimes needed when +subraster I/O procedures are used to redisplay subregions and overwrite +existing markers. +.sp 0.5 +.us "Synopsis" +.nf + \f(CWint cdl_redrawOverlay (CDLPtr cdl)\fR +.fi +.NH +ANSI C Function Prototypes +.LP + The current release of CDL provides full ANSI C function prototypes +for all public and private procedures. By default these will not be used +even on systems with native ANSI compilers, however. +To make use of the CDL prototypes users will +need to define the macro \fBCDL_ANSIC\fR either when compiling the program +(using the -D option to the compiler), +or as a definition in the program source preceding the 'cdl.h' include +directive. +.LP + For example, +.sp 0.5 +.nf + \f(CW#define CDL_ANSIC + #include "cdl.h" + : + main (int argc, char **argv) + :\fR +.fi +.sp 0.5 +or when compiling using something like +.sp 0.5 +.nf + \f(CWcc -DCDL_ANSIC client.c libcdl.a -lm\fR +.fi +.sp 0.5 + Note that when using CDL_ANSIC to build the client program it is +also required that the CDL itself be built in the same way to avoid +confusing FPE errors. Similarly, when building client tasks that \fIdo +not\fR +use CDL_ANSIC you must use a version of the library that has not been +compiled with prototypes. +.LP + The reason is that the float args to the CDL procedures in the +library, or in your task calls, are +promoted to doubles when compiling those procedures, but may only be passed as +floats in your code (or as double where the CDL is expecting float). +This means the argument stack is off by 4 bytes for each float arg and +the values interpreted by the CDL procedure will be corrupted. +If you're going to use the prototypes you'll +need to edit the CDL Imakefile to define "-DCDL_ANSIC" in the EXTRA_DEFINES +so it will use the prototypes and everything will line up. You will then +need to rebuild the libcdl.a as well as relink your program. +.NH +Fortran Language Binding Notes +.LP + The Fortran language binding routines are implemented in C but +should be accessible from any fortran program as though they were real +fortran subroutines. The calling sequences are the same as with the C +library routines with the following exceptions: +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All Fortran functions are +implemented as subroutines. +.IP +\(bu The procedure names are the same except that \fIcdl_\fR has been +replaced with \fIcf\fR in the fortran binding. If your compiler is +case-sensitive then use all lower case letters. +.LP +The binding has been tested on a number of different platforms without +problems. The procedure names haven't been restricted to the traditional +6-character fortran names since most modern compilers can handle longer +names, if yours isn't one of them contact \fIiraf@noao.edu\fR for help +in changing the names. +.LP + Since the CDL is implemented as a set of C routines, the one aspect +that cannot be overlooked in the fortran binding is the between Fortran and +C storage order for arrays. In most cases this will not be a problem since +the CDL routines are just passing around pointers even if they live for a +short while in a fortran program. The problem comes when using the fortran +program to read the arrays, for example in using the array returned by the +\fBcfreadIRAF()\fR procedure, or when passing in arrays for display that +originated in the user's fortran code. In these cases the array \fBmust\fR +be transposed to be interpreted correctly. It was assumed that in most +applications arrays returned by CDL procedures would be immediately passed +to other CDL procedures so having the binding routines +transpose the array to/from +Fortran storage order was unnecessarily inefficient. This may be changed in +later releases if required. + +.NH +SPP Language Binding Notes +.LP + The SPP language binding is experimental and is intended to provide +a way to quickly prototype tasks, it should not be used in production code +as it may not be as portable as the rest of the task. In essence this +binding is a layer on top of the Fortran binding since most IRAF platforms +still use Fortran as the intermediate code. The calling sequences are the +same as with the Fortran library routines with the following caveats: +.IP +\(bu The 'cdlspp.h' SPP include file is required by all files which call +CDL routines. The binding names are actually SPP macros to resolve the +current 6 character limit on procedure names. +.IP +\(bu All character string arguments must be dimensioned to at least SZ_FNAME +characters in length. +.IP +\(bu The CDL package pointer is maintained internally so no 'cdl' pointer is +passed in the fortran interface. +.IP +\(bu All routines which are integer procedures in the C interface return an +extra 'ier' argument to contain the error flag. All SPP functions are +implemented as subroutines. +.IP +\(bu On HPUX or IBM RS6000 systems the 'cdlspp.h' file must be edited to +remove the trailing underscores from the procedure name macros. This is +because on these platforms the fortran compiler will not append an +underscore to the SPP symbols as it does on other platforms. + +.NH +IIS Protocol Description +.LP + The communications protocol used by the CDL and servers such as +\fIXImtool\fR and \fISAOimage\fR, is a slightly modified version of that used +by the IIS Model 70. All operations are initiated by sending a header +packet containing a \fIthing id\fR (tid) and \fIsubunit\fR selecting the +function to be performed, optionally followed by data up to 32K bytes long. +The IIS header packet used is defined as +.nf + \f(CWstruct iism70 { + short tid; + short thingct; + short subunit; + short checksum; + short x, y, z; + short t; + };\fR +.fi + +The \fIthing count\fR field contains the negative number of bytes of data +that will be sent following the header packet. The IIS header checksum is +computed as +.nf +\f(CW + checksum = 0177777 - (tid + subunit + thingct + x + y + z + t); +\fR +.fi +The four IIS registers are set differently depending on the operation, a +summary of the header packets for each operation is summarized below. + +.KS +.ce 1 +\fBIIS Header Packet Summary\fR +.TS +tab(:); +c c c c c c c c c. +:TID:Subunit:Thingct:X:Y:Z:T:Data +.T& +l | l | l | c | c | c | l | l | l |. +:_:_:_:_:_:_:_:_ +Read Data:IIS_READ\fB|\fPPACKED:MEMORY:-nbytes:x:y:frame:-:nbytes +Write Data:IIS_WRITE\fB|\fPPACKED:MEMORY:-nbytes:x:y:frame:-:nbytes +Read Cursor:IIS_READ:IMCURSOR:-:-:-:-:-:- +Write Cursor:IIS_WRITE:IMCURSOR:-:x:y:wcs:-:- +Set Frame:IIS_WRITE:LUT\fB|\fPCOMMAND:-1:-:-:-:-:2 +Write WCS:IIS_WRITE\fB|\fPPACKED:WCS:-N:-:-:frame:fb:N +Read WCS:IIS_READ:WCS:-:-:-:frame:wcs:320 +Erase Frame:IIS_WRITE \fB|\fP fb:FEEDBACK:-:-:-:frame:-:- +:_:_:_:_:_:_:_:_ +.TE +.KE +.TS +l l l. +Where nbytes = number of bytes expected or written + x = x position of operation in frame buffer coords + y = y position of operation in frame buffer coords + frame = frame number (passed as bitflag (i.e. 1, 2 ,4 8, etc) + fb = frame buffer config number (zero indexed) + N = length of WCS string + wcs = WCS number (usually zero) + Data = the number of bytes of data to be read or written following the header packet. + + IIS_WRITE = 0400000 + IIS_READ = 0100000 + COMMAND = 0100000 + PACKED = 0040000 + IMC_SAMPLE = 0040000 + + MEMORY = 001 + LUT = 002 + FEEDBACK = 005 + IMCURSOR = 020 + WCS = 021 +.TE +.LP +TID fields can be logically OR'd with the PACKED flag indicating the number +of data bytes is exactly \fIthingct\fR bytes long, otherwise \fIthingct\fR +must be specified as half the number of data bytes. In a cursor read, if +the IIS_READ flag is OR'd with IMC_SAMPLE the logical cursor position (i.e. +the last value read or set) is returned immediately, otherwise the server +will wait for a keystroke to be hit before returning a string containing the +(x,y) position, wcs of the read, and the keystroke. When setting the frame +you must send a short integer in the data containing the frame selected. + +.NH +VXIMTOOL Proxy/Display Server Usage +.LP +\fIVXIMTOOL\fR is a image display server process much like \fIXIMTOOL\fR, +except that all it normally does is respond to datastream requests +to read and write to internal frame buffers maintained as arrays in memory. +Multiple frame buffers and frame buffer configurations are supported. It +can be used to debug CDL programs by printing out the +protocol packets received, or can simply be used as a dummy server in cases +where no image display is really needed. By enabling the \fI-proxy\fR +flag the server can also be used to repeat the datastream requests to a +list of other servers, effectively splitting the image display to a number +of other servers. See the \fIvximtool\fR man page for details on other +command-line arguments and usage. +.LP +The program was originally intended as a debugging tool, either in the +development of CDL clients directly or in cases where the display may +need to go to separate screens as part of a larger project. For example, +engineers may wish to "eavesdrop" on the system by viewing images displayed +by CDL clients used as part of a data acquisition system. It can also be +used as a memory-only display server for CDL clients which need to be run +in the background as part of a pipeline processing system requiring a +frame buffer for image marking. +.LP +In proxy mode the program acts as a relay for the IIS datastream packets, +sending image data, frame requests, etc. to a list of other servers specified +on the command line. The effect of this is to allow a client to display to +this program which then re-displays to each of the other named servers. +Of course CDL clients can also do this internally by opening multiple +connections, using \fIvximtool\fR in proxy mode adds the functionality to +programs which may use this feature only ocasionally. A maximum of 8 servers +may be named, they may be either on the local host or a remote machine +and connections can be established using either fifos or sockets. See +above or the \fIvximtool\fR man page for details on how to specify the +server connection. +.LP +The current implementation has a few restrictions users should keep in mind: +.IP +\(bu The time to display an image or perform any output operation scales +with the number of connected hosts. Each IIS packet is forwarded to each +host in turn before processing the next input packet, and connection over a slow +network will delay the entire process. +.IP +\(bu Cursor and image readback are done by sending the request \fIonly\fR to +the first server named on the command line. This is done to avoid forcing +a cursor mode on all servers which cannot be terminated when a response is +received from only one server, and means that the first server named should +be the one used to control interactive sessions. The remaining servers +however can still respond to cursor requests from other applications +connected to that server on another channel. +.IP +\(bu All named servers must be running prior to starting the proxy server. +The connection to the remote servers is established when this task is first +run and if no server is running that connection will be ignored. The task will +exit if no remote servers can be found for display. +.IP +\(bu Any connected server that shuts down while the proxy server is running +is likely to cause the program to crash on the next display. +.bp +.NH +C Interface Summary +.LP +.in 0.5i +#include "\fBcdl.h\fR" +.in -0.5i + +.TS +center; +r l. +CDLPtr \fBcdl_open\fR (imtdev) +int \fBcdl_displayPix\fR (cdl, pix, nx, ny, bitpix, frame, fbconfig, zscale) +char \fBcdl_readCursor\fR (cdl, sample, x, y, wcs, key) +int \fBcdl_setCursor\fR (cdl, x, y, wcs) +int \fBcdl_setWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +int \fBcdl_getWCS\fR (cdl, name, title, a, b, c, d, tx, ty, z1, z2, zt) +void \fBcdl_setFrame\fR (cdl, frame) +int \fBcdl_clearFrame\fR (cdl) +void \fBcdl_close\fR (cdl) + +int \fBcdl_displayIRAF\fR (cdl, fname, band, frame, fbconfig, zscale) +int \fBcdl_isIRAF\fR (fname) +int \fBcdl_readIRAF\fR (fname, band, pix, nx, ny, bitpix, title) + +int \fBcdl_displayFITS\fR (cdl, fname, frame, fbconfig, zscale) +int \fBcdl_isFITS\fR (fname) +int \fBcdl_readFITS\fR (fname, pix, nx, ny, bitpix, title) + +void \fBcdl_computeZscale\fR (cdl, pix, nx, ny, bitpix, z1, z2) +void \fBcdl_zscaleImage\fR (cdl, pix, nx, ny, bitpix, z1, z2) + +int \fBcdl_printPix\fR (cdl, cmd, pix, nx, ny, annotate) +int \fBcdl_printPixToFile\fR (cdl, fname, pix, nx, ny, annotate) + +int \fBcdl_readImage\fR (cdl, pix, nx, ny) +int \fBcdl_readFrameBuffer\fR (cdl, pix, nx, ny) +int \fBcdl_readSubRaster\fR (cdl, lx, ly, nx, ny, pix) +int \fBcdl_writeSubRaster\fR (cdl, lx, ly, nx, ny, pix) + +void \fBcdl_selectFB\fR (cdl, nx, ny, fb, w, h, nf, reset) +void \fBcdl_setFBConfig\fR (cdl, configno) +void \fBcdl_getFBConfig\fR (cdl, configno, w, h, nf) +void \fBcdl_lookupFBSize\fR (cdl, configno, w, h, nf) + +void \fBcdl_setZTrans\fR (cdl, ztrans) +void \fBcdl_setZScale\fR (cdl, z1, z2) +void \fBcdl_setSample\fR (cdl, nsample) +void \fBcdl_setSampleLines\fR (cdl, nlines) +void \fBcdl_setContrast\fR (cdl, contrast) +void \fBcdl_setName\fR (cdl, imname) +void \fBcdl_setTitle\fR (cdl, imtitle) + +void \fBcdl_getFrame\fR (cdl, frame) +void \fBcdl_getZTrans\fR (cdl, ztrans) +void \fBcdl_getZScale\fR (cdl, z1, z2) +void \fBcdl_getSample\fR (cdl, nsample) +void \fBcdl_getSampleLines\fR (cdl, nlines) +void \fBcdl_getContrast\fR (cdl, contrast) +void \fBcdl_getName\fR (cdl, imname) +void \fBcdl_getTitle\fR (cdl, imtitle) + +int \fBcdl_mapFrame\fR (cdl, frame) +int \fBcdl_markCoordsFile\fR (cdl, fname, type, size, color, label) +int \fBcdl_markPoint\fR (cdl, x, y, number, size, type, color) +int \fBcdl_markPointLabel\fR (cdl, x, y, label, size, type, color) +int \fBcdl_markLine\fR (cdl, xs, ys, xe, ye, color) +int \fBcdl_markBox\fR (cdl, lx, ly, ux, uy, fill, color) +int \fBcdl_markPolygon\fR (cdl, xarray, yarray, npts, fill, color) +int \fBcdl_markPolyline\fR (cdl, xarray, yarray, npts, color) +int \fBcdl_markCircle\fR (cdl, x, y, radius, fill, color) +int \fBcdl_markCircAnnuli\fR (cdl, x, y, radius, nannuli, sep, color) +int \fBcdl_markEllipse\fR (cdl, x, y, xrad, yrad, rotang, fill, color) +int \fBcdl_markEllipAnnuli\fR (cdl, x, y, xrad, yrad, ang, nannuli, sep, color) +int \fBcdl_markText\fR (cdl, x, y, str, size, angle, color) +int \fBcdl_setFont\fR (cdl, font) +int \fBcdl_setTextWidth\fR (cdl, width) +int \fBcdl_setLineWidth\fR (cdl, width) +int \fBcdl_setLineStyle\fR (cdl, style) +int \fBcdl_deleteMark\fR (cdl, x, y) +int \fBcdl_clearOverlay\fR (cdl) +int \fBcdl_redrawOverlay\fR (cdl) +.TE + +.bp +.NH +C Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include "cdl.h" + +/* \fIDISPLAY -- Example task to display an image as a command-line task. + * This task is meant to show three ways the CDL can be used to display + * an image, see the code comments for a description of each method. + * + * Examples: + * To display a simple IRAF or FITS file: + * % ./display -frame 2 image.imh + * % ./display image.fits + * + * To display a FITS file as a raw image: + * % ./display -nx 512 -ny 512 -depth 16 -hskip 5760 -raw dpix.fits + * + * Usage: + * display [-depth N] [-fits] [-frame N] [-fbconfig N] [-hskip N] + * [-iraf] [-nozscale] [-nx N] [-ny N] [-raw] [-zscale] file\fP + */ + +#define NONE -1 +#define IRAF 0 +#define FITS 1 +#define RAW 2 + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname, title[128]; + int i, status = 0, frame = 1, fbconfig = 0, zscale = 1; + int format = NONE, nx = 0, ny = 0, depth = 8, hskip = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strcmp (argv[i], "-depth") == 0) depth = atoi (argv[++i]); + else if (strcmp (argv[i], "-fits") == 0) format = FITS; + else if (strcmp (argv[i], "-frame") == 0) frame = atoi (argv[++i]); + else if (strcmp (argv[i], "-fbconfig") == 0) fbconfig = atoi (argv[++i]); + else if (strcmp (argv[i], "-hskip") == 0) hskip = atoi (argv[++i]); + else if (strcmp (argv[i], "-iraf") == 0) format = IRAF; + else if (strcmp (argv[i], "-nozscale") == 0) zscale = 0; + else if (strcmp (argv[i], "-nx") == 0) nx = atoi (argv[++i]); + else if (strcmp (argv[i], "-ny") == 0) ny = atoi (argv[++i]); + else if (strcmp (argv[i], "-raw") == 0) format = RAW; + else if (strcmp (argv[i], "-zscale") == 0) zscale = 1; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + fname = argv[argc-1]; + + /* \fIMETHOD 1: Displays the image using the high-level format display + * call. Display as an IRAF image if the option was set indicating + * this is the format, otherwise test the file to see if it is anyway.\fP + */ + if (format == IRAF || (format == NONE && \fBcdl_isIRAF\fP (fname))) { + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, FB_AUTO, zscale); + + /* \fIMETHOD 2: Uses the CDL procedure for getting image pixels from + * a known format, minimal work required to display an image. The + * point here is that you can use this method to process the image + * yourself prior to display, e.g. subsample the pixels, apply a user + * LUT, etc but still use the CDL to get the raw image and do the + * display.\fP + */ + } else if (format == FITS || (format == NONE && \fBcdl_isFITS\fP (fname))) { + + /* \fIGet the FITS image pixels, exit w/ an error status if something + * went wrong, the procedure will print what that was.\fP + */ + if (\fBcdl_readFITS\fP (fname, &pix, &nx, &ny, &depth, title)) { + \fBcdl_close\fP (cdl); /* close the package */ + exit (1); /* exit w/ error code */ + } + + /* \fINow select a frame buffer large enough for the image. The + * fbconfig number is passed in the WCS packet, but the display + * call below will compute the correct WCS for the image and + * transmit that prior to display, all we're doing here is + * setting up the FB to be used.\fP + */ + if (fbconfig == 0) + cdl_selectFB (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 0); + + /* \fILastly, display the pixels to the requested frame, do any + * zscaling requested using the CDL procedure.\fP + */ + status = \fBcdl_displayPix\fP (cdl, pix, nx, ny, depth, frame, + fbconfig, zscale); + + /* \fIMETHOD 3: Displays an image of raw pixels. The client code is + * responsible for reading the image and calling all the procedures + * needed for image display, initialize the frame, zscaling pix, etc. + * While we assume a simple raster format in this program, the user + * code can read a compressed image format such as GIF, mosaic multiple + * images for display as a single image, or just about anything that + * produces a raster for display. The intent here is to show all the + * lowest level calls needed for displaying the image.\fP + */ + } else if (format == RAW) { + FILE *fd; + int lx, ly; + + if (nx == 0 || ny == 0) { + fprintf (stderr, "No size given for raw data.\\n"); + exit (1); + } + + /* \fIOpen the image file if we can.\fP */ + if (fd = fopen (fname, "r")) { + + /* \fISeek to the offset specified.\fP */ + lseek (fileno(fd), (off_t) hskip, SEEK_SET); + + /* \fIAllocate the pixel pointer and read the data.\fP */ + pix = (unsigned char *) malloc (nx * ny * (depth / 8)); + fread (pix, depth/8, nx * ny, fd); + + /* \fIIf we're zscaling and depth is more than 8-bits, do that.\fP */ + if (zscale && depth > 8) { + \fBcdl_computeZscale\fP (cdl, pix, nx, ny, depth, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, nx, ny, depth, z1, z2); + } + + /* \fINow select a frame buffer large enough for the image. We'll + * ask that this be reset but the change won't go to the server + * until we send in a WCS, so compute that as well. For the + * WCS we assume a simple linear transform where the image is + * Y-flipped, the (x,y) translation is computed so it is correct + * for an frame buffer >= than the image size.\fP + */ + \fBcdl_selectFB\fP(cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf,1); + \fBcdl_setWCS\fP (cdl, fname, NULL, 1., 0., 0., -1., + (float) (nx / 2) - (fb_w / 2) + 1, /* \fIX trans.\fP */ + (float) (fb_h / 2) + (ny / 2), /* \fIY trans.\fP */ + z1, z2, CDL_LINEAR); /* \fIZ transform\fP */ + + /* \fISelect and clear the requested frame prior to display.\fP */ + \fBcdl_setFrame\fP (cdl, frame); + \fBcdl_clearFrame\fP (cdl); + + /* \fINow display the pixels. We'll compute the image placement + * ourselves and write the image as a raw subraster of the frame + * buffer. In this case we'll center the image, but the CDL + * cdl_writeSubRaster() procedure can be used to write arbitrary + * rasters at any point in the frame buffer.\fP + */ + lx = (fb_w / 2) - (nx / 2); + ly = fb_h - ((fb_h / 2) + (ny / 2)); + status = \fBcdl_writeSubRaster\fP (cdl, lx, ly, nx, ny, pix); + } else + status = 1; + } else { + if (access (fname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image does not exist.\\n", fname); + status = 1; + } + + /* \fINow just free the pixel pointer to clean up.\fP */ + if (pix) + free ((unsigned char *) pix); + \fBcdl_close\fP (cdl); /* \fIclose the package\fP */ + exit (status); +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Interactive Graphics Overlay Example +.LP +.ps -2 +.vs -2 +.nf +\f(CW +#include <stdio.h> +#include <unistd.h> +#include <math.h> +#include "cdl.h" + +/* \fI + * TVMARK -- Example task for displaying an marking images. This program + * can be used to either display an image and overlay points defined in + * a coordinate file, map an existing display frame for marking, or option- + * ally enter a cursor command loop after either of these providing other + * marking capability. All options support minimum match. + * + * Examples: + * % tvmark dpix.fits + * % tvmark -coords coords -color 205 dpix.fits + * % tvmark -frame 2 + * % tvmark -coords coords -interactive dpix.fits + * + * Usage: + * tvmark [-frame N] [-fbconfig N] [-coords <file>] [-size N] [-color N] + * [-nolabel] [-fill] [-interactive] [image]\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, *cfname = NULL; + int i, status = 0, fill = 0, frame = 1, fb = FB_AUTO, zscale = 1; + int color = 201, label = 1, size = 9, interactive = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp(argv[i], "-color",4) == 0) color = atoi (argv[++i]); + else if (strncmp(argv[i], "-coords",4) == 0) cfname = argv[++i]; + else if (strncmp(argv[i], "-fbconfig",3) == 0) fb = atoi (argv[++i]); + else if (strncmp(argv[i], "-fill",4) == 0) fill = 1; + else if (strncmp(argv[i], "-frame",3) == 0) frame = atoi (argv[++i]); + else if (strncmp(argv[i], "-interactive",4) == 0) interactive = 1; + else if (strncmp(argv[i], "-nolabel",4) == 0) label = 0; + else if (strncmp(argv[i], "-nozscale",4) == 0) zscale = 0; + else if (strncmp(argv[i], "-size",2) == 0) size = atoi (argv[++i]); + else + fname = argv[i]; + } + } + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIIf an image was specified display it first, otherwise assume the + * image has already been loaded in the frame and mark that.\fP + */ + if (fname) { + if (\fBcdl_isIRAF\fP (fname)) + status = \fBcdl_displayIRAF\fP (cdl, fname, 1, frame, fb, zscale); + else if (\fBcdl_isFITS\fP (fname)) + status = \fBcdl_displayFITS\fP (cdl, fname, frame, fb, zscale); + else { + if (access (cfname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\\n", fname); + else + fprintf (stderr, "'%s': image doesn't exist.\\n", fname); + status = 1; + } + if (status) goto err_; + } else { + + /* \fIIf we've requested a special frame buffer, set it now.\fP */ + if (fb > 0) + \fBcdl_setFBConfig\fP (cdl, fb); + + /* \fIMap the current display frame for use as an image.\fP */ + \fBcdl_mapFrame\fP (cdl, frame); + } + + /* \fIIf a coordinate file was specified read the file and mark those + * coords with points.\fP + */ + if (cfname) + \fBcdl_markCoordsFile\fP (cdl, cfname, M_STAR, size, color, label); + + /* \fILastly, start up an interactive cursor loop if needed.\fP */ + if (interactive) + tvmInteractive (cdl, label, fill, color, size); + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} + +/* \fITVMINTERACTIVE -- Process commands interactively.\fP */ + +tvmInteractive (cdl, label, fill, color, size) +CDLPtr cdl; +int label, fill, color, size; +{ + float angle = 0.0, rx, ry, txsize = 1.; + int nx, ny, i, x, y, x2, y2, wcs; + int number=1, radius=11, xrad=11, yrad=6, nannuli=3, sep=5; + char key, cmd[SZ_NAME], str[SZ_NAME]; + unsigned char *pix; + + /* \fIProcess commands until a 'q' keystroke is hit.\fP */ + while (\fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key) != 'q') { + x = (int) (rx + 0.5); /* \fIconvert to int pixels\fP */ + y = (int) (ry + 0.5); + + switch (key) { + case ':': /* \fIprocess a colon command\fP */ + putchar (':'); + gets (str); + for (i=0; str[i] != ' ' && str[i]; i++) + cmd[i] = str[i]; + cmd[i++] = '\0'; + + if (strcmp (cmd, "angle") == 0) angle = atof (&str[i]); + else if (strcmp (cmd, "color") == 0) color = atoi (&str[i]); + else if (strcmp (cmd, "fill") == 0) fill = atoi (&str[i]); + else if (strcmp (cmd, "number") == 0) number = atoi (&str[i]); + else if (strcmp (cmd, "nannuli") == 0) nannuli = atoi (&str[i]); + else if (strcmp (cmd, "label") == 0) label = atoi (&str[i]); + else if (strcmp (cmd, "sep") == 0) sep = atoi (&str[i]); + else if (strcmp (cmd, "size") == 0) size = atoi (&str[i]); + else if (strcmp (cmd, "txsize") == 0) txsize = atof (&str[i]); + else if (strcmp (cmd, "xrad") == 0) xrad = atoi (&str[i]); + else if (strcmp (cmd, "yrad") == 0) yrad = atoi (&str[i]); + else if (strcmp (cmd, "print") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPix\fP (cdl, NULL, pix, nx, ny, 1); + } else if (strcmp (cmd, "snap") == 0) { + \fBcdl_readFrameBuffer\fP (cdl, &pix, &nx, &ny); + \fBcdl_printPixToFile\fP (cdl, &str[i], pix, nx, ny, 1); + } else if (strcmp (cmd, "status") == 0) { + printf ("angle = %-5.3g\tcolor = %d\t", angle, color); + printf ("fill = %-5d\tnumber = %d\\n", fill, number); + printf ("nannuli = %-5d\tsep = %d\t", nannuli, sep); + printf ("size = %-5d\ttxsize = %g\\n", size, txsize); + printf ("xrad = %-5d\tyrad = %d\t", xrad, yrad); + printf ("label = %-5d\\n", label); + } + break; + + case '?': + /* ......\fIhelp procedures\fP */ + break; + + case 'p': /* \fIplus mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_PLUS, color); + break; + case 'x': /* \fIcross mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CROSS, color); + break; + case '.': /* \fIpoint mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_POINT, color); + break; + case '*': /* \fIstar mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_STAR, color); + break; + case '_': /* \fIhoriz dash mark\fP*/ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_HBLINE, color); + break; + case '|': /* \fIvert dash mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_VBLINE, color); + break; + case 'o': /* \fIcircle mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_CIRCLE|fill, color); + break; + case 's': /* \fIsquare mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_BOX|fill, color); + break; + case 'v': /* \fIdiamond mark\fP */ + \fBcdl_markPoint\fP (cdl, x, y, (label ? number++ : 0), size, M_DIAMOND|fill, color); + break; + + case 'b': /* \fIBox\fP */ + printf ("Hit another key to define the box...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markBox\fP (cdl, x, y, x2, y2, fill, color); + break; + case 'c': /* \fICircle\fP */ + printf ("Hit another key to set radius ...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + radius = (int) sqrt ((double) ((x2-x)*(x2-x) + (y2-y)*(y2-y))); + \fBcdl_markCircle\fP (cdl, x, y, radius, fill, color); + break; + case 'd': /* \fIDelete marker\fP */ + \fBcdl_deleteMark\fP (cdl, x, y); + break; + case 'e': /* \fIEllipse\fP */ + \fBcdl_markEllipse\fP (cdl, x, y, xrad, yrad, angle, fill, color); + break; + case 'l': /* \fILine\fP */ + printf ("Hit another key to set line endpoint...\\n"); + (void) \fBcdl_readCursor\fP (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + 0.5); y2 = (int) (ry + 0.5); + \fBcdl_markLine\fP (cdl, x, y, x2, y2, color); + break; + case 't': /* \fIText string\fP */ + printf ("Text string: "); + gets (str); + \fBcdl_markText\fP (cdl, x, y, str, txsize, angle, color); + break; + case 'C': /* \fICircular annuli\fP*/ + \fBcdl_markCircAnnuli\fP (cdl, x, y, radius, nannuli, sep, color); + break; + case 'D': /* \fIDelete all markers\fP*/ + \fBcdl_clearOverlay\fP (cdl); + break; + case 'E': /* \fIElliptical annuli\fP*/ + \fBcdl_markEllipAnnuli\fP (cdl, x, y, xrad, yrad, angle, nannuli, sep, color); + break; + default: + break; + } + } +} +\fR +.fi +.vs +2 +.ps +2 +.bp +.NH 2 +Image Mosaic Example +.LP +.in 0.5i +.ps -2 +.vs -2 +.nf +#include <stdio.h> +#include <unistd.h> +#\fBinclude "cdl.h"\fP + +/* \fIMOSAIC -- Example task to mosaic several images on a display. Demonstrates + * usage of low-level routines for complex display operations.\fP + */ + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, title[128]; + int i, j, k, status=0, label=0, frame=1, fb=FB_AUTO, zscale=1; + int sample=1, pad=0, col=204, imx, imy, bitpix, nimages, nim; + int ii, xinit, rowx, rowy, nnx, nny, fb_w, fb_h, nf, mx, my, nx, ny; + float z1, z2; + unsigned char *pix = NULL; + + /* \fIProcess the command line options.\fP */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp (argv[i], "-fbconfig",3) == 0) fb=atoi(argv[++i]); + else if (strncmp (argv[i],"-frame",3) == 0) frame=atoi(argv[++i]); + else if (strncmp (argv[i],"-color",3) == 0) col=atoi(argv[++i]); + else if (strncmp (argv[i],"-label",4) == 0) label=1; + else if (strncmp (argv[i],"-nozscale",4) == 0) zscale=0; + else if (strncmp (argv[i],"-nx",3) == 0) nx=atoi(argv[++i]); + else if (strncmp (argv[i],"-ny",3) == 0) ny=atoi(argv[++i]); + else if (strncmp (argv[i],"-pad",4) == 0) pad=atoi(argv[++i]); + else if (strncmp (argv[i],"-sample",4) == 0) sample=atoi(argv[++i]); + else + break; + } + } + nimages = argc - i; + + /* \fIOpen the package and a connection to the server.\fP */ + if (!(cdl = \fBcdl_open\fP ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* \fIClear the frame to begin.\fP */ + (void) \fBcdl_clearFrame\fP (cdl); + + /* \fILoop over each of the images in the list.\fP */ + nim = rowx = rowy = nnx = nny = 0; + for (k=0; k < ny && nim < nimages; k++) { + rowy += nny + pad; + for (rowx = xinit, j=0; j < nx && nim < nimages; j++) { + + /* \fIGet the image name for display.\fP */ + fname = argv[i++]; + + /* \fIFigure out what kind of image it is and get the pixels.\fP */ + if (cdl_isIRAF (fname)) + status = \fBcdl_readIRAF\fP (fname, 1, &pix, &imx, &imy, &bitpix, title); + else if (cdl_isFITS (fname)) + status = \fBcdl_readFITS\fP (fname, &pix, &imx, &imy, &bitpix, title); + else { + fprintf(stderr, "'%s': unknown or nonexistant image.\\n", fname); + status = 1; + } + if (status) goto err_; + + /* \fICompute subsampled image size.\fP */ + if (sample > 1) + nnx = imx / sample, nny = imy / sample; + else + nnx = imx, nny = imy; + + /* \fIUnless we asked for a specific FB size find one large enough + * to handle the mosaic. We don't check to be sure what's + * returned is really large enough.\fP + */ + if (nim == 0 && fb == FB_AUTO) + \fBcdl_selectFB\fP (cdl, nx*nnx+(pad*(nx-1)), ny*nny+(pad*(ny-1)), &fb, &fb_w, &fb_h, &nf, 1); + else { + \fBcdl_setFBConfig\fP (cdl, fb); + \fBcdl_lookupFBSize\fP (cdl, fb, &fb_w, &fb_h, &nf); + } + + /* \fIDefine a WCS for the frame.\fP */ + \fBcdl_setWCS\fP (cdl, "image mosaic", title, 1., 0., 0., -1., 0., (float) ny*imy+(pad*(ny+1)), 1., 255., 1); + + /* \fIThe first time through figure out the placement so the + * entire mosaic is centered in the frame.\fP + */ + if (nim == 0) { + mx = (nx * nnx) + pad * (nx-1); + my = (ny * nny) + pad * (ny-1); + rowy = (fb_h - my) / 2; + xinit = rowx = (fb_w - mx) / 2; + } + + /* \fICompute the zscaled imaged pixels.\fP */ + if (zscale) { + \fBcdl_computeZscale\fP (cdl, pix, imx ,imy, bitpix, &z1, &z2); + \fBcdl_zscaleImage\fP (cdl, &pix, imx ,imy, bitpix, z1, z2); + } + + /* \fISubsample the image if requested.\fP */ + if (sample > 1) { + int l, m, n=0; + for (l=0; l < imy; l+=sample) + for (m=0; m < imx; m+=sample) + pix[n++] = pix[(l*imx)+m]; + } + + /* \fIWrite the image to the frame buffer.\fP */ + if (\fBcdl_writeSubRaster\fP (cdl, rowx, rowy, nnx, nny, pix)) goto err_; + + /* \fIDraw the image name as a label.\fP */ + if (label) \fBcdl_markText\fP (cdl, rowx+10, rowy+10, fname, 1., 0., col); + + nim++; rowx += nnx + pad; + } + } + + /* \fIClose the package and clean up.\fP */ +err_: \fBcdl_close\fP (cdl); + exit (status); +} +.fi +.vs +2 +.ps +2 +.in -0.5i + +.bp +.NH +Fortran Interface Summary +.LP +.in 0.5i +include "\fBcdlftn.inc\fR" +.in -0.5i + +.TS +center; +r l. +\fBcfopen\fR (imtdev, ier) +\fBcfdisplayPix\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBcfreadCursor\fR (sample, x, y, key, ier) +\fBcfsetCursor\fR (x, y, wcs, ier) +\fBcfsetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfgetWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcfsetFrame\fR (frame) +\fBcfclearFrame\fR (ier) +\fBcfclose\fR () + +\fBcfdisplayIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBcfisIRAF\fR (fname, isiraf) +\fBcfreadIRAF\fR (fname, band, pix, nx, ny, bitpix, title, ier) + +\fBcfdisplayFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBcfisFITS\fR (fname, isfits) +\fBcfreadFITS\fR (fname, pix, nx, ny, bitpix, title, ier) + +\fBcfcomputeZscale\fR (pix, nx, ny, bitpix, z1, z2) +\fBcfzscaleImage\fR (pix, nx, ny, bitpix, z1, z2) + +\fBcfprintPix\fR (cmd, pix, nx, ny, annotate, ier) +\fBcfprintPixToFile\fR (fname, pix, nx, ny, annotate, ier) + +\fBcfreadImage\fR (pix, nx, ny, ier) +\fBcfreadFrameBuffer\fR (pix, nx, ny, ier) +\fBcfreadSubRaster\fR (lx, ly, nx, ny, pix, ier) +\fBcfwriteSubRaster\fR (lx, ly, nx, ny, pix, ier) + +\fBcfselectFB\fR (nx, ny, fb, w, h, nf, reset) +\fBcfsetFBConfig\fR (configno) +\fBcfgetFBConfig\fR (configno, w, h, nf) +\fBcflookupFBSize\fR (configno, w, h, nf) + +\fBcfsetZTrans\fR (ztrans) +\fBcfsetZScale\fR (z1, z2) +\fBcfsetSample\fR (nsample) +\fBcfsetSampleLines\fR (nlines) +\fBcfsetContrast\fR (contrast) +\fBcfsetName\fR (imname) +\fBcfsetTitle\fR (imtitle) + +\fBcfgetFrame\fR (frame) +\fBcfgetZTrans\fR (ztrans) +\fBcfgetZScale\fR (z1, z2) +\fBcfgetSample\fR (nsample) +\fBcfgetSampleLines\fR (nlines) +\fBcfgetContrast\fR (contrast) +\fBcfgetName\fR (imname) +\fBcfgetTitle\fR (imtitle) + +\fBcfmapFrame\fR (frame, ier) +\fBcfmarkPoint\fR (x, y, number, size, type, color, ier) +\fBcfmarkcoordsfile\fR (fname, type, size, color, label, ier) +\fBcfmarkPointLabel\fR (x, y, label, size, type, color, ier) +\fBcfmarkLine\fR (xs, ys, xe, ye, color, ier) +\fBcfmarkBox\fR (lx, ly, ux, uy, fill, color, ier) +\fBcfmarkPolygon\fR (xarray, yarray, npts, fill, color, ier) +\fBcfmarkPolyline\fR (xarray, yarray, npts, color, ier) +\fBcfmarkCircle\fR (x, y, radius, fill, color, ier) +\fBcfmarkCircAnnuli\fR (x, y, radius, nannuli, sep, color, ier) +\fBcfmarkEllipse\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBcfmarkEllipAnnuli\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBcfmarkText\fR (x, y, str, size, angle, color, ier) +\fBcfsetfont\fR (font) +\fBcfsettextwidth\fR (width) +\fBcfsetlwidth\fR (width) +\fBcfsetlstyle\fR (style) +\fBcfdeleteMark\fR (x, y, ier) +\fBcfclearOverlay\fR (ier) +\fBcfredrawOverlay\fR (ier) +.TE +.bp +.NH +Fortran Example Tasks +.LP + The examples shown here are for demonstration purposes only. They +are based on working example tasks in the CDL source \fIexamples\fR +subdirectory, see the programs there for the full program listing. + +.NH 2 +Display Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ======================================================================== +C FDISPLAY -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for displaying images. +C ======================================================================== + + PROGRAM FDISPLAY + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + if (ier .gt. 0) then + write (*,*) 'open: Error return from CDL' + goto 999 + endif + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fIUnrecognized image, punt and exit.\fP + write (*,*) 'Unrecognized image format' + endif + endif + +C \fIClean up and exit.\fP +999 continue + call \fBcfclose\fP (ier) + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH 2 +Interactive Graphics Overlay Example +.in 0.5i +.ps -2 +.vs -2 +.nf +\f(CW +C ========================================================================== +C FTVMARK -- Example fortran program showing the use of the Client +C Display Library (CDL) Fortran interface for doing graphics overlay. No +C checking of the error flag is done here for space considerations. +C ========================================================================== + + PROGRAM FTVMARK + include "\fBcdlftn.inc\fP" + character*64 imname + +C \fIInitialize the CDL package\fP + call \fBcfopen\fP (0, ier) + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C \fIIf we've got a FITS format image, go ahead and display it.\fP + call \fBcfisFITS\fP (imname, isfits) + if (isfits .gt. 0) then + call \fBcfdisplayFITS\fP (imname, iframe, ifb, 1, ier) + else +C \fIWe've got an IRAF format image, go ahead and display it.\fP + call \fBcfisIRAF\fP (imname, isiraf) + if (isiraf .gt. 0) then + call \fBcfdisplayIRAF\fP (imname, 1, iframe, ifb, 1, ier) + else +C \fINo valid image given, so map the current display for marking.\fP + call \fBcfmapFrame\fP (iframe) + endif + endif + +C \fINow that we've got an image displayed or mapped, enter a cursor loop to mark the image. \fP + call markInteractive () + +C \fIClean up and exit\fP +999 continue + call \fBcfclose\fP (ier) + end + +C \fIMARKINTERACTIVE -- Subroutine for processing the cursor loop.\fP + subroutine markInteractive () + include "\fBcdlftn.inc\fP" + real angle, rx, ry, txsize + integer nx, ny, x, y, x2, y2, fill, size, color + integer number, radius, xrad, yrad, nannuli, sep + character key + character*64 cmd, str + +C \fIAllocate a 1024x1024 array for pixels. \fP + character pix(1048576) + +C \fI....Initialize the local parameters to use\fP + +C \fIRead a cursor keystroke telling us what to do.\fP +10 call \fBcfreadCursor\fP (0, rx, ry, key, ier) + +C \fIRound the real cursor position to integer pixel positions.\fP + x = nint (rx + 0.5) + y = nint (ry + 0.5) + +C \fICheck the keystroke and take the appropriate action.\fP +C \fIColon Commands\fP + if (key .eq. ':') then +C \fIRead a three character command and value field and process the colon command\fP + read (*,'(A3, i4)') cmd, ival + if (cmd(1:3) .eq. 'ang') then + angle = real (ival) + else if (cmd(1:3) .eq. 'col') then + color = ival + else if (cmd(1:3) .eq. 'fil') then + fill = ival +\fI : + ....and so on to set local variables + :\fR + else if (cmd(1:3) .eq. 'pri') then +C \fIPrint contents of the current frame buffer\fP + call \fBcfreadFrameBuffer\fP (pix, nx, ny, ier) + call \fBcfprintPix\fP ("lpr", pix, nx, ny, 1, ier) + else if (cmd(1:3) .eq. 'sta') then + \fI....print out the status (value) of variables\fP + endif + +C \fIPoint Markers\fP + else if (key .eq. 'p') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_PLUS, color, ier) + else if (key .eq. 'x') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_CROSS, color, ier) + else if (key .eq. '_') then + call \fBcfmarkPoint\fP (x, y, 1, size, M_HBLINE, color, ier) + else if (key .eq. 'o') then +C \fIExample of a filled point marker \fP + call \fBcfmarkPoint\fP (x, y, 1, size, or(M_CIRCLE,fill), color, ier) +\fI : + ....and so on to set other types of point markers\fR + +C \fIOther Markers\fP + else if (key .eq. 'b') then + print '("Hit another key to define the box ....")' + call \fBcfreadCursor\fP (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + call \fBcfmarkBox\fP (x, y, x2, y2, fill, color, ier) + else if (key .eq. 'd') then + call \fBcfdeleteMark\fP (x, y, ier) + else if (key .eq. 'e') then + call \fBcfmarkEllipse\fP (x, y, xrad, yrad, angle, fill, color, ier) + else if (key .eq. 't') then + print '("Text string: ", $)' + read (*,'(A64)') str + call \fBcfmarkText\fP (x, y, str, txsize, angle, color, ier) +\fI : + ....and so on to set other types of markers\fR + +C \fIQuit\fP + else if (key .eq. 'q') then + goto 998 + endif + +C \fILoop back until we want to quit\fP + goto 10 +998 continue + end +\fR +.fi +.ps +2 +.vs +2 +.in -0.5i +.bp +.NH +SPP Interface Summary +.LP +.in 0.5i +#include "\fBcdlspp.h\fR" +.in -0.5i + +.TS +center; +r l. +\fBcdl_open\fR (imtdev, ier) +\fBcdl_displayPix\fR (pix, nx, ny, bitpix, frame, fbconfig, zscale, ier) +\fBcdl_readCursor\fR (sample, x, y, wcs, key, ier) +\fBcdl_setCursor\fR (x, y, wcs, ier) +\fBcdl_setWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcdl_getWCS\fR (name, title, a, b, c, d, tx, ty, z1, z2, zt, ier) +\fBcdl_setFrame\fR (frame) +\fBcdl_clearFrame\fR (ier) +\fBcdl_close\fR () + +\fBcdl_displayIRAF\fR (fname, band, frame, fbconfig, zscale, ier) +\fBcdl_isIRAF\fR (fname, isiraf) +\fBcdl_readIRAF\fR (fname, band, pix, nx, ny, bitpix, title, ier) + +\fBcdl_displayFITS\fR (fname, frame, fbconfig, zscale, ier) +\fBcdl_isFITS\fR (fname, isfits) +\fBcdl_readFITS\fR (fname, pix, nx, ny, bitpix, title, ier) + +\fBcdl_computeZscale\fR (pix, nx, ny, bitpix, z1, z2) +\fBcdl_zscaleImage\fR (pix, nx, ny, bitpix, z1, z2) + +\fBcdl_printPix\fR (cmd, pix, nx, ny, annotate, ier) +\fBcdl_printPixToFile\fR (fname, pix, nx, ny, annotate, ier) + +\fBcdl_readImage\fR (pix, nx, ny, ier) +\fBcdl_readFrameBuffer\fR (pix, nx, ny, ier) +\fBcdl_readSubRaster\fR (lx, ly, nx, ny, pix, ier) +\fBcdl_writeSubRaster\fR (lx, ly, nx, ny, pix, ier) + +\fBcdl_selectFB\fR (nx, ny, fb, w, h, nf, reset) +\fBcdl_setFBConfig\fR (configno) +\fBcdl_getFBConfig\fR (configno, w, h, nf) +\fBcdl_lookupFBSize\fR (configno, w, h, nf) + +\fBcdl_setZTrans\fR (ztrans) +\fBcdl_setZScale\fR (z1, z2) +\fBcdl_setSample\fR (nsample) +\fBcdl_setSampleLines\fR (nlines) +\fBcdl_setContrast\fR (contrast) +\fBcdl_setName\fR (imname) +\fBcdl_setTitle\fR (imtitle) + +\fBcdl_getFrame\fR (frame) +\fBcdl_getZTrans\fR (ztrans) +\fBcdl_getZScale\fR (z1, z2) +\fBcdl_getSample\fR (nsample) +\fBcdl_getSampleLines\fR (nlines) +\fBcdl_getContrast\fR (contrast) +\fBcdl_getName\fR (imname) +\fBcdl_getTitle\fR (imtitle) + +\fBcdl_mapFrame\fR (frame, ier) +\fBcdl_markCoordsFile\fR (fname, type, size, color, label, ier) +\fBcdl_markPoint\fR (x, y, number, size, type, color, ier) +\fBcdl_markPointLabel\fR (x, y, label, size, type, color, ier) +\fBcdl_markLine\fR (xs, ys, xe, ye, color, ier) +\fBcdl_markBox\fR (lx, ly, ux, uy, fill, color, ier) +\fBcdl_markPolygon\fR (xarray, yarray, npts, fill, color, ier) +\fBcdl_markPolyline\fR (xarray, yarray, npts, color, ier) +\fBcdl_markCircle\fR (x, y, radius, fill, color, ier) +\fBcdl_markCircAnnuli\fR (x, y, radius, nannuli, sep, color, ier) +\fBcdl_markEllipse\fR (x, y, xrad, yrad, rotang, fill, color, ier) +\fBcdl_markEllipAnnuli\fR (x, y, xrad, yrad, ang, nannuli, sep, color, ier) +\fBcdl_markText\fR (x, y, str, size, angle, color, ier) +\fBcdl_setFont\fR (font) +\fBcdl_setTextWidth\fR (width) +\fBcdl_setLineWidth\fR (width) +\fBcdl_setLineStyle\fR (style) +\fBcdl_deleteMark\fR (x, y, ier) +\fBcdl_clearOverlay\fR (ier) +\fBcdl_redrawOverlay\fR (ier) +\fBcdl_setDebug\fR (level) +.TE diff --git a/vendor/x11iraf/cdl/doc/cdlref.ps b/vendor/x11iraf/cdl/doc/cdlref.ps new file mode 100644 index 00000000..f192e0b1 --- /dev/null +++ b/vendor/x11iraf/cdl/doc/cdlref.ps @@ -0,0 +1,19799 @@ +%!PS-Adobe-1.0 +%%Creator: devps (Pipeline Associates, Inc.) +%%CreationDate: Sat Aug 11 21:36:49 2001 +%%Pages: (atend) +%%DocumentFonts: (atend) + +/X{exch}def +/r{rmoveto}def +/m{moveto}def +/l{lineto}def +/rl{rlineto}def +/lc{yc X xc X l st}def +/mc{yc X xc X m}def +/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}def +/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}def +/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}def +/st{stroke}def +/gs{gsave}def +/gr{grestore}def +/cp{currentpoint}def +/np{newpath}def +/ct{curveto}def +/m0{0 0 moveto}def +/BP{/devps-save save def m0}def +/EP{ +clear devps-save restore +showpage}def +/res 10.000000 def +/V{res neg div 792 add +currentpoint pop X +m}def +/H{res div +currentpoint X pop +moveto}def +/h{res div 0 r}def +/v{res neg div 0 X r}def +/xc{res div}def +/yc{res neg div 792 add}def +/S{X H show}def +/psize 10 def +/height 1 def +/slant 0 def +/FF{findfont X dup 12 div setlinewidth /psize X def + [psize 0 psize height mul slant sin slant cos div mul psize height mul 0 0] + makefont setfont}def +/shade{gs + /dy X def + /dx X def + np m + setgray + 0 dy rl + dx 0 rl + 0 dy neg rl + dx neg 0 rl + closepath + fill +gr}def +1 setlinecap +/R{/Times-Roman FF}def +/B{/Times-Bold FF}def +/I{/Times-Italic FF}def +/C{/Courier FF}def +%% Troff special characters not on Symbol font +%% Copyright (C) 1986 by Pipeline Associates, Inc. +%% Version 1.1 +/altRTD 20 dict def +altRTD begin +/s{setcachedevice}def +/C{1000 1000 scale}def +/m{moveto}def +/c{curveto}def +/S{stroke}def +/l{lineto}def +/a{arcto}def +/p{pop}def +/sl{setlinewidth}def +end +/F_Troff 17 dict def F_Troff begin +systemdict /currentpacking known +{/SavePacking currentpacking def true setpacking}if +/PaintType 0 def +/FontType 3 def +/StrokeWidth 0 def +/UniqueID 8277003 def +/FontMatrix [.001000 0 0 .001000 0 0] def +/FontBBox [-12 -105 942 855 ] def +/Encoding 256 array def +/CD 256 1 add dict def +/FontInfo 3 dict def FontInfo begin +/UnderlinePosition -133 def /UnderlineThickness 20 def end +/FontName (Troff) def +0 1 256 1 sub{Encoding exch /.notdef put}for +CD /.notdef{500 0 setcharwidth{}}put +Encoding (1) 0 get /br put +%% bold vertical rule used by tbl +CD /br{ +C +0 0 -.5 -.5 1 1 s +np +.05 sl +0 -.1 m +0 .9 l +{S} +}put +Encoding (2) 0 get /ul put +%% underline used by tbl +CD /ul{ +C +.5 0 -.5 -.5 1 1 s +np +.05 sl +0 -.1 m +.5 -.1 l +{S} +}put +Encoding (3) 0 get /ru put +%% baseline rule +CD /ru{ +C +.5 0 -.5 -.5 1 1 s +np +.05 sl +m0 +.5 0 l +{S} +}put +Encoding (4) 0 get /vr put +%% vertical rule +CD /vr{ +C +0 0 -.5 -.5 1 1 s +np +.05 sl +m0 +0 1 l +{S} +}put +Encoding (5) 0 get /sq put +%% square +CD /sq{ +C +.5 0 -.5 -.5 1 1 s +np +.05 sl +0 .25 m +0 .5 rl +.5 0 rl +0 -.5 rl +-.5 0 rl +closepath +{S} +}put +Encoding (6) 0 get /bx put +%% solid box +CD /bx{ +C +.5 0 -.5 -.5 1 1 s +np +0 .25 m +0 .5 rl +.5 0 rl +0 -.5 rl +-.5 0 rl +closepath +{fill} +}put +Encoding (7) 0 get /rn put +%% radical extender +CD /rn{ +C +.5 0 -.5 -.5 1 1 s +np +.03 sl +-.03 .9 m +.5 0 rl +{S} +}put +Encoding (8) 0 get /GR put +%% gray mask +CD /GR{ +C +.5 0 setcharwidth +.5 setgray +np +0 -.1 m +0 1 rl +.5 0 rl +0 -1 rl +-.5 0 rl +closepath +{fill} +}put +Encoding 97 /a put +CD /a{1000 0 0 66 942 421 s 430 415 +m 578 406 678 349 662 319 c 655 306 614 287 583 +296 c 570 300 466 340 438 332 c 365 309 335 213 +270 209 c 0 310 m 108 310 l 108 114 l 0 +114 l 0 310 l 42 161 m 42 134 l 66 134 l 66 +161 l 42 161 l 47 155 m 47 140 l 62 140 l 62 +155 l 47 155 l 110 133 m 226 113 300 66 410 +80 c 497 91 550 69 634 76 c 645 76 663 92 669 +107 c 677 125 673 141 668 160 c 725 334 m 758 +332 734 253 701 250 c 501 325 m 475 316 476 309 +473 302 c 465 282 482 263 499 257 c 552 236 615 +253 689 253 c 701 253 713 236 713 218 c 712 194 +702 168 678 161 c 671 159 663 160 655 160 c 591 +158 516 156 479 168 c 461 173 453 191 453 210 c 453 +224 456 235 466 244 c 476 253 490 252 503 255 c 459 +84 m 447 96 435 106 435 123 c 435 136 440 145 447 +155 c 453 163 462 168 469 173 c 110 293 m 173 +318 300 421 435 415 c 609 407 852 416 885 411 c 898 +409 924 411 930 380 c 942 316 828 339 742 334 c 731 +334 730 335 725 335 c 701 336 685 336 660 336 c{S}}put +Encoding 98 /b put +CD /b{1000 0 -12 66 930 421 s 500 +415 m 352 406 252 349 268 319 c 275 306 316 287 +347 296 c 360 300 464 340 492 332 c 565 309 595 +213 660 209 c 930 310 m 822 310 l 822 114 l 930 +114 l 930 310 l 888 161 m 888 134 l 864 134 +l 864 161 l 888 161 l 883 155 m 883 140 l 868 +140 l 868 155 l 883 155 l 820 133 m 704 113 +630 66 520 80 c 433 91 380 69 296 76 c 285 76 +267 92 261 107 c 253 125 257 141 262 160 c 205 +334 m 172 332 196 253 229 250 c 429 325 m 455 +316 454 309 457 302 c 465 282 448 263 431 257 c 378 +236 315 253 241 253 c 229 253 217 236 217 218 c 218 +194 228 168 252 161 c 259 159 267 160 275 160 c 339 +158 414 156 451 168 c 469 173 477 191 477 210 c 477 +224 474 235 464 244 c 454 253 440 252 427 255 c 471 +84 m 483 96 495 106 495 123 c 495 136 490 145 483 +155 c 477 163 468 168 461 173 c 820 293 m 757 +318 630 421 495 415 c 321 407 78 416 45 411 c 32 +409 6 411 0 380 c -12 316 102 339 188 334 c 199 +334 200 335 205 335 c 229 336 245 336 270 336 c{S}}put +Encoding 99 /c put +CD /c{1000 0 184 0 827 627 s 185 315 +m 186 488 332 627 505 625 c 682 623 827 467 815 +290 c 804 124 666 0 500 0 c 327 0 184 142 185 +315 c{S}}put +Encoding 100 /d put +CD /d{590 0 134 158 477 500 s 300 +160 m 208 162 134 238 135 330 c 136 423 212 500 +305 500 c 397 500 473 427 475 335 c 477 239 396 +158 300 160 c{fill}}put +Encoding 101 /e put % Bell Symbol +CD /e{1010 0 -100 -210 1010 1010 s 100 sl 0 setlinecap +420 300 450 0 360 arc +420 650 m 420 575 l S +newpath 120 125 m 720 125 l 75 sl S +420 125 m 420 25 l S +220 400 m 220 175 120 175 100 a p p p p +220 400 m 220 550 420 550 80 a p p p p +620 400 m 620 175 720 175 100 a p p p p +620 400 m 620 550 420 550 80 a p p p p +295 550 m 545 550 l{S}}put +/BuildChar{altRTD /BuildChar get exec}def end +altRTD begin /BuildChar{altRTD begin +/char exch def /fontdict exch def save +/charname fontdict /Encoding get char get def +fontdict /StrokeWidth get sl +fontdict /CD get dup charname known +{charname}{/.notdef}ifelse get newpath exec +fontdict /PaintType get 0 eq{exec}{p S}ifelse +restore end}def end +systemdict /currentpacking known{F_Troff /SavePacking get setpacking}if +/Troff F_Troff definefont pop +/Y1{/Troff FF}def +%%EndProlog +%%Page: 1 1 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +1230 V +12 B +1419(A)S +1541(Reference)S +2088(Guide)S +2439(for)S +2628(the)S +2824(IRAF)S +3152(Client)S +3502(Display)S +3926(Library)S +4369(\(CDL\))S +1470 V +10 I +2662(Michael)S +3019(Fitzpatrick)S +1650 V +10 R +2645(NOAO/IRAF)S +3219(Group)S +1890 V +2765(February)S +3155(1997)S +2130 V +10 I +2619(Revised:)S +2992(August)S +3300(2001)S +2250 V +2479(Current)S +2826(Version:)S +3230(CDL)S +3455(V1.8)S +2850 V +2823(ABSTRACT)S +3090 V +11 R +1510(The)S +1713(Client)S +2016(Display)S +2391(Library)S +2752(\(CDL\))S +3077(is)S +3184(a)S +3265(host)S +3482(interface)S +3896(for)S +4056(C,)S +4192(Fortran)S +4549(or)S +4674(SPP)S +3210 V +1260(programs)S +1707(allowing)S +2125(them)S +2378(to)S +2497(display)S +2848(images)S +3192(or)S +3316(overlay)S +3677(graphics)S +4081(to)S +4200(display)S +4551(servers)S +3330 V +1260(such)S +1513(as)S +11 I +1656(XImtool)S +11 R +2010(,)S +11 I +2090(DS9)S +11 R +2279(,)S +2359(or)S +11 I +2502(SAOimage)S +3023(/)S +3106(SAOtng)S +11 R +3448(.)S +3562(High-level)S +4084(procedures)S +4616(allow)S +3450 V +1260(IRAF)S +1545(or)S +1670(FITS)S +1931(images)S +2276(to)S +2396(be)S +2533(displayed)S +2988(simply,)S +3351(other)S +3610(routines)S +3998(permit)S +4319(access)S +4631(to)S +4750(all)S +3570 V +1260(other)S +1537(server)S +1855(functions)S +2316(\(e.g.)S +2563(cursor)S +2888(and)S +3098(image)S +3418(readback,)S +3891(frame)S +4198(selection,)S +4669(etc\).)S +3690 V +1260(The)S +1470(library)S +1802(also)S +2019(features)S +2404(a)S +2492(number)S +2867(of)S +2997(functions)S +3445(for)S +3611(doing)S +3901(image)S +4208(overlay)S +4575(graph-)S +3810 V +1260(ics;)S +1451(supported)S +1922(graphics)S +2331(primitives)S +2816(include)S +3177(numerous)S +3648(point)S +3913(shapes,)S +4272(lines,)S +4547(circles,)S +3930 V +1260(ellipses,)S +1651(polygons,)S +2116(annular)S +2477(shapes,)S +2830(and)S +3021(text.)S +4410 V +10 R +900(August)S +1219(11,)S +1374(2001)S +7920 V +EP +%%Page: 1 2 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +840 V +13 B +2810(Contents)S +1200 V +10 R +900(1)S +10 B +1080(Introduction)S +10 R +1632(....................................................................................................................................)S +5032(1)S +1380 V +900(2)S +10 B +1080(Getting)S +1432(Started)S +10 R +1757(...............................................................................................................................)S +5032(1)S +1560 V +900(3)S +10 B +1080(Server)S +1392(Connections)S +10 R +1932(........................................................................................................................)S +5032(2)S +1680 V +1080(3.1)S +1440(Domain)S +1792(Sockets)S +2107(.................................................................................................................)S +5032(2)S +1800 V +1080(3.2)S +1440(Named)S +1758(FIFO)S +2005(Pipes)S +2232(............................................................................................................)S +5032(3)S +1920 V +1080(3.3)S +1440(Inet)S +1625(Sockets)S +1957(.......................................................................................................................)S +5032(3)S +2040 V +1080(3.4)S +1440(User-De\256ned)S +2007(Connections.................................................................................................)S +5032(3)S +2220 V +900(4)S +10 B +1080(Image)S +1376(Display)S +10 R +1707(.................................................................................................................................)S +5032(3)S +2340 V +1080(4.1)S +1440(Overview)S +1863(of)S +1976(the)S +2128(Display)S +2469(Process)S +2782(......................................................................................)S +5032(3)S +2460 V +1080(4.2)S +1440(Displaying)S +1909(IRAF)S +2167(Images)S +2457(...................................................................................................)S +5032(4)S +2580 V +1080(4.3)S +1440(Displaying)S +1909(FITS)S +2145(Images)S +2457(...................................................................................................)S +5032(5)S +2700 V +1080(4.4)S +1440(Displaying)S +1909(Raw)S +2122(Pixels)S +2382(......................................................................................................)S +5032(5)S +2820 V +1080(4.5)S +1440(Frame)S +1725(Selection)S +2107(.................................................................................................................)S +5032(5)S +2940 V +1080(4.6)S +1440(Clearing)S +1814(the)S +1966(Display)S +2282(..........................................................................................................)S +5032(5)S +3060 V +1080(4.7)S +1440(Frame)S +1725(Bu)S +1842 H + (f)show 10 -.5 mul h (f)show +10 R +1903(er)S +2010(Selection......................................................................................................)S +5032(6)S +3180 V +1188(4.7.1)S +1584(Automatic)S +2036(Selection)S +2432(....................................................................................................)S +5032(6)S +3300 V +1188(4.7.2)S +1584(The)S +1769(Frame)S +2054(Bu)S +2171 H + (f)show 10 -.5 mul h (f)show +10 R +2232(er)S +2339(Con\256guration)S +2925(File)S +3082(..........................................................................)S +5032(6)S +3420 V +1080(4.8)S +1440(Image)S +1719(WCS)S +1966(Description....................................................................................................)S +5032(7)S +3540 V +1188(4.8.1)S +1584(Image)S +1863(Mappings)S +2282(..........................................................................................................)S +5032(7)S +3660 V +1080(4.9)S +1440(Image)S +1719(Colormaps)S +2182(..............................................................................................................)S +5032(8)S +3780 V +1188(4.9.1)S +1584(Imtool)S +1881(Color)S +2139(Model)S +2407(.....................................................................................................)S +5032(9)S +3900 V +1080(4.10)S +1440(ZScale)S +1747(Intensity)S +2127(Mapping)S +2507(.................................................................................................)S +5032(9)S +4020 V +1080(4.11)S +1440(Image)S +1719(Hardcopy)S +2132(................................................................................................................)S +4982(10)S +4140 V +1080(4.12)S +1440(Image)S +1719(Cursor)S +2007(.....................................................................................................................)S +4982(10)S +4260 V +1188(4.12.1)S +1584(Cursor)S +1886(Sampling)S +2282(..........................................................................................................)S +4982(11)S +4380 V +1080(4.13)S +1440(Image)S +1719(Readout)S +2057(...................................................................................................................)S +4982(11)S +4500 V +1080(4.14)S +1440(Subraster)S +1847(I/O)S +1982(......................................................................................................................)S +4982(11)S +4680 V +900(5)S +10 B +1080(Graphics)S +1505(Overlay)S +10 R +1857(...........................................................................................................................)S +4982(11)S +4800 V +1080(5.1)S +1440(Marker)S +1763(Coordinates)S +2257(...........................................................................................................)S +4982(11)S +4920 V +1080(5.2)S +1440(Mapping)S +1831(a)S +1905(Previously)S +2363(Displayed)S +2798(Image)S +3057(...........................................................................)S +4982(11)S +5040 V +1080(5.3)S +1440(Marking)S +1814(a)S +1888(Coordinate)S +2362(File)S +2532(................................................................................................)S +4982(12)S +5160 V +1080(5.4)S +1440(Marker)S +1763(Colors)S +2032(....................................................................................................................)S +4982(12)S +5280 V +1080(5.5)S +1440(Marker)S +1763(Types.....................................................................................................................)S +4982(12)S +5400 V +1188(5.5.1)S +1584(Point)S +1807(.............................................................................................................................)S +4982(13)S +5520 V +1188(5.5.2)S +1584(Line)S +1782(..............................................................................................................................)S +4982(13)S +5640 V +1188(5.5.3)S +1584(Box)S +1757(...............................................................................................................................)S +4982(13)S +5760 V +1188(5.5.4)S +1584(Circle)S +1832(............................................................................................................................)S +4982(13)S +5880 V +1188(5.5.5)S +1584(Polyline)S +1932(........................................................................................................................)S +4982(14)S +6000 V +1188(5.5.6)S +1584(Polygon)S +1932(........................................................................................................................)S +4982(14)S +6120 V +1188(5.5.7)S +1584(Ellipse)S +1882(..........................................................................................................................)S +4982(14)S +6240 V +1188(5.5.8)S +1584(Circular)S +1941(Annuli)S +2232(............................................................................................................)S +4982(14)S +6360 V +1188(5.5.9)S +1584(Elliptical)S +1981(Annuli)S +2282(..........................................................................................................)S +4982(14)S +6480 V +1188(5.5.10)S +1584(Text)S +1782(..............................................................................................................................)S +4982(14)S +6600 V +1080(5.6)S +1440(Text)S +1653(Fonts)S +1882(..........................................................................................................................)S +4982(15)S +6720 V +1188(5.6.1)S +1584(In-line)S +1880(Font)S +2094(Changes)S +2457(...................................................................................................)S +4982(15)S +6840 V +1080(5.7)S +1440(Line)S +1653(Widths)S +1972(and)S +2146(Styles)S +2407(.....................................................................................................)S +4982(15)S +6960 V +1080(5.8)S +1440(Deleting)S +1814(Markers)S +2157(...............................................................................................................)S +4982(16)S +7080 V +1188(5.8.1)S +1584(Individual)S +2025(Markers.......................................................................................................)S +4982(16)S +7200 V +1188(5.8.2)S +1584(The)S +1769(Entire)S +2043(Overlay)S +2382(......................................................................................................)S +4982(16)S +7920 V +EP +%%Page: 2 3 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +480 V +11 R +2963(- 2 -)S +840 V +10 R +1080(5.9)S +1440(Redrawing)S +1908(the)S +2060(Overlay)S +2382(......................................................................................................)S +4982(16)S +1020 V +900(6)S +10 B +1080(ANSI)S +1349(C)S +1451(Function)S +1865(Prototypes)S +10 R +2332(........................................................................................................)S +4982(17)S +1200 V +900(7)S +10 B +1080(Fortran)S +1448(Language)S +1901(Binding)S +2272(Notes)S +10 R +2532(................................................................................................)S +4982(17)S +1380 V +900(8)S +10 B +1080(SPP)S +1288(Language)S +1741(Binding)S +2112(Notes)S +10 R +2357(.......................................................................................................)S +4982(18)S +1560 V +900(9)S +10 B +1080(IIS)S +1244(Protocol)S +1634(Description)S +10 R +2132(................................................................................................................)S +4982(18)S +1740 V +900(10)S +10 B +1080(VXIMTOOL)S +1677(Proxy/Display)S +2313(Server)S +2625(Usage)S +10 R +2882(..................................................................................)S +4982(19)S +1920 V +900(11)S +10 B +1080(C)S +1182(Interface)S +1599(Summary)S +10 R +2032(....................................................................................................................)S +4982(21)S +2100 V +900(12)S +10 B +1080(C)S +1182(Example)S +1590(Tasks)S +10 R +1857(...........................................................................................................................)S +4982(23)S +2220 V +1080(12.1)S +1440(Display)S +1781(Example)S +2157(...............................................................................................................)S +4982(23)S +2340 V +1080(12.2)S +1440(Interactive)S +1896(Graphics)S +2286(Overlay)S +2637(Example)S +3007(.............................................................................)S +4982(27)S +2460 V +1080(12.3)S +1440(Image)S +1719(Mosaic)S +2043(Example)S +2407(.....................................................................................................)S +4982(31)S +2640 V +900(13)S +10 B +1080(Fortran)S +1448(Interface)S +1865(Summary)S +10 R +2307(.........................................................................................................)S +4982(33)S +2820 V +900(14)S +10 B +1080(Fortran)S +1448(Example)S +1856(Tasks)S +10 R +2107(.................................................................................................................)S +4982(35)S +2940 V +1080(14.1)S +1440(Display)S +1781(Example)S +2157(...............................................................................................................)S +4982(35)S +3060 V +1080(14.2)S +1440(Interactive)S +1896(Graphics)S +2286(Overlay)S +2637(Example)S +3007(.............................................................................)S +4982(36)S +3240 V +900(15)S +10 B +1080(SPP)S +1288(Interface)S +1705(Summary)S +10 R +2132(................................................................................................................)S +4982(38)S +7920 V +EP +%%Page: 1 4 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +1230 V +12 B +1419(A)S +1541(Reference)S +2088(Guide)S +2439(for)S +2628(the)S +2824(IRAF)S +3152(Client)S +3502(Display)S +3926(Library)S +4369(\(CDL\))S +1470 V +10 I +2662(Michael)S +3019(Fitzpatrick)S +1650 V +10 R +2645(NOAO/IRAF)S +3219(Group)S +1890 V +2765(February)S +3155(1997)S +2130 V +10 I +2619(Revised:)S +2992(August)S +3300(2001)S +2250 V +2479(Current)S +2826(Version:)S +3230(CDL)S +3455(V1.8)S +2730 V +11 B +900(1.)S +1049(Introduction)S +2886 V +11 R +1175(For)S +1368(more)S +1633(than)S +1862(a)S +1950(decade)S +2292(IRAF)S +2583(has)S +2769(used)S +3010(a)S +11 I +3098(display)S +3456(server)S +11 R +3769(as)S +3900(the)S +4075(primary)S +4463(means)S +4784(for)S +4952(image)S +3006 V +900(display.)S +1320(IRAF)S +1612(client)S +1897(tasks)S +2158(connect)S +2539(to)S +2666(the)S +2840(server)S +3146(and)S +3344(send)S +3585(or)S +3716(read)S +3943(data)S +4165(using)S +4444(a)S +4532(modi\256cation)S +5129(of)S +3126 V +900(the)S +1081(IIS)S +1262(Model)S +1596(70)S +1753(protocol,)S +2194(originally)S +2669(through)S +3058(named)S +3397(\256fo)S +3597(pipes)S +3876(but)S +4064(more)S +4337(recently)S +4737(using)S +5024(unix)S +3246 V +900(domain)S +1268(or)S +1397(inet)S +1600(sockets.)S +2022(The)S +2230(advantage)S +2710(to)S +2833(this)S +3030(approach)S +3467(was)S +3674(that)S +3876(IRAF)S +4164(client)S +4445(tasks)S +4702(could)S +4983(make)S +3366 V +900(use)S +1083(of)S +1211(the)S +1383(image)S +1689(display)S +2045(functionality)S +2645(without)S +3020(duplicating)S +3553(the)S +3725(code)S +3969(needed)S +4316(for)S +4481(actually)S +4866(display-)S +3486 V +900(ing)S +1078(the)S +1249(image.)S +1615(The)S +1822(longtime)S +2251(disadvantage)S +2859(was)S +3065(that)S +3266(the)S +3436(IIS)S +3606(protocol)S +4008(used)S +4245(was)S +4451(arcane)S +4770(and)S +4964(undo-)S +3606 V +900(cumented)S +1375(and)S +1582(therefore)S +2024(largely)S +2377(unavailable)S +2931(to)S +3066(applications)S +3646(outside)S +4013(of)S +4153(the)S +4336(IRAF)S +4636(project.)S +5050(The)S +3726 V +900(Client)S +1213(Display)S +1598(Library)S +1969(\(CDL\))S +2304(provides)S +2725(a)S +2816(public)S +3134(C)S +3251(and)S +3451(Fortran)S +3816(interface)S +4239(for)S +4408(displaying)S +4909(images)S +3846 V +900(and)S +1091(overlay)S +1452(graphics)S +1856(that)S +2054(is)S +2161(independent)S +2730(of)S +2854(the)S +3021(underlying)S +3530(protocol)S +3929(used.)S +4002 V +1175(Unlike)S +1512(the)S +1684(interface)S +2103(used)S +2342(by)S +2490(IRAF)S +2779(applications,)S +3376(the)S +3548(CDL)S +3807(is)S +3920(meant)S +4227(to)S +4352(provide)S +4726(an)S +4868(easy-to-)S +4122 V +900(use,)S +1109(fully)S +1351(featured)S +1742(interface)S +2157(for)S +2318(applications)S +2883(that)S +3082(can)S +3267(be)S +3404(easily)S +3694(evolved)S +4075(for)S +4236(future)S +4531(display)S +4883(servers,)S +4242 V +900(communications)S +1675(schemes,)S +2122(or)S +2261(display)S +2627(functionality.)S +3298(Indeed,)S +3671(the)S +3853(CDL)S +4121(is)S +4244(independent)S +4829(of)S +4969(IRAF)S +4362 V +900(itself)S +1163(\(as)S +1333(are)S +1508(the)S +1685(display)S +2046(servers\))S +2434(so)S +2575(display)S +2936(tasks)S +3199(can)S +3393(be)S +3539(written)S +3893(for)S +4063(any)S +4264(discipline)S +4735(or)S +4868(applica-)S +4482 V +900(tion.)S +4638 V +1175(While)S +1478(this)S +1673(guide)S +1952(assumes)S +2353(programs)S +2802(are)S +2969(written)S +3315(in)S +3436(C,)S +3573(Fortran)S +3931(programmers)S +4550(should)S +4879(\256nd)S +5086(the)S +4758 V +900(translation)S +1408(straightforward)S +2127(by)S +2281(referring)S +2706(to)S +2836(the)S +3014(Fortran)S +3381(interface)S +3806(summary.)S +4320(The)S +4534(package)S +4935(source)S +4878 V +900(\256les)S +1117(include)S +1473(example)S +1877(tasks)S +2130(as)S +2254(does)S +2488(this)S +2681(guide;)S +2989(users)S +3247(with)S +3477(problems,)S +3948(questions,)S +4426(or)S +4551(bug)S +4750(reports)S +5088(are)S +4998 V +900(encouraged)S +1444(to)S +1571(contact)S +11 I +1928(iraf@noao.edu)S +11 R +2595(.)S +2697(A)S +2817(small)S +3097(code)S +3344(sample)S +3696(demonstrating)S +4365(the)S +4539(problem)S +4945(would)S +5118 V +900(be)S +1036(very)S +1263(helpful)S +1607(in)S +1726(\256nding)S +2072(a)S +2153(solution)S +2542(to)S +2661(any)S +2852(reported)S +3249(problems.)S +5478 V +11 B +900(2.)S +1049(Getting)S +1436(Started)S +5634 V +11 R +1175(All)S +1358(C)S +1474(programs)S +1930(must)S +2188(include)S +2554(the)S +2731(header)S +3064(\256le)S +11 B +3248("cdl.h")S +11 R +3646(in)S +3775(order)S +4048(to)S +4177(get)S +4354(package)S +4754(de\256nitions)S +5754 V +900(for)S +1084(constants)S +1550(such)S +1808(as)S +1956(colors)S +2281(and)S +2496(structure)S +2936(de\256nitions)S +3459(used.)S +3778(The)S +4005(Fortran)S +4385(interface)S +4822(does)S +5079(not)S +5874 V +11 I +900(require)S +11 R +1257(anything)S +1676(similar,)S +2045(however)S +2456(for)S +2618(fortran)S +2950(compilers)S +3418(which)S +3721(support)S +4086(an)S +11 C +4257(include)S +11 R +4754(directive)S +5172(a)S +5994 V +11 B +900(cdlftn.inc)S +11 R +1383(\256le)S +1562(may)S +1789(be)S +1930(used)S +2169(to)S +2293(de\256ne)S +2599(symbolic)S +3041(constants)S +3488(passed)S +3818(to)S +3942(procedures,)S +4487(this)S +4685(\256le)S +4864(must)S +5117(be)S +6114 V +900(included)S +1320(by)S +1472(each)S +1713(procedure)S +2191(using)S +2472(the)S +2648(CDL.)S +2971(Fortran)S +3336(programs)S +3792(not)S +3975(using)S +4257(this)S +4460(\256le)S +4644(must)S +4902(pass)S +5134(in)S +6234 V +900(the)S +1077(constants)S +1529(explicitly,)S +2016(needed)S +2368(values)S +2690(are)S +2864(found)S +3162(throughout)S +3687(this)S +3889(manual.)S +4315(C)S +4431(procedures)S +4952(which)S +6354 V +900(return)S +1199(an)S +1340(integer)S +1682(value)S +1957(will)S +2167(return)S +2466(a)S +2552(positive)S +2939(number)S +3312(to)S +3436(indicate)S +3821(an)S +3962(error)S +4211(has)S +4395(occurred)S +4815(and)S +5012(print)S +6474 V +900(an)S +1036(error)S +1280(message,)S +1712(otherwise)S +2171(zero)S +2391(is)S +2498(returned.)S +6630 V +1175(The)S +11 B +1381(cdl_open\(\))S +11 R +1912(procedure)S +2384(is)S +2494(used)S +2731(to)S +2853(establish)S +3274(a)S +3358(connection)S +3875(to)S +3997(the)S +4167(server)S +4469(and)S +4664(initialize)S +5086(the)S +6750 V +900(package,)S +1323(it)S +1423(returns)S +1765(a)S +1851(CDL)S +2108(structure)S +2528(pointer)S +2876(that)S +3078(is)S +3189(passed)S +3518(to)S +3641(other)S +3903(CDL)S +4160(procedures.)S +4737(For)S +4927(C)S +5038(pro-)S +6870 V +900(grams)S +1207(this)S +1406(means)S +1726(a)S +1814(separate)S +2211(pointer)S +2562(may)S +2791(be)S +2934(maintained)S +3462(for)S +3629(each)S +3868(server)S +4174(connection,)S +4723(the)S +4897(Fortran)S +6990 V +900(interface)S +1329(is)S +1451(limited)S +1812(to)S +1946(only)S +2190(one)S +2396(server)S +2710(connection)S +3239(per)S +3425(process)S +3800(since)S +4072(the)S +4253(pointer)S +4611(is)S +4732(maintained)S +7110 V +900(internally.)S +1428(The)S +1644(connection)S +2171(is)S +2291(terminated)S +2806(using)S +3091(the)S +11 B +3271(cdl_close\(\))S +11 R +3810(procedure.)S +4353(Between)S +4783(these)S +5055(two)S +7230 V +900(calls)S +1158(may)S +1404(be)S +1564(any)S +1779(combination)S +2385(of)S +2532(CDL)S +2808(procedure)S +3300(calls)S +3557(for)S +3740(doing)S +4047(image)S +4371(display)S +4745(or)S +4892(overlay)S +7920 V +EP +%%Page: 2 5 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 2 -)S +840 V +900(graphics.)S +996 V +1175(For)S +1376(example,)S +1823(the)S +2005(simplest)S +2421(possible)S +2830(program)S +3249(for)S +3424(displaying)S +3931(an)S +4083(IRAF)S +4383(image)S +4700(would)S +5024(look)S +1116 V +900(something)S +1392(like:)S +1296 V +11 C +1450(#include)S +2044("cdl.h")S +1536 V +1450(main)S +1780(\(int)S +2110(argc,)S +2506(char)S +2836(*argv[]\))S +1656 V +1450({)S +1776 V +1714(CDLPtr)S +2176(cdl)S +2440(=)S +2572(cdl_open)S +3166(\(\(char)S +3628(*\)0\);)S +1896 V +1714(cdl_displayIRAF)S +2770(\(cdl,)S +3166(argv[1],)S +3760(1,)S +3958(1,)S +4156(1,)S +4354(1\);)S +2016 V +1714(cdl_close)S +2374(\(cdl\);)S +2136 V +1450(})S +2352 V +11 R +900(This)S +1131(program)S +1537(displays)S +1933(band)S +2181(one)S +2374(of)S +2500(an)S +2638(image)S +2941(named)S +3268(on)S +3413(the)S +3582(command)S +4050(line)S +4250(to)S +4372(the)S +4542(server)S +4844(in)S +4966(frame)S +2472 V +900(one)S +1092(using)S +1365(the)S +1533(default)S +1871(512x512)S +2290(frame)S +2577(bu)S +2687 H + (f)show 11 -.5 mul h (f)show +11 R +2754(er,)S +2899(zscaling)S +3291(the)S +3458(pixels)S +3754(to)S +3873(8-bit)S +4114(values)S +4427(automatically.)S +5086(No)S +2592 V +900(error)S +1146(checking)S +1576(is)S +1685(performed)S +2175(to)S +2296(verify)S +2592(that)S +2792(a)S +2875(connection)S +3391(was)S +3596(established)S +4119(or)S +4245(that)S +4445(the)S +4614(argument)S +5063(is)S +5172(a)S +2712 V +900(valid)S +1163(IRAF)S +1457(image.)S +1829(Most)S +2099(programs)S +2555(will)S +2769(be)S +2914(more)S +3181(complex)S +3601(than)S +3832(this)S +4034(but)S +4217(it)S +4321(should)S +4657(be)S +4802(clear)S +5055(that)S +2832 V +900(image)S +1201(display)S +1552(from)S +1798(client)S +2075(applications)S +2639(is)S +2746(a)S +2827(now)S +3049(trivial)S +3345(operation.)S +3072 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +3252 V +11 C +1175(#include)S +1769("cdl.h")S +3492 V +1175(CDLPtr)S +1637(cdl_open)S +2231(\(char)S +2627(*imtdev\))S +3612 V +1175(void)S +1505(cdl_close)S +2165(\(CDLPtr)S +2693(cdl\))S +3972 V +11 B +900(3.)S +1049(Server)S +1391(Connections)S +4128 V +11 R +1175(The)S +11 B +1391(cdl_open\(\))S +11 R +1932(procedure)S +2414(takes)S +2685(a)S +2779(single)S +3088(argument)S +3548(specifying)S +4051(the)S +4232(type)S +4468(of)S +4606(connection)S +5134(to)S +4248 V +900(make)S +1175(to)S +1298(the)S +1469(server,)S +1800(this)S +1997(routine)S +2345(also)S +2559(initializes)S +3024(the)S +3195(CDL)S +3452(package.)S +3907(If)S +4016(this)S +4213(is)S +4324(a)S +4409(NULL)S +4738(pointer)S +5086(the)S +4368 V +900(CDL)S +1171(will)S +1395(attempt)S +1777(to)S +1915(\256rst)S +2139(connect)S +2531(on)S +2693(a)S +2793(unix)S +3041(domain)S +3423(socket,)S +3783(if)S +3902(that)S +4119(fails)S +4360(the)S +4546(standard)S +4969(IRAF)S +4488 V +900(/dev/imt1*)S +1411(\256fo)S +1597(pipes)S +1862(are)S +2027(tried.)S +2322(The)S +2525(syntax)S +2845(for)S +3005(the)S +11 I +3172(imtdev)S +11 R +3497(argument)S +3944(is)S +4051(as)S +4175(follows:)S +4668 V +11 C +2000(<domain>)S +2594(:)S +2726(<address>)S +4884 V +11 R +900(where)S +1204(<domain>)S +1696(is)S +1808(one)S +2004(of)S +2133(")S +11 B +2178(inet)S +11 R +2355(")S +2438(\(internet)S +2847(tcp/ip)S +3136(socket\),)S +3518(")S +11 B +3563(unix)S +11 R +3773(")S +3856(\(unix)S +4126(domain)S +4494(socket\))S +4848(or)S +4977(")S +11 B +5022(\256fo)S +11 R +5175(")S +5004 V +900(\(named)S +1264(pipe\).)S +1586(The)S +1792(form)S +2041(of)S +2168(the)S +2338(address)S +2702(depends)S +3097(upon)S +3353(the)S +3522(domain,)S +3915(as)S +4041(illustrated)S +4516(in)S +4637(the)S +4806(examples)S +5124 V +900(below.)S +1264(The)S +1469(address)S +1832(\256eld)S +2063(may)S +2288(contain)S +2647(up)S +2793(to)S +2915(two)S +3116("%d")S +3388(\256elds.)S +3724(If)S +3832(present,)S +4212(the)S +4382(user's)S +4679(UID)S +4909(will)S +5117(be)S +5244 V +900(substituted)S +1440(\(e.g.)S +1697("unix:/tmp/.IMT%d"\).)S +2749(The)S +2981(default)S +3347(connection)S +3890(if)S +4019(no)S +4191(imtdev)S +4559(is)S +4695(speci\256ed)S +5146(is)S +5364 V +900("unix:/tmp/.IMT%d",)S +1909(failing)S +2251(that)S +2471(a)S +2574(connection)S +3110(is)S +3239(attempted)S +3727(on)S +3892(the)S +4082(/dev/imt1[io])S +4719(named)S +5067(\256fo)S +5484 V +900(pipes.)S +5724 V +11 B +900(3.1.)S +1132(Domain)S +1538(Sockets)S +5880 V +11 R +1175(Domain)S +1576(sockets)S +1946(are)S +2125(sockets)S +2495(created)S +2856(on)S +3013(the)S +3194(local)S +3454(host.)S +3746(The)S +3963(connection)S +4491(is)S +4612(usually)S +4978(faster)S +6000 V +900(than)S +1130(an)S +1274(inet)S +1479(socket)S +1799(and)S +1997(comparable)S +2547(to)S +2673(a)S +2761(\256fo.)S +3015(If)S +3127(the)S +3301(socket)S +3621(name)S +3898(is)S +4012(speci\256ed)S +4442(with)S +4678(a)S +4766('%d')S +5024(\256eld)S +6120 V +900(the)S +1073(client)S +1356(can)S +1546(be)S +1688(assured)S +2055(of)S +2185(a)S +2272(unique)S +2610(socket)S +2929(name)S +3205(for)S +3371(each)S +3609(user)S +3831(allowing)S +4256(multiple)S +4664(clients)S +4991(to)S +5117(be)S +6240 V +900(run)S +1079(on)S +1222(the)S +1389(same)S +1647(host)S +1864(by)S +2007(di)S +2093 H + (f)show 11 -.5 mul h (f)show +11 R +2160(erent)S +2411(users.)S +6396 V +900(Example)S +11 Y1 +900(2)S +905(2222222)S +6696 V +11 C +1175(/*)S +1373(Connection)S +2099(to)S +2297(a)S +2429(local)S +2825(host)S +3155(using)S +3551(socket)S +4013(domain)S +4475(socket.)S +5003(*/)S +6816 V +1175(if)S +1373(\(\(cdl)S +1769(=)S +1901(cdl_open)S +2495(\("unix:/tmp/.IMT%d"\)\))S +3947(==)S +4145(NULL\))S +4541({)S +6936 V +1505(fprintf)S +2033(\(stderr,)S +2627("cannot)S +3155(open)S +3485(domain)S +3947(socket)S +4409(connection\\n"\);)S +7056 V +1505(exit)S +1835(\(1\);)S +7176 V +1175(})S +7920 V +EP +%%Page: 3 6 +BP +/slant 0 def +/height 1.000000 def +11 C +11 C +480 V +11 R +2963(- 3 -)S +840 V +11 B +900(3.2.)S +1132(Named)S +1500(FIFO)S +1796(Pipes)S +996 V +11 R +1175(This)S +1426(is)S +1555(the)S +1744(traditional)S +2251(approach,)S +2734(and)S +2947(the)S +3136(only)S +3387(one)S +3600(supported)S +4089(by)S +4255(SAOimage)S +4799(\(although)S +1116 V +900(recent)S +1208(versions)S +1616(contain)S +1981(support)S +2353(for)S +2522(sockets\).)S +2951(Any)S +3182(named)S +3516(\256fo)S +3711(pipe)S +3942(may)S +4173(be)S +4318(used,)S +4589(the)S +4765(syntax)S +5093(for)S +1236 V +900(the)S +11 I +1067(imtdev)S +11 R +1392(string)S +1676(in)S +1795(this)S +1988(case)S +2208(is)S +1416 V +11 B +1450(\256fo:)S +11 C +1639(<input_fifo>)S +11 B +2431(:)S +11 C +2467(<output_fifo>)S +1632 V +11 R +900(Example)S +11 Y1 +900(2)S +905(2222222)S +1812 V +11 C +1175(/*)S +1373(Connection)S +2099(to)S +2297(a)S +2429(local)S +2825(host)S +3155(using)S +3551(named)S +3947(fifo)S +4277(pipes.)S +4739(*/)S +1932 V +1175(if)S +1373(\(\(cdl)S +1769(=)S +1901(cdl_open)S +2495(\("fifo:/dev/imt1i:/dev/imt1o"\)\))S +4607(==)S +4805(NULL\))S +5201({)S +2052 V +1505(fprintf)S +2033(\(stderr,)S +2627("cannot)S +3155(open)S +3485(fifo)S +3815(pipe)S +4145(connection\\n"\);)S +2172 V +1505(exit)S +1835(\(1\);)S +2292 V +1175(})S +2532 V +11 B +900(3.3.)S +1132(Inet)S +1354(Sockets)S +2688 V +11 R +1175(Inet)S +1378(sockets)S +1734(are)S +1899(connections)S +2456(between)S +2854(hosts)S +3115(via)S +3283(a)S +3365(tcp/ip)S +3650(socket.)S +4025(This)S +4255(permits)S +4619(connecting)S +5134(to)S +2808 V +900(the)S +1067(server)S +1366(over)S +1593(a)S +1674(remote)S +2011(network)S +2403(connection)S +2917(anywhere)S +3374(on)S +3517(the)S +3684(Internet.)S +2964 V +900(Example)S +11 Y1 +900(2)S +905(2222222)S +3144 V +11 C +1175(/*)S +1373(Connection)S +2099(to)S +2297(a)S +2429(local)S +2825(host)S +3155(using)S +3551(socket)S +4013(5137.)S +4409(*/)S +3264 V +1175(if)S +1373(\(\(cdl)S +1769(=)S +1901(cdl_open)S +2495(\("inet:5137"\)\))S +3485(==)S +3683(NULL\))S +4079({)S +3384 V +1505(fprintf)S +2033(\(stderr,)S +2627("cannot)S +3155(open)S +3485(inet)S +3815(socket)S +4277(connection\\n"\);)S +3504 V +1505(exit)S +1835(\(1\);)S +3624 V +1175(})S +3864 V +1175(/*)S +1373(Connection)S +2099(to)S +2297(a)S +2429(remote)S +2891(internet)S +3485(host)S +3815(using)S +4211(socket)S +4673(5137.)S +5069(*/)S +3984 V +1175(if)S +1373(\(\(cdl)S +1769(=)S +1901(cdl_open)S +2495(\("inet:5137:foo.bar.edu"\)\))S +4277(==)S +4475(NULL\))S +4871({)S +4104 V +1505(fprintf)S +2033(\(stderr,)S +2627("cannot)S +3155(open)S +3485(inet)S +3815(socket)S +4277(connection\\n"\);)S +4224 V +1505(exit)S +1835(\(1\);)S +4344 V +1175(})S +4584 V +11 B +900(3.4.)S +1132(User-De\256ned)S +1780(Connections)S +4740 V +11 R +1175(Since)S +1465(IRAF)S +1762(V2.10.3)S +2163(client)S +2453(tasks)S +2719(have)S +2971(been)S +3223(able)S +3451(to)S +3583(use)S +3775(an)S +11 B +3924(IMTDEV)S +11 R +4422(unix)S +4665(environment)S +4860 V +900(variable)S +1286(to)S +1406(set)S +1562(the)S +1730(connection)S +2245(type,)S +2496(the)S +2663(syntax)S +2983(of)S +3107(this)S +3300(variable)S +3685(is)S +3792(the)S +3959(same)S +4217(as)S +4341(described)S +4793(above.)S +5148(If)S +4980 V +900(the)S +11 I +1069(cdl_open\(\))S +11 R +1578(procedure)S +2049(is)S +2158(called)S +2454(with)S +2685(a)S +2768(NULL)S +3095(pointer)S +3441(the)S +3610(IMTDEV)S +4071(environment)S +4661(variable)S +5048(will)S +5100 V +900(automatically)S +1544(be)S +1693(checked.)S +2157(To)S +2325(explicitly)S +2787(use)S +2979(this)S +3185(\(or)S +3358(any)S +3562(other\))S +3868(variable)S +4265(in)S +4396(the)S +4575(client)S +4864(task)S +5086(the)S +5220 V +11 I +900(cdl_open\(\))S +11 R +1407(procedure)S +1876(may)S +2098(be)S +2234(called)S +2528(as)S +2652(e.g.)S +5400 V +11 C +1175(if)S +1373(\(\(cdl)S +1769(=)S +1901(cdl_open)S +2495(\(getenv\("IMTDEV"\)\)\))S +3815(==)S +4013(NULL\))S +4409({)S +5520 V +1505(fprintf)S +2033(\(stderr,)S +2627("cannot)S +3155(open)S +3485(server)S +3947(connection\\n"\);)S +5640 V +1505(exit)S +1835(\(1\);)S +5760 V +1175(})S +6000 V +11 B +900(4.)S +1049(Image)S +1374(Display)S +6240 V +900(4.1.)S +1132(Overview)S +1615(of)S +1739(the)S +1918(Display)S +2307(Process)S +6396 V +11 R +1175(Basic)S +1492(image)S +1833(display)S +2224(is)S +2371(done)S +2658(most)S +2947(easily)S +3277(using)S +3590(the)S +3798(high-level)S +11 B +4317(cdl_displayIRAF\(\))S +11 R +5192(,)S +6516 V +11 B +900(cdl_displayFITS\(\))S +11 R +1807(and)S +11 B +2018(cdl_displayPix\(\))S +11 R +2831(procedures.)S +3424(These)S +3738(routines)S +4145(automatically)S +4796(de\256ne)S +5117(an)S +6636 V +900(image)S +1218(WCS)S +1507(and)S +1715(mapping,)S +2178(clear)S +2439(the)S +2623(frame,)S +2955(set)S +3127(the)S +3311(frame)S +3615(bu)S +3725 H + (f)show 11 -.5 mul h (f)show +11 R +3792(er)S +3926(con\256guration)S +4562(and)S +4770(center)S +5086(the)S +6756 V +900(image)S +1237(in)S +1392(the)S +1595(display.)S +2043(For)S +2265(most)S +2549(applications)S +3149(these)S +3443(are)S +3644(all)S +3823(that)S +4057(will)S +4298(be)S +4470(needed,)S +4876(but)S +5086(the)S +6876 V +11 B +900(cdl_writeSubRaster\(\))S +11 R +1940(procedure)S +2411(can)S +2597(also)S +2809(be)S +2947(used)S +3183(to)S +3304(display)S +3657(an)S +3795(image.)S +4159(For)S +4347(example,)S +4781(to)S +4902(display)S +6996 V +900(one)S +1109(image)S +1428(in)S +1565(a)S +1664(mosaic)S +2026(or)S +2168(other)S +2444(cases)S +2725(where)S +3042(the)S +3226(task)S +3453(needs)S +3752(low-level)S +4216(access)S +4544(to)S +4680(position)S +5086(the)S +7116 V +900(image)S +1201(or)S +1325(write)S +1583(raw)S +1779(pixel)S +2032(values.)S +7920 V +EP +%%Page: 4 7 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 4 -)S +840 V +1175(In)S +1322(these)S +1603(cases)S +1889(it)S +2007(is)S +2137(the)S +2328(responsibility)S +2985(of)S +3133(the)S +3324(client)S +3625(program)S +4053(to)S +4196(prepare)S +4579(the)S +4770(server)S +5093(for)S +960 V +900(display.)S +1312(The)S +1515(basic)S +1773(steps)S +2026(involved)S +2444(in)S +2563(displaying)S +3055(an)S +3191(image)S +3492(include)S +1200 V +11 B +1407(Operation)S +3773(CDL)S +4038(Procedure)S +1210 V +11 Y1 +1407(2)S +1413(222222222222222222222222222222222222222222222222222222222222)S +1330 V +11 R +1407(Selecting)S +1849(the)S +2016(frame)S +11 I +3773(cdl_setFrame\(\))S +1450 V +11 R +1407(Clear)S +1677(the)S +1844(frame)S +11 I +3773(cdl_clearFrame\(\))S +1570 V +11 R +1407(Select)S +1708(the)S +1875(frame)S +2162(bu)S +2272 H + (f)show 11 -.5 mul h (f)show +11 R +2339(er)S +2456(con\256guration)S +11 I +3773(cdl_selectFB\(\))S +1690 V +11 R +1407(Set)S +1581(the)S +1748(frame)S +2035(bu)S +2145 H + (f)show 11 -.5 mul h (f)show +11 R +2212(er)S +2329(con\256guration)S +11 I +3773(cdl_setFBCon\256g\(\))S +1810 V +11 R +1407(Scale)S +1677(the)S +1844(image)S +2145(pixels)S +2441(to)S +2560(201)S +2758(display)S +3109(values)S +11 I +3773(cdl_zscaleImage\(\))S +1930 V +11 R +1407(Compute)S +1844(the)S +2011(raster)S +2286(placement)S +2769(in)S +2888(the)S +3055(frame)S +3342(bu)S +3452 H + (f)show 11 -.5 mul h (f)show +11 R +3519(er)S +2050 V +1407(Construct)S +1868(a)S +11 I +1949(node!path)S +11 R +2427(image)S +2728(path)S +2170 V +1407(Set)S +1581(the)S +1748(image)S +2049(mapping)S +11 I +3773(cdl_setMapping\(\))S +2290 V +11 R +1407(De\256ne)S +1732(the)S +1899(image)S +2200(WCS)S +2410 V +1407(Set)S +1581(the)S +1748(image)S +2049(WCS)S +11 I +3773(cdl_setWCS\(\))S +2530 V +11 R +1407(Write)S +1689(the)S +1856(pixels)S +2152(to)S +2271(the)S +2438(display)S +11 I +3773(cdl_writeSubRaster\(\))S +2770 V +11 R +900(In)S +1044(cases)S +1328(like)S +1547(a)S +1649(mosaic)S +2014(display,)S +2414(obviously)S +2903(some)S +3189(steps)S +3463(\(e.g.)S +3712(clearing)S +4118(the)S +4306(frame,)S +4642(selecting)S +5086(the)S +2890 V +900(con\256guration,)S +1548(etc\))S +1745(will)S +1950(only)S +2179(need)S +2418(to)S +2537(be)S +2673(done)S +2919(once.)S +3219(XImtool)S +3625(V1.3)S +3875(and)S +4066(later)S +4293(version)S +4649(support)S +5012(mul-)S +3010 V +900(tiple)S +1147(WCSs)S +1480(in)S +1617(a)S +1716(single)S +2030(frame)S +2335(so)S +2484(each)S +2734(piece)S +3015(of)S +3157(the)S +3342(mosaic)S +3704(should)S +4050(de\256ne)S +4370(a)S +4470(mapping)S +4907(and)S +5117(an)S +3130 V +900(independent)S +1487(WCS.)S +1838(The)S +2058(last)S +2261(step)S +2488(in)S +2624(the)S +2808(display)S +3176(here)S +3413(should)S +3757(be)S +3910(a)S +4008(single)S +4321(WCS)S +4610(for)S +4787(the)S +4971(entire)S +3250 V +900(mosaic)S +1264(such)S +1518(as)S +1662(")S +11 I +1707(detector)S +2119(coordinates)S +11 R +2638(",)S +2764(without)S +3154(this)S +3367(the)S +3555(coordinates)S +4114(used)S +4369(by)S +4533(default)S +4891(will)S +5117(be)S +3370 V +900(based)S +1195(on)S +1351(the)S +1530(last)S +1728(WCS)S +2012(sent)S +2234(to)S +2365(the)S +2544(display.)S +2968(Servers)S +3341(which)S +3654(do)S +3809(not)S +3995(support)S +4370(mappings)S +4843(will)S +5060(just)S +3490 V +900(ignore)S +1227(the)S +1408(mapping)S +1840(information,)S +2434(but)S +2622(may)S +2858(still)S +3072(require)S +3428(a)S +3523(frame)S +3824(bu)S +3934 H + (f)show 11 -.5 mul h (f)show +11 R +4001(er)S +4132(WCS)S +4418(for)S +4593(other)S +4866(tasks)S +5134(to)S +3610 V +900(operate)S +1269(correctly.)S +1766(For)S +1967(simple)S +2309(displays)S +2718(of)S +2857(single)S +3168(images,)S +3555(the)S +3737(high-level)S +4230(routines)S +4632(handle)S +4972(all)S +5129(of)S +3730 V +900(these)S +1164(steps)S +1423(automatically,)S +2088(they)S +2316(are)S +2487(included)S +2904(here)S +3130(as)S +3260(checklist)S +3689(of)S +3819(what)S +4071(must)S +4326(be)S +4469(considered)S +4983(when)S +3850 V +900(using)S +1172(the)S +1339(CDL)S +1592(for)S +1752(low-level)S +2199(display.)S +4090 V +11 B +900(4.2.)S +1132(Displaying)S +1669(IRAF)S +1970(Images)S +4246 V +11 R +1175(The)S +11 B +1379(cdl_displayIRAF\(\))S +11 R +2288(procedure)S +2758(can)S +2943(be)S +3080(used)S +3315(to)S +3435(display)S +3787(an)S +3924(IRAF)S +4209(OIF)S +4420(format)S +4746(image)S +5049(\(i.e.)S +4366 V +900(images)S +1252(with)S +1489(a)S +11 I +1578(.imh)S +11 R +1812(extension\))S +2310(by)S +2461(simply)S +2803(passing)S +3174(in)S +3300(the)S +3474(image)S +3782(name.)S +4120(Pixel)S +4387(\256les)S +4611(for)S +4778(the)S +4952(image)S +4486 V +900(must)S +1150(be)S +1288(accessible)S +1766(from)S +2014(the)S +2183(local)S +2431(machine)S +2837(but)S +3013(can)S +3199(be)S +3337(in)S +3458(any)S +3651(directory,)S +4109(the)S +4278(HDR$)S +4600(syntax)S +4923(for)S +5086(the)S +4606 V +900(imdir)S +1174(is)S +1283(also)S +1495(recognized.)S +2070(Images)S +2421(may)S +2645(be)S +2783(three)S +3036(dimensional,)S +3637(the)S +11 I +3806(band)S +11 R +4060(argument)S +4508(is)S +4616(used)S +4851(to)S +4971(select)S +4726 V +900(the)S +1073(image)S +1380(band)S +1632(to)S +1757(be)S +1899(displayed.)S +2420(The)S +11 I +2629(frame)S +11 R +2924(and)S +11 I +3121(fbcon\256g)S +11 R +3514(arguments)S +4011(select)S +4300(the)S +4474(frame)S +4768(and)S +4966(frame)S +4846 V +900(bu)S +1010 H + (f)show 11 -.5 mul h (f)show +11 R +1077(er)S +1210(size)S +1429(respectively,)S +2035(the)S +2218(special)S +2571(symbolic)S +3024(value)S +11 B +3310(FB_AUTO)S +11 R +3872(may)S +4109(be)S +4260(used)S +4509(for)S +4684(the)S +11 I +4866(fbcon\256g)S +4966 V +11 R +900(argument)S +1358(to)S +1488(have)S +1738(the)S +1916(procedure)S +2396(automatically)S +3038(select)S +3331(the)S +3509(frame)S +3807(bu)S +3917 H + (f)show 11 -.5 mul h (f)show +11 R +3984(er)S +4112(most)S +4371(appropriate)S +4914(for)S +5086(the)S +5086 V +900(image)S +1208(size.)S +1479(If)S +1591(the)S +11 I +1765(zscale)S +11 R +2073(\257ag)S +2278(is)S +2392(greater)S +2734(than)S +2963(zero)S +3190(the)S +3364(image)S +3672(will)S +3884(automatically)S +4522(be)S +4664(converted)S +5134(to)S +5206 V +900(8-bit)S +1154(values)S +1480(using)S +1765(the)S +1945(zscale)S +2257(mapping)S +2688(algorithm.)S +3223(The)S +3439(function)S +3851(returns)S +4201(a)S +4295(positive)S +4690(value)S +4973(if)S +5086(the)S +5326 V +900(image)S +1201(cannot)S +1526(be)S +1662(accessed)S +2076(or)S +2200(displayed)S +2654(for)S +2814(any)S +3005(reason,)S +3351(an)S +3487(error)S +3731(message)S +4135(will)S +4340(be)S +4476(printed.)S +5482 V +1175(The)S +11 I +1393(cdl_isIRAF\(\))S +11 R +2013(procedure)S +2497(returns)S +2849(a)S +2946(positive)S +3344(value)S +3630(if)S +3746(the)S +3929(\256lename)S +4356(argument)S +4819(is)S +4942(recog-)S +5602 V +900(nized)S +1177(as)S +1308(an)S +1451(IRAF)S +1742(image,)S +2078(it)S +2180(does)S +2421(not)S +2602(check)S +2896(whether)S +3288(the)S +3462(pixel)S +3722(\256le)S +3903(can)S +4094(be)S +4236(successfully)S +4811(accessed.)S +5722 V +900(For)S +1086(simply)S +1420(reading)S +1781(the)S +1948(pixels)S +2244(from)S +2490(an)S +2626(IRAF)S +2910(image)S +3211(the)S +11 B +3378(cdl_readIRAF\(\))S +11 R +4161(procedure)S +4631(may)S +4854(be)S +4991(used.)S +5842 V +900(The)S +1114(function)S +1524(returns)S +1872(a)S +1964(zero)S +2195(value)S +2475(and)S +2676(sets)S +2884(the)S +3061(output)S +3386(pixel)S +3649(array,)S +3943(image)S +4254(dimensions)S +4799(and)S +5000(pixel)S +5962 V +900(size)S +1117(if)S +1231(successful,)S +1756(otherwise)S +2229(the)S +2410(function)S +2823(returns)S +3175(a)S +3271(positive)S +3668(value.)S +4014(Note)S +4275(that)S +4488(the)S +4670(output)S +5000(pixel)S +6082 V +900(values)S +1213(may)S +1435(need)S +1674(to)S +1793(be)S +1929(scaled)S +2235(before)S +2546(they)S +2768(can)S +2952(be)S +3088(displayed.)S +6322 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6442 V +11 C +1175(int)S +1439(cdl_displayIRAF)S +2495(\(CDLPtr)S +3023(cdl,)S +3353(char)S +3683(*fname,)S +4211(int)S +4475(band,)S +6562 V +1439(int)S +1703(frame,)S +2165(int)S +2429(fbconfig,)S +3089(int)S +3353(zscale\))S +6682 V +1175(int)S +1439(cdl_isIRAF)S +2165(\(char)S +2561(*fname\))S +6802 V +1175(int)S +1439(cdl_readIRAF)S +2297(\(char)S +2693(*fname,)S +3221(int)S +3485(band,)S +3881(uchar)S +4277(**pix,)S +6922 V +1439(int)S +1703(*nx,)S +2033(int)S +2297(*ny,)S +2627(int)S +2891(*bitpix,)S +3485(char)S +3815(*title\))S +7920 V +EP +%%Page: 5 8 +BP +/slant 0 def +/height 1.000000 def +11 C +11 C +480 V +11 R +2963(- 5 -)S +840 V +11 B +900(4.3.)S +1132(Displaying)S +1669(FITS)S +1948(Images)S +996 V +11 R +1175(The)S +11 B +1385(cdl_displayFITS\(\))S +11 R +2278(procedure)S +2754(can)S +2945(be)S +3088(used)S +3329(to)S +3455(display)S +3813(a)S +11 I +3901(simple)S +11 R +4228(FITS)S +4495(image)S +4804(by)S +4955(name.)S +1116 V +900(A)S +1016("simple")S +1437(FITS)S +1701(\256le)S +1879(is)S +1990(assumed)S +2405(to)S +2528(be)S +2668(one)S +2863(containing)S +3364(a)S +3449(single)S +3749(image)S +4053(and)S +4247(having)S +4582(no)S +4728(extensions.)S +1236 V +900(Other)S +1183(types)S +1449(of)S +1574(FITS)S +1835(\256les)S +2053(may)S +2276(of)S +2401(course)S +2720(be)S +2857(displayed)S +3312(but)S +3487(the)S +3655(client)S +3933(will)S +4139(have)S +4379(to)S +4499(use)S +4680(other)S +4940(means)S +1356 V +900(to)S +1026(import)S +1360(the)S +1534(pixels.)S +1898(FITS)S +2164(image)S +2471(extensions)S +2974(may)S +3202(be)S +3344(supported)S +3816(in)S +3941(a)S +4028(future)S +4328(release)S +4669(of)S +4799(the)S +4972(CDL.)S +1476 V +900(The)S +11 I +1110(frame)S +11 R +1406(and)S +11 I +1605(fbcon\256g)S +11 R +2000(arguments)S +2498(select)S +2788(the)S +2963(frame)S +3258(and)S +3457(frame)S +3752(bu)S +3862 H + (f)show 11 -.5 mul h (f)show +11 R +3929(er)S +4054(size)S +4265(respectively,)S +4863(the)S +5038(spe-)S +1596 V +900(cial)S +1103(symbolic)S +1552(value)S +11 B +1834(FB_AUTO)S +11 R +2393(may)S +2627(be)S +2775(used)S +3021(for)S +3192(the)S +11 I +3370(fbcon\256g)S +11 R +3768(argument)S +4226(to)S +4356(have)S +4606(the)S +4784(procedure)S +1716 V +900(automatically)S +1540(select)S +1831(the)S +2007(frame)S +2303(bu)S +2413 H + (f)show 11 -.5 mul h (f)show +11 R +2480(er)S +2606(most)S +2863(appropriate)S +3403(for)S +3573(the)S +3750(image)S +4061(size.)S +4335(If)S +4450(the)S +11 I +4627(zscale)S +11 R +4938(\257ag)S +5146(is)S +1836 V +900(greater)S +1236(than)S +1459(zero)S +1680(the)S +1847(image)S +2148(will)S +2353(automatically)S +2984(be)S +3120(converted)S +3584(to)S +3703(8-bit)S +3944(values)S +4257(using)S +4529(the)S +4696(zscale)S +4995(map-)S +1956 V +900(ping)S +1154(algorithm.)S +1702(The)S +1931(function)S +2356(returns)S +2719(a)S +2826(positive)S +3234(value)S +3530(if)S +3656(the)S +3849(image)S +4176(cannot)S +4527(be)S +4689(accessed)S +5129(or)S +2076 V +900(displayed)S +1354(for)S +1514(any)S +1705(reason,)S +2051(an)S +2187(error)S +2431(message)S +2835(will)S +3040(be)S +3176(printed.)S +2232 V +1175(The)S +11 I +1378(cdl_isFITS\(\))S +11 R +1966(procedure)S +2435(returns)S +2772(a)S +2853(positive)S +3235(value)S +3505(if)S +3605(the)S +3773(\256lename)S +4185(argument)S +4633(is)S +4741(recognized)S +2352 V +900(as)S +1037(a)S +1131(simple)S +1470(FITS)S +1742(image.)S +2116(For)S +2314(simply)S +2660(reading)S +3033(the)S +3212(image)S +3525(pixels)S +3833(the)S +11 B +4012(cdl_readFITS\(\))S +11 R +4784(procedure)S +2472 V +900(may)S +1123(be)S +1260(used.)S +1556(The)S +1760(output)S +2076(pixel)S +2330(array,)S +2615(image)S +2917(dimensions)S +3453(and)S +3645(pixel)S +3899(size)S +4103(are)S +4269(returned)S +4668(if)S +4770(successful)S +2592 V +900(otherwise)S +1362(the)S +1532(function)S +1934(returns)S +2274(a)S +2358(positive)S +2743(value.)S +3077(Note)S +3326(that)S +3527(the)S +3697(returned)S +4097(pixel)S +4353(values)S +4669(may)S +4893(need)S +5134(to)S +2712 V +900(be)S +1036(scaled)S +1342(before)S +1653(they)S +1875(can)S +2059(be)S +2195(displayed.)S +2952 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +3072 V +11 C +1175(int)S +1439(cdl_displayFITS)S +2495(\(CDLPtr)S +3023(cdl,)S +3353(char)S +3683(*fname,)S +4211(int)S +4475(frame,)S +3192 V +1439(int)S +1703(fbconfig,)S +2363(int)S +2627(zscale\))S +3312 V +1175(int)S +1439(cdl_isFITS)S +2165(\(char)S +2561(*fname\))S +3432 V +1175(int)S +1439(cdl_readFITS)S +2297(\(char)S +2693(*fname,)S +3221(uchar)S +3617(**pix,)S +4079(int)S +4343(*nx,)S +4673(int)S +4937(*ny,)S +3552 V +1439(int)S +1703(*bitpix,)S +2297(char)S +2627(*title\))S +3792 V +11 B +900(4.4.)S +1132(Displaying)S +1669(Raw)S +1915(Pixels)S +3948 V +11 R +1175(The)S +11 B +1381(cdl_displayPix\(\))S +11 R +2177(procedure)S +2649(can)S +2837(be)S +2977(used)S +3215(to)S +3338(display)S +3693(an)S +3833(arbitrary)S +4246(array)S +4506(of)S +4634(pixels)S +4934(of)S +5062(any)S +4068 V +900(size.)S +1166(The)S +11 I +1371(nx)S +11 R +1509(and)S +11 I +1701(ny)S +11 R +1838(arguments)S +2329(are)S +2495(the)S +2663(raster)S +2939(dimensions,)S +3503(and)S +11 I +3695(bitpix)S +11 R +3980(is)S +4088(the)S +4256(pixel)S +4510(size)S +4714(and)S +4906(has)S +5086(the)S +4188 V +900(same)S +1178(meaning)S +1609(as)S +1753(the)S +1940(FITS)S +2220(BITPIX)S +2627(keyword.)S +3124(The)S +11 I +3347(frame)S +11 R +3656(and)S +11 I +3867(fbcon\256g)S +11 R +4274(arguments)S +4784(select)S +5086(the)S +4308 V +900(frame)S +1199(and)S +1402(frame)S +1701(bu)S +1811 H + (f)show 11 -.5 mul h (f)show +11 R +1878(er)S +2007(size)S +2222(respectively,)S +2824(the)S +3003(special)S +3352(symbolic)S +3800(value)S +11 B +4081(FB_AUTO)S +11 R +4639(may)S +4872(be)S +5019(used)S +4428 V +900(for)S +1082(the)S +11 I +1271(fbcon\256g)S +11 R +1680(argument)S +2149(to)S +2290(have)S +2551(the)S +2740(procedure)S +3231(automatically)S +3884(select)S +4188(the)S +4378(frame)S +4688(bu)S +4798 H + (f)show 11 -.5 mul h (f)show +11 R +4865(er)S +5005(most)S +4548 V +900(appropriate)S +1441(for)S +1611(the)S +1788(image)S +2099(size.)S +2372(If)S +2486(the)S +11 I +2662(zscale)S +11 R +2972(\257ag)S +3179(is)S +3295(greater)S +3639(than)S +3870(zero)S +4099(the)S +4275(image)S +4585(will)S +4799(automati-)S +4668 V +900(cally)S +1146(be)S +1282(converted)S +1746(to)S +1865(8-bit)S +2106(values)S +2419(using)S +2691(the)S +2858(zscale)S +3157(mapping)S +3575(algorithm.)S +4908 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +5028 V +11 C +1175(int)S +1439(cdl_displayPix)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(uchar)S +3683(*pix,)S +4079(int)S +4343(nx,)S +4607(int)S +4871(ny,)S +5148 V +1439(int)S +1703(bitpix,)S +2231(int)S +2495(frame,)S +2957(int)S +3221(fbconfig,)S +3881(int)S +4145(zscale\))S +5388 V +11 B +900(4.5.)S +1132(Frame)S +1474(Selection)S +5544 V +11 R +1175(Frame)S +1495(selection)S +1925(is)S +2039(normally)S +2476(done)S +2729(as)S +2860(an)S +3003(argument)S +3457(to)S +3583(one)S +3781(of)S +3913(the)S +4088(display)S +4447(procedures,)S +4995(how-)S +5664 V +900(ever)S +1127(frames)S +1464(may)S +1693(be)S +1836(explicitly)S +2292(selected)S +2684(using)S +2963(the)S +11 B +3136(cdl_setFrame\(\))S +11 R +3879(procedure.)S +4415(This)S +4650(allows)S +4976(client)S +5784 V +900(programs)S +1361(to)S +1494(essentially)S +2005("blink")S +2370(frames)S +2715(independently,)S +3413(as)S +3552(long)S +3796(as)S +3935(the)S +4117(server)S +4431(supports)S +4852(multiple)S +5904 V +900(frames.)S +1291(The)S +11 B +1494(cdl_getFrame\(\))S +11 R +2243(procedure)S +2712(may)S +2934(be)S +3070(used)S +3304(to)S +3423(get)S +3590(the)S +3757(current)S +4099(frame)S +4386(set)S +4541(in)S +4660(the)S +4827(server.)S +6144 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6264 V +11 C +1175(void)S +1505(cdl_setFrame)S +2363(\(CDLPtr)S +2891(cdl,)S +3221(int)S +3485(frame\))S +6384 V +1175(void)S +1505(cdl_getFrame)S +2363(\(CDLPtr)S +2891(cdl,)S +3221(int)S +3485(*frame\))S +6624 V +11 B +900(4.6.)S +1132(Clearing)S +1574(the)S +1753(Display)S +6780 V +11 R +1175(The)S +1400(current)S +1764(display)S +2137(frame)S +2446(may)S +2690(be)S +2848(explicitly)S +3320(cleared)S +3690(using)S +3985(the)S +11 B +4175(cdl_clearFrame\(\))S +11 R +5038(pro-)S +6900 V +900(cedure.)S +1329(The)S +1577(frame)S +1909(is)S +2061(also)S +2316(cleared)S +2707(prior)S +2997(to)S +3160(displaying)S +3696(new)S +3955(images)S +4343(by)S +4530(the)S +4741(procedures)S +7020 V +11 B +900(cdl_displayPix\(\))S +11 R +1660(,)S +11 B +1721(cdl_displayFITS\(\))S +11 R +2574(,)S +2635(and)S +11 B +2826(cdl_displayIRAF\(\))S +11 R +3701(.)S +7260 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +7920 V +EP +%%Page: 6 9 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 6 -)S +840 V +11 C +1175(int)S +1439(cdl_clearFrame)S +2429(\(CDLPtr)S +2957(cdl\))S +1080 V +11 B +900(4.7.)S +1132(Frame)S +1474(Bu)S +1610 H + (f)show 11 -.5 mul h (f)show +11 B +1677(er)S +1806(Selection)S +1236 V +11 R +1175(The)S +1415(default)S +1789(frame)S +2113(bu)S +2223 H + (f)show 11 -.5 mul h (f)show +11 R +2290(er)S +2444(used)S +2715(is)S +2859(512x512,)S +3342(other)S +3637(sizes)S +3920(may)S +4179(be)S +4353(selected)S +4776(using)S +5086(the)S +1356 V +11 B +900(cdl_setFBCon\256g\(\))S +11 R +1796(procedure.)S +2340(To)S +2509(set)S +2678(the)S +2859(frame)S +3160(bu)S +3270 H + (f)show 11 -.5 mul h (f)show +11 R +3337(er)S +3467(size)S +3683(the)S +3863(client)S +4153(passes)S +4479(the)S +4659(frame)S +4959(bu)S +5069 H + (f)show 11 -.5 mul h (f)show +11 R +5136(er)S +1476 V +900(number)S +1284(as)S +1424(de\256ned)S +1796(in)S +1931(the)S +2114(frame)S +2417(bu)S +2527 H + (f)show 11 -.5 mul h (f)show +11 R +2594(er)S +2727(con\256guration)S +3362(\256le)S +3552(\(see)S +3776(below\))S +4130(while)S +4424(setting)S +4768(the)S +4952(image)S +1596 V +900(WCS.)S +1243(It)S +1353(is)S +1470(important)S +1941(to)S +2069(note)S +2300(that)S +2507(the)S +2683(frame)S +2979(bu)S +3089 H + (f)show 11 -.5 mul h (f)show +11 R +3156(er)S +3282(isn't)S +3520(actually)S +3909(changed)S +4315(in)S +4443(the)S +4619(server)S +4927(until)S +5172(a)S +1716 V +900(subsequent)S +11 B +1431(cdl_setWCS\(\))S +11 R +2120(call,)S +2349(either)S +2641(directly)S +3019(or)S +3154(through)S +3540(some)S +3816(other)S +4085(procedure)S +4565(which)S +4877(sets)S +5086(the)S +1836 V +900(WCS)S +1172(\(e.g.)S +1400(one)S +1591(of)S +1715(the)S +1882(display)S +2233(procedures\).)S +1992 V +1175(To)S +1384(get)S +1605(the)S +1827(size)S +2085(of)S +2264(the)S +2486(currently)S +2969(de\256ned)S +3380(frame)S +3722(bu)S +3832 H + (f)show 11 -.5 mul h (f)show +11 R +3899(er)S +4071(the)S +4293(user)S +4563(may)S +4840(call)S +5086(the)S +2112 V +11 B +900(cdl_getFBCon\256g\(\))S +11 R +1803(procedure.)S +2342(This)S +2580(returns)S +2926(not)S +3109(only)S +3347(the)S +3523(current)S +3873(con\256guration)S +4500(number,)S +4904(but)S +5086(the)S +2232 V +900(size)S +1121(as)S +1263(well.)S +1564(To)S +1737(get)S +1922(the)S +2107(size)S +2328(and)S +2537(any)S +2746(arbitrary)S +3173(con\256guration)S +3810(without)S +4199(actually)S +4598(setting)S +4944(it,)S +5086(the)S +2352 V +11 B +900(cdl_lookupFBSize\(\))S +11 R +1880(procedure)S +2371(may)S +2615(be)S +2773(used.)S +3090(Any)S +3333(con\256guration)S +3973(not)S +4168(actually)S +4569(de\256ned)S +4946(in)S +5086(the)S +2472 V +900(frame)S +1187(bu)S +1297 H + (f)show 11 -.5 mul h (f)show +11 R +1364(er)S +1481(con\256guration)S +2100(\256le)S +2274(is)S +2381(returned)S +2778(as)S +2902(the)S +3069(default)S +3406(512x512)S +3824(size.)S +2712 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +2832 V +11 C +1175(void)S +1505(cdl_setFBConfig)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(int)S +3683(configno\))S +2952 V +1175(void)S +1505(cdl_getFBConfig)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(int)S +3683(*configno,)S +4409(int)S +4673(*width,)S +3072 V +1439(int)S +1703(*height,)S +2297(int)S +2561(*nframes\))S +3192 V +1175(void)S +1505(cdl_lookupFBSize)S +2627(\(CDLPtr)S +3155(cdl,)S +3485(int)S +3749(configno,)S +4409(int)S +4673(*width,)S +3312 V +1439(int)S +1703(*height,)S +2297(int)S +2561(*nframes\))S +3552 V +11 B +900(4.7.1.)S +1215(Automatic)S +1741(Selection)S +3708 V +11 R +1175(The)S +11 B +1383(cdl_selectFB\(\))S +11 R +2084(procedure)S +2558(may)S +2785(be)S +2926(used)S +3165(to)S +3289(select)S +3577(the)S +3750(most)S +4004(appropriate)S +4541(frame)S +4834(bu)S +4944 H + (f)show 11 -.5 mul h (f)show +11 R +5011(er)S +5134(to)S +3828 V +900(use)S +1085(for)S +1251(a)S +1338(given)S +1621(image)S +1928(size.)S +2198(If)S +2309(possible)S +2709(a)S +2796(frame)S +3089(bu)S +3199 H + (f)show 11 -.5 mul h (f)show +11 R +3266(er)S +3389(the)S +3562(same)S +3825(size)S +4033(as)S +4162(the)S +4334(image)S +4640(will)S +4850(be)S +4991(used,)S +3948 V +900(otherwise)S +1364(one)S +1560(that)S +1763(is)S +1875(larger)S +2167(will)S +2377(be)S +2518(chosen.)S +2922(Rather)S +3253(than)S +3481(simply)S +3821(selecting)S +4250(the)S +4423(\256rst)S +4634(con\256guration)S +4068 V +900(larger)S +1192(than)S +1419(the)S +1590(image,)S +1923(the)S +2094(procedure)S +2567(searches)S +2973(the)S +3144(entire)S +3430(con\256guration)S +4053(\256le)S +4231(selecting)S +4658(the)S +4829(one)S +5024(with)S +4188 V +900(the)S +1067(least)S +1302(empty)S +1611(space)S +1887(in)S +2007(both)S +2237(dimensions.)S +2834(If)S +2940(the)S +11 I +3108(reset)S +11 R +3355(\257ag)S +3554(is)S +3662(non-zero)S +4084(this)S +4278(frame)S +4566(is)S +4674(set)S +4830(automat-)S +4308 V +900(ically)S +1184(by)S +1334(the)S +1508(procedure,)S +2012(otherwise)S +2478(the)S +2652(selected)S +3044(dimension)S +3543(is)S +3657(simply)S +3998(returned)S +4402(to)S +4527(the)S +4700(calling)S +5038(pro-)S +4428 V +900(gram.)S +1227(In)S +1359(either)S +1649(case)S +1877(the)S +2052(new)S +2275(frame)S +2570(bu)S +2680 H + (f)show 11 -.5 mul h (f)show +11 R +2747(er)S +2872(will)S +3085(not)S +3267(take)S +3490(e)S +3538 H + (f)show 11 -.5 mul h (f)show +11 R +3605(ect)S +3773(until)S +4017(a)S +4107(new)S +4331(WCS)S +4612(is)S +4728(de\256ned)S +5093(for)S +4548 V +900(the)S +1067(frame.)S +4788 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4908 V +11 C +1175(void)S +1505(cdl_selectFB)S +2363(\(CDLPtr)S +2891(cdl,)S +3221(int)S +3485(nx,)S +3749(int)S +4013(ny,)S +4277(int)S +4541(*fb,)S +5028 V +1450(int)S +1714(*w,)S +1978(int)S +2242(*h,)S +2506(int)S +2770(*nf,)S +3100(int)S +3364(reset\))S +5268 V +11 B +900(4.7.2.)S +1215(The)S +1432(Frame)S +1774(Bu)S +1910 H + (f)show 11 -.5 mul h (f)show +11 B +1977(er)S +2106(Con\256guration)S +2801(File)S +5424 V +11 R +1175(The)S +1378(size)S +1581(of)S +1705(the)S +1872(frame)S +2160(bu)S +2270 H + (f)show 11 -.5 mul h (f)show +11 R +2337(er)S +2455(is)S +2563(not)S +2738(passed)S +3064(directly)S +3433(to)S +3553(the)S +3721(server)S +4021(since)S +4280(this)S +4474(is)S +4582(not)S +4757(part)S +4961(of)S +5086(the)S +5544 V +900(communications)S +1675(protocol)S +2089(used.)S +2399(Instead,)S +2790(the)S +2971(frame)S +3272(bu)S +3382 H + (f)show 11 -.5 mul h (f)show +11 R +3449(er)S +3580(number)S +3962(is)S +4083(sent)S +4307(as)S +4445(part)S +4662(of)S +4800(the)S +4981(WCS)S +5664 V +900(header)S +1247(packet.)S +1650(So)S +1824(that)S +2046(both)S +2299(the)S +2490(server)S +2813(and)S +3028(client)S +3330(can)S +3539(know)S +3841(that)S +4064(a)S +4170(particular)S +4647(frame)S +4959(bu)S +5069 H + (f)show 11 -.5 mul h (f)show +11 R +5136(er)S +5784 V +900(number)S +1277(corresponds)S +1848(to)S +1976(a)S +2066(speci\256c)S +2443(size,)S +2683(a)S +11 I +2773(frame)S +3071(bu)S +3181 H + (f)show 11 -.5 mul h (f)show +11 I +3237(er)S +3370(con\256guration)S +4005(\256le)S +11 R +4181(is)S +4297(used)S +4540(which)S +4849(both)S +5086(the)S +5904 V +900(client)S +1177(and)S +1368(server)S +1667(read.)S +6060 V +1175(The)S +1383(default)S +1725(con\256guration)S +2349(\256le)S +2528(is)S +2640(/usr/local/lib/imtoolrc,)S +3667(this)S +3865(can)S +4055(be)S +4197(overridden)S +4710(by)S +4859(de\256ning)S +6180 V +900(an)S +11 B +1038(IMTOOLRC)S +11 R +1697(environment)S +2287(variable)S +2674(naming)S +3039(the)S +3208(\256le)S +3384(to)S +3505(be)S +3643(used,)S +3907(or)S +4032(by)S +4176(creating)S +4562(a)S +4644(.imtoolrc)S +5079(\256le)S +6300 V +900(in)S +1022(your)S +1259(home)S +1539(directory.)S +2031(Since)S +2311(the)S +2481(server)S +2783(must)S +3034(also)S +3247(read)S +3470(the)S +3640(same)S +3901(\256le,)S +4106(this)S +4302(must)S +4553(be)S +4692(done)S +4942(before)S +6420 V +900(starting)S +1263(both)S +1492(the)S +1659(client)S +1936(and)S +2127(server)S +2426(applications.)S +6576 V +900(The)S +1103(format)S +1428(of)S +1552(the)S +1719(frame)S +2006(bu)S +2116 H + (f)show 11 -.5 mul h (f)show +11 R +2183(er)S +2300(con\256guration)S +2919(\256le)S +3093(is)S +6756 V +11 I +1175(con\256gno)S +1586(nframes)S +1973(width)S +2252(height)S +2560([extra)S +2861(\256elds])S +6936 V +11 R +900(e.g.)S +7116 V +1230(1)S +1351(2)S +1472(512)S +1703(512)S +7236 V +1230(2)S +1351(2)S +1472(800)S +1703(800)S +7920 V +EP +%%Page: 7 10 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 7 -)S +840 V +1230(3)S +1351(1)S +1439(1024)S +1692(1024)S +2242(#)S +2330(comment)S +960 V +1230(:)S +1327(:)S +1457(:)S +1620(:)S +1200 V +900(At)S +1050(most)S +1305(128)S +1510(frame)S +1804(bu)S +1914 H + (f)show 11 -.5 mul h (f)show +11 R +1981(er)S +2105(sizes)S +2358(may)S +2587(be)S +2730(de\256ned,)S +3121(each)S +3360(con\256guration)S +3986(may)S +4215(de\256ne)S +4523(up)S +4673(to)S +4799(4)S +4895(frames,)S +1320 V +900(con\256guration)S +1519(numbers)S +1930(need)S +2169(not)S +2343(be)S +2479(sequential)S +2957(but)S +3131(should)S +3458(be)S +3594(in)S +3713(ascending)S +4184(order.)S +1560 V +11 B +900(4.8.)S +1132(Image)S +1457(WCS)S +1741(Description)S +1716 V +11 R +1175(The)S +1380(image)S +1683(WCS)S +1957(is)S +2066(de\256ned)S +2424(using)S +2698(the)S +11 B +2868(cdl_setWCS\(\))S +11 R +3550(procedure.)S +4083(The)S +4289(WCS)S +4564(de\256nes)S +4911(a)S +4995(map-)S +1836 V +900(ping)S +1137(between)S +1542(any)S +1741(linear)S +2031(coordinate)S +2534(system)S +2881(and)S +3080(the)S +3254(image)S +3562(pixels,)S +3893(for)S +4060(our)S +4246(purposes)S +4676(we)S +4843(will)S +5055(dis-)S +1956 V +900(cuss)S +1126(how)S +1352(the)S +1523(WCS)S +1799(is)S +1910(used)S +2148(to)S +2271(map)S +2497(the)S +2668(frame)S +2959(bu)S +3069 H + (f)show 11 -.5 mul h (f)show +11 R +3136(er)S +3257(pixels)S +3557(to)S +3680(image)S +3985(coordinates.)S +4588(It)S +4692(is)S +4804(passed)S +5134(to)S +2076 V +900(the)S +1067(server)S +1366(in)S +1485(a)S +1566(string)S +1850(of)S +1974(the)S +2141(form:)S +2256 V +11 I +1428(name)S +11 R +1698(-)S +11 I +1767(title)S +11 R +1939(\\n)S +2376 V +1450(a)S +1531(b)S +1619(c)S +1700(d)S +1788(tx)S +1907(ty)S +2026(z1)S +2162(z2)S +2298(zt)S +2520 V +900(where:)S +2664 V +11 B +1362(X)S +11 R +1441(')S +1510(=)S +1605(a)S +1686(*)S +11 B +1774(X)S +11 R +1886(+)S +1981(c)S +2062(*)S +11 B +2150(Y)S +11 R +2262(+)S +2357(tx)S +2784 V +11 B +1362(Y)S +11 R +1441(')S +1510(=)S +1605(b)S +1693(*)S +11 B +1781(X)S +11 R +1893(+)S +1988(d)S +2076(*)S +11 B +2164(Y)S +11 R +2276(+)S +2371(ty)S +3024 V +900(The)S +1111(terms)S +11 I +1396(a,)S +1520(b,)S +1644(c)S +11 R +1692(,)S +1761(and)S +11 I +1960(d)S +11 R +2056(de\256ne)S +2366(a)S +2456(rotation)S +2840(of)S +2973(the)S +3149(WCS)S +3430(wrt)S +3618(the)S +3794(pixel)S +4056(\(i.e.)S +4269(frame)S +4565(bu)S +4675 H + (f)show 11 -.5 mul h (f)show +11 R +4742(er\))S +4904(coordi-)S +3144 V +900(nates,)S +1195(the)S +11 I +1371(tx)S +11 R +1492(and)S +11 I +1692(ty)S +11 R +1813(values)S +2135(are)S +2309(translation)S +2815(terms)S +3101(relative)S +3471(to)S +3599(the)S +3775(upper-left)S +4248(corner)S +4567(of)S +4699(the)S +4874(display.)S +3264 V +900(The)S +1134(remaining)S +1643(three)S +1925(values)S +2269(de\256ne)S +2601(the)S +2799(intensity)S +3243(mapping)S +3692(of)S +3847(the)S +4045(display)S +4427(pixels;)S +11 I +4785(z1)S +11 R +4947(is)S +5086(the)S +3384 V +900(minimum)S +1373(pixel)S +1636(value)S +1916(used)S +2160(in)S +2289(the)S +2466(transformation,)S +11 I +3183(z2)S +11 R +3324(is)S +3441(the)S +3618(maximum)S +4108(value,)S +4416(and)S +11 I +4617(zt)S +11 R +4733(de\256nes)S +5086(the)S +3504 V +900(type)S +1122(of)S +1246(transformation)S +1925(used)S +2159(\(0)S +2283(for)S +2443(none,)S +2717(1)S +2805(for)S +2965(linear,)S +3275(2)S +3363(for)S +3523(log10\).)S +3660 V +1175(The)S +1391(WCS)S +1676(may)S +1911(be)S +2060(set)S +2228(explicitly)S +2690(by)S +2846(the)S +3026(calling)S +3371(program)S +3788(or)S +3925(a)S +4019(default)S +4369(appropriate)S +4913(for)S +5086(the)S +3780 V +900(image)S +1209(will)S +1422(be)S +1566(set)S +1729(automatically)S +2368(by)S +2519(the)S +2694(high-level)S +3180(display)S +3539(procedures,)S +4086(otherwise)S +4552(a)S +4640(WCS)S +4919(for)S +5086(the)S +3900 V +900(frame)S +1200(bu)S +1310 H + (f)show 11 -.5 mul h (f)show +11 R +1377(er)S +1507(is)S +1627(de\256ned)S +1996(\(i.e.)S +2213(returned)S +2623(coordinates)S +3174(are)S +3352(frame)S +3652(bu)S +3762 H + (f)show 11 -.5 mul h (f)show +11 R +3829(er)S +3959(coords\).)S +4394(As)S +4562(an)S +4711(example)S +5129(of)S +4020 V +900(how)S +1134(the)S +1313(WCS)S +1597(is)S +1716(de\256ned,)S +2112(the)S +2291(default)S +2640(WCS)S +2924(for)S +3096(an)S +3244(image)S +11 I +3557(IMX)S +11 R +3796(x)S +11 I +3896(IMY)S +11 R +4130(pixels)S +4438(in)S +4569(a)S +4661(frame)S +4959(bu)S +5069 H + (f)show 11 -.5 mul h (f)show +11 R +5136(er)S +4140 V +11 I +900(FBX)S +11 R +1134(x)S +11 I +1222(FBY)S +11 R +1451(pixels)S +1747(is)S +1854(de\256ned)S +2210(as)S +4320 V +11 C +1428(a)S +1626(=)S +1824(1.0;)S +3738(/*)S +3936(no)S +4134(rotation)S +4728(*/)S +4440 V +1428(b)S +1626(=)S +1824(0.0;)S +4560 V +1428(c)S +1626(=)S +1824(0.0;)S +4680 V +1428(d)S +1626(=)S +1758(-1.0;)S +4800 V +1428(tx)S +1626(=)S +1758(\()S +11 I +1824(IMX)S +11 C +2084(/)S +2216(2\))S +2414(-)S +2546(\()S +11 I +2612(FBX)S +11 C +2879(/)S +3011(2\))S +3209(+)S +3341(1;)S +3737(/*)S +3935(center)S +4397(in)S +4595(FB)S +4793(*/)S +4920 V +1428(ty)S +1626(=)S +1758(\()S +11 I +1824(FBY)S +11 C +2086(/)S +2218(2\))S +2416(+)S +2548(\()S +11 I +2614(IMY)S +11 C +2869(/)S +3001(2\);)S +5040 V +1428(z1)S +1626(=)S +1758(z1;)S +3738(/*)S +3936(zscale)S +4398(values)S +4860(*/)S +5160 V +1428(z2)S +1626(=)S +1758(z2;)S +5280 V +1428(zt)S +1626(=)S +1758(1;)S +5520 V +11 R +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +5640 V +11 C +1175(int)S +1439(cdl_setWCS)S +2165(\(CDLPtr)S +2693(cdl,)S +3023(char)S +3353(*name,)S +3815(char)S +4145(*title,)S +5760 V +1439(float)S +1835(a,)S +2033(float)S +2429(b,)S +2627(float)S +3023(c,)S +3221(float)S +3617(d,)S +3815(float)S +4211(tx,)S +4475(float)S +4871(ty,)S +5880 V +1439(float)S +1835(z1,)S +2099(float)S +2495(z2,)S +2759(int)S +3023(zt\))S +6000 V +1175(int)S +1439(cdl_getWCS)S +2165(\(CDLPtr)S +2693(cdl,)S +3023(char)S +3353(*name,)S +3815(char)S +4145(*title,)S +6120 V +1439(float)S +1835(*a,)S +2099(float)S +2495(*b,)S +2759(float)S +3155(*c,)S +3419(float)S +3815(*d,)S +4079(float)S +4475(*tx,)S +4805(float)S +5201(*ty,)S +6240 V +1439(float)S +1835(*z1,)S +2165(float)S +2561(*z2,)S +2891(int)S +3155(*zt\))S +6480 V +11 B +900(4.8.1.)S +1215(Image)S +1540(Mappings)S +6636 V +11 R +1175(Beginning)S +1668(with)S +11 B +1898(X11IRAF)S +2389(V1.3)S +11 R +2640(the)S +11 I +2808(XImtool)S +11 R +3196(display)S +3549(server)S +3850(has)S +4031(had)S +4224(the)S +4393(ability)S +4710(to)S +4831(use)S +5012(mul-)S +6756 V +900(tiple)S +1135(world)S +1430(coordinate)S +1931(systems)S +2319(in)S +2444(a)S +2531(frame)S +2824(\(e.g.)S +3058(subrasters)S +3535(of)S +3664(a)S +3750(mosaic)S +4099(display\).)S +4552(To)S +4712(do)S +4860(this,)S +5086(the)S +6876 V +11 B +900(IRAF)S +11 R +1214(and)S +11 B +1418(CDL)S +11 R +1696(display)S +2060(interfaces)S +2530(were)S +2787(modi\256ed)S +3225(to)S +3357(pass)S +3593(in)S +3726(extra)S +3991(information)S +4557(with)S +4800(the)S +4981(WCS)S +6996 V +900(string)S +1188(to)S +1311(de\256ne)S +1616(the)S +1787(mapping)S +2209(of)S +2337(the)S +2508(image)S +2813(pixels)S +3112(to)S +3234(the)S +3404(frame)S +3694(bu)S +3804 H + (f)show 11 -.5 mul h (f)show +11 R +3871(er)S +3991(pixels.)S +4351(This)S +4583(extra)S +4837(informa-)S +7116 V +900(tion)S +1119(allows)S +1453(the)S +1634(XImtool)S +2055(to)S +2189(know)S +2481(when)S +2766(the)S +2948(cursor)S +3269(in)S +3403(within)S +3733(one)S +3939(of)S +4078(the)S +4260(image)S +4576(subrasters)S +5062(and)S +7236 V +900(compute)S +1321(coordinates)S +1869(appropriately.)S +2557(\(See)S +2794(the)S +11 I +2971(XImtool)S +11 R +3368(documentation)S +4063(for)S +4232(details)S +4561(on)S +4713(how)S +4944(this)S +5146(is)S +7920 V +EP +%%Page: 8 11 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 8 -)S +840 V +900(done)S +1146(exactly\).)S +996 V +1175(The)S +1391(CDL)S +1657(will)S +1875(automatically)S +2519(determine)S +3003(when)S +3286(the)S +3466(connection)S +3993(is)S +4114(\256rst)S +4333(established)S +4868(whether)S +1116 V +900(the)S +1068(server)S +1368(is)S +1476(aware)S +1768(of)S +1892(this)S +2085(new)S +2300(mapping)S +2718(information.)S +3331(Calls)S +3591(to)S +3710(send)S +3944(or)S +4068(receive)S +4415(mapping)S +4833(data)S +5048(will)S +1236 V +900(be)S +1036(ignored)S +1404(for)S +1564(servers)S +1906(which)S +2208(are)S +2374(not)S +2549(aware)S +2842(of)S +2967(the)S +3135(extra)S +3387(data)S +3603(in)S +3723(the)S +3891(string.)S +4237(For)S +4424(servers)S +4767(which)S +5069(can)S +1356 V +900(use)S +1079(the)S +1246(mappings,)S +1735(and)S +1926(where)S +2225(a)S +2306(mapping)S +2724(has)S +2903(been)S +3142(provided,)S +3626(the)S +3793(WCS)S +4065(string)S +4349(now)S +4571(looks)S +4843(like)S +1536 V +11 I +1428(name)S +11 R +1698(-)S +11 I +1767(title)S +11 R +1939(\\n)S +1656 V +1450(a)S +1531(b)S +1619(c)S +1700(d)S +1788(tx)S +1907(ty)S +2026(z1)S +2162(z2)S +2298(zt\\n)S +1776 V +11 B +1450(region_name)S +2093(sx)S +2224(sy)S +2355(snx)S +2548(sny)S +2741(dx)S +2891(dy)S +3041(dnx)S +3253(dny\\n)S +1896 V +1450(object_refR)S +2076 V +900(where)S +1218(the)S +1397(new)S +1619(parameters)S +2186(are)S +2370(de\256ned)S +2747(to)S +2871(be:)S +2280 V +1606(region_name)S +11 I +2546(User-de\256ned)S +3144(name)S +3414(for)S +3576(the)S +3743(region.)S +2400 V +11 B +1606(sx,)S +1765(sy,)S +1924(snx,)S +2145(sny)S +11 I +2546(Source)S +2883(rect)S +3086(in)S +3205(the)S +3372(object.)S +2520 V +11 B +1606(dx,)S +1784(dy,)S +1962(dnx,)S +2202(dny)S +11 I +2546(Destination)S +3093(rect)S +3296(in)S +3415(the)S +3582(display)S +3933(frame)S +4222(bu)S +4332 H + (f)show 11 -.5 mul h (f)show +11 I +4388(er.)S +2640 V +11 B +1606(object_ref)S +11 I +2546(Full)S +2763(node!/path)S +3272(image)S +3573(speci\256cation.)S +2820 V +11 B +900(The)S +11 I +1124(object_ref)S +11 R +1609(should)S +1943(be)S +2086(a)S +2174(complete)S +2616(node!path)S +3094(speci\256cation)S +3689(to)S +3815(the)S +3989(image)S +4297(including)S +4753(any)S +4952(image)S +2940 V +900(section)S +1253(or)S +1385(extension.)S +1908(This)S +2145(is)S +2260(needed)S +2610(by)S +2761(the)S +2936(XImtool)S +3350(coordinate/pixel)S +4104(plug-in)S +4463(to)S +4590(map)S +4820(the)S +4995(same)S +3060 V +900(image)S +1206(as)S +1335(was)S +1543(displayed)S +2002(by)S +2150(the)S +2322(client.)S +2665(The)S +2873(path)S +3100(and)S +3296(node)S +3547(are)S +3717(required)S +4119(to)S +4244(ensure)S +4568(the)S +4741(image)S +5048(will)S +3180 V +900(be)S +1041(found)S +1335(properly.)S +1805(The)S +11 I +2013(region_name)S +11 R +2630(can)S +2819(be)S +2960(anything)S +3383(such)S +3621(as)S +11 I +3749(image)S +11 R +4017(,)S +11 I +4082(subraster1)S +11 R +4553(,)S +4618(or)S +11 I +4746(ccd3)S +11 R +4952(.)S +5050(The)S +3300 V +900(purpose)S +1294(of)S +1432(this)S +1639(\256eld)S +1883(is)S +2005(to)S +2139(provide)S +2522(some)S +2802(named)S +3142(value)S +3427(for)S +3602(the)S +3784(mapping)S +4217(that)S +4430(may)S +4667(be)S +4818(useful)S +5134(to)S +3420 V +900(other)S +1159(client)S +1437(programs)S +1885(needing)S +2266(to)S +2386(access)S +2698(the)S +2865(mapping.)S +11 I +3344(Source)S +11 R +3681(coordinates)S +4219(refer)S +4456(to)S +4575(the)S +4742(image)S +5043(pix-)S +3540 V +900(els,)S +11 I +1083(destination)S +11 R +1606(coordinates)S +2144(refer)S +2381(to)S +2500(the)S +2667(frame)S +2954(bu)S +3064 H + (f)show 11 -.5 mul h (f)show +11 R +3131(er.)S +3696 V +1175(Because)S +1580(we)S +1748(did)S +1930(not)S +2112(wish)S +2361(to)S +2488(change)S +2838(any)S +3037(of)S +3169(the)S +3344(existing)S +3734(interfaces,)S +4227(mappings)S +4696(must)S +4953(be)S +5098(set)S +3816 V +900(prior)S +1152(to)S +1277(the)S +11 B +1449(cdl_setWCS\(\))S +11 R +2133(call)S +2362(using)S +2639(the)S +11 B +2811(cdl_setMapping\(\))S +11 R +3674(procedure.)S +4209(The)S +4417(mapping)S +4840(is)S +4952(stored)S +3936 V +900(until)S +1147(the)S +1325(WCS)S +1608(is)S +1726(actually)S +2117(sent.)S +2399(Similarly,)S +2882(a)S +2974(mapping)S +3403(may)S +3636(be)S +3783(retrieved)S +11 I +4216(after)S +11 R +4469(a)S +11 B +4562(cdl_getWCS\(\))S +4056 V +11 R +900(call)S +1124(using)S +1428(the)S +11 B +1627(cdl_getMapping\(\))S +11 R +2529(procedure)S +3030(to)S +3181(return)S +3507(the)S +3706(values)S +4051(read)S +4303(with)S +4564(the)S +4763(last)S +4981(WCS)S +4176 V +900(retrieval.)S +1359(Since)S +1637(there)S +1889(can)S +2074(at)S +2187(times)S +2460(be)S +2597(more)S +2856(than)S +3079(one)S +3271(WCS)S +3545(in)S +3666(a)S +3749(frame,)S +4066(it's)S +4242(also)S +4454(possible)S +4850(to)S +4971(query)S +4296 V +900(the)S +1074(mapping)S +1499(for)S +1665(a)S +1752(particular)S +2210(WCS)S +2488(by)S +2637(number)S +3011(\(e.g.)S +3245(the)S +3418(WCS)S +3696(number)S +4070(returned)S +4473(in)S +4598(a)S +4685(cursor)S +4997(read\))S +4416 V +900(using)S +1178(the)S +11 I +1351(cdl_queryMap\(\))S +11 R +2101(procedure.)S +2637(See)S +2834(the)S +3008(sample)S +3359(programs)S +3813(in)S +3939(the)S +4113(appendices)S +4639(for)S +4806(examples)S +4536 V +900(of)S +1024(how)S +1246(these)S +1504(procedures)S +2016(might)S +2307(be)S +2443(called.)S +4776 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4896 V +11 C +1175(int)S +1439(cdl_getMapping\(CDLPtr)S +2891(cdl,)S +3221(char)S +3551(*region,)S +5016 V +1439(float)S +1835(*sx,)S +2165(float)S +2561(*sy,)S +2891(int)S +3155(*snx,)S +3551(int)S +3815(*sny,)S +5136 V +1439(int)S +1703(*dx,)S +2033(int)S +2297(*dy,)S +2627(int)S +2891(*dnx,)S +3287(int)S +3551(*dny,)S +3947(char)S +4277(*ref\);)S +5256 V +1175(int)S +1439(cdl_setMapping\(CDLPtr)S +2891(cdl,)S +3221(char)S +3551(*region,)S +5376 V +1439(float)S +1835(sx,)S +2099(float)S +2495(sy,)S +2759(int)S +3023(snx,)S +3353(int)S +3617(sny,)S +5496 V +1439(int)S +1703(dx,)S +1967(int)S +2231(dy,)S +2495(int)S +2759(dnx,)S +3089(int)S +3353(dny,)S +3683(char)S +4013(*ref\);)S +5616 V +1175(int)S +1439(cdl_queryMap\(CDLPtr)S +2759(cdl,)S +3089(int)S +3353(wcs,)S +3683(char)S +4013(*region,)S +5736 V +1439(float)S +1835(*sx,)S +2165(float)S +2561(*sy,)S +2891(int)S +3155(*snx,)S +3551(int)S +3815(*sny,)S +5856 V +1439(int)S +1703(*dx,)S +2033(int)S +2297(*dy,)S +2627(int)S +2891(*dnx,)S +3287(int)S +3551(*dny,)S +3947(char)S +4277(*objref\);)S +6216 V +11 B +900(4.9.)S +1132(Image)S +1457(Colormaps)S +6372 V +11 R +1175(The)S +1395(IIS)S +1579(protocol)S +1996(used)S +2248(does)S +2500(not)S +2692(permit)S +3030(the)S +3215(downloading)S +3840(of)S +3982(user-de\256ned)S +4574(colormaps,)S +5110(all)S +6492 V +900(images)S +1255(are)S +1431(loaded)S +1767(as)S +1902(raw)S +2109(grayscale)S +2565(values)S +2889(according)S +3364(to)S +3494(the)S +3672(XImtool)S +4089(colormap)S +4547(model)S +4866(used)S +5110(by)S +6612 V +900(currently)S +1348(supported)S +1834(servers.)S +2257(All)S +2451(images)S +2815(containing)S +3332(private)S +3689(colormaps)S +4200(or)S +4345(more)S +4624(than)S +4867(the)S +5055(201)S +6732 V +900(grayscale)S +1355(values)S +1678(de\256ned)S +2043(by)S +2195(the)S +2371(Imtool)S +2707(colormap)S +3163(model)S +3480(must)S +3737(either)S +4028(convert)S +4398(the)S +4574(image)S +4884(to)S +5012(8-bit)S +6852 V +900(grayscale)S +1418(values)S +1804(by)S +2020(calling)S +2425(the)S +2665(CDL)S +2991(zscale)S +3364(procedures)S +3950(\()S +11 B +3986(cdl_computeZscale\(\))S +11 R +5062(and)S +6972 V +11 B +900(cdl_zscaleImage\(\))S +11 R +1733(\))S +1814(or)S +1950(scale)S +2213(the)S +2392(images)S +2748(in)S +2879(client)S +3168(code)S +3419(with)S +3660(user)S +3887(LUTs.)S +4249(The)S +4464(CDL)S +4728(zscale)S +5038(pro-)S +7092 V +900(cedures)S +1276(scale)S +1537(image)S +1849(to)S +1979(201)S +2188(grayscale)S +2644(values)S +2968(so)S +3110(that)S +3319(they)S +3552(are)S +3728(displayed)S +4193(to)S +4323(the)S +4501(full)S +4698(8-bit)S +4950(range,)S +7212 V +900(user)S +1135(LUT)S +1401(transformations)S +2143(or)S +2287(user)S +2522(code)S +2781(for)S +2961(converting)S +3483(to)S +3621(grayscale)S +4085(from)S +4350(a)S +4450(private)S +4806(colormap)S +7920 V +EP +%%Page: 9 12 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2963(- 9 -)S +840 V +900(procedures)S +1412(should)S +1739(do)S +1882(the)S +2049(same.)S +1080 V +11 B +900(4.9.1.)S +1215(Imtool)S +1559(Color)S +1860(Model)S +1236 V +11 R +1175(The)S +1383(IMTOOL)S +1847(color)S +2110(model)S +2423(de\256nes)S +2772(at)S +2889(most)S +3142(201)S +3345(grayscale)S +3795(values)S +4113(for)S +4278(use)S +4463(in)S +4588(displaying)S +5086(the)S +1356 V +900(image,)S +1239(a)S +1330(set)S +1495(of)S +1629(16)S +1782(static)S +2057(colors)S +2368(are)S +2543(also)S +2763(de\256ned)S +3129(for)S +3299(overlay)S +3670(graphics.)S +4145(Pixel)S +4415(values)S +4738(sent)S +4958(to)S +5086(the)S +1476 V +900(server)S +1200(should)S +1528(be)S +1665(already)S +2020(scaled)S +2327(to)S +2447(this)S +2641(model,)S +2978(i.e.)S +3147(the)S +3315(image)S +3617(pixels)S +3914(should)S +4242(be)S +4380(scaled)S +4688(to)S +4809(the)S +4978(range)S +1596 V +900(1-200,)S +1231(values)S +1558(above)S +1866(this)S +2073(will)S +2292(either)S +2588(represent)S +3035(the)S +3216(overlay)S +3591(colors)S +3906(or)S +4044(will)S +4263(wrap)S +4528(around)S +4879(to)S +5012(8-bit)S +1716 V +900(values.)S +1286(The)S +1501(CDL)S +1766(zscale)S +2077(procedures)S +2601(will)S +2818(automatically)S +3461(scale)S +3724(arbitrary)S +4145(pixel)S +4410(values)S +4736(to)S +4868(use)S +5060(this)S +1836 V +900(color)S +1169(model,)S +1516(the)S +1694(overlay)S +2066(procedures)S +2589(assume)S +2956(color)S +3224(values)S +3547(are)S +3722(de\256ned)S +4088(for)S +4258(the)S +4435(static)S +4710(color)S +4978(range)S +1956 V +900(201-217)S +1299(but)S +1473(any)S +1664(8-bit)S +1905(value)S +2175(may)S +2397(be)S +2533(used.)S +2112 V +1175(A)S +1287(summary)S +1729(of)S +1853(the)S +2020(color)S +2278(model)S +2586(values)S +2899(is)S +3006(included)S +3417(below:)S +2292 V +11 B +1593(Color)S +2080(Description)S +3337(Color)S +3819(Description)S +2412 V +11 R +1593(0)S +2080(Background)S +3388(208)S +3819(Cyan)S +2532 V +1593(1)S +1681(-)S +1750(200)S +2080(Image)S +2386(data)S +3388(209)S +3819(Magenta)S +2652 V +1593(201)S +2080(Cursor)S +2412(\(white\))S +3388(210)S +3819(Coral)S +2772 V +1593(202)S +2080(Background)S +2649(\(black\))S +3388(211)S +3819(Maroon)S +2892 V +1593(203)S +2080(White)S +3388(212)S +3819(Orange)S +3012 V +1593(204)S +2080(Red)S +3388(213)S +3819(Khaki)S +3132 V +1593(205)S +2080(Green)S +3388(214)S +3819(Orchid)S +3252 V +1593(206)S +2080(Blue)S +3388(215)S +3819(Turquoise)S +3372 V +1593(207)S +2080(Yellow)S +3388(216)S +3819(Violet)S +3492 V +1593(217)S +2080(Wheat)S +3288(218-255)S +3819(unde\256ned)S +3792 V +11 B +900(4.10.)S +1187(ZScale)S +1538(Intensity)S +1987(Mapping)S +3948 V +11 R +1175(Since)S +1455(most)S +1706(display)S +2060(servers)S +2405(are)S +2573(only)S +2805(capable)S +3174(of)S +3301(displaying)S +3796(8-bit)S +4041(pixel)S +4298(values,)S +4676(images)S +5024(with)S +4068 V +900(more)S +1172(than)S +1408(8-bits)S +1706(per)S +1892(pixel)S +2159(must)S +2421(be)S +2571(scaled)S +2891(prior)S +3151(to)S +3284(display.)S +3710(For)S +3910(linear)S +4205(transformations)S +4940(this)S +5146(is)S +4188 V +900(typically)S +1334(done)S +1596(using)S +1885(a)S +1983(simple)S +2327(conversion)S +2858(of)S +2999(the)S +3183(image)S +3501(min/max)S +3943(values)S +4273(to)S +4409(the)S +4593(256)S +4808(grayscale)S +4308 V +900(values,)S +1247(however)S +1662(this)S +1861(doesn't)S +2223(produce)S +2614(very)S +2847(good)S +3106(results)S +3432(when)S +3708(most)S +3962(pixel)S +4220(values)S +4538(are)S +4708(near)S +4933(one)S +5129(of)S +4428 V +900(the)S +1088(extremes)S +1537(\(usually)S +1945(the)S +2133(image)S +2455(min)S +2681(for)S +2862(astronomical)S +3483(images\).)S +3945(To)S +4121(solve)S +4407(this)S +4622(IRAF)S +4928(uses)S +5172(a)S +4548 V +11 I +900(zscale)S +11 R +1218(mapping)S +1653(algorithm)S +2131(where)S +2447(a)S +2544(sampling)S +2997(grid)S +3223(is)S +3346(used)S +3596(to)S +3731(approximate)S +4328(the)S +4511(image)S +4828(min/max)S +4668 V +900(values)S +1214(rather)S +1502(than)S +1725(computing)S +2230(it)S +2326(directly,)S +2723(a)S +2806(line)S +3006(is)S +3115(then)S +3339(\256t)S +3467(to)S +3588(these)S +3848(sample)S +4194(pixels)S +4492(to)S +4613(determine)S +5086(the)S +4788 V +900(optimal)S +1274(transformation)S +1957(to)S +2080(the)S +2251(display)S +2606(values.)S +2984(This)S +3217(is)S +3328(not)S +3506(only)S +3739(more)S +4001(e)S +4049 H + (f)show 11 -.5 mul h (\256)show +11 R +4141(cient)S +4390(but)S +4567(maps)S +4835(the)S +5005(most)S +4908 V +900(common)S +1318(pixel)S +1571(values)S +1884(to)S +2003(the)S +2170(display)S +2521(range)S +2796(producing)S +3274(a)S +3355(better)S +3637(image.)S +5064 V +1175(The)S +1379(CDL)S +1633(has)S +1813(several)S +2156(routines)S +2544(for)S +2705(doing)S +2991(the)S +3160(same)S +3420(transformation:)S +4132(the)S +11 I +4301(cdl_computeZscale\(\))S +5184 V +11 R +900(procedure)S +1383(is)S +1504(used)S +1752(to)S +1885(compute)S +2310(the)S +2491(optimal)S +11 I +2875(z1)S +11 R +3020(and)S +11 I +3225(z2)S +11 R +3370(values)S +3697(\(the)S +3914(min/max)S +4353(used)S +4601(for)S +4774(the)S +4954(zscale)S +5304 V +900(transform\))S +1402(for)S +1569(an)S +1712(image)S +2020(of)S +2151(any)S +2349(pixel)S +2609(size.)S +2880(The)S +11 I +3090(bitpix)S +11 R +3381(argument)S +3835(is)S +3949(the)S +4123(number)S +4498(of)S +4629(bits-per-pixel)S +5424 V +900(for)S +1086(the)S +1279(input)S +1565(array)S +1847(and)S +2063(has)S +2267(the)S +2459(same)S +2742(meaning)S +3178(as)S +3327(for)S +3512(the)S +3704(FITS)S +11 I +3989(BITPIX)S +11 R +4382(keyword.)S +4851(To)S +5031(then)S +5544 V +900(transform)S +1361(the)S +1530(image)S +1833(using)S +2107(these)S +2368(values)S +2684(\(or)S +2847(user-de\256ned)S +3424(values\))S +3776(the)S +11 I +3946(cdl_zscaleImage\(\))S +11 R +4784(procedure)S +5664 V +900(is)S +1015(used.)S +1318(The)S +1528(input)S +1795(pixels)S +2098(are)S +2270(modi\256ed)S +2702(by)S +2852(this)S +3052(procedure)S +3528(but)S +3709(the)S +3883(array)S +4146(is)S +4260(not)S +4441(reallocated)S +4960(to)S +5086(the)S +5784 V +900(smaller)S +1273(size)S +1493(needed)S +1852(by)S +2012(an)S +2166(8-bit)S +2425(array.)S +2760(The)S +11 B +2981(cdl_setSample\(\))S +11 R +3776(and)S +11 B +3985(cdl_setSampleLines\(\))S +11 R +5038(pro-)S +5904 V +900(cedures)S +1278(can)S +1474(be)S +1622(used)S +1868(to)S +1999(change)S +2352(the)S +2530(sampling)S +2978(grid)S +3199(and)S +3401(number)S +3780(of)S +3915(sample)S +4270(points)S +4584(\(the)S +4798(default)S +5146(is)S +6024 V +900(600)S +1099(points)S +1403(on)S +1547(5)S +1636(lines\).)S +1975(The)S +11 B +2179(cdl_setContrast\(\))S +11 R +3022(procedure)S +3493(can)S +3679(be)S +3817(used)S +4053(to)S +4174(change)S +4518(the)S +4687(default)S +5026(con-)S +6144 V +900(trast)S +1128(adjustment)S +1650(to)S +1775(the)S +1948(slope)S +2219(used)S +2459(in)S +2584(the)S +2757(transformation)S +3442(\(the)S +3651(default)S +3993(is)S +4105(0.25\).)S +4433(If)S +4543(a)S +4629(value)S +4904(of)S +5033(zero)S +6264 V +900(is)S +1007(given)S +1284(then)S +1506(the)S +1673(minimum)S +2136(and)S +2327(maximum)S +2807(of)S +2931(the)S +3098(intensity)S +3511(sample)S +3855(is)S +3962(used)S +4196(as)S +4320(the)S +4487(z1/z2)S +4757(value.)S +6420 V +1175(Each)S +1440(of)S +1578(the)S +1759(CDL)S +2026(display)S +2391(procedures)S +2917(has)S +3110(a)S +11 I +3205(zscale)S +11 R +3520(\257ag)S +3732(to)S +3865(automatically)S +4510(scale)S +4775(the)S +4957(pixels)S +6540 V +900(prior)S +1151(to)S +1275(display.)S +1691(Applications)S +2290(wishing)S +2676(to)S +2799(set)S +2958(their)S +3196(own)S +3422(z1/z2)S +3696(values)S +4013(will)S +4222(need)S +4465(to)S +4588(call)S +4783(the)S +4954(zscale)S +6660 V +900(procedures)S +1421(and)S +1621(disable)S +1974(this)S +2176(\257ag.)S +2444(By)S +2615(default)S +2961(cdl_zscaleImage\(\))S +3803(will)S +4017(use)S +4206(a)S +4297(linear)S +4589(transform,)S +5086(the)S +6780 V +11 B +900(cdl_setZTrans\(\))S +11 R +1764(procedure)S +2312(may)S +2613(be)S +2828(used)S +3141(to)S +3339(change)S +3760(this.)S +4093(Acceptable)S +4696(values)S +5088(are)S +6900 V +11 B +900(CDL_UNITARY)S +11 R +1733(\(zero\))S +2026(for)S +2187(a)S +2269(unitary)S +2614(transform,)S +11 B +3102(CDL_LINEAR)S +11 R +3851(\(one\))S +4115(for)S +4276(a)S +4358(linear)S +4641(transform,)S +5129(or)S +7020 V +11 B +900(CDL_LOG)S +11 R +1466(\(two\))S +1736(for)S +1896(a)S +1977(log10)S +2261(transform.)S +7260 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +7920 V +EP +%%Page: 10 13 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 10 -)S +840 V +11 C +1175(void)S +1505(cdl_computeZscale)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(uchar)S +3947(*pix,)S +4343(int)S +4607(nx,)S +960 V +1439(int)S +1703(ny,)S +1967(int)S +2231(bitpix,)S +2759(float)S +3155(*z1,)S +3485(float)S +3881(*z2\))S +1080 V +1175(void)S +1505(cdl_zscaleImage)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(uchar)S +3815(**pix,)S +4277(int)S +4541(nx,)S +1200 V +1439(int)S +1703(ny,)S +1967(int)S +2231(bitpix,)S +2759(float)S +3155(z1,)S +3419(float)S +3815(z2\))S +1440 V +1175(void)S +1505(cdl_setZTrans)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(ztrans\))S +1560 V +1175(void)S +1505(cdl_getZTrans)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(*ztrans\))S +1680 V +1175(void)S +1505(cdl_setZScale)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(float)S +3683(z1,)S +3947(float)S +4343(z2\))S +1800 V +1175(void)S +1505(cdl_getZScale)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(float)S +3683(*z1,)S +4013(float)S +4409(*z2\))S +2040 V +1175(void)S +1505(cdl_setSample)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(nsample\))S +2160 V +1175(void)S +1505(cdl_setSampleLines)S +2759(\(CDLPtr)S +3287(cdl,)S +3617(int)S +3881(nlines\))S +2280 V +1175(void)S +1505(cdl_setContrast)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(float)S +3815(contrast\))S +2400 V +1175(void)S +1505(cdl_getSample)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(*nsample\))S +2520 V +1175(void)S +1505(cdl_getSampleLines)S +2759(\(CDLPtr)S +3287(cdl,)S +3617(int)S +3881(*nlines\))S +2640 V +1175(void)S +1505(cdl_getContrast)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(float)S +3815(*contrast\))S +3000 V +11 B +900(4.11.)S +1187(Image)S +1512(Hardcopy)S +3156 V +11 R +1175(While)S +1479(most)S +1731(servers)S +2077(include)S +2437(some)S +2706(hardcopy)S +3150(capability)S +3620(of)S +3748(their)S +3986(own)S +4212(the)S +4383(CDL)S +4640(provides)S +5055(two)S +3276 V +900(procedures)S +1428(for)S +1603(creating)S +2003(hardcopy)S +2458(images)S +2817(from)S +3078(the)S +3260(client)S +3552(\(e.g.)S +3795(for)S +3970(a)S +4066(batch)S +4351(processing)S +4868(applica-)S +3396 V +900(tion\).)S +1207(The)S +1415(client)S +1697(will)S +1907(typically)S +2330(read)S +2555(back)S +2799(the)S +2971(entire)S +3258(image,)S +3592(frame)S +3884(bu)S +3994 H + (f)show 11 -.5 mul h (f)show +11 R +4061(er,)S +4212(of)S +4342(just)S +4541(a)S +4628(subraster)S +5062(and)S +3516 V +900(pass)S +1134(those)S +1411(pixels)S +1718(to)S +1848(the)S +2026(print)S +2278(procedure.)S +2819(Images)S +3179(will)S +3395(be)S +3542(written)S +3897(as)S +4032(Pseudocolor)S +4619(Postscript)S +5098(\(to)S +3636 V +900(preserve)S +1376(the)S +1617(overlay)S +2052(marker)S +2468(colors\))S +2879(and)S +3144(may)S +3440(be)S +3650(disposed)S +4142(to)S +4335(a)S +4490(\256le)S +4739(using)S +5086(the)S +3756 V +11 B +900(cdl_printPixToFile\(\))S +11 R +1903(procedure)S +2376(or)S +2504(to)S +2627(any)S +2822(command)S +3292(string)S +3580(accepting)S +4036(input)S +4299(from)S +11 I +4548(stdin)S +11 R +4799(\(typically)S +3876 V +900(just)S +1093(an)S +1229('lpr')S +1456(command\))S +1958(by)S +2101(using)S +2373(the)S +11 B +2540(cdl_printPix\(\))S +11 R +3233(procedure.)S +4116 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4236 V +11 C +1175(int)S +1439(cdl_printPix)S +2297(\(CDLPtr)S +2825(cdl,)S +3155(char)S +3485(*cmd,)S +3881(uchar)S +4277(*pix,)S +4673(int)S +4937(nx,)S +4356 V +1439(int)S +1703(ny,)S +1967(int)S +2231(annotate\))S +4476 V +1175(int)S +1439(cdl_printPixToFile)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(char)S +3881(*fname,)S +4409(uchar)S +4805(*pix,)S +4596 V +1439(int)S +1703(nx,)S +1967(int)S +2231(ny,)S +2495(int)S +2759(annotate\))S +4836 V +11 B +900(4.12.)S +1187(Image)S +1512(Cursor)S +4992 V +11 R +1175(The)S +1390(image)S +1703(cursor)S +2021(is)S +2140(read)S +2372(using)S +2656(the)S +11 B +2835(cdl_readCursor\(\))S +11 R +3696(procedure.)S +4238(The)S +4453(returned)S +4863(value)S +5146(is)S +5112 V +900(the)S +1082(cursor)S +11 I +1403(\(x,y\))S +11 R +1647(position)S +2051(as)S +2190(\257oating)S +2575(point)S +2850(value)S +3135(in)S +3269(terms)S +3561(of)S +3700(the)S +3881(currently)S +4323(de\256ne)S +4638(image)S +4953(WCS.)S +5232 V +900(Note)S +1149(that)S +1350(this)S +1546(position)S +1938(must)S +2189(be)S +2328(converted)S +2796(to)S +2919(integer)S +3260(if)S +3364(it)S +3463(is)S +3574(to)S +3697(be)S +3837(used)S +4075(in)S +4198(one)S +4393(of)S +4521(the)S +4692(marker)S +5038(pro-)S +5352 V +900(cedures.)S +5592 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +5712 V +11 C +1175(int)S +1439(cdl_readCursor)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(sample,)S +4079(float)S +4475(*x,)S +5832 V +1439(float)S +1835(*y,)S +2099(int)S +2363(*wcs,)S +2759(char)S +3089(*key\))S +6072 V +11 R +900(The)S +11 I +1103(wcs)S +11 R +1301(argument)S +1748(is)S +1855(de\256ned)S +2211(as)S +6312 V +1164(wcs)S +1367(=)S +1462(frame)S +1749(*)S +1837(100)S +2035(+)S +2130(wcs_number)S +6552 V +900(\(where)S +1247(wcs_number=0)S +1969(for)S +2141(frame)S +2440(bu)S +2550 H + (f)show 11 -.5 mul h (f)show +11 R +2617(er)S +2746(coords)S +3083(and)S +3286(1)S +3386(for)S +3558(image)S +3872(coords\).)S +4307(So,)S +4498(you)S +4709(can)S +4906(get)S +5086(the)S +6672 V +900(frame)S +1187(as)S +1311(simply)S +6912 V +1164(frame)S +1451(=)S +1546(\(int\))S +1768(\(wcs)S +2007(/)S +2071(100\))S +7920 V +EP +%%Page: 11 14 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 11 -)S +840 V +11 B +900(4.12.1.)S +1270(Cursor)S +1638(Sampling)S +996 V +11 R +1175(If)S +1307(the)S +1501(cdl_readCursor\(\))S +11 I +2308(sample)S +11 R +2680(\257ag)S +2906(is)S +3041(non-zero)S +3490(the)S +11 I +3685(logical)S +4052(image)S +4381(cursor)S +11 R +4729(position)S +5146(is)S +1116 V +900(returned)S +1300(immediately,)S +1914(otherwise)S +2376(the)S +2545(display)S +2898(server)S +3199(will)S +3406(wait)S +3630(for)S +3792(a)S +3875(keystroke)S +4336(before)S +4649(returning)S +5086(the)S +1236 V +900(cursor)S +1214(position.)S +1672(The)S +1883(logical)S +2223(image)S +2532(cursor)S +2846(is)S +2961(the)S +3136(last)S +3330(value)S +3609(set)S +3773(by)S +3925(a)S +11 I +4015(cdl_setCursor\(\))S +11 R +4753(call)S +4953(or)S +5086(the)S +1356 V +900(last)S +1101(value)S +1386(returned)S +1798(by)S +1956(a)S +11 I +2051(cdl_readCursor\(\))S +11 R +2873(call.)S +3139(When)S +3447(sampling)S +3898(the)S +4079(cursor)S +4399(position)S +4802(the)S +4983(keys-)S +1476 V +900(troke)S +1158(value)S +1428(is)S +1535(unde\256ned.)S +1716 V +11 B +900(4.13.)S +1187(Image)S +1512(Readout)S +1872 V +11 R +1175(The)S +1390(CDL)S +1655(maintains)S +2128(an)S +2276(internal)S +2657(knowledge)S +3184(of)S +3321(where)S +3633(an)S +3782(image)S +4096(has)S +4288(been)S +4540(positioned)S +5045(if)S +5158(it)S +1992 V +900(was)S +1110(displayed)S +1571(using)S +1850(one)S +2048(of)S +2179(the)S +11 I +2353(cdl_display*)S +11 R +2955(procedures.)S +3535(The)S +11 B +3744(cdl_readImage\(\))S +11 R +4556(procedure)S +5031(may)S +2112 V +900(be)S +1046(used)S +1290(to)S +1419(read)S +1649(back)S +1899(the)S +2077(entire)S +2370(image)S +2682(pixels)S +2989(from)S +3246(the)S +3424(server)S +3734(ignoring)S +4151(the)S +4329(region)S +4653(of)S +4788(the)S +4966(frame)S +2232 V +900(bu)S +1010 H + (f)show 11 -.5 mul h (f)show +11 R +1077(er)S +1203(outside)S +1563(of)S +1696(the)S +1872(image,)S +2209(the)S +11 B +2384(cdl_readFrameBu)S +3238 H + (f)show 11 -.5 mul h (f)show +11 B +3305(er\(\))S +11 R +3514(procedure)S +3991(will)S +4204(read)S +4432(back)S +4679(the)S +4854(contents)S +2352 V +900(of)S +1024(the)S +1191(entire)S +1473(frame)S +1760(bu)S +1870 H + (f)show 11 -.5 mul h (f)show +11 R +1937(er.)S +2115(The)S +2318(dimensions)S +2853(of)S +2977(the)S +3144(array)S +3400(are)S +3565(returned)S +3962(in)S +4081(the)S +11 I +4248(nx)S +11 R +4384(and)S +11 I +4575(ny)S +11 R +4711(arguments.)S +2592 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +2712 V +11 C +1175(int)S +1439(cdl_readImage)S +2363(\(CDLPtr)S +2891(cdl,)S +3221(uchar)S +3617(**pix,)S +4079(int)S +4343(*nx,)S +2832 V +1439(int)S +1703(*ny\)R)S +2952 V +1175(int)S +1439(cdl_readFrameBuffer)S +2759(\(CDLPtr)S +3287(cdl,)S +3617(uchar)S +4013(**pix,)S +3072 V +1439(int)S +1703(*nx,)S +2033(int)S +2297(*ny\)R)S +3312 V +11 B +900(4.14.)S +1187(Subraster)S +1684(I/O)S +3468 V +11 R +1175(The)S +11 B +1379(cdl_writeSubRaster\(\))S +11 R +2418(procedure)S +2888(is)S +2996(used)S +3231(to)S +3351(write)S +3610(an)S +3747(arbitrary)S +4157(raster)S +4433(to)S +4553(any)S +4745(location)S +5134(in)S +3588 V +900(the)S +1069(display.)S +1483(Similarly)S +1929(the)S +11 B +2098(cdl_readSubRaster\(\))S +11 R +3109(procedure)S +3580(is)S +3689(used)S +3925(to)S +4046(read)S +4268(back)S +4509(an)S +4647(arbitrary)S +5057(ras-)S +3708 V +900(ter.)S +1127(When)S +1439(an)S +1593(image)S +1912(has)S +2109(previously)S +2624(been)S +2881(displayed)S +3353(the)S +3538(subraster)S +3984(position)S +4392(is)S +4518(given)S +4814(in)S +4952(image)S +3828 V +900(coordinates)S +1446(\(e.g.)S +1682(when)S +1960(writing)S +2319(a)S +2408(subregion)S +2882(of)S +3014(edited)S +3323(pixels\),)S +3690(otherwise)S +4156(the)S +4330(position)S +4726(is)S +4840(in)S +4966(frame)S +3948 V +900(bu)S +1010 H + (f)show 11 -.5 mul h (f)show +11 R +1077(er)S +1256(coordinates)S +1856(\(e.g.)S +2146(to)S +2327(display)S +2740(multiple)S +3203(images)S +3609(per)S +3843(frame)S +4193(you)S +4454(should)S +4844(use)S +5086(the)S +4068 V +900(cdl_writeSubRaster\(\))S +1885(call\).)S +2187(See)S +2392(the)S +2573(section)S +2931(on)S +11 I +3088(Marker)S +3463(Coordinates)S +11 R +4055(for)S +4228(further)S +4571(explanation)S +5129(of)S +4188 V +900(the)S +1067(coordinate)S +1562(systems)S +1944(used.)S +4428 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4548 V +11 C +1175(int)S +1439(cdl_writeSubRaster)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(int)S +3815(lx,)S +4079(int)S +4343(ly,)S +4607(int)S +4871(nx,)S +4668 V +1439(int)S +1703(ny,)S +1967(uchar)S +2363(*pix\))S +4788 V +1175(int)S +1439(cdl_readSubRaster)S +2627(\(CDLPtr)S +3155(cdl,)S +3485(int)S +3749(lx,)S +4013(int)S +4277(ly,)S +4541(int)S +4805(nx,)S +4908 V +1439(int)S +1703(ny,)S +1967(uchar)S +2363(**pix\))S +5148 V +11 B +900(5.)S +1049(Graphics)S +1517(Overlay)S +5388 V +900(5.1.)S +1132(Marker)S +1529(Coordinates)S +5544 V +11 R +1175(All)S +1369(marker)S +1731(positions)S +2183(are)S +2368(assumed)S +2799(to)S +2938(be)S +3094(image)S +3415(pixel)S +3688(coordinates,)S +4274(although)S +4712(there)S +4983(is)S +5110(no)S +5664 V +900(requirement)S +1465(that)S +1666(the)S +1836(position)S +2227(be)S +2365(on)S +2510(the)S +2679(image)S +2982(itself.)S +3298(When)S +3594(an)S +3732(image)S +4035(WCS)S +4309(is)S +4418(de\256ned)S +4776(\(using)S +5086(the)S +5784 V +900(CDL)S +1162(display)S +1522(procedures)S +2043(or)S +2176(explicitly\))S +2670(the)S +2846(origin)S +3151(of)S +3284(the)S +3460(coordinates)S +4007(used)S +4251(shifts)S +4533(from)S +4789(the)S +4966(frame)S +5904 V +900(bu)S +1010 H + (f)show 11 -.5 mul h (f)show +11 R +1077(er)S +1205(lower-left)S +1680(to)S +1810(the)S +1988(lower-left)S +2463(of)S +2598(the)S +2776(image)S +3088(as)S +3222(displayed)S +3686(in)S +3815(the)S +3992(frame.)S +4383(Negative)S +4821(positions)S +6024 V +900(are)S +1069(allowed)S +1453(and)S +1648(will)S +1857(either)S +2144(refer)S +2386(to)S +2510(empty)S +2823(pixels)S +3124(if)S +3229(the)S +3401(frame)S +3693(bu)S +3803 H + (f)show 11 -.5 mul h (f)show +11 R +3870(er)S +3992(is)S +4104(larger)S +4396(than)S +4623(the)S +4795(image,)S +5129(or)S +6144 V +900(pixels)S +1213(outside)S +1581(the)S +1765(frame)S +2069(bu)S +2179 H + (f)show 11 -.5 mul h (f)show +11 R +2246(er)S +2380(boundaries.)S +2971(Raster)S +3300(I/O)S +3495(requests)S +3903(will)S +4124(be)S +4276(clipped)S +4648(to)S +4783(the)S +4966(frame)S +6264 V +900(bu)S +1010 H + (f)show 11 -.5 mul h (f)show +11 R +1077(er)S +1194(endpoints,)S +1683(a)S +1764(request)S +2113(completely)S +2634(outside)S +2985(the)S +3152(frame)S +3439(bu)S +3549 H + (f)show 11 -.5 mul h (f)show +11 R +3616(er)S +3733(is)S +3840(an)S +3976(error.)S +6504 V +11 B +900(5.2.)S +1132(Mapping)S +1595(a)S +1683(Previously)S +2211(Displayed)S +2710(Image)S +6660 V +11 R +1175(Ideally)S +1512(any)S +1703(application)S +2224(wishing)S +2606(to)S +2725(draw)S +2976(markers)S +3361(on)S +3504(an)S +3641(image)S +3943(will)S +4149(have)S +4389(also)S +4600(displayed)S +5055(that)S +6780 V +900(image,)S +1242(however)S +1664(the)S +11 B +1844(cdl_mapFrame\(\))S +11 R +2675(procedure)S +3157(may)S +3392(be)S +3540(used)S +3786(to)S +3917(map)S +4151(the)S +4330(requested)S +4794(frame)S +5093(for)S +6900 V +900(marker)S +1247(overlay.)S +1674(It)S +1779(does)S +2018(this)S +2216(by)S +2365(reading)S +2732(the)S +2905(WCS)S +3183(de\256ned)S +3545(for)S +3711(that)S +3915(frame)S +4208(and)S +4405(assumes)S +4810(an)S +4952(image)S +7020 V +900(has)S +1089(been)S +1338(displayed)S +1802(and)S +2003(centered)S +2415(in)S +2544(the)S +2721(frame)S +3018(bu)S +3128 H + (f)show 11 -.5 mul h (f)show +11 R +3195(er,)S +3350(then)S +3582(resets)S +3874(the)S +4051(internal)S +4428(CDL)S +4690(image)S +5000(posi-)S +7140 V +900(tion.)S +1200(For)S +1387(this)S +1581(reason)S +1900(it)S +1997(should)S +2326(not)S +2502(be)S +2640(used)S +2876(when)S +3148(multiple)S +3551(image)S +3854(mappings)S +4317(have)S +4558(been)S +4799(displayed)S +7260 V +900(to)S +1026(a)S +1114(frame)S +1408(unless)S +1723(the)S +1897(marker)S +2246(overlay)S +2614(can)S +2805(be)S +2948(done)S +3201(reliably)S +3576(using)S +3855(the)S +4029(last)S +4222(WCS)S +4501(displayed)S +4961(to)S +5086(the)S +7920 V +EP +%%Page: 12 15 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 12 -)S +840 V +900(frame)S +1191(bu)S +1301 H + (f)show 11 -.5 mul h (f)show +11 R +1368(er.)S +1550(If)S +1659(no)S +1807(image)S +2113(has)S +2297(been)S +2541(displayed)S +3000(the)S +3172(frame)S +3464(bu)S +3574 H + (f)show 11 -.5 mul h (f)show +11 R +3641(er)S +3763(is)S +3875(mapped)S +4260(directly.)S +4694(This)S +4928(can)S +5117(be)S +960 V +900(used)S +1142(for)S +1310(example)S +1722(to)S +1849(map)S +2079(an)S +2223(empty)S +2539(frame)S +2834(for)S +3002(displaying)S +3502(just)S +3703(the)S +3878(markers)S +4271(without)S +4649(an)S +4793(image,)S +5129(or)S +1080 V +900(for)S +1063(mapping)S +1484(another)S +1849(frame's)S +2219(WCS)S +2495(for)S +2659(use)S +2842(on)S +2989(the)S +3160(current)S +3506(display.)S +3922(The)S +4129(frame)S +4420(is)S +4531(not)S +4709(changed)S +5110(by)S +1200 V +900(the)S +1067(procedure)S +1536(call)S +1727(however)S +2136(the)S +2303(current)S +2645(WCS)S +11 I +2917(is)S +11 R +3024(changed.)S +1440 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +1560 V +11 C +1175(int)S +1439(cdl_mapFrame)S +2297(\(CDLPtr)S +2825(cdl,)S +3155(int)S +3419(frame\))S +1800 V +11 B +900(5.3.)S +1132(Marking)S +1581(a)S +1669(Coordinate)S +2233(File)S +1956 V +11 R +1175(Since)S +1465(a)S +1559(common)S +1990(function)S +2402(for)S +2576(programs)S +3037(will)S +3256(be)S +3406(to)S +3539(mark)S +3811(a)S +3906(list)S +4089(of)S +4227(coordinates,)S +4807(the)S +4988(high-)S +2076 V +900(level)S +11 B +1158(cdl_markCoordsFile\(\))S +11 R +2246(procedure)S +2727(is)S +2846(provided)S +3281(to)S +3412(make)S +3693(this)S +3897(easier.)S +4256(The)S +4470(input)S +4741(parameters)S +2196 V +900(include)S +1273(a)S +1371(\256lename)S +1799(expected)S +2237(to)S +2373(contain)S +2747(a)S +2846(set)S +3019(of)S +3161(\(x,y\))S +3422(points)S +3743(\(real)S +3993(or)S +4135(integer\),)S +4554(and)S +4763(arguments)S +2316 V +900(specifying)S +1395(the)S +1567(point)S +1832(type,)S +2087(size)S +2294(and)S +2489(color)S +2751(to)S +2874(draw.)S +3190(If)S +3299(the)S +11 I +3470(label)S +11 R +3727(argument)S +4178(is)S +4289(positive)S +4675(each)S +4911(marker)S +2436 V +900(point)S +1160(will)S +1365(be)S +1501(labeled)S +1850(with)S +2079(it's)S +2254(relative)S +2616(number)S +2985(in)S +3105(the)S +3273(\256le.)S +3509(The)S +3713(size,)S +3945(type)S +4168(and)S +4360(color)S +4619(arguments)S +5110(all)S +2556 V +900(have)S +1139(the)S +1306(same)S +1564(meaning)S +1975(as)S +2099(for)S +2259(the)S +11 B +2426(cdl_markPoint\(\))S +11 R +3234(procedure)S +3703(described)S +4155(below.)S +2796 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +2916 V +11 C +1175(int)S +1439(cdl_markCoordsFile)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(char)S +3881(*fname,)S +4409(int)S +4673(type,)S +3036 V +1439(int)S +1703(size,)S +2099(int)S +2363(color,)S +2825(int)S +3089(label\))S +3276 V +11 B +900(5.4.)S +1132(Marker)S +1529(Colors)S +3432 V +11 R +1175(Markers)S +1576(may)S +1802(be)S +1942(drawn)S +2252(using)S +2528(any)S +2723(8-bit)S +2969(value,)S +3272(in)S +3396(order)S +3664(to)S +3788(use)S +3972(the)S +4144(static)S +4414(overlay)S +4780(colors)S +5086(the)S +3552 V +900(color)S +1174(must)S +1438(be)S +1589(in)S +1723(the)S +1905(range)S +2195(201-217)S +2609(\(see)S +2832(above)S +3141(for)S +3316(notes)S +3596(on)S +3754(the)S +3936(XImtool)S +4357(color)S +4630(model\).)S +5050(The)S +3672 V +900(")S +11 I +945(cdl.h)S +11 R +1162(")S +1272(include)S +1660(\256le)S +1866(for)S +2059(C)S +2199(programs,)S +2707(the)S +2907(")S +11 I +2952(cdlftn.inc)S +11 R +3365(")S +3476(include)S +3865(for)S +4058(fortran)S +4421(programs,)S +4929(or)S +5086(the)S +3792 V +900(")S +11 I +945(cdlspp.h)S +11 R +1315(")S +1402(include)S +1767(for)S +1936(SPP)S +2164(programs,)S +2648(de\256nes)S +3001(the)S +3177(following)S +3647(symbolic)S +4093(constants)S +4544(for)S +4713(each)S +4954(of)S +5086(the)S +3912 V +900(static)S +1165(overlay)S +1526(colors:)S +4152 V +11 B +1730(C_BLACK)S +11 R +2603(202)S +11 B +3263(C_CORAL)S +11 R +4224(210)S +4272 V +11 B +1730(C_WHITE)S +11 R +2603(203)S +11 B +3263(C_MAROON)S +11 R +4224(211)S +4392 V +11 B +1730(C_RED)S +11 R +2603(204)S +11 B +3263(C_ORANGE)S +11 R +4224(212)S +4512 V +11 B +1730(C_GREEN)S +11 R +2603(205)S +11 B +3263(C_KHAKI)S +11 R +4224(213)S +4632 V +11 B +1730(C_BLUE)S +11 R +2603(206)S +11 B +3263(C_ORCHID)S +11 R +4224(214)S +4752 V +11 B +1730(C_YELLOW)S +11 R +2603(207)S +11 B +3263(C_TURQUOISE)S +11 R +4224(215)S +4872 V +11 B +1730(C_CYAN)S +11 R +2603(208)S +11 B +3263(C_VIOLET)S +11 R +4224(216)S +4992 V +11 B +1730(C_MAGENTA)S +11 R +2603(209)S +11 B +3263(C_WHEAT)S +11 R +4224(217)S +5292 V +11 B +900(5.5.)S +1132(Marker)S +1529(Types)S +5448 V +11 R +1175(Currently)S +1629(supported)S +2095(marker)S +2437(types)S +2702(include:)S +5628 V +11 I +1534(Point)S +1974(Line)S +2846(Box)S +3317(Polyline)S +4220(Polygon)S +5748 V +1534(Circle)S +1974(Circular)S +2387(Annuli)S +2846(Ellipse)S +3317(Elliptical)S +3761(Annuli)S +4220(Text)S +5964 V +11 R +1175(The)S +1386(")S +11 I +1431(cdl.h)S +11 R +1648(")S +1734(include)S +2099(\256le)S +2282(for)S +2451(C)S +2567(programs,)S +3051(the)S +3227(")S +11 I +3272(cdlftn.inc)S +11 R +3685(")S +3772(include)S +4137(for)S +4306(fortran)S +4645(programs,)S +5129(or)S +6084 V +900(the)S +1075(")S +11 I +1120(cdlspp.h)S +11 R +1490(")S +1576(include)S +1940(\256le)S +2122(SPP)S +2349(programs,)S +2832(de\256nes)S +3184(the)S +3359(following)S +3828(symbolic)S +4273(constants)S +4723(for)S +4890(each)S +5129(of)S +6204 V +900(the)S +1067(de\256ned)S +11 I +1423(Point)S +11 R +1695(marker)S +2037(types:)S +6384 V +11 B +1835(M_FILL)S +11 R +2761(1)S +11 B +3311(M_CIRCLE)S +11 R +4174(64)S +6504 V +11 B +1835(M_POINT)S +11 R +2761(2)S +11 B +3311(M_STAR)S +11 R +4119(128)S +6624 V +11 B +1835(M_BOX)S +11 R +2761(4)S +11 B +3311(M_HLINE)S +11 R +4119(256)S +6744 V +11 B +1835(M_PLUS)S +11 R +2761(8)S +11 B +3311(M_VLINE)S +11 R +4119(512)S +6864 V +11 B +1835(M_CROSS)S +11 R +2706(16)S +11 B +3311(M_HBLINE)S +11 R +4064(1024)S +6984 V +11 B +1835(M_DIAMOND)S +11 R +2706(32)S +11 B +3311(M_VBLINE)S +11 R +4064(2048)S +7920 V +EP +%%Page: 13 16 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 13 -)S +840 V +1175(Point)S +1449(markers)S +1841(are)S +2013(drawn)S +2326(using)S +2605(the)S +11 B +2779(cdl_markPoint\(\))S +11 R +3594(procedure,)S +4098(point)S +4365(types)S +4638(may)S +4868(be)S +5012(logi-)S +960 V +900(cally)S +11 I +1156(OR)S +11 R +1302('d)S +1436(to)S +1565(create)S +1867(composite)S +2362(markers,)S +2784(closed)S +3106(shapes)S +3440(such)S +3683(as)S +3816(a)S +3906(circles,)S +4261(diamonds,)S +4759(or)S +4892(squares)S +1080 V +900(may)S +1122(be)S +11 I +1258(OR)S +11 R +1404('d)S +1528(with)S +1757(the)S +1924(M_FILL)S +2342(\257ag)S +2540(to)S +2659(\257ood-\256ll)S +3079(the)S +3246(point)S +3506(with)S +3735(the)S +3902(current)S +4244(overlay)S +4605(color.)S +1320 V +11 B +900(5.5.1.)S +1215(Point)S +1476 V +11 R +1175(The)S +11 B +1384(cdl_markPoint\(\))S +11 R +2199(procedure)S +2675(is)S +2789(used)S +3030(to)S +3156(mark)S +3421(a)S +3509(speci\256c)S +3884(point)S +4151(on)S +4301(the)S +4475(image)S +4783(using)S +5062(one)S +1596 V +900(of)S +1033(the)S +1209(marker)S +1560(types)S +1834(listed)S +2115(above.)S +2479(The)S +2691(marker)S +3042(is)S +3158(centered)S +3569(at)S +3690(the)S +3866(coordinates)S +4413(speci\256ed)S +4845(by)S +4997(the)S +11 I +5172(x)S +1716 V +11 R +900(and)S +11 I +1099(y)S +11 R +1188(arguments,)S +11 I +1714(type)S +11 R +1937(is)S +2052(an)S +2196(integer)S +2542(\257ag)S +2749(indicating)S +3231(what)S +3486(kind)S +3724(of)S +3857(marker)S +4208(to)S +4336(draw)S +4596(and)S +4796(may)S +5027(be)S +5172(a)S +1836 V +900(composite)S +1393(type)S +1623(by)S +1774(logically)S +2200(ORing)S +2535(two)S +2741(or)S +2873(more)S +3138(marker)S +3487(types.)S +11 I +3820(Size)S +11 R +4037(is)S +4151(the)S +4325(width)S +4616(and)S +4814(height)S +5129(of)S +1956 V +900(the)S +1082(marker)S +1439(measured)S +1906(in)S +2040(pixel)S +2308(unxits,)S +2654(and)S +11 I +2860(color)S +11 R +3140(is)S +3262(the)S +3444(color)S +3717(used)S +3966(to)S +4100(draw)S +4366(the)S +4548(marker.)S +4966(If)S +5086(the)S +2076 V +11 I +900(number)S +11 R +1280(argument)S +1739(is)S +1858(greater)S +2205(than)S +2439(zero)S +2671(that)S +2881(number)S +3260(will)S +3476(be)S +3623(drawn)S +3940(next)S +4173(to)S +4303(the)S +4481(point)S +4752(as)S +4887(a)S +4979(label,)S +2196 V +900(creating)S +1285(text)S +1483(labels)S +1772(for)S +1932(point)S +2192(markers)S +2577(can)S +2761(be)S +2897(done)S +3143(using)S +3415(the)S +11 I +3582(cdl_markPointLabel)S +11 R +4519(procedure.)S +2352 V +1175(Most)S +1466(marker)S +1839(names)S +2183(are)S +2379(fairly)S +2680(obvious)S +3093(but)S +3299(several)S +3673(are)S +3870(worth)S +4191(special)S +4560(mention:)S +5050(The)S +2472 V +900(M_DIAMOND,)S +1676(M_CIRCLE)S +2287(and)S +2511(M_BOX)S +2962(marker)S +3337(types)S +3635(may)S +3890(be)S +4059(logically)S +11 I +4510(OR)S +11 R +4656(ed)S +4825(with)S +5086(the)S +2592 V +900(M_FILL)S +1331(\257ag)S +1542(to)S +1674(produce)S +2072(a)S +2166(\256lled)S +2439(marker)S +2794(type.)S +3090(Unless)S +11 I +3435(OR)S +11 R +3581(d)S +3682(with)S +3924(the)S +4104(M_POINT)S +4626(\257ag)S +4837(all)S +4993(point)S +2712 V +900(markers)S +1306(will)S +1531(leave)S +1814(the)S +2001(center)S +2320(pixel)S +2593(unchanged.)S +3181(The)S +3404(M_HLINE)S +3938(and)S +4149(M_VLINE)S +4683(markers)S +5088(are)S +2832 V +900(most)S +1149(useful)S +1451(in)S +1571(astronomical)S +2172(applications)S +2737(to)S +2857(mark)S +3116(an)S +3253(individual)S +3734(star,)S +3954(they)S +4177(are)S +4343(horizontal)S +4822(and)S +5014(vert-)S +2952 V +900(ical)S +1117(lines)S +1384(respectively)S +1971(with)S +2225(a)S +2331(gap)S +2547(in)S +2691(the)S +2883(middle)S +3247(third)S +3513(of)S +3662(the)S +3854(marker)S +4221(\(the)S +4449(M_HBLINE)S +5062(and)S +3072 V +900(M_VBLINE)S +1488(are)S +1653(identical)S +2064(but)S +2238(with)S +2467(a)S +2548(width)S +2832(of)S +2956(3)S +3044(pixels\).)S +3252 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +3372 V +11 C +1175(int)S +1439(cdl_markPoint)S +2363(\(CDLPtr)S +2891(cdl,)S +3221(int)S +3485(x,)S +3683(int)S +3947(y,)S +4145(int)S +4409(number,)S +3492 V +1439(int)S +1703(size,)S +2099(int)S +2363(type,)S +2759(int)S +3023(color\))S +3612 V +1175(int)S +1439(cdl_markPointLabel)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(int)S +3815(x,)S +4013(int)S +4277(y,)S +4475(char)S +4805(*label)S +3732 V +1439(int)S +1703(size,)S +2099(int)S +2363(type,)S +2759(int)S +3023(color\))S +3972 V +11 B +900(5.5.2.)S +1215(Line)S +4128 V +11 R +1175(The)S +11 B +1399(cdl_markLine\(\))S +11 R +2192(procedure)S +2682(is)S +2810(used)S +3065(to)S +3205(draw)S +3477(a)S +3579(line)S +3798(of)S +3943(the)S +4131(speci\256ed)S +4576(color)S +4856(between)S +4248 V +900(points)S +1203(\()S +11 I +1239(xs,ys)S +11 R +1449(\))S +1518(and)S +1709(\()S +11 I +1745(xe,ye)S +11 R +1965(\).)S +4428 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4548 V +11 C +1175(int)S +1439(cdl_markLine)S +2297(\(CDLPtr)S +2825(cdl,)S +3155(int)S +3419(xs,)S +3683(int)S +3947(ys,)S +4211(int)S +4475(xe,)S +4739(int)S +5003(ye,)S +4668 V +1439(int)S +1703(color\))S +4908 V +11 B +900(5.5.3.)S +1215(Box)S +5064 V +11 R +1175(The)S +11 B +1378(cdl_markBox\(\))S +11 R +2120(procedure)S +2590(is)S +2698(used)S +2933(to)S +3053(draw)S +3305(a)S +3387(box)S +3586(of)S +3711(the)S +3879(speci\256ed)S +4303(color)S +4562(with)S +4792(endpoints)S +5184 V +900(speci\256ed)S +1323(by)S +1466(\()S +11 I +1502(lx,ly)S +11 R +1688(\))S +1757(and)S +1948(\()S +11 I +1984(ux,uy)S +11 R +2218(\).)S +2348(If)S +2453(the)S +11 I +2620(\256ll)S +11 R +2770(\257ag)S +2968(is)S +3075(set)S +3230(the)S +3397(box)S +3595(will)S +3800(be)S +3936(\256lled)S +4196(with)S +4425(the)S +4592(marker)S +4934(color.)S +5364 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +5484 V +11 C +1175(int)S +1439(cdl_markBox)S +2231(\(CDLPtr)S +2759(cdl,)S +3089(int)S +3353(lx,)S +3617(int)S +3881(ly,)S +4145(int)S +4409(ux,)S +4673(int)S +4937(uy,)S +5604 V +1439(int)S +1703(fill,)S +2099(int)S +2363(color\))S +5844 V +11 B +900(5.5.4.)S +1215(Circle)S +6000 V +11 R +1175(The)S +11 B +1393(cdl_markCircle\(\))S +11 R +2250(procedure)S +2734(is)S +2856(used)S +3105(to)S +3239(draw)S +3505(a)S +3601(circle)S +3891(of)S +4031(the)S +4214(speci\256ed)S +4653(color)S +4927(with)S +5172(a)S +6120 V +900(center)S +1209(at)S +1331(\()S +11 I +1367(x,y)S +11 R +1491(\))S +1570(and)S +1771(radius)S +11 I +2082(radius)S +11 R +2364(.)S +2468(If)S +2583(the)S +11 I +2760(\256ll)S +11 R +2920(\257ag)S +3128(is)S +3245(set)S +3409(the)S +3585(circle)S +3869(will)S +4083(be)S +4228(\256lled)S +4497(with)S +4735(the)S +4911(marker)S +6240 V +900(color.)S +6420 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6540 V +11 C +1175(int)S +1439(cdl_markCircle)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(x,)S +3749(int)S +4013(y,)S +4211(int)S +4475(radius,)S +6660 V +1439(int)S +1703(fill,)S +2099(int)S +2363(color\))S +7920 V +EP +%%Page: 14 17 +BP +/slant 0 def +/height 1.000000 def +11 C +11 C +480 V +11 R +2936(- 14 -)S +840 V +11 B +900(5.5.5.)S +1215(Polyline)S +996 V +11 R +1175(The)S +11 B +1401(cdl_markPolyline\(\))S +11 R +2361(procedure)S +2853(is)S +2983(used)S +3240(to)S +3382(draw)S +3656(a)S +3760(line)S +3981(connecting)S +4518(the)S +11 I +4709(npts)S +11 R +4950(points)S +1116 V +900(speci\256ed)S +1323(by)S +1466(the)S +11 I +1633(xpts)S +11 R +1843(and)S +11 I +2034(ypts)S +11 R +2244(array)S +2500(in)S +2619(the)S +2786(desired)S +11 I +3135(color)S +11 R +3367(.)S +1296 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +1416 V +11 C +1175(int)S +1439(cdl_markPolyline)S +2561(\(CDLPtr)S +3089(cdl,)S +3419(int)S +3683(*xpts,)S +4145(int)S +4409(*ypts,)S +1536 V +1439(int)S +1703(npts,)S +2099(int)S +2363(color\))S +1776 V +11 B +900(5.5.6.)S +1215(Polygon)S +1932 V +11 R +1175(The)S +11 B +1390(cdl_markPolygon\(\))S +11 R +2339(procedure)S +2820(is)S +2939(used)S +3185(to)S +3316(draw)S +3579(a)S +3673(closed)S +3999(polygon)S +4406(consisting)S +4899(of)S +11 I +5036(npts)S +2052 V +11 R +900(vertices)S +1275(speci\256ed)S +1700(by)S +1845(the)S +11 I +2014(xpts)S +11 R +2226(and)S +11 I +2418(ypts)S +11 R +2629(array)S +2886(in)S +3006(the)S +3174(desired)S +11 I +3524(color)S +11 R +3756(.)S +3851(The)S +4055(last)S +4242(point)S +4503(in)S +4623(the)S +4791(array)S +5048(will)S +2172 V +900(automatically)S +1542(be)S +1689(connected)S +2176(to)S +2306(the)S +2484(\256rst)S +2700(point)S +2971(by)S +3125(the)S +3303(procedure.)S +3845(If)S +3962(the)S +11 I +4141(\256ll)S +11 R +4303(\257ag)S +4513(is)S +4632(set)S +4799(the)S +4978(circle)S +2292 V +900(will)S +1105(be)S +1241(\256lled)S +1501(with)S +1730(the)S +1897(marker)S +2239(color.)S +2472 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +2592 V +11 C +1175(int)S +1439(cdl_markPolygon)S +2495(\(CDLPtr)S +3023(cdl,)S +3353(int)S +3617(*xpts,)S +4079(int)S +4343(*ypts,)S +2712 V +1439(int)S +1703(npts,)S +2099(int)S +2363(fill,)S +2759(int)S +3023(color\))S +2952 V +11 B +900(5.5.7.)S +1215(Ellipse)S +3108 V +11 R +1175(The)S +11 B +1383(cdl_markEllipse\(\))S +11 R +2265(procedure)S +2739(is)S +2851(used)S +3091(to)S +3216(draw)S +3473(an)S +3615(ellipse)S +3941(of)S +4071(the)S +4244(speci\256ed)S +4673(color)S +4937(with)S +5172(a)S +3228 V +900(center)S +1207(at)S +1327(\()S +11 I +1363(x,y)S +11 R +1487(\))S +1563(and)S +1761(semimajor-axis)S +11 I +2478(xrad)S +11 R +2719(and)S +2917(semiminor-axis)S +11 I +3641(yrad)S +11 R +3882(pixels)S +4185(long.)S +4482(A)S +4601(rotation)S +4983(angle)S +3348 V +900(for)S +1063(the)S +1233(ellipse)S +1556(may)S +1781(be)S +1920(speci\256ed)S +2346(by)S +2492(passing)S +2858(a)S +2942(non-zero)S +11 I +3366(angle)S +11 R +3646(argument,)S +4124(the)S +4294(angle)S +4567(is)S +4678(measured)S +5134(in)S +3468 V +900(degrees)S +1276(from)S +1532(the)S +1709(positive)S +2101(x-axis.)S +2473(If)S +2587(the)S +11 I +2763(\256ll)S +11 R +2922(\257ag)S +3129(is)S +3245(set)S +3409(the)S +3585(circle)S +3869(will)S +4083(be)S +4228(\256lled)S +4497(with)S +4735(the)S +4911(marker)S +3588 V +900(color.)S +3768 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +3888 V +11 C +1175(int)S +1439(cdl_markEllipse)S +2495(\(CDLPtr)S +3023(cdl,)S +3353(int)S +3617(x,)S +3815(int)S +4079(y,)S +4277(int)S +4541(xrad,)S +4008 V +1439(int)S +1703(yrad,)S +2099(float)S +2495(ang,)S +2825(int)S +3089(fill,)S +3485(int)S +3749(color\))S +4248 V +11 B +900(5.5.8.)S +1215(Circular)S +1650(Annuli)S +4404 V +11 R +1175(The)S +11 B +1391(cdl_markCircAnnuli\(\))S +11 R +2494(procedure)S +2976(is)S +3096(used)S +3344(to)S +3477(draw)S +11 I +3742(nannuli)S +11 R +4126(circles)S +4458(separated)S +4917(by)S +11 I +5074(sep)S +4524 V +11 R +900(pixels)S +1196(each.)S +1489(The)S +1692(circle)S +1967(is)S +2074(centered)S +2476(at)S +2588(\()S +11 I +2624(x,y)S +11 R +2748(\))S +2817(with)S +3046(an)S +3182(initial)S +3473(radius)S +3774(of)S +11 I +3898(radius)S +11 R +4213(pixels.)S +4704 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +4824 V +11 C +1175(int)S +1439(cdl_markCircAnnuli)S +2693(\(CDLPtr)S +3221(cdl,)S +3551(int)S +3815(x,)S +4013(int)S +4277(y,)S +4475(int)S +4739(radius,)S +4944 V +1439(int)S +1703(nannuli,)S +2297(int)S +2561(sep,)S +2891(int)S +3155(color\))S +5184 V +11 B +900(5.5.9.)S +1215(Elliptical)S +1678(Annuli)S +5340 V +11 R +1175(The)S +11 B +1385(cdl_markEllipAnnuli\(\))S +11 R +2505(procedure)S +2981(is)S +3095(used)S +3336(to)S +3462(draw)S +11 I +3721(nannuli)S +11 R +4099(ellipses)S +4470(separated)S +4923(by)S +11 I +5074(sep)S +5460 V +11 R +900(pixels)S +1220(each.)S +1537(The)S +1764(ellipse)S +2108(is)S +2239(centered)S +2665(at)S +2801(\()S +11 I +2837(x,y)S +11 R +2961(\))S +3054(with)S +3307(an)S +3467(initial)S +3782(semimajor)S +4302(and)S +4516(semiminor)S +5043(axis)S +5580 V +900(speci\256ed)S +1335(by)S +1490(the)S +11 I +1669(xrad)S +11 R +1915(and)S +11 I +2118(yrad)S +11 R +2364(arguments.)S +2927(Each)S +3190(ellipse)S +3522(will)S +3739(be)S +3887(optionally)S +4379(rotate)S +4673(by)S +4828(an)S +11 I +4976(angle)S +5700 V +11 R +900(degrees)S +1266(as)S +1390(measured)S +1842(from)S +2088(the)S +2255(positive)S +2637(x-axis.)S +5880 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6000 V +11 C +1175(int)S +1439(cdl_markEllipAnnuli)S +2759(\(CDLPtr)S +3287(cdl,)S +3617(x,)S +3815(y,)S +4013(xrad,)S +4409(yrad,)S +4805(ang,)S +6120 V +1439(int)S +1703(nannuli,)S +2297(int)S +2561(sep,)S +2891(int)S +3155(color\))S +6360 V +11 B +900(5.5.10.)S +1270(Text)S +6516 V +11 R +1175(The)S +11 B +1393(cdl_markText\(\))S +11 R +2178(procedure)S +2662(is)S +2784(used)S +3033(to)S +3167(draw)S +3433(a)S +3529(text)S +3742(string)S +4042(speci\256ed)S +4481(by)S +11 I +4640(str)S +11 R +4806(argument)S +6636 V +900(with)S +1142(an)S +1291(initial)S +1595(position)S +1997(at)S +2121(\()S +11 I +2157(x,y)S +11 R +2281(\))S +2362(and)S +2565(optionally)S +3057(rotated)S +3406(by)S +11 I +3561(angle)S +11 R +3850(degrees)S +4228(as)S +4364(measured)S +4828(from)S +5086(the)S +6756 V +900(positive)S +1288(x-axis.)S +1657(The)S +1867(default)S +11 I +2211(size)S +11 R +2416(is)S +2530(1.0)S +2708(and)S +2906(is)S +3020(approximately)S +3694(a)S +3782(6x13)S +4042(font,)S +4287(the)S +4461(font)S +4678(size)S +4888(may)S +5117(be)S +6876 V +900(scaled)S +1206(by)S +1349(any)S +1540(fractional)S +1992(amount.)S +7056 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +7176 V +11 C +1175(int)S +1439(cdl_markText)S +2297(\(CDLPtr)S +2825(cdl,)S +3155(int)S +3419(x,)S +3617(int)S +3881(y,)S +4079(char)S +4409(*str,)S +7296 V +1439(float)S +1835(size,)S +2231(float)S +2627(angle,)S +3089(int)S +3353(color\))S +7920 V +EP +%%Page: 15 18 +BP +/slant 0 def +/height 1.000000 def +11 C +11 C +480 V +11 R +2936(- 15 -)S +840 V +11 B +900(5.6.)S +1132(Text)S +1378(Fonts)S +996 V +11 R +1175(The)S +11 B +1382(cdl_setFont\(\))S +11 R +2034(procedure)S +2507(is)S +2618(used)S +2856(to)S +2979(choose)S +3320(between)S +3721(one)S +3917(of)S +4046(four)S +4266(available)S +4699(fonts)S +4957(as)S +5086(the)S +1116 V +900(text)S +1099(marker)S +1442(default:)S +1811(Roman,)S +2191(Greek,)S +2518(Futura,)S +2866(Bold)S +3114(and)S +3305(Times)S +3613(respectively.)S +4236(By)S +4398(default)S +4735(the)S +4902(Roman)S +1236 V +900(font)S +1110(will)S +1315(be)S +1451(used.)S +1713(The)S +1916(width)S +2200(of)S +2324(the)S +2491(lines)S +2732(used)S +2966(to)S +3085(draw)S +3336(the)S +3503(text)S +3701(may)S +3923(also)S +4133(be)S +4269(set.)S +1416 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +1536 V +11 C +1175(void)S +1505(cdl_setFont)S +2297(\(CDLPtr)S +2825(cdl,)S +3155(int)S +3419(font\))S +1656 V +1175(void)S +1505(cdl_setTextWidth)S +2627(\(CDLPtr)S +3155(cdl,)S +3485(int)S +3749(width\))S +1836 V +11 R +900(A)S +1023(complete)S +1469(listing)S +1790(of)S +1925(the)S +2103(Greek)S +2413(character)S +2856(mappings)S +3329(can)S +3525(be)S +3673(found)S +3974(in)S +4105(the)S +4284(\256le)S +4470('greek.ps')S +4955(in)S +5086(the)S +1956 V +900('doc')S +1173(subdirectory)S +1764(of)S +1898(the)S +2074(CDL)S +2336(distribution.)S +3223(The)S +11 I +3435(Roman)S +11 R +3788(font)S +4007(is)S +4123(the)S +4299(font)S +4518(implemented)S +5134(in)S +2076 V +900(the)S +1084(original)S +1476(version)S +1849(of)S +1990(the)S +2174(CDL)S +2444(and)S +2652(works)S +2970(well)S +3209(for)S +3386(most)S +3651(applications.)S +4294(Both)S +4560(the)S +11 I +4745(Greek)S +11 R +5062(and)S +2196 V +11 I +900(Times)S +11 R +1211(fonts)S +1479(are)S +1659(hi-resolution)S +2269(fonts)S +2537(which)S +2853(work)S +3126(best)S +3351(for)S +3526(larger)S +3828(frame)S +4130(bu)S +4240 H + (f)show 11 -.5 mul h (f)show +11 R +4307(ers)S +4482(but)S +4670(can)S +4868(produce)S +2316 V +900(publication)S +1429(quality)S +1769(text.)S +2029(The)S +11 I +2233(Futura)S +11 R +2573(font)S +2784(is)S +2892(a)S +2974(simpler)S +3338(font)S +3549(which)S +3852(can)S +4038(produce)S +4425(better)S +4709(results)S +5031(than)S +2436 V +900(the)S +1072(default)S +1414(on)S +1562(small)S +1839(size)S +2047(frame)S +2339(bu)S +2449 H + (f)show 11 -.5 mul h (f)show +11 R +2516(ers.)S +2742(A)S +11 I +2859(Bold)S +11 R +3105(font)S +3320(automatically)S +3956(increases)S +4394(the)S +4565(text)S +4767(line)S +4969(width)S +2556 V +900(by)S +1043(one)S +1234(pixel)S +1487(over)S +1714(the)S +1881(current)S +2223(setting)S +2550(and)S +2741(may)S +2963(be)S +3099(used)S +3333(with)S +3562(any)S +3753(font.)S +2796 V +11 B +900(5.6.1.)S +1215(In-Line)S +1604(Font)S +1857(Changes)S +2952 V +11 R +1175(Text)S +1421(markers)S +1818(are)S +1995(drawn)S +2314(using)S +2599(the)S +2779(font)S +3002(selected)S +3400(with)S +3642(the)S +11 I +3822(cdl_setFont\(\))S +11 R +4459(routine,)S +4844(however)S +3072 V +900(fonts)S +1174(may)S +1417(be)S +1573(change)S +1935(within)S +2270(a)S +2371(string)S +2675(itself)S +2948(\(e.g.)S +3196(to)S +3335(set)S +3510(a)S +3611(Greek)S +3930(character\))S +4417(using)S +4709(a)S +4810(\\f)S +4930(escape)S +3192 V +900(sequence.)S +1399(The)S +1608(escape)S +1937(is)S +2050(followed)S +2479(by)S +2628(the)S +2801(character)S +3238('R')S +3423(to)S +3548(set)S +3709(a)S +3796(Roman)S +4153(font,)S +4397('G')S +4587(for)S +4753(Greek,)S +5086('F')S +3312 V +900(for)S +1061(futura,)S +1384('B')S +1564(for)S +1725(bold)S +1954(and)S +2145('T')S +2317(for)S +2477(Times.)S +2846(Any)S +3068(number)S +3436(of)S +3560(escapes)S +3926(are)S +4091(permitted)S +4545(within)S +4860(a)S +4941(string,)S +3432 V +900(the)S +1071(font)S +1285(change)S +1631(will)S +1840(remain)S +2181(in)S +2304(e)S +2352 H + (f)show 11 -.5 mul h (f)show +11 R +2419(ect)S +2583(until)S +2823(it)S +2922(is)S +3033(changed,)S +3462(or)S +3590(the)S +3761(end)S +3956(of)S +4085(string)S +4374(at)S +4491(which)S +4797(point)S +5062(any)S +3552 V +900(subsequent)S +1431(strings)S +1768(will)S +1982(again)S +2261(be)S +2406(drawn)S +2721(with)S +2959(the)S +3135(default)S +3481(font.)S +3761(Additionally)S +4360(a)S +4450('P')S +4626(in)S +4754(the)S +4930(escape)S +3672 V +900(sequence)S +1333(will)S +1538(change)S +1880(the)S +2047(font)S +2257(to)S +2376(the)S +2543(one)S +2734(previously)S +3231(used,)S +3493(whatever)S +3926(that)S +4124(may)S +4346(be.)S +3828 V +1175(The)S +1382(CDL)S +1639(also)S +1853(supports)S +2263(a)S +2348(sub/superscripting)S +3191(of)S +3319(text)S +3521(which)S +3826(can)S +4014(only)S +4247(be)S +4387(done)S +4637(with)S +4871(the)S +5043(font)S +3948 V +900(escapes.)S +1337(In)S +1471(this)S +1674(case)S +1904(the)S +2081(escape)S +2414(character)S +2855(followed)S +3288(by)S +3441(a)S +3532('U')S +3726(produces)S +4164(a)S +4255(superscript)S +4779(and)S +4979(a)S +5069('D')S +4068 V +900(produces)S +1334(a)S +1421(subscript.)S +1918(The)S +2127(changes)S +2518(may)S +2746(be)S +2889(nested)S +3209(permitting)S +3708(several)S +4057(levels)S +4353(of)S +4484(sub/superscripts,)S +4188 V +900(these)S +1159(escapes)S +1526(may)S +1749(also)S +1960(be)S +2097(used)S +2332(in)S +2452(conjunction)S +3005(with)S +3235(a)S +3317(font)S +3528(change)S +3871(to)S +3991(cause)S +4267(the)S +4435(sub/superscript)S +5134(to)S +4308 V +900(be)S +1045(drawn)S +1360(with)S +1598(a)S +1688(di)S +1774 H + (f)show 11 -.5 mul h (f)show +11 R +1841(erent)S +2101(font.)S +2381(A)S +2502(superscript)S +3025(escape)S +3357(will)S +3571(remain)S +3917(in)S +4045(e)S +4093 H + (f)show 11 -.5 mul h (f)show +11 R +4160(ect)S +4329(until)S +4574(the)S +4751(end)S +4952(of)S +5086(the)S +4428 V +900(string)S +1188(or)S +1316(a)S +1401(\\fD)S +1584(escape)S +1911(is)S +2022(seen.)S +2314(Similarly)S +2762(a)S +2847(subscript)S +3281(remains)S +3665(in)S +3788(e)S +3836 H + (f)show 11 -.5 mul h (f)show +11 R +3903(ect)S +4067(until)S +4307(the)S +4478(end)S +4672(of)S +4799(the)S +4969(string)S +4548 V +900(of)S +1028(a)S +1113(\\fU)S +1296(escape.)S +1684(Sub/superscripted)S +2508(text)S +2710(is)S +2821(drawn)S +3131(using)S +3407(a)S +3492(smaller)S +3852(font)S +4066(size,)S +4302(there)S +4558(is)S +4670(presently)S +5110(no)S +4668 V +900(way)S +1115(to)S +1234(specify)S +1583(a)S +1664(di)S +1750 H + (f)show 11 -.5 mul h (f)show +11 R +1817(erent)S +2068(size)S +2271(for)S +2431(the)S +2598(sub/superscripted)S +3399(text.)S +4848 V +11 B +2436(Summary)S +2933(of)S +3057(Font)S +3310(Escapes)S +5028 V +11 R +2179(\\fR)S +2521(change)S +2863(to)S +2982(Roman)S +3333(font)S +5148 V +2179(\\fG)S +2521(change)S +2863(to)S +2982(Greek)S +3281(font)S +5268 V +2179(\\fF)S +2521(change)S +2863(to)S +2982(Futura)S +3302(font)S +5388 V +2179(\\fT)S +2521(change)S +2863(to)S +2982(Times)S +3290(font)S +5508 V +2179(\\fB)S +2521(change)S +2863(to)S +2982(bold)S +3211(font)S +5628 V +2179(\\fP)S +2521(change)S +2863(to)S +2982(previous)S +3393(font)S +5748 V +2179(\\fU)S +2521(begin)S +2798(relative)S +3159(superscripted)S +3776(text)S +5868 V +2179(\\fD)S +2521(begin)S +2798(relative)S +3159(subscripted)S +3692(text)S +6168 V +11 B +900(5.7.)S +1132(Line)S +1380(Widths)S +1757(and)S +1969(Styles)S +6324 V +11 R +1175(The)S +11 B +1407(cdl_setLineWidth\(\))S +11 R +2380(procedure)S +2878(can)S +3091(be)S +3256(used)S +3519(to)S +3667(set)S +3851(the)S +4047(line)S +4275(width)S +4589(used)S +4853(to)S +5002(draw)S +6444 V +900(polygon)S +1306(or)S +1442(polyline)S +1848(markers,)S +2273(point)S +2544(markers)S +2940(will)S +3156(not)S +3341(be)S +3488(a)S +3536 H + (f)show 11 -.5 mul h (f)show +11 R +3603(ected.)S +3938(The)S +11 B +4152(cdl_setLineStyle\(\))S +11 R +5038(pro-)S +6564 V +900(cedure)S +1223(is)S +1330(used)S +1564(to)S +1683(set)S +1838(a)S +1919(line)S +2117(style)S +2358(other)S +2616(than)S +2838(solid.)S +6744 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6864 V +11 C +1175(void)S +1505(cdl_setLineWidth)S +2627(\(CDLPtr)S +3155(cdl,)S +3485(int)S +3749(width\))S +6984 V +1175(void)S +1505(cdl_setLineStyle)S +2627(\(CDLPtr)S +3155(cdl,)S +3485(int)S +3749(style\))S +7140 V +11 R +1175(The)S +1386(")S +11 I +1431(cdl.h)S +11 R +1648(")S +1734(include)S +2099(\256le)S +2282(for)S +2451(C)S +2567(programs,)S +3051(the)S +3227(")S +11 I +3272(cdlftn.inc)S +11 R +3685(")S +3772(include)S +4137(for)S +4306(fortran)S +4645(programs,)S +5129(or)S +7260 V +900(the)S +1075(")S +11 I +1120(cdlspp.h)S +11 R +1490(")S +1576(include)S +1940(\256le)S +2122(SPP)S +2349(programs,)S +2832(de\256nes)S +3184(the)S +3359(following)S +3828(symbolic)S +4273(constants)S +4723(for)S +4890(each)S +5129(of)S +7920 V +EP +%%Page: 16 19 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 16 -)S +840 V +900(the)S +1067(de\256ned)S +1423(line)S +1621(styles:)S +1020 V +11 B +1933(L_SOLID)S +11 R +2743(0)S +11 B +3293(L_DASHED)S +11 R +4132(1)S +1140 V +11 B +1933(L_DOTTED)S +11 R +2743(2)S +11 B +3293(L_DOTDASH)S +11 R +4132(3)S +1260 V +11 B +1933(L_HOLLOW)S +11 R +2743(4)S +11 B +3293(L_SHADOW)S +11 R +4132(5)S +1476 V +1175(The)S +11 I +1379(hollow)S +11 R +1714(line)S +1913(style)S +2155(is)S +2263(drawn)S +2571(with)S +2802(a)S +2885(linewidth)S +3336(of)S +3462(\256ve)S +3662(pixels,)S +3988(two)S +4188(pixels)S +4486(of)S +4612(color,)S +4900(a)S +4983(black)S +1596 V +900(line,)S +1132(and)S +1329(two)S +1533(pixels)S +1835(of)S +1965(color.)S +2290(It)S +2396(is)S +2509(best)S +2725(used)S +2965(when)S +3241(the)S +3414(marker)S +3761(will)S +3971(traverse)S +4354(extreme)S +4744(changes)S +5134(in)S +1716 V +900(brightness,)S +1414(due)S +1606(to)S +1726(the)S +1894(thickness)S +2337(of)S +2462(the)S +2630(line)S +2829(it)S +2925(may)S +3148(work)S +3407(best)S +3618(with)S +3848(larger)S +4137(frame)S +4426(bu)S +4536 H + (f)show 11 -.5 mul h (f)show +11 R +4603(ers.)S +4826(The)S +11 I +5031(sha-)S +1836 V +900(dow)S +11 R +1128(linestyle)S +1545(is)S +1663(drawn)S +1980(as)S +2115(two)S +2324(pixels)S +2631(of)S +2766(color)S +3035(and)S +3237(two)S +3445(pixels)S +3751(of)S +3885(black)S +4165(and)S +4366(should)S +4703(be)S +4849(used)S +5093(for)S +1956 V +900(similar)S +1240(brightness)S +1726(variations,)S +2221(however)S +2631(it)S +2727(e)S +2775 H + (f)show 11 -.5 mul h (f)show +11 R +2842(ectively)S +3223(shows)S +3532(up)S +3676(as)S +3802(a)S +3885(line)S +4085(only)S +4316(two)S +4516(pixels)S +4814(wide)S +5062(and)S +2076 V +900(may)S +1122(be)S +1258(preferred)S +1689(for)S +1849(medium)S +2243(or)S +2367(smaller)S +2723(frame)S +3010(bu)S +3120 H + (f)show 11 -.5 mul h (f)show +11 R +3187(ers.)S +2232 V +1175(The)S +1390(three)S +1654(dashed)S +2004(linestyles)S +2466(are)S +2644(drawn)S +2963(using)S +3248("gap")S +3542(spacings)S +3966(of)S +4103(5)S +4204(pixels)S +4513(in)S +4645(between)S +5055(line)S +2352 V +900(segments.)S +1405(Whether)S +1816(or)S +1942(not)S +2118(these)S +2378(gaps)S +2614(are)S +2781(resolved)S +3187(depends)S +3581(on)S +3726(the)S +3895(size)S +4100(of)S +4225(the)S +4393(frame)S +4681(bu)S +4791 H + (f)show 11 -.5 mul h (f)show +11 R +4858(er)S +4976(being)S +2472 V +900(used)S +1150(and)S +1358(the)S +1542(magni\256cation)S +2197(used)S +2448(in)S +2584(the)S +2768(display)S +3136(server.)S +3513(By)S +3692(default)S +4046(they)S +4285(should)S +4629(resolve)S +4995(com-)S +2592 V +900(pletely)S +1271(using)S +1582(frame)S +1908(bu)S +2018 H + (f)show 11 -.5 mul h (f)show +11 R +2085(ers)S +2284(up)S +2466(to)S +2624(1024x1024)S +3191(pixels,)S +3554(or)S +3717(magni\256cation)S +4393(factors)S +4761(displaying)S +2712 V +900(1024x1024)S +1428(pixels.)S +1785(If)S +1890(larger)S +2177(sizes)S +2423(are)S +2588(needed)S +2930(the)S +3097(image)S +3398(should)S +3725(be)S +3862(subsampled)S +4415(prior)S +4662(to)S +4782(display)S +5134(to)S +2832 V +900(maintain)S +1318(the)S +1485(marker)S +1827(resolution)S +2300(needed)S +2642(for)S +2802(these)S +3060(linestyles.)S +3192 V +11 B +900(5.8.)S +1132(Deleting)S +1555(Markers)S +3348 V +11 R +1175(When)S +1481(markers)S +1878(are)S +2055(drawn)S +2373(the)S +2552(underlying)S +3073(subraster)S +3514(is)S +3634(\256rst)S +3852(saved)S +4147(to)S +4279(an)S +4428(internal)S +4809(structure,)S +3468 V +900(erasure)S +1268(is)S +1396(done)S +1663(by)S +1827(simply)S +2181(redisplaying)S +2777(the)S +2964(saved)S +3266(raster.)S +3622(Problems)S +4091(can)S +4295(arise)S +4554(however)S +4983(when)S +3588 V +900(markers)S +1295(overlap;)S +1730(when)S +2010(deleting)S +2407(a)S +2498(marker)S +2850(that)S +3058(is)S +11 I +3175(under)S +11 R +3474(another)S +3845(marker)S +4198(the)S +4376(original)S +4762(pixels)S +5069(can)S +3708 V +900(overwrite)S +1372(the)S +1559(pixels)S +1875(of)S +2019(the)S +2206(marker)S +2568(on)S +2731(top.)S +2986(This)S +3235(is)S +3362(an)S +3517(unfortunate)S +4074(side)S +4303(e)S +4351 H + (f)show 11 -.5 mul h (f)show +11 R +4418(ect)S +4597(of)S +4740(the)S +4926(simple)S +3828 V +900(scheme)S +1268(used)S +1509(in)S +1635(this)S +1835(version)S +2198(of)S +2329(the)S +2503(package,)S +2928(users)S +3193(can)S +3384(call)S +3582(the)S +11 B +3757(cdl_redrawOverlay\(\))S +11 R +4784(procedure)S +3948 V +900(to)S +1019(help)S +1241(clean)S +1504(up)S +1647(any)S +1838(artifacts)S +2223(left)S +2402(behind.)S +4188 V +11 B +900(5.8.1.)S +1215(Individual)S +1742(Markers)S +4344 V +11 R +1175(The)S +11 B +1396(cdl_deleteMark\(\))S +11 R +2257(procedure)S +2745(is)S +2871(used)S +3124(to)S +3262(delete)S +3575(a)S +3675(single)S +3990(marker)S +4351(from)S +4616(the)S +4802(display\(\).)S +4464 V +900(The)S +1107(\()S +11 I +1143(x,y)S +11 R +1267(\))S +1340(argument)S +1791(is)S +1902(either)S +2188(the)S +2358(center)S +2660(position)S +3052(of)S +3179(the)S +3349(marker)S +3694(if)S +3797(that)S +3998(is)S +4108(know)S +4388(by)S +4534(the)S +4704(application,)S +4584 V +900(more)S +1162(typically)S +1584(it)S +1683(will)S +1893(be)S +2034(an)S +2175(approximate)S +2761(position.)S +3216(In)S +3345(the)S +3517(latter)S +3780(case)S +4005(the)S +4177(marker)S +4524(whose)S +4842(center)S +5146(is)S +4704 V +900(closest)S +1234(to)S +1355(this)S +1550(position)S +1941(will)S +2148(be)S +2286(deleted.)S +2698(For)S +2886(markers)S +3273(with)S +3504(no)S +3648(de\256ned)S +4005(center)S +4338(the)S +4506(distance)S +4899(used)S +5134(to)S +4824 V +900(decide)S +1220(if)S +1323(the)S +1493(marker)S +1838(should)S +2168(be)S +2307(deleted)S +2659(is)S +2769(the)S +2939(distance)S +3334(from)S +3583(the)S +3753(argument)S +4203(position)S +4595(to)S +4717(the)S +4887(edge)S +5129(of)S +4944 V +900(the)S +1075(marker.)S +1486(For)S +1680(example,)S +2120(distance)S +2520(from)S +2774(a)S +2863(box)S +3069(or)S +3201(polygon)S +3603(is)S +3718(measured)S +4177(as)S +4308(the)S +4482(distance)S +4881(from)S +5134(to)S +5064 V +900(one)S +1103(of)S +1239(the)S +1418(sides,)S +1711(for)S +1883(text)S +2093(it)S +2200(is)S +2319(the)S +2498(distance)S +2902(to)S +3033(the)S +3212(start)S +3446(of)S +3582(the)S +3761(text)S +3972(string.)S +4330(There)S +4630(is)S +4750(no)S +4906(way)S +5134(to)S +5184 V +11 I +900(un)S +11 R +1010(delete)S +1304(a)S +1385(marker)S +1727(other)S +1985(than)S +2207(to)S +2326(redraw)S +2661(it.)S +5364 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +5484 V +11 C +1175(int)S +1439(cdl_deleteMark)S +2429(\(CDLPtr)S +2957(cdl,)S +3287(int)S +3551(x,)S +3749(int)S +4013(y\))S +5724 V +11 B +900(5.8.2.)S +1215(The)S +1432(Entire)S +1764(Overlay)S +5880 V +11 R +1175(To)S +1337(erase)S +1600(all)S +1750(markers)S +2142(currently)S +2577(displayed)S +3039(use)S +3226(the)S +11 B +3401(cdl_clearOverlay\(\))S +11 R +4318(procedure.)S +4856(Markers)S +6000 V +900(are)S +1069(erased)S +1383(in)S +1505(the)S +1675(reverse)S +2025(order)S +2291(they)S +2516(were)S +2763(drawn)S +3072(to)S +3194(help)S +3419(reduce)S +3745(the)S +3915(chance)S +4253(that)S +4454(overlaying)S +4959(mark-)S +6120 V +900(ers)S +1060(will)S +1265(leave)S +1528(stray)S +1774(pixels.)S +6300 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +6420 V +11 C +1175(int)S +1439(cdl_clearOverlay)S +2561(\(CDLPtr)S +3089(cdl\))S +6660 V +11 B +900(5.9.)S +1132(Redraw)S +6816 V +11 R +1175(The)S +11 B +1389(cdl_redrawOverlay\(\))S +11 R +2419(procedure)S +2899(can)S +3094(be)S +3241(used)S +3486(to)S +3616(redraw)S +3963(all)S +4118(markers)S +4515(currently)S +4955(in)S +5086(the)S +6936 V +900(display)S +1271(list.)S +1520(This)S +1768(is)S +1894(sometimes)S +2417(needed)S +2778(when)S +3067(subraster)S +3514(I/O)S +3712(procedures)S +4243(are)S +4427(used)S +4680(to)S +4818(redisplay)S +7056 V +900(subregions)S +1409(and)S +1600(overwrite)S +2052(existing)S +2434(markers.)S +7236 V +900(Synopsis)S +11 Y1 +900(2)S +914(2222222)S +7920 V +EP +%%Page: 17 20 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 17 -)S +840 V +11 C +1175(int)S +1439(cdl_redrawOverlay)S +2627(\(CDLPtr)S +3155(cdl\))S +1080 V +11 B +900(6.)S +1049(ANSI)S +1345(C)S +1457(Function)S +1913(Prototypes)S +1236 V +11 R +1175(The)S +1387(current)S +1738(release)S +2082(of)S +2215(CDL)S +2477(provides)S +2897(full)S +3092(ANSI)S +3390(C)S +3506(function)S +3914(prototypes)S +4421(for)S +4591(all)S +4744(public)S +5062(and)S +1356 V +900(private)S +1244(procedures.)S +1824(By)S +1993(default)S +2337(these)S +2602(will)S +2814(not)S +2994(be)S +3136(used)S +3376(even)S +3621(on)S +3770(systems)S +4158(with)S +4393(native)S +4700(ANSI)S +4995(com-)S +1476 V +900(pilers,)S +1227(however.)S +1719(To)S +1896(make)S +2188(use)S +2389(of)S +2535(the)S +2724(CDL)S +3000(prototypes)S +3520(users)S +3801(will)S +4029(need)S +4291(to)S +4433(de\256ne)S +4757(the)S +4947(macro)S +1596 V +11 B +900(CDL_ANSIC)S +11 R +1566(either)S +1852(when)S +2126(compiling)S +2609(the)S +2779(program)S +3186(\(using)S +3497(the)S +3667(-D)S +3818(option)S +4136(to)S +4258(the)S +4428(compiler\),)S +4918(or)S +5045(as)S +5172(a)S +1716 V +900(de\256nition)S +1356(in)S +1475(the)S +1642(program)S +2046(source)S +2364(preceding)S +2828(the)S +2995('cdl.h')S +3317(include)S +3673(directive.)S +1872 V +1175(For)S +1361(example,)S +2052 V +11 C +1175(#define)S +1769(CDL_ANSIC)S +2172 V +1175(#include)S +1769("cdl.h")S +2292 V +1505(:)S +2412 V +1175(main)S +1505(\(int)S +1835(argc,)S +2231(char)S +2561(**argv\))S +2532 V +1505(:)S +2712 V +11 R +900(or)S +1024(when)S +1294(compiling)S +1774(using)S +2046(something)S +2538(like)S +2892 V +11 C +1175(cc)S +1373(-DCDL_ANSIC)S +2165(client.c)S +2759(libcdl.a)S +3353(-lm)S +3072 V +11 R +1175(Note)S +1424(that)S +1625(when)S +1898(using)S +2173(CDL_ANSIC)S +2814(to)S +2936(build)S +3199(the)S +3370(client)S +3651(program)S +4059(it)S +4158(is)S +4269(also)S +4483(required)S +4884(that)S +5086(the)S +3192 V +900(CDL)S +1163(itself)S +1426(be)S +1572(built)S +1818(in)S +1946(the)S +2122(same)S +2389(way)S +2613(to)S +2741(avoid)S +3027(confusing)S +3502(FPE)S +3735(errors.)S +4092(Similarly,)S +4573(when)S +4852(building)S +3312 V +900(client)S +1178(tasks)S +1432(that)S +11 I +1631(do)S +1775(not)S +11 R +1950(use)S +2130(CDL_ANSIC)S +2769(you)S +2968(must)S +3217(use)S +3397(a)S +3479(version)S +3836(of)S +3961(the)S +4130(library)S +4457(that)S +4657(has)S +4838(not)S +5014(been)S +3432 V +900(compiled)S +1342(with)S +1571(prototypes.)S +3588 V +1175(The)S +1378(reason)S +1696(is)S +1803(that)S +2001(the)S +2168(\257oat)S +2397(args)S +2612(to)S +2731(the)S +2898(CDL)S +3151(procedures)S +3663(in)S +3782(the)S +3949(library,)S +4302(or)S +4426(in)S +4545(your)S +4780(task)S +4991(calls,)S +3708 V +900(are)S +1071(promoted)S +1531(to)S +1656(doubles)S +2037(when)S +2313(compiling)S +2799(those)S +3070(procedures,)S +3616(but)S +3796(may)S +4023(only)S +4257(be)S +4398(passed)S +4728(as)S +4857(\257oats)S +5134(in)S +3828 V +900(your)S +1134(code)S +1373(\(or)S +1533(as)S +1657(double)S +1989(where)S +2288(the)S +2455(CDL)S +2709(is)S +2817(expecting)S +3277(\257oat\).)S +3571(This)S +3801(means)S +4115(the)S +4283(argument)S +4731(stack)S +4990(is)S +5098(o)S +5153 H + (f)show 11 -.5 mul h (f)show +11 R +3948 V +900(by)S +1045(4)S +1135(bytes)S +1402(for)S +1564(each)S +1798(\257oat)S +2029(arg)S +2203(and)S +2396(the)S +2565(values)S +2880(interpreted)S +3389(by)S +3534(the)S +3703(CDL)S +3958(procedure)S +4429(will)S +4636(be)S +4773(corrupted.)S +4068 V +900(If)S +1031(you're)S +1376(going)S +1687(to)S +1833(use)S +2039(the)S +2233(prototypes)S +2757(you'll)S +3080(need)S +3346(to)S +3492(edit)S +3717(the)S +3911(CDL)S +4191(Imake\256le)S +4665(to)S +4811(de\256ne)S +5139("-)S +4188 V +900(DCDL_ANSIC")S +1665(in)S +1787(the)S +1957(EXTRA_DEFINES)S +2865(so)S +2998(it)S +3095(will)S +3302(use)S +3483(the)S +3652(prototypes)S +4151(and)S +4344(everything)S +4848(will)S +5055(line)S +4308 V +900(up.)S +1104(You)S +1326(will)S +1531(then)S +1753(need)S +1992(to)S +2111(rebuild)S +2455(the)S +2622(libcdl.a)S +2982(as)S +3106(well)S +3328(as)S +3452(relink)S +3741(your)S +3975(program.)S +4548 V +11 B +900(7.)S +1049(Fortran)S +1453(Language)S +1952(Binding)S +2362(Notes)S +4704 V +11 R +1175(The)S +1396(Fortran)S +1770(language)S +2216(binding)S +2604(routines)S +3009(are)S +3193(implemented)S +3819(in)S +3957(C)S +4083(but)S +4276(should)S +4622(be)S +4777(accessible)S +4824 V +900(from)S +1155(any)S +1355(fortran)S +1694(program)S +2107(as)S +2240(though)S +2588(they)S +2819(were)S +3072(real)S +3277(fortran)S +3616(subroutines.)S +4226(The)S +4437(calling)S +4777(sequences)S +4944 V +900(are)S +1065(the)S +1232(same)S +1490(as)S +1614(with)S +1843(the)S +2010(C)S +2117(library)S +2442(routines)S +2829(with)S +3058(the)S +3225(following)S +3686(exceptions:)S +5100 V +11 Y1 +1150(d)S +11 R +1289(The)S +1500(CDL)S +1761(package)S +2159(pointer)S +2511(is)S +2626(maintained)S +3155(internally)S +3617(so)S +3756(no)S +3907('cdl')S +4155(pointer)S +4508(is)S +4624(passed)S +4958(in)S +5086(the)S +5220 V +1150(fortran)S +1480(interface.)S +5376 V +11 Y1 +1150(d)S +11 R +1289(All)S +1471(routines)S +1866(which)S +2175(are)S +2348(integer)S +2693(procedures)S +3213(in)S +3340(the)S +3515(C)S +3630(interface)S +4053(return)S +4356(an)S +4501(extra)S +4761('ier')S +4990(argu-)S +5496 V +1150(ment)S +1403(to)S +1522(contain)S +1878(the)S +2045(error)S +2289(\257ag.)S +2548(All)S +2722(Fortran)S +3078(functions)S +3520(are)S +3685(implemented)S +4292(as)S +4416(subroutines.)S +5652 V +11 Y1 +1150(d)S +11 R +1281(The)S +1485(procedure)S +1955(names)S +2269(are)S +2435(the)S +2603(same)S +2862(except)S +3181(that)S +11 I +3380(cdl_)S +11 R +3603(has)S +3783(been)S +4023(replaced)S +4426(with)S +11 I +4656(cf)S +11 R +4769(in)S +4889(the)S +5057(for-)S +5772 V +1150(tran)S +1353(binding.)S +1784(If)S +1889(your)S +2123(compiler)S +2546(is)S +2653(case-sensitive)S +3294(then)S +3516(use)S +3695(all)S +3838(lower)S +4120(case)S +4340(letters.)S +5928 V +900(The)S +1117(binding)S +1501(has)S +1695(been)S +1949(tested)S +2253(on)S +2411(a)S +2507(number)S +2890(of)S +3029(di)S +3115 H + (f)show 11 -.5 mul h (f)show +11 R +3182(erent)S +3448(platforms)S +3917(without)S +4302(problems.)S +4820(The)S +5038(pro-)S +6048 V +900(cedure)S +1243(names)S +1576(haven't)S +1957(been)S +2216(restricted)S +2676(to)S +2815(the)S +3002(traditional)S +3506(6-character)S +4047(fortran)S +4396(names)S +4728(since)S +5005(most)S +6168 V +900(modern)S +1278(compilers)S +1754(can)S +1948(handle)S +2283(longer)S +2606(names,)S +2957(if)S +3067(yours)S +3354(isn't)S +3593(one)S +3794(of)S +3929(them)S +4193(contact)S +11 I +4553(iraf@noao.edu)S +6288 V +11 R +900(for)S +1060(help)S +1282(in)S +1401(changing)S +1836(the)S +2003(names.)S +6444 V +1175(Since)S +1456(the)S +1627(CDL)S +1884(is)S +1995(implemented)S +2606(as)S +2734(a)S +2819(set)S +2978(of)S +3106(C)S +3217(routines,)S +3637(the)S +3809(one)S +4005(aspect)S +4316(that)S +4519(cannot)S +4849(be)S +4990(over-)S +6564 V +900(looked)S +1245(in)S +1377(the)S +1557(fortran)S +1900(binding)S +2283(is)S +2403(the)S +2583(between)S +2993(Fortran)S +3362(and)S +3566(C)S +3686(storage)S +4048(order)S +4324(for)S +4497(arrays.)S +4869(In)S +5005(most)S +6684 V +900(cases)S +1166(this)S +1362(will)S +1570(not)S +1747(be)S +1886(a)S +1970(problem)S +2372(since)S +2633(the)S +2803(CDL)S +3059(routines)S +3449(are)S +3617(just)S +3813(passing)S +4179(around)S +4519(pointers)S +4910(even)S +5153(if)S +6804 V +900(they)S +1136(live)S +1348(for)S +1522(a)S +1617(short)S +1884(while)S +2174(in)S +2306(a)S +2400(fortran)S +2743(program.)S +3221(The)S +3437(problem)S +3849(comes)S +4175(when)S +4458(using)S +4743(the)S +4923(fortran)S +6924 V +900(program)S +1313(to)S +1441(read)S +1670(the)S +1846(arrays,)S +2183(for)S +2353(example)S +2767(in)S +2896(using)S +3178(the)S +3355(array)S +3621(returned)S +4028(by)S +4181(the)S +11 B +4358(cfreadIRAF\(\))S +11 R +5038(pro-)S +7044 V +900(cedure,)S +1254(or)S +1381(when)S +1654(passing)S +2020(in)S +2142(arrays)S +2444(for)S +2607(display)S +2961(that)S +3162(originated)S +3643(in)S +3765(the)S +3935(user's)S +4232(fortran)S +4565(code.)S +4868(In)S +4995(these)S +7164 V +900(cases)S +1179(the)S +1362(array)S +11 B +1634(must)S +11 R +1915(be)S +2067(transposed)S +2585(to)S +2720(be)S +2872(interpreted)S +3395(correctly.)S +3893(It)S +4009(was)S +4228(assumed)S +4655(that)S +4869(in)S +5005(most)S +7284 V +900(applications)S +1481(arrays)S +1797(returned)S +2211(by)S +2371(CDL)S +2641(procedures)S +3170(would)S +3495(be)S +3648(immediately)S +4248(passed)S +4590(to)S +4726(other)S +5000(CDL)S +7920 V +EP +%%Page: 18 21 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 18 -)S +840 V +900(procedures)S +1415(so)S +1549(having)S +1885(the)S +2056(binding)S +2430(routines)S +2821(transpose)S +3272(the)S +3443(array)S +3703(to/from)S +4070(Fortran)S +4430(storage)S +4783(order)S +5050(was)S +960 V +900(unnecessarily)S +1529(ine)S +1663 H + (f)show 11 -.5 mul h (\256)show +11 R +1755(cient.)S +2062(This)S +2291(may)S +2513(be)S +2649(changed)S +3046(in)S +3165(later)S +3392(releases)S +3770(if)S +3870(required.)S +1320 V +11 B +900(8.)S +1049(SPP)S +1278(Language)S +1777(Binding)S +2187(Notes)S +1476 V +11 R +1175(The)S +1390(SPP)S +1621(language)S +2061(binding)S +2443(is)S +2562(experimental)S +3179(and)S +3382(is)S +3501(intended)S +3924(to)S +4055(provide)S +4436(a)S +4530(way)S +4758(to)S +4890(quickly)S +1596 V +900(prototype)S +1356(tasks,)S +1639(it)S +1736(should)S +2065(not)S +2241(be)S +2379(used)S +2615(in)S +2736(production)S +3247(code)S +3488(as)S +3614(it)S +3711(may)S +3935(not)S +4111(be)S +4249(as)S +4375(portable)S +4769(as)S +4894(the)S +5062(rest)S +1716 V +900(of)S +1033(the)S +1209(task.)S +1489(In)S +1622(essence)S +1997(this)S +2200(binding)S +2580(is)S +2697(a)S +2788(layer)S +3049(on)S +3202(top)S +3386(of)S +3520(the)S +3697(Fortran)S +4063(binding)S +4443(since)S +4711(most)S +4969(IRAF)S +1836 V +900(platforms)S +1357(still)S +1560(use)S +1742(Fortran)S +2101(as)S +2228(the)S +2398(intermediate)S +2982(code.)S +3285(The)S +3490(calling)S +3824(sequences)S +4302(are)S +4469(the)S +4638(same)S +4898(as)S +5024(with)S +1956 V +900(the)S +1067(Fortran)S +1423(library)S +1748(routines)S +2135(with)S +2364(the)S +2531(following)S +2992(caveats:)S +2112 V +11 Y1 +1150(d)S +11 R +1290(The)S +1502('cdlspp.h')S +1986(SPP)S +2214(include)S +2579(\256le)S +2762(is)S +2878(required)S +3284(by)S +3437(all)S +3590(\256les)S +3817(which)S +4128(call)S +4329(CDL)S +4592(routines.)S +5050(The)S +2232 V +1150(binding)S +1535(names)S +1863(are)S +2043(actually)S +2438(SPP)S +2672(macros)S +3036(to)S +3170(resolve)S +3534(the)S +3716(current)S +4073(6)S +4176(character)S +4622(limit)S +4880(on)S +5038(pro-)S +2352 V +1150(cedure)S +1473(names.)S +2508 V +11 Y1 +1150(d)S +11 R +1287(All)S +1467(character)S +1904(string)S +2194(arguments)S +2690(must)S +2944(be)S +3086(dimensioned)S +3687(to)S +3812(at)S +3930(least)S +4170(SZ_FNAME)S +4779(characters)S +2628 V +1150(in)S +1269(length.)S +2784 V +11 Y1 +1150(d)S +11 R +1289(The)S +1500(CDL)S +1761(package)S +2159(pointer)S +2511(is)S +2626(maintained)S +3155(internally)S +3617(so)S +3756(no)S +3907('cdl')S +4155(pointer)S +4508(is)S +4624(passed)S +4958(in)S +5086(the)S +2904 V +1150(fortran)S +1480(interface.)S +3060 V +11 Y1 +1150(d)S +11 R +1289(All)S +1471(routines)S +1866(which)S +2175(are)S +2348(integer)S +2693(procedures)S +3213(in)S +3340(the)S +3515(C)S +3630(interface)S +4053(return)S +4356(an)S +4501(extra)S +4761('ier')S +4990(argu-)S +3180 V +1150(ment)S +1403(to)S +1522(contain)S +1878(the)S +2045(error)S +2289(\257ag.)S +2548(All)S +2722(SPP)S +2941(functions)S +3383(are)S +3548(implemented)S +4155(as)S +4279(subroutines.)S +3336 V +11 Y1 +1150(d)S +11 R +1293(On)S +1472(HPUX)S +1816(or)S +1952(IBM)S +2205(RS6000)S +2606(systems)S +3001(the)S +3181('cdlspp.h')S +3669(\256le)S +3856(must)S +4117(be)S +4266(edited)S +4580(to)S +4712(remove)S +5086(the)S +3456 V +1150(trailing)S +1507(underscores)S +2068(from)S +2320(the)S +2493(procedure)S +2968(name)S +3244(macros.)S +3659(This)S +3893(is)S +4005(because)S +4388(on)S +4536(these)S +4799(platforms)S +3576 V +1150(the)S +1319(fortran)S +1652(compiler)S +2078(will)S +2286(not)S +2463(append)S +2815(an)S +2954(underscore)S +3469(to)S +3591(the)S +3761(SPP)S +3983(symbols)S +4387(as)S +4514(it)S +4612(does)S +4849(on)S +4995(other)S +3696 V +1150(platforms.)S +4056 V +11 B +900(9.)S +1049(IIS)S +1230(Protocol)S +1658(Description)S +4212 V +11 R +1175(The)S +1383(communications)S +2148(protocol)S +2552(used)S +2791(by)S +2939(the)S +3111(CDL)S +3369(and)S +3565(servers)S +3913(such)S +4153(as)S +11 I +4283(XImtool)S +11 R +4676(and)S +11 I +4873(SAOim-)S +4332 V +900(age)S +11 R +1058(,)S +1121(is)S +1230(a)S +1313(slightly)S +1679(modi\256ed)S +2105(version)S +2462(of)S +2587(that)S +2786(used)S +3021(by)S +3165(the)S +3333(IIS)S +3501(Model)S +3822(70.)S +4027(All)S +4202(operations)S +4693(are)S +4859(initiated)S +4452 V +900(by)S +1051(sending)S +1434(a)S +1523(header)S +1855(packet)S +2182(containing)S +2688(a)S +11 I +2778(thing)S +3047(id)S +11 R +3175(\(tid\))S +3406(and)S +11 I +3606(subunit)S +11 R +3973(selecting)S +4405(the)S +4581(function)S +4989(to)S +5117(be)S +4572 V +900(performed,)S +1429(optionally)S +1922(followed)S +2358(by)S +2514(data)S +2742(up)S +2897(to)S +3028(32K)S +3262(bytes)S +3539(long.)S +3841(The)S +4056(IIS)S +4235(header)S +4570(packet)S +4900(used)S +5146(is)S +4692 V +900(de\256ned)S +1256(as)S +4812 V +11 C +1450(struct)S +1978(iism70)S +2440({)S +4932 V +1725(short)S +2253(tid;)S +5052 V +1725(short)S +2253(thingct;)S +5172 V +1725(short)S +2253(subunit;)S +5292 V +1725(short)S +2253(checksum;)S +5412 V +1725(short)S +2253(x,)S +2451(y,)S +2649(z;)S +5532 V +1725(short)S +2253(t;)S +5652 V +1450(};)S +5892 V +11 R +900(The)S +11 I +1109(thing)S +1375(count)S +11 R +1658(\256eld)S +1893(contains)S +2299(the)S +2473(negative)S +2884(number)S +3259(of)S +3390(bytes)S +3662(of)S +3793(data)S +4015(that)S +4220(will)S +4432(be)S +4575(sent)S +4792(following)S +6012 V +900(the)S +1067(header)S +1390(packet.)S +1769(The)S +1972(IIS)S +2139(header)S +2462(checksum)S +2933(is)S +3040(computed)S +3506(as)S +6252 V +11 C +1164(checksum)S +1758(=)S +1890(0177777)S +2418(-)S +2550(\(tid)S +2880(+)S +3012(subunit)S +3540(+)S +3672(thingct)S +4200(+)S +4332(x)S +4464(+)S +4596(y)S +4728(+)S +4860(z)S +4992(+)S +5124(t\);)S +6492 V +11 R +900(The)S +1112(four)S +1336(IIS)S +1512(registers)S +1925(are)S +2099(set)S +2263(di)S +2349 H + (f)show 11 -.5 mul h (f)show +11 R +2416(erently)S +2762(depending)S +3261(on)S +3414(the)S +3591(operation,)S +4076(a)S +4167(summary)S +4619(of)S +4753(the)S +4930(header)S +6612 V +900(packets)S +1261(for)S +1421(each)S +1653(operation)S +2100(is)S +2207(summarized)S +2776(below.)S +7920 V +EP +%%Page: 19 22 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 19 -)S +840 V +11 B +2373(IIS)S +2554(Header)S +2934(Packet)S +3283(Summary)S +1020 V +11 R +2296(TID)S +3291(Subunit)S +4061(Tct)S +4394(X)S +4638(Y)S +4933(Z)S +5268(T)S +5575(Data)S +1030 V +11 Y1 +1805(2)S +1845(2222222222222222222222222222222222222222222222222222222222222222222222222)S +1150 V +11 R +900(Read)S +1158(Data)S +1887(IIS_READ)S +11 B +2375(|)S +11 R +2399(PACKED)S +3052(MEMORY)S +4040(-NB)S +4406(x)S +4650(y)S +4882(fr)S +5217(-)S +5552(NB)S +1270 V +900(Write)S +1182(Data)S +1887(IIS_WRITE)S +11 B +2423(|)S +11 R +2447(PACKED)S +3052(MEMORY)S +4040(-NB)S +4406(x)S +4650(y)S +4882(fr)S +5217(-)S +5552(NB)S +1390 V +900(Read)S +1158(Cursor)S +1887(IIS_READ)S +3052(IMCURSOR)S +4116(-)S +4415(-)S +4659(-)S +4882(-)S +5217(-)S +5552(-)S +1510 V +900(Write)S +1182(Cursor)S +1887(IIS_WRITE)S +3052(IMCURSOR)S +4116(-)S +4406(x)S +4650(y)S +4882(wcs)S +5217(-)S +5552(-)S +1630 V +900(Set)S +1074(Frame)S +1887(IIS_WRITE)S +3052(LUT)S +11 B +3265(|)S +11 R +3289(COMMAND)S +4089(-1)S +4415(-)S +4659(-)S +4882(-)S +5217(-)S +5552(2)S +1750 V +900(Erase)S +1175(Frame)S +1887(IIS_WRITE)S +11 B +2456(|)S +11 R +2513(fb)S +3052(FEEDBACK)S +4116(-)S +4415(-)S +4659(-)S +4882(fr)S +5217(-)S +5552(-)S +1990 V +900(Old)S +1098(Write)S +1380(WCS)S +1887(IIS_WRITE)S +11 B +2423(|)S +11 R +2447(PACKED)S +3052(WCS)S +4077(-N)S +4415(-)S +4659(-)S +4882(fr)S +5217(fb)S +5552(320)S +2110 V +900(Old)S +1098(Read)S +1356(WCS)S +1887(IIS_READ)S +3052(WCS)S +4116(-)S +4415(-)S +4659(-)S +4882(fr)S +5217(wcs)S +5552(320)S +2350 V +900(WCS)S +1172(Version?)S +1887(IIS_READ)S +3052(WCS)S +4116(-)S +4406(1)S +4650(1)S +4882(-)S +5217(-)S +5552(320)S +2470 V +900(WCS)S +1172(by)S +1315(Number?)S +1887(IIS_READ)S +3052(WCS)S +4116(-)S +4406(1)S +4659(-)S +4882(fr)S +5217(wcs)S +5552(1024)S +2590 V +900(New)S +1139(Write)S +1421(WCS)S +1887(IIS_WRITE)S +11 B +2423(|)S +11 R +2447(PACKED)S +3052(WCS)S +4077(-N)S +4406(1)S +4659(-)S +4882(fr)S +5217(fb)S +5552(1024)S +2710 V +900(New)S +1139(Read)S +1397(WCS)S +1887(IIS_READ)S +3052(WCS)S +4116(-)S +4406(1)S +4659(-)S +4882(fr)S +5217(wcs)S +5552(1024)S +2720 V +11 Y1 +1805(2)S +1845(2222222222222222222222222222222222222222222222222222222222222222222222222)S +1804(1)S +2680 V +1804(1)S +2570 V +1804(1)S +2460 V +1804(1)S +2350 V +1804(1)S +2240 V +1804(1)S +2130 V +1804(1)S +2020 V +1804(1)S +1910 V +1804(1)S +1800 V +1804(1)S +1690 V +1804(1)S +1580 V +1804(1)S +1470 V +1804(1)S +1360 V +1804(1)S +1250 V +1804(1)S +1140 V +1804(1)S +2720 V +2969(1)S +2680 V +2969(1)S +2570 V +2969(1)S +2460 V +2969(1)S +2350 V +2969(1)S +2240 V +2969(1)S +2130 V +2969(1)S +2020 V +2969(1)S +1910 V +2969(1)S +1800 V +2969(1)S +1690 V +2969(1)S +1580 V +2969(1)S +1470 V +2969(1)S +1360 V +2969(1)S +1250 V +2969(1)S +1140 V +2969(1)S +2720 V +3957(1)S +2680 V +3957(1)S +2570 V +3957(1)S +2460 V +3957(1)S +2350 V +3957(1)S +2240 V +3957(1)S +2130 V +3957(1)S +2020 V +3957(1)S +1910 V +3957(1)S +1800 V +3957(1)S +1690 V +3957(1)S +1580 V +3957(1)S +1470 V +3957(1)S +1360 V +3957(1)S +1250 V +3957(1)S +1140 V +3957(1)S +2720 V +4311(1)S +2680 V +4311(1)S +2570 V +4311(1)S +2460 V +4311(1)S +2350 V +4311(1)S +2240 V +4311(1)S +2130 V +4311(1)S +2020 V +4311(1)S +1910 V +4311(1)S +1800 V +4311(1)S +1690 V +4311(1)S +1580 V +4311(1)S +1470 V +4311(1)S +1360 V +4311(1)S +1250 V +4311(1)S +1140 V +4311(1)S +2720 V +4555(1)S +2680 V +4555(1)S +2570 V +4555(1)S +2460 V +4555(1)S +2350 V +4555(1)S +2240 V +4555(1)S +2130 V +4555(1)S +2020 V +4555(1)S +1910 V +4555(1)S +1800 V +4555(1)S +1690 V +4555(1)S +1580 V +4555(1)S +1470 V +4555(1)S +1360 V +4555(1)S +1250 V +4555(1)S +1140 V +4555(1)S +2720 V +4799(1)S +2680 V +4799(1)S +2570 V +4799(1)S +2460 V +4799(1)S +2350 V +4799(1)S +2240 V +4799(1)S +2130 V +4799(1)S +2020 V +4799(1)S +1910 V +4799(1)S +1800 V +4799(1)S +1690 V +4799(1)S +1580 V +4799(1)S +1470 V +4799(1)S +1360 V +4799(1)S +1250 V +4799(1)S +1140 V +4799(1)S +2720 V +5134(1)S +2680 V +5134(1)S +2570 V +5134(1)S +2460 V +5134(1)S +2350 V +5134(1)S +2240 V +5134(1)S +2130 V +5134(1)S +2020 V +5134(1)S +1910 V +5134(1)S +1800 V +5134(1)S +1690 V +5134(1)S +1580 V +5134(1)S +1470 V +5134(1)S +1360 V +5134(1)S +1250 V +5134(1)S +1140 V +5134(1)S +2720 V +5469(1)S +2680 V +5469(1)S +2570 V +5469(1)S +2460 V +5469(1)S +2350 V +5469(1)S +2240 V +5469(1)S +2130 V +5469(1)S +2020 V +5469(1)S +1910 V +5469(1)S +1800 V +5469(1)S +1690 V +5469(1)S +1580 V +5469(1)S +1470 V +5469(1)S +1360 V +5469(1)S +1250 V +5469(1)S +1140 V +5469(1)S +2720 V +5860(1)S +2680 V +5860(1)S +2570 V +5860(1)S +2460 V +5860(1)S +2350 V +5860(1)S +2240 V +5860(1)S +2130 V +5860(1)S +2020 V +5860(1)S +1910 V +5860(1)S +1800 V +5860(1)S +1690 V +5860(1)S +1580 V +5860(1)S +1470 V +5860(1)S +1360 V +5860(1)S +1250 V +5860(1)S +1140 V +5860(1)S +2960 V +11 R +900(Where)S +1355(NB)S +2218(=)S +2313(number)S +2681(of)S +2805(bytes)S +3070(expected)S +3491(or)S +3615(written)S +3080 V +1355(x)S +2218(=)S +2313(x)S +2401(position)S +2790(of)S +2914(operation)S +3361(in)S +3480(frame)S +3767(bu)S +3877 H + (f)show 11 -.5 mul h (f)show +11 R +3944(er)S +4061(coords)S +3200 V +1355(y)S +2218(=)S +2313(y)S +2401(position)S +2790(of)S +2914(operation)S +3361(in)S +3480(frame)S +3767(bu)S +3877 H + (f)show 11 -.5 mul h (f)show +11 R +3944(er)S +4061(coords)S +3320 V +1355(fr)S +2218(=)S +2313(frame)S +2600(number)S +2968(\(passed)S +3329(as)S +3453(bit\257ag)S +3768(\(i.e.)S +3972(1,)S +4088(2)S +4176(,4)S +4292(8,)S +4408(etc\))S +3440 V +1355(fb)S +2218(=)S +2313(frame)S +2600(bu)S +2710 H + (f)show 11 -.5 mul h (f)show +11 R +2777(er)S +2894(con\256g)S +3202(number)S +3570(\(zero)S +3826(indexed\))S +3560 V +1355(N)S +2218(=)S +2313(length)S +2621(of)S +2745(WCS)S +3017(string)S +3680 V +1355(wcs)S +2218(=)S +2313(WCS)S +2585(number)S +2953(\(usually)S +3340(zero\))S +3800 V +1355(Data)S +2218(=)S +2313(the)S +2480(number)S +2848(of)S +2972(bytes)S +3237(of)S +3361(data)S +3576(to)S +3695(be)S +3831(read)S +4051(or)S +4175(written)S +4519(following)S +4980(the)S +5147(header)S +5470(packet.)S +4040 V +1355(IIS_WRITE)S +2251(=)S +2346(0400000)S +4160 V +1355(IIS_READ)S +2251(=)S +2346(0100000)S +4280 V +1355(COMMAND)S +2251(=)S +2346(0100000)S +4400 V +1355(PACKED)S +2251(=)S +2346(0040000)S +4520 V +1355(IMC_SAMPLE)S +2251(=)S +2346(0040000)S +4760 V +1355(MEMORY)S +2251(=)S +2346(001)S +4880 V +1355(LUT)S +2251(=)S +2346(002)S +5000 V +1355(FEEDBACK)S +2251(=)S +2346(005)S +5120 V +1355(IMCURSOR)S +2251(=)S +2346(020)S +5240 V +1355(WCS)S +2251(=)S +2346(021)S +5456 V +900(TID)S +1119(\256elds)S +1395(can)S +1583(be)S +1723(logically)S +2145(OR'd)S +2426(with)S +2659(the)S +2830(PACKED)S +3307(\257ag)S +3509(indicating)S +3986(the)S +4157(number)S +4529(of)S +4657(data)S +4876(bytes)S +5146(is)S +5576 V +900(exactly)S +11 I +1252(thingct)S +11 R +1594(bytes)S +1862(long,)S +2122(otherwise)S +11 I +2584(thingct)S +11 R +2926(must)S +3177(be)S +3316(speci\256ed)S +3742(as)S +3869(half)S +4075(the)S +4245(number)S +4616(of)S +4743(data)S +4960(bytes.)S +5696 V +900(In)S +1028(a)S +1113(cursor)S +1423(read,)S +1675(if)S +1779(the)S +1951(IIS_READ)S +2477(\257ag)S +2680(is)S +2792(OR'd)S +3074(with)S +3308(IMC_SAMPLE)S +4044(the)S +4216(logical)S +4553(cursor)S +4864(position)S +5816 V +900(\(i.e.)S +1153(the)S +1336(last)S +1538(value)S +1824(read)S +2060(or)S +2200(set\))S +2407(is)S +2530(returned)S +2943(immediately,)S +3570(otherwise)S +4044(the)S +4226(server)S +4540(will)S +4760(wait)S +4997(for)S +5172(a)S +5936 V +900(keystroke)S +1366(to)S +1492(be)S +1635(hit)S +1792(before)S +2110(returning)S +2552(a)S +2640(string)S +2932(containing)S +3437(the)S +3612(\(x,y\))S +3863(position,)S +4288(wcs)S +4499(of)S +4631(the)S +4806(read,)S +5062(and)S +6056 V +900(the)S +1072(keystroke.)S +1597(When)S +1896(setting)S +2228(the)S +2400(frame)S +2692(you)S +2895(must)S +3148(send)S +3387(a)S +3473(short)S +3731(integer)S +4072(in)S +4195(the)S +4366(data)S +4585(containing)S +5086(the)S +6176 V +900(frame)S +1187(selected.)S +6536 V +11 B +900(10.)S +1104(VXIMTOOL)S +1761(Proxy/Display)S +2461(Server)S +2803(Usage)S +6692 V +11 I +900(VXIMTOOL)S +11 R +1481(is)S +1593(a)S +1679(image)S +1986(display)S +2343(server)S +2648(process)S +3015(much)S +3298(like)S +11 I +3502(XIMTOOL)S +11 R +3978(,)S +4045(except)S +4369(that)S +4573(all)S +4722(it)S +4823(normally)S +6812 V +900(does)S +1139(is)S +1251(respond)S +1636(to)S +1760(datastream)S +2272(requests)S +2669(to)S +2793(read)S +3018(and)S +3214(write)S +3477(to)S +3600(internal)S +3972(frame)S +4263(bu)S +4373 H + (f)show 11 -.5 mul h (f)show +11 R +4440(ers)S +4604(maintained)S +5129(as)S +6932 V +900(arrays)S +1201(in)S +1322(memory.)S +1784(Multiple)S +2199(frame)S +2488(bu)S +2598 H + (f)show 11 -.5 mul h (f)show +11 R +2665(ers)S +2827(and)S +3020(frame)S +3309(bu)S +3419 H + (f)show 11 -.5 mul h (f)show +11 R +3486(er)S +3605(con\256gurations)S +4269(are)S +4436(supported.)S +4966(It)S +5069(can)S +7052 V +900(be)S +1038(used)S +1274(to)S +1395(debug)S +1698(CDL)S +1953(programs)S +2402(by)S +2547(printing)S +2931(out)S +3107(the)S +3276(protocol)S +3677(packets)S +4040(received,)S +4472(or)S +4597(can)S +4782(simply)S +5117(be)S +7172 V +900(used)S +1148(as)S +1286(a)S +1381(dummy)S +1766(server)S +2080(in)S +2214(cases)S +2492(where)S +2806(no)S +2964(image)S +3280(display)S +3646(is)S +3768(really)S +4065(needed.)S +4483(By)S +4660(enabling)S +5086(the)S +7292 V +11 I +900(-proxy)S +11 R +1219(\257ag)S +1418(the)S +1585(server)S +1884(can)S +2068(also)S +2278(be)S +2414(used)S +2648(to)S +2767(repeat)S +3066(the)S +3233(datastream)S +3740(requests)S +4132(to)S +4251(a)S +4332(list)S +4501(of)S +4625(other)S +4883(servers,)S +7920 V +EP +%%Page: 20 23 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 20 -)S +840 V +900(e)S +948 H + (f)show 11 -.5 mul h (f)show +11 R +1015(ectively)S +1399(splitting)S +1799(the)S +1970(image)S +2275(display)S +2630(to)S +2753(a)S +2838(number)S +3210(of)S +3338(other)S +3600(servers.)S +4007(See)S +4202(the)S +11 I +4373(vximtool)S +11 R +4788(man)S +5014(page)S +960 V +900(for)S +1060(details)S +1380(on)S +1523(other)S +1781(command-line)S +2448(arguments)S +2938(and)S +3129(usage.)S +1116 V +900(The)S +1116(program)S +1533(was)S +1749(originally)S +2223(intended)S +2647(as)S +2785(a)S +2880(debugging)S +3391(tool,)S +3638(either)S +3934(in)S +4067(the)S +4248(development)S +4862(of)S +5000(CDL)S +1236 V +900(clients)S +1233(directly)S +1614(or)S +1751(in)S +1883(cases)S +2159(where)S +2471(the)S +2651(display)S +3015(may)S +3249(need)S +3500(to)S +3631(go)S +3786(to)S +3917(separate)S +4319(screens)S +4685(as)S +4821(part)S +5036(of)S +5172(a)S +1356 V +900(larger)S +1207(project.)S +1625(For)S +1832(example,)S +2285(engineers)S +2758(may)S +3001(wish)S +3263(to)S +3403("eavesdrop")S +3990(on)S +4154(the)S +4342(system)S +4702(by)S +4866(viewing)S +1476 V +900(images)S +1249(displayed)S +1708(by)S +1856(CDL)S +2114(clients)S +2439(used)S +2678(as)S +2807(part)S +3015(of)S +3144(a)S +3230(data)S +3449(acquisition)S +3969(system.)S +4373(It)S +4477(can)S +4665(also)S +4879(be)S +5019(used)S +1596 V +900(as)S +1036(a)S +1129(memory-only)S +1772(display)S +2135(server)S +2446(for)S +2618(CDL)S +2883(clients)S +3215(which)S +3529(need)S +3781(to)S +3913(be)S +4062(run)S +4254(in)S +4386(the)S +4566(background)S +5129(as)S +1716 V +900(part)S +1103(of)S +1227(a)S +1308(pipeline)S +1695(processing)S +2197(system)S +2536(requiring)S +2971(a)S +3052(frame)S +3339(bu)S +3449 H + (f)show 11 -.5 mul h (f)show +11 R +3516(er)S +3633(for)S +3793(image)S +4094(marking.)S +1872 V +900(In)S +1031(proxy)S +1327(mode)S +1611(the)S +1785(program)S +2197(acts)S +2408(as)S +2540(a)S +2629(relay)S +2888(for)S +3056(the)S +3231(IIS)S +3406(datastream)S +3921(packets,)S +4318(sending)S +4701(image)S +5010(data,)S +1992 V +900(frame)S +1188(requests,)S +1609(etc.)S +1798(to)S +1918(a)S +2000(list)S +2169(of)S +2293(other)S +2551(servers)S +2893(speci\256ed)S +3316(on)S +3459(the)S +3626(command)S +4092(line.)S +4351(The)S +4554(e)S +4602 H + (f)show 11 -.5 mul h (f)show +11 R +4669(ect)S +4829(of)S +4953(this)S +5146(is)S +2112 V +900(to)S +1027(allow)S +1312(a)S +1402(client)S +1688(to)S +1816(display)S +2176(to)S +2304(this)S +2506(program)S +2919(which)S +3229(then)S +3460(re-displays)S +3983(to)S +4111(each)S +4352(of)S +4485(the)S +4661(other)S +4928(named)S +2232 V +900(servers.)S +1289(Of)S +1456(course)S +1793(CDL)S +2065(clients)S +2404(can)S +2607(also)S +2836(do)S +2998(this)S +3210(internally)S +3683(by)S +3844(opening)S +4249(multiple)S +4668(connections,)S +2352 V +900(using)S +11 I +1185(vximtool)S +11 R +1609(in)S +1741(proxy)S +2044(mode)S +2335(adds)S +2583(the)S +2764(functionality)S +3373(to)S +3506(programs)S +3967(which)S +4282(may)S +4518(use)S +4711(this)S +4918(feature)S +2472 V +900(only)S +1132(ocasionally.)S +1729(A)S +1844(maximum)S +2327(of)S +2453(8)S +2543(servers)S +2887(may)S +3111(be)S +3249(named,)S +3604(they)S +3828(may)S +4052(be)S +4190(either)S +4474(on)S +4619(the)S +4788(local)S +5036(host)S +2592 V +900(or)S +1024(a)S +1105(remote)S +1442(machine)S +1846(and)S +2037(connections)S +2594(can)S +2779(be)S +2916(established)S +3438(using)S +3711(either)S +3994(\256fos)S +4224(or)S +4349(sockets.)S +4767(See)S +4959(above)S +2712 V +900(or)S +1024(the)S +11 I +1191(vximtool)S +11 R +1602(man)S +1824(page)S +2063(for)S +2223(details)S +2543(on)S +2686(how)S +2908(to)S +3027(specify)S +3376(the)S +3543(server)S +3842(connection.)S +2868 V +900(The)S +1103(current)S +1445(implementation)S +2169(has)S +2348(a)S +2429(few)S +2625(restrictions)S +3146(users)S +3404(should)S +3731(keep)S +3970(in)S +4089(mind:)S +3024 V +11 Y1 +1150(d)S +11 R +1288(The)S +1498(time)S +1734(to)S +1860(display)S +2218(an)S +2361(image)S +2669(or)S +2801(perform)S +3194(any)S +3393(output)S +3716(operation)S +4171(scales)S +4473(with)S +4710(the)S +4885(number)S +3144 V +1150(of)S +1285(connected)S +1772(hosts.)S +2104(Each)S +2366(IIS)S +2544(packet)S +2873(is)S +2991(forwarded)S +3483(to)S +3612(each)S +3854(host)S +4081(in)S +4210(turn)S +4430(before)S +4751(processing)S +3264 V +1150(the)S +1317(next)S +1539(input)S +1799(packet,)S +2145(and)S +2336(connection)S +2850(over)S +3077(a)S +3158(slow)S +3399(network)S +3791(will)S +3996(delay)S +4266(the)S +4433(entire)S +4715(process.)S +3420 V +11 Y1 +1150(d)S +11 R +1298(Cursor)S +1647(and)S +1855(image)S +2173(readback)S +2616(are)S +2799(done)S +3063(by)S +3224(sending)S +3617(the)S +3802(request)S +11 I +4169(only)S +11 R +4409(to)S +4546(the)S +4731(\256rst)S +4954(server)S +3540 V +1150(named)S +1483(on)S +1634(the)S +1809(command)S +2283(line.)S +2550(This)S +2787(is)S +2902(done)S +3156(to)S +3283(avoid)S +3568(forcing)S +3925(a)S +4014(cursor)S +4327(mode)S +4611(on)S +4761(all)S +4911(servers)S +3660 V +1150(which)S +1455(cannot)S +1784(be)S +1924(terminated)S +2430(when)S +2705(a)S +2791(response)S +3212(is)S +3324(received)S +3731(from)S +3982(only)S +4216(one)S +4412(server,)S +4744(and)S +4940(means)S +3780 V +1150(that)S +1365(the)S +1549(\256rst)S +1771(server)S +2087(named)S +2429(should)S +2773(be)S +2926(the)S +3110(one)S +3318(used)S +3569(to)S +3705(control)S +4066(interactive)S +4578(sessions.)S +5050(The)S +3900 V +1150(remaining)S +1648(servers)S +2010(however)S +2439(can)S +2643(still)S +2863(respond)S +3263(to)S +3403(cursor)S +3730(requests)S +4143(from)S +4410(other)S +4689(applications)S +4020 V +1150(connected)S +1626(to)S +1745(that)S +1943(server)S +2242(on)S +2385(another)S +2746(channel.)S +4176 V +11 Y1 +1150(d)S +11 R +1282(All)S +1457(named)S +1783(servers)S +2126(must)S +2375(be)S +2513(running)S +2890(prior)S +3138(to)S +3259(starting)S +3624(the)S +3793(proxy)S +4084(server.)S +4413(The)S +4618(connection)S +5134(to)S +4296 V +1150(the)S +1321(remote)S +1661(servers)S +2006(is)S +2116(established)S +2640(when)S +2913(this)S +3109(task)S +3322(is)S +3432(\256rst)S +3640(run)S +3822(and)S +4016(if)S +4119(no)S +4265(server)S +4567(is)S +4677(running)S +5055(that)S +4416 V +1150(connection)S +1687(will)S +1915(be)S +2074(ignored.)S +2493(The)S +2719(task)S +2952(will)S +3180(exit)S +3401(if)S +3524(no)S +3690(remote)S +4050(servers)S +4415(can)S +4622(be)S +4781(found)S +5093(for)S +4536 V +1150(display.)S +4692 V +11 Y1 +1150(d)S +11 R +1295(Any)S +1531(connected)S +2021(server)S +2334(that)S +2546(shuts)S +2820(down)S +3111(while)S +3402(the)S +3583(proxy)S +3887(server)S +4201(is)S +4323(running)S +4713(is)S +4835(likely)S +5134(to)S +4812 V +1150(cause)S +1425(the)S +1592(program)S +1996(to)S +2115(crash)S +2378(on)S +2521(the)S +2688(next)S +2910(display.)S +7920 V +EP +%%Page: 21 24 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 21 -)S +840 V +11 B +900(11.)S +1104(C)S +1216(Interface)S +1673(Summary)S +996 V +11 R +1260(#include)S +1704(")S +11 B +1749(cdl.h)S +11 R +1980(")S +1296 V +1537(CDLPtr)S +11 B +1919(cdl_open)S +11 R +2507(\(imtdev\))S +1416 V +1504(int)S +11 B +1654(cdl_displayPix)S +11 R +2507(\(cdl,)S +2738(pix,)S +2940(nx,)S +3111(ny,)S +3282(bitpix,)S +3601(frame,)S +3916(fbcon\256g,)S +4343(zscale\))S +1536 V +1378(char)S +11 B +1598(cdl_readCursor)S +11 R +2507(\(cdl,)S +2738(sample,)S +3110(x,)S +3226(y,)S +3342(wcs,)S +3573(key\))S +1656 V +1534(int)S +11 B +1684(cdl_setCursor)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(wcs\))S +1776 V +1618(int)S +11 B +1768(cdl_setWCS)S +11 R +2507(\(cdl,)S +2738(name,)S +3036(title,)S +3269(a,)S +3378(b,)S +3494(c,)S +3603(d,)S +3719(tx,)S +3866(ty,)S +4013(z1,)S +4177(z2,)S +4341(zt\))S +1896 V +1606(int)S +11 B +1756(cdl_getWCS)S +11 R +2507(\(cdl,)S +2738(name,)S +3036(title,)S +3269(a,)S +3378(b,)S +3494(c,)S +3603(d,)S +3719(tx,)S +3866(ty,)S +4013(z1,)S +4177(z2,)S +4341(zt\))S +2016 V +1481(void)S +11 B +1710(cdl_setFrame)S +11 R +2507(\(cdl,)S +2738(frame\))S +2136 V +1457(int)S +11 B +1607(cdl_clearFrame)S +11 R +2507(\(cdl\))S +2256 V +1692(void)S +11 B +1921(cdl_close)S +11 R +2507(\(cdl\))S +2496 V +1439(int)S +11 B +1589(cdl_setMapping)S +11 R +2507(\(cdl,)S +2738(region,)S +3079(sx,sy,snx,sny,)S +3726(dx,dy,dnx,dny,)S +4421(ref\))S +2616 V +1427(int)S +11 B +1577(cdl_getMapping)S +11 R +2507(\(cdl,)S +2738(region,)S +3079(sx,sy,snx,sny,)S +3726(dx,dy,dnx,dny,)S +4421(ref\))S +2736 V +1501(int)S +11 B +1651(cdl_queryMap)S +11 R +2507(\(cdl,)S +2738(wcs,)S +2969(region,)S +3310(sx,sy,snx,sny,)S +3957(dx,dy,dnx,dny,)S +4652(objref\))S +2976 V +1389(int)S +11 B +1539(cdl_displayIRAF)S +11 R +2507(\(cdl,)S +2738(fname,)S +3072(band,)S +3346(frame,)S +3661(fbcon\256g,)S +4088(zscale\))S +3096 V +1654(int)S +11 B +1804(cdl_isIRAF)S +11 R +2507(\(fname\))S +3216 V +1515(int)S +11 B +1665(cdl_readIRAF)S +11 R +2507(\(fname,)S +2877(band,)S +3151(pix,)S +3353(nx,)S +3524(ny,)S +3695(bitpix,)S +4014(title\))S +3456 V +1411(int)S +11 B +1561(cdl_displayFITS)S +11 R +2507(\(cdl,)S +2738(fname,)S +3072(frame,)S +3387(fbcon\256g,)S +3814(zscale\))S +3576 V +1676(int)S +11 B +1826(cdl_isFITS)S +11 R +2507(\(fname\))S +3696 V +1537(int)S +11 B +1687(cdl_readFITS)S +11 R +2507(\(fname,)S +2877(pix,)S +3079(nx,)S +3250(ny,)S +3421(bitpix,)S +3740(title\))S +3936 V +1216(void)S +11 B +1445(cdl_computeZscale)S +11 R +2507(\(cdl,)S +2738(pix,)S +2940(nx,)S +3111(ny,)S +3282(bitpix,)S +3601(z1,)S +3765(z2\))S +4056 V +1352(void)S +11 B +1581(cdl_zscaleImage)S +11 R +2507(\(cdl,)S +2738(pix,)S +2940(nx,)S +3111(ny,)S +3282(bitpix,)S +3601(z1,)S +3765(z2\))S +4296 V +1604(int)S +11 B +1754(cdl_printPix)S +11 R +2507(\(cdl,)S +2738(cmd,)S +2988(pix,)S +3190(nx,)S +3361(ny,)S +3532(annotate\))S +4416 V +1298(int)S +11 B +1448(cdl_printPixToFile)S +11 R +2507(\(cdl,)S +2738(fname,)S +3072(pix,)S +3274(nx,)S +3445(ny,)S +3616(annotate\))S +4656 V +1491(int)S +11 B +1641(cdl_readImage)S +11 R +2507(\(cdl,)S +2738(pix,)S +2940(nx,)S +3111(ny\))S +4776 V +1175(int)S +11 B +1325(cdl_readFrameBu)S +2179 H + (f)show 11 -.5 mul h (f)show +11 B +2246(er)S +11 R +2507(\(cdl,)S +2738(pix,)S +2940(nx,)S +3111(ny\))S +4896 V +1288(int)S +11 B +1438(cdl_readSubRaster)S +11 R +2507(\(cdl,)S +2738(lx,)S +2885(ly,)S +3032(nx,)S +3203(ny,)S +3374(pix\))S +5016 V +1259(int)S +11 B +1409(cdl_writeSubRaster)S +11 R +2507(\(cdl,)S +2738(lx,)S +2885(ly,)S +3032(nx,)S +3203(ny,)S +3374(pix\))S +5256 V +1522(void)S +11 B +1751(cdl_selectFB)S +11 R +2507(\(cdl,)S +2738(nx,)S +2909(ny,)S +3080(fb,)S +3232(w,)S +3372(h,)S +3488(nf,)S +3640(reset\))S +5376 V +1336(void)S +11 B +1565(cdl_setFBCon\256g)S +11 R +2507(\(cdl,)S +2738(con\256gno\))S +5496 V +1324(void)S +11 B +1553(cdl_getFBCon\256g)S +11 R +2507(\(cdl,)S +2738(con\256gno,)S +3184(w,)S +3324(h,)S +3440(nf\))S +5616 V +1260(void)S +11 B +1489(cdl_lookupFBSize)S +11 R +2507(\(cdl,)S +2738(con\256gno,)S +3184(w,)S +3324(h,)S +3440(nf\))S +5856 V +1434(void)S +11 B +1663(cdl_setZTrans)S +11 R +2507(\(cdl,)S +2738(ztrans\))S +5976 V +1472(void)S +11 B +1701(cdl_setZScale)S +11 R +2507(\(cdl,)S +2738(z1,)S +2902(z2\))S +6096 V +1441(void)S +11 B +1670(cdl_setSample)S +11 R +2507(\(cdl,)S +2738(nsample\))S +6216 V +1183(void)S +11 B +1412(cdl_setSampleLines)S +11 R +2507(\(cdl,)S +2738(nlines\))S +6336 V +1376(void)S +11 B +1605(cdl_setContrast)S +11 R +2507(\(cdl,)S +2738(contrast\))S +6456 V +1517(void)S +11 B +1746(cdl_setName)S +11 R +2507(\(cdl,)S +2738(imname\))S +6576 V +1570(void)S +11 B +1799(cdl_setTitle)S +11 R +2507(\(cdl,)S +2738(imtitle\))S +6816 V +1469(void)S +11 B +1698(cdl_getFrame)S +11 R +2507(\(cdl,)S +2738(frame\))S +6936 V +1422(void)S +11 B +1651(cdl_getZTrans)S +11 R +2507(\(cdl,)S +2738(ztrans\))S +7056 V +1460(void)S +11 B +1689(cdl_getZScale)S +11 R +2507(\(cdl,)S +2738(z1,)S +2902(z2\))S +7176 V +1429(void)S +11 B +1658(cdl_getSample)S +11 R +2507(\(cdl,)S +2738(nsample\))S +7296 V +1171(void)S +11 B +1400(cdl_getSampleLines)S +11 R +2507(\(cdl,)S +2738(nlines\))S +7920 V +EP +%%Page: 22 25 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 22 -)S +840 V +1364(void)S +11 B +1593(cdl_getContrast)S +11 R +2507(\(cdl,)S +2738(contrast\))S +960 V +1505(void)S +11 B +1734(cdl_getName)S +11 R +2507(\(cdl,)S +2738(imname\))S +1080 V +1558(void)S +11 B +1787(cdl_getTitle)S +11 R +2507(\(cdl,)S +2738(imtitle\))S +1320 V +1479(int)S +11 B +1629(cdl_mapFrame)S +11 R +2507(\(cdl,)S +2738(frame\))S +1440 V +1221(int)S +11 B +1371(cdl_markCoordsFile)S +11 R +2507(\(cdl,)S +2738(fname,)S +3072(type,)S +3322(size,)S +3553(color,)S +3839(label\))S +1560 V +1489(int)S +11 B +1639(cdl_markPoint)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(number,)S +3366(size,)S +3597(type,)S +3847(color\))S +1680 V +1219(int)S +11 B +1369(cdl_markPointLabel)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(label,)S +3244(size,)S +3475(type,)S +3725(color\))S +1800 V +1525(int)S +11 B +1675(cdl_markLine)S +11 R +2507(\(cdl,)S +2738(xs,)S +2897(ys,)S +3056(xe,)S +3220(ye,)S +3384(color\))S +1920 V +1556(int)S +11 B +1706(cdl_markBox)S +11 R +2507(\(cdl,)S +2738(lx,)S +2885(ly,)S +3032(ux,)S +3203(uy,)S +3374(\256ll,)S +3559(color\))S +2040 V +1360(int)S +11 B +1510(cdl_markPolygon)S +11 R +2507(\(cdl,)S +2738(xarray,)S +3077(yarray,)S +3416(npts,)S +3661(\256ll,)S +3846(color\))S +2160 V +1360(int)S +11 B +1510(cdl_markPolyline)S +11 R +2507(\(cdl,)S +2738(xarray,)S +3077(yarray,)S +3416(npts,)S +3661(color\))S +2280 V +1455(int)S +11 B +1605(cdl_markCircle)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(radius,)S +3299(\256ll,)S +3484(color\))S +2400 V +1207(int)S +11 B +1357(cdl_markCircAnnuli)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(radius,)S +3299(nannuli,)S +3690(sep,)S +3897(color\))S +2520 V +1420(int)S +11 B +1570(cdl_markEllipse)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(xrad,)S +3225(yrad,)S +3480(rotang,)S +3821(\256ll,)S +4006(color\))S +2640 V +1184(int)S +11 B +1334(cdl_markEllipAnnuli)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(xrad,)S +3225(yrad,)S +3480(ang,)S +3699(nannuli,)S +4090(sep,)S +4297(color\))S +2760 V +1527(int)S +11 B +1677(cdl_markText)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y,)S +2970(str,)S +3141(size,)S +3372(angle,)S +3670(color\))S +2880 V +1649(int)S +11 B +1799(cdl_setFont)S +11 R +2507(\(cdl,)S +2738(font\))S +3000 V +1355(int)S +11 B +1505(cdl_setTextWidth)S +11 R +2507(\(cdl,)S +2738(width\))S +3120 V +1353(int)S +11 B +1503(cdl_setLineWidth)S +11 R +2507(\(cdl,)S +2738(width\))S +3240 V +1422(int)S +11 B +1572(cdl_setLineStyle)S +11 R +2507(\(cdl,)S +2738(style\))S +3360 V +1455(int)S +11 B +1605(cdl_deleteMark)S +11 R +2507(\(cdl,)S +2738(x,)S +2854(y\))S +3480 V +1355(int)S +11 B +1505(cdl_clearOverlay)S +11 R +2507(\(cdl\))S +3600 V +1245(int)S +11 B +1395(cdl_redrawOverlay)S +11 R +2507(\(cdl\))S +7920 V +EP +%%Page: 23 26 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 23 -)S +840 V +11 B +900(12.)S +1104(C)S +1216(Example)S +1665(Tasks)S +996 V +11 R +1175(The)S +1381(examples)S +1831(shown)S +2154(here)S +2377(are)S +2545(for)S +2708(demonstration)S +3374(purposes)S +3801(only.)S +4095(They)S +4357(are)S +4526(based)S +4812(on)S +4959(work-)S +1116 V +900(ing)S +1079(example)S +1488(tasks)S +1746(in)S +1870(the)S +2042(CDL)S +2300(source)S +11 I +2622(examples)S +11 R +3066(subdirectory,)S +3679(see)S +3855(the)S +4026(programs)S +4477(there)S +4732(for)S +4896(the)S +5067(full)S +1236 V +900(program)S +1304(listing.)S +1596 V +11 B +900(12.1.)S +1187(Display)S +1576(Example)S +1832 V +9 C +900(#include)S +1386(<stdio.h>)S +1932 V +900(#include)S +1386(<unistd.h>)S +2032 V +900(#include)S +1386("cdl.h")S +2232 V +900(/*)S +9 I +1116(DISPLAY)S +1493(--)S +1580(Example)S +1922(task)S +2094(to)S +2191(display)S +2478(an)S +2595(image)S +2842(as)S +2949(a)S +3021(command-line)S +3563(task.)S +2332 V +954(*)S +1053(This)S +1235(task)S +1407(is)S +1494(meant)S +1741(to)S +1838(show)S +2050(three)S +2262(ways)S +2469(the)S +2606(CDL)S +2808(can)S +2965(be)S +3077(used)S +3269(to)S +3366(display)S +2432 V +954(*)S +1053(an)S +1170(image,)S +1440(see)S +1582(the)S +1719(code)S +1916(comments)S +2303(for)S +2435(a)S +2507(description)S +2939(of)S +3036(each)S +3233(method.)S +2532 V +954(*)S +2632 V +954(*)S +1053(Examples:)S +2732 V +954(*)S +1161(To)S +1283(display)S +1570(a)S +1642(simple)S +1904(IRAF)S +2126(or)S +2233(FITS)S +2440(\256le:)S +2832 V +954(*)S +1283(%)S +1385(./display)S +1720(-frame)S +1987(2)S +2059(image.imh)S +2932 V +954(*)S +1242(%)S +1344(./display)S +1679(image.\256ts)S +3032 V +954(*)S +3132 V +954(*)S +1161(To)S +1283(display)S +1570(a)S +1642(FITS)S +1849(\256le)S +1986(as)S +2093(a)S +2165(raw)S +2332(image:)S +3232 V +954(*)S +1269(%)S +1371(./display)S +1706(-nx)S +1848(512)S +2010(-ny)S +2152(512)S +2314(-depth)S +2571(16)S +2688(-hskip)S +2935(5760)S +3142(-raw)S +3339(dpix.\256ts)S +3332 V +954(*)S +3432 V +954(*)S +1053(Usage:)S +3532 V +954(*)S +1175(display)S +1462([-depth)S +1754(N])S +1876([-\256ts])S +2108([-frame)S +2410(N])S +2532([-fbcon\256g)S +2914(N])S +3036([-hskip)S +3318(N])S +3632 V +954(*)S +1283([-iraf])S +1540([-nozscale])S +1977([-nx)S +2154(N])S +2276([-ny)S +2453(N])S +2575([-raw])S +2842([-zscale])S +3189(\256le)S +3732 V +9 C +954(*/)S +3932 V +900(#define)S +1332(NONE)S +1725(-1)S +4032 V +900(#define)S +1450(IRAF)S +1779(0)S +4132 V +900(#define)S +1450(FITS)S +1779(1)S +4232 V +900(#define)S +1450(RAW)S +1779(2)S +4432 V +900(main)S +1170(\(argc,)S +1548(argv\))S +4532 V +900(int)S +1175(argc;)S +4632 V +900(char)S +1175(*argv[];)S +4732 V +900({)S +4832 V +1175(CDLPtr)S +1725(cdl;)S +4932 V +1175(char)S +1450(*fname,)S +1882(title[128];)S +5032 V +1175(int)S +1450(i,)S +1612(status)S +1990(=)S +2098(0,)S +2260(frame)S +2584(=)S +2692(1,)S +2854(fbconfig)S +3340(=)S +3448(0,)S +3610(zscale)S +3988(=)S +4096(1;)S +5132 V +1175(int)S +1450(format)S +1828(=)S +1936(NONE,)S +2260(nx)S +2422(=)S +2530(0,)S +2692(ny)S +2854(=)S +2962(0,)S +3124(depth)S +3448(=)S +3556(8,)S +3718(hskip)S +4042(=)S +4150(0;)S +5232 V +1175(float)S +1725(z1,)S +1941(z2;)S +5332 V +1175(int)S +1450(fb_w,)S +1774(fb_h,)S +2098(nf;)S +5432 V +1175(unsigned)S +1661(char)S +1931(*pix)S +2201(=)S +2309(NULL;)S +5632 V +1175(/*)S +9 I +1337(Process)S +1649(the)S +1786(command)S +2163(line)S +2325(options.)S +9 C +2667(*/)S +5732 V +1175(if)S +1337(\(argc)S +1661(>)S +1769(1\))S +1931({)S +5832 V +1391(for)S +1607(\(i=1;)S +1931(i)S +2039(<)S +2147(argc;)S +2471(i++\))S +2741({)S +5932 V +1548(if)S +1710(\(strcmp)S +2142(\(argv[i],)S +2682("-depth"\))S +3222(==)S +3384(0\))S +3978(depth)S +4302(=)S +4410(atoi)S +4680(\(argv[++i]\);)S +6032 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-fits"\))S +3438(==)S +3600(0\))S +3978(format)S +4356(=)S +4464(FITS;)S +6132 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-frame"\))S +3492(==)S +3654(0\))S +3978(frame)S +4302(=)S +4410(atoi)S +4680(\(argv[++i]\);)S +6232 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-fbconfig"\))S +3654(==)S +3816(0\))S +3978(fbconfig)S +4464(=)S +4572(atoi)S +4842(\(argv[++i]\);)S +6332 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-hskip"\))S +3492(==)S +3654(0\))S +3978(hskip)S +4302(=)S +4410(atoi)S +4680(\(argv[++i]\);)S +6432 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-iraf"\))S +3438(==)S +3600(0\))S +3978(format)S +4356(=)S +4464(IRAF;)S +6532 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-nozscale"\))S +3654(==)S +3816(0\))S +3978(zscale)S +4356(=)S +4464(0;)S +6632 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-nx"\))S +3330(==)S +3492(0\))S +3978(nx)S +4140(=)S +4248(atoi)S +4518(\(argv[++i]\);)S +6732 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-ny"\))S +3330(==)S +3492(0\))S +3978(ny)S +4140(=)S +4248(atoi)S +4518(\(argv[++i]\);)S +6832 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-raw"\))S +3384(==)S +3546(0\))S +3978(format)S +4356(=)S +4464(RAW;)S +6932 V +1548(else)S +1818(if)S +1980(\(strcmp)S +2412(\(argv[i],)S +2952("-zscale"\))S +3546(==)S +3708(0\))S +3978(zscale)S +4356(=)S +4464(1;)S +7032 V +1391(})S +7132 V +1175(})S +7920 V +EP +%%Page: 24 27 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 24 -)S +820 V +9 C +1175(/*)S +9 I +1337(Open)S +1559(the)S +1696(package)S +2023(and)S +2185(a)S +2257(connection)S +2679(to)S +2776(the)S +2913(server.)S +9 C +3215(*/)S +920 V +1175(if)S +1337(\(!\(cdl)S +1715(=)S +9 B +1823(cdl_open)S +9 C +2222(\(\(char)S +2600(*\)getenv\("IMTDEV"\)\)\))S +3734(\))S +1020 V +1337(exit)S +1607(\(-1\);)S +1220 V +1175(fname)S +1499(=)S +1607(argv[argc-1];)S +1420 V +1175(/*)S +9 I +1337(METHOD)S +1739(1:)S +1868(Displays)S +2210(the)S +2347(image)S +2594(using)S +2816(the)S +2953(high-level)S +3340(format)S +3607(display)S +1520 V +1229(*)S +1301(call.)S +1513(Display)S +1820(as)S +1927(an)S +2044(IRAF)S +2266(image)S +2513(if)S +2590(the)S +2727(option)S +2984(was)S +3151(set)S +3278(indicating)S +1620 V +1229(*)S +1301(this)S +1458(is)S +1545(the)S +1682(format,)S +1972(otherwise)S +2349(test)S +2501(the)S +2638(\256le)S +2775(to)S +2872(see)S +3014(if)S +3091(it)S +3168(is)S +3255(anyway.)S +1720 V +9 C +1229(*/)S +1820 V +1175(if)S +1337(\(format)S +1769(==)S +1931(IRAF)S +2201(||)S +2363(\(format)S +2795(==)S +2957(NONE)S +3227(&&)S +9 B +3389(cdl_isIRAF)S +9 C +3883(\(fname\)\)\))S +4423({)S +1920 V +1391(status)S +1769(=)S +9 B +1877(cdl_displayIRAF)S +9 C +2586(\(cdl,)S +2910(fname,)S +3288(1,)S +3450(frame,)S +3828(FB_AUTO,)S +4314(zscale\);)S +2120 V +1175(/*)S +9 I +1337(METHOD)S +1739(2:)S +1868(Uses)S +2070(the)S +2207(CDL)S +2409(procedure)S +2806(for)S +2938(getting)S +3215(image)S +3462(pixels)S +3699(from)S +2220 V +1229(*)S +1301(a)S +1373(known)S +1635(format,)S +1925(minimal)S +2247(work)S +2454(required)S +2791(to)S +2888(display)S +3175(an)S +3292(image.)S +3589(The)S +2320 V +1229(*)S +1301(point)S +1513(here)S +1700(is)S +1787(that)S +1954(you)S +2111(can)S +2268(use)S +2415(this)S +2572(method)S +2864(to)S +2961(process)S +3263(the)S +3400(image)S +2420 V +1229(*)S +1301(yourself)S +1618(prior)S +1830(to)S +1927(display,)S +2237(e.g.)S +2395(subsample)S +2802(the)S +2939(pixels,)S +3199(apply)S +3426(a)S +3498(user)S +2520 V +1229(*)S +1301(LUT,)S +1516(etc)S +1648(but)S +1790(still)S +1952(use)S +2099(the)S +2236(CDL)S +2438(to)S +2535(get)S +2672(the)S +2809(raw)S +2976(image)S +3223(and)S +3385(do)S +3502(the)S +2620 V +1229(*)S +1301(display.)S +2720 V +9 C +1229(*/)S +2820 V +1175(})S +1283(else)S +1553(if)S +1715(\(format)S +2147(==)S +2309(FITS)S +2579(||)S +2741(\(format)S +3173(==)S +3335(NONE)S +3605(&&)S +9 B +3767(cdl_isFITS)S +9 C +4241(\(fname\)\)\))S +4781({)S +3020 V +1391(/*)S +9 I +1553(Get)S +1710(the)S +1847(FITS)S +2054(image)S +2301(pixels,)S +2561(exit)S +2718(w/)S +2830(an)S +2947(error)S +3164(status)S +3401(if)S +3478(something)S +3120 V +1445(*)S +1517(went)S +1714(wrong,)S +1994(the)S +2131(procedure)S +2528(will)S +2690(print)S +2892(what)S +3094(that)S +3261(was.)S +3220 V +9 C +1445(*/)S +3320 V +1391(if)S +1553(\()S +9 B +1607(cdl_readFITS)S +9 C +2196(\(fname,)S +2628(&pix,)S +2952(&nx,)S +3222(&ny,)S +3492(&depth,)S +3924(title\)\))S +4356({)S +3420 V +9 B +1450(cdl_close)S +9 C +1849(\(cdl\);)S +2550(/*)S +9 I +2712(close)S +2924(the)S +3061(package)S +9 C +3469(*/)S +3520 V +1450(exit)S +1720(\(1\);)S +2550(/*)S +9 I +2712(exit)S +2869(w/)S +2981(error)S +3198(code)S +9 C +3422(*/)S +3620 V +1391(})S +3820 V +1391(/*)S +9 I +1553(Now)S +1745(select)S +1977(a)S +2049(frame)S +2286(bu)S +2376 H + (f)show 9 -.5 mul h (f)show +9 I +2422(er)S +2524(large)S +2741(enough)S +3033(for)S +3165(the)S +3302(image.)S +3572(The)S +3920 V +1445(*)S +1517(fbcon\256g)S +1834(number)S +2136(is)S +2223(passed)S +2495(in)S +2592(the)S +2729(WCS)S +2936(packet,)S +3221(but)S +3363(the)S +3500(display)S +4020 V +1445(*)S +1517(call)S +1679(below)S +1921(will)S +2083(compute)S +2415(the)S +2552(correct)S +2839(WCS)S +3046(for)S +3178(the)S +3315(image)S +3562(and)S +4120 V +1445(*)S +1517(transmit)S +1844(that)S +2011(prior)S +2223(to)S +2320(display,)S +2630(all)S +2752(we're)S +2984(doing)S +3216(here)S +3403(is)S +4220 V +1445(*)S +1517(setting)S +1784(up)S +1901(the)S +2038(FB)S +2175(to)S +2272(be)S +2384(used.)S +4320 V +9 C +1445(*/)S +4420 V +1391(if)S +1553(\(fbconfig)S +2093(==)S +2255(0\))S +4520 V +9 B +1607(cdl_selectFB)S +9 C +2146(\(cdl,)S +2470(nx,)S +2686(ny,)S +2902(&fbconfig,)S +3496(&fb_w,)S +3874(&fb_h,)S +4252(&nf,)S +4522(0\);)S +4720 V +1391(/*)S +9 I +1553(Lastly,)S +1823(display)S +2110(the)S +2247(pixels)S +2484(to)S +2581(the)S +2718(requested)S +3095(frame,)S +3355(do)S +3472(any)S +4820 V +1445(*)S +1517(zscaling)S +1839(requested)S +2216(using)S +2438(the)S +2575(CDL)S +2777(procedure.)S +4920 V +9 C +1445(*/)S +5020 V +1391(status)S +1769(=)S +9 B +1877(cdl_displayPix)S +9 C +2491(\(cdl,)S +2815(pix,)S +3085(nx,)S +3301(ny,)S +3517(depth,)S +3895(frame,)S +5120 V +1450(fbconfig,)S +1990(zscale\);)S +5320 V +1175(/*)S +9 I +1337(METHOD)S +1739(3:)S +1868(Displays)S +2210(an)S +2327(image)S +2574(of)S +2671(raw)S +2838(pixels.)S +3125(The)S +3287(client)S +3514(code)S +3711(is)S +5420 V +1229(*)S +1301(responsible)S +1743(for)S +1875(reading)S +2182(the)S +2319(image)S +2566(and)S +2728(calling)S +3005(all)S +3127(the)S +3264(procedures)S +5520 V +1229(*)S +1301(needed)S +1583(for)S +1715(image)S +1962(display,)S +2272(initialize)S +2614(the)S +2751(frame,)S +3011(zscaling)S +3333(pix,)S +3493(etc.)S +5620 V +1229(*)S +1301(While)S +1538(we)S +1665(assume)S +1957(a)S +2029(simple)S +2291(raster)S +2533(format)S +2800(in)S +2897(this)S +3054(program,)S +3419(the)S +3556(user)S +5720 V +1229(*)S +1301(code)S +1498(can)S +1655(read)S +1847(a)S +1919(compressed)S +2371(image)S +2618(format)S +2885(such)S +3077(as)S +3184(GIF,)S +3384(mosaic)S +3666(multiple)S +5820 V +1229(*)S +1301(images)S +1583(for)S +1715(display)S +2002(as)S +2109(a)S +2181(single)S +2423(image,)S +2693(or)S +2800(just)S +2957(about)S +3189(anything)S +3531(that)S +5920 V +1229(*)S +1301(produces)S +1658(a)S +1730(raster)S +1972(for)S +2104(display.)S +2414(The)S +2576(intent)S +2808(here)S +2995(is)S +3082(to)S +3179(show)S +3391(all)S +3513(the)S +6020 V +1229(*)S +1301(lowest)S +1558(level)S +1755(calls)S +1952(needed)S +2234(for)S +2366(displaying)S +2768(the)S +2905(image.)S +6120 V +9 C +1229(*/)S +6220 V +1175(})S +1283(else)S +1553(if)S +1715(\(format)S +2147(==)S +2309(RAW\))S +2579({)S +6320 V +1391(FILE)S +1725(*fd;)S +6420 V +1391(int)S +2000(lx,)S +2216(ly;)S +6620 V +1391(if)S +1553(\(nx)S +1769(==)S +1931(0)S +2039(||)S +2201(ny)S +2363(==)S +2525(0\))S +2687({)S +6720 V +1607(fprintf)S +2039(\(stderr,)S +2525("No)S +2741(size)S +3011(given)S +3335(for)S +3551(raw)S +3767(data.\\n"\);)S +6820 V +1607(exit)S +1877(\(1\);)S +6920 V +1391(})S +7120 V +1391(/*)S +9 I +1553(Open)S +1775(the)S +1912(image)S +2159(\256le)S +2296(if)S +2373(we)S +2500(can.)S +9 C +2707(*/)S +7220 V +1391(if)S +1553(\(fd)S +1769(=)S +1877(fopen)S +2201(\(fname,)S +2633("r"\)\))S +2957({)S +7920 V +EP +%%Page: 25 28 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 25 -)S +820 V +9 C +1450(/*)S +9 I +1612(Seek)S +1804(to)S +1901(the)S +2038(o)S +2083 H + (f)show 9 -.5 mul h (f)show +9 I +2129(set)S +2256(speci\256ed.)S +9 C +2648(*/)S +920 V +1450(lseek)S +1774(\(fileno\(fd\),)S +2476(\(off_t\))S +2908(hskip,)S +3286(SEEK_SET\);)S +1120 V +1450(/*)S +9 I +1612(Allocate)S +1939(the)S +2076(pixel)S +2278(pointer)S +2565(and)S +2727(read)S +2919(the)S +3056(data.)S +9 C +3293(*/)S +1220 V +1450(pix)S +1666(=)S +1774(\(unsigned)S +2314(char)S +2584(*\))S +2746(malloc)S +3124(\(nx)S +3340(*)S +3448(ny)S +3610(*)S +3718(\(depth)S +4096(/)S +4204(8\)\);)S +1320 V +1450(fread)S +1774(\(pix,)S +2098(depth/8,)S +2584(nx)S +2746(*)S +2854(ny,)S +3070(fd\);)S +1520 V +1450(/*)S +9 I +1612(If)S +1694(we're)S +1926(zscaling)S +2248(and)S +2410(depth)S +2637(is)S +2724(more)S +2936(than)S +3123(8-bits,)S +3378(do)S +3495(that.)S +9 C +3712(*/)S +1620 V +1450(if)S +1612(\(zscale)S +2044(&&)S +2206(depth)S +2530(>)S +2638(8\))S +2800({)S +1720 V +9 B +1666(cdl_computeZscale)S +9 C +2455(\(cdl,)S +2779(pix,)S +3049(nx,)S +3265(ny,)S +3481(depth,)S +3859(&z1,)S +4129(&z2\);)S +1820 V +9 B +1666(cdl_zscaleImage)S +9 C +2345(\(cdl,)S +2669(&pix,)S +2993(nx,)S +3209(ny,)S +3425(depth,)S +3803(z1,)S +4019(z2\);)S +1920 V +1450(})S +2120 V +1450(/*)S +9 I +1612(Now)S +1804(select)S +2036(a)S +2108(frame)S +2345(bu)S +2435 H + (f)show 9 -.5 mul h (f)show +9 I +2481(er)S +2583(large)S +2800(enough)S +3092(for)S +3224(the)S +3361(image.)S +2220 V +1477(*)S +1549(We'll)S +1771(ask)S +1918(that)S +2085(this)S +2242(be)S +2354(reset)S +2556(but)S +2698(the)S +2835(change)S +3122(won't)S +3354(go)S +3471(to)S +2320 V +1477(*)S +1549(the)S +1686(server)S +1938(until)S +2130(we)S +2257(send)S +2449(in)S +2546(the)S +2683(WCS)S +2890(below.)S +2420 V +9 C +1504(*/)S +2520 V +9 B +1450(cdl_selectFB)S +9 C +1989(\(cdl,)S +2313(nx,)S +2529(ny,)S +2745(&fbconfig,)S +3339(&fb_w,)S +3717(&fb_h,)S +4095(&nf,)S +4365(1\);)S +2720 V +1450(/*)S +9 I +1612(Compute)S +1964(the)S +2101(image)S +2348(placement)S +2745(so)S +2852(it's)S +2994(centered)S +3331(in)S +3428(the)S +3565(frame,)S +2820 V +1477(*)S +1549(but)S +1691(note)S +1873(the)S +2010(cdl_writeSubRaster\(\))S +2807(routine)S +3094(can)S +3251(place)S +3473(an)S +2920 V +1477(*)S +1549(arbitrary)S +1906(raster)S +2148(anywhere)S +2525(in)S +2622(the)S +2759(frame)S +2996(bu)S +3086 H + (f)show 9 -.5 mul h (f)show +9 I +3132(er.)S +3020 V +9 C +1450(lx)S +1612(=)S +1720(\(fb_w)S +2044(/)S +2152(2\))S +2314(-)S +2422(\(nx)S +2638(/)S +2746(2\);)S +3120 V +1450(ly)S +1612(=)S +1720(fb_h)S +1990(-)S +2098(\(\(fb_h)S +2476(/)S +2584(2\))S +2746(+)S +2854(\(ny)S +3070(/)S +3178(2\)\);)S +3320 V +1450(/*)S +9 I +1612(Set)S +1749(the)S +1886(mapping)S +2228(we'll)S +2435(send)S +2627(with)S +2809(the)S +2946(WCS)S +3153(which)S +3395(must)S +3592(be)S +3420 V +1477(*)S +1549(called)S +1796(before)S +2053(the)S +2190(cdl_setWCS\(\))S +2712(call)S +2874(since)S +3086(the)S +3223(data)S +3410(is)S +3497(sent)S +3520 V +1477(*)S +1549(with)S +1731(the)S +1868(WCS)S +2075(and)S +2237(not)S +2379(as)S +2486(a)S +2558(separate)S +2895(call.)S +3620 V +9 C +1504(*)S +3720 V +1504(*)S +9 R +1612(First)S +1804(we)S +1936(must)S +2138(compose)S +2485(a)S +2552(node!path)S +2939(pre\256x)S +3176(for)S +3308(the)S +3445(image.)S +9 C +3742(*/)S +3820 V +1504(*/)S +3920 V +1450(gethostname)S +2098(\(node,)S +2476(512\);)S +4020 V +1450(\(void\))S +1828(getcwd)S +2206(\(path,)S +2584(512\);)S +4120 V +1450(if)S +1612(\(*fname)S +2044(==)S +2206('/'\))S +4220 V +1666(\(void\))S +2044(sprintf)S +2476(\(path_prefix,)S +3232("%s!%s",)S +3718(node,)S +4042(fname\);)S +4320 V +1450(else)S +4420 V +1666(\(void\))S +2044(sprintf)S +2476(\(path_prefix,)S +3232("%s!%s/%s",)S +3880(node,)S +4204(path,)S +4528(fname\);)S +4620 V +9 B +1450(cdl_setMapping)S +9 C +2119(\(cdl,)S +2443("image",)S +2929(0.,)S +3145(0.,)S +3361(nx,)S +3577(ny,)S +3793(lx,)S +4009(ly,)S +4225(nx,)S +4441(ny,)S +4720 V +1612(path_prefix\);)S +4920 V +1450(/*)S +9 I +1612(For)S +1774(the)S +1911(WCS)S +2118(we)S +2245(assume)S +2537(a)S +2609(simple)S +2871(linear)S +3113(transform)S +3495(where)S +3742(the)S +5020 V +1477(*)S +1549(image)S +1796(is)S +1883(Y-\257ipped,)S +2258(the)S +2395(\(x,y\))S +2585(translation)S +3007(is)S +3094(computed)S +3471(so)S +5120 V +1477(*)S +1549(it)S +1626(is)S +1713(correct)S +2000(for)S +2132(an)S +2249(frame)S +2486(bu)S +2576 H + (f)show 9 -.5 mul h (f)show +9 I +2622(er)S +2724(>=)S +2873(than)S +3060(the)S +3197(image)S +3444(size.)S +5220 V +9 C +1504(*/)S +5320 V +9 B +1450(cdl_setWCS)S +9 C +1974(\(cdl,)S +2298(fname,)S +2676("",)S +2892(1.,)S +3108(0.,)S +3324(0.,)S +3540(-1.,)S +5420 V +1666(\(float\))S +2098(\(nx)S +2314(/)S +2422(2\))S +2584(-)S +2692(\(fb_w)S +3016(/)S +3124(2\))S +3286(+)S +3394(1,)S +3826(/*)S +9 I +3988(X)S +4070(trans.)S +9 C +4494(*/)S +5520 V +1666(\(float\))S +2098(\(fb_h)S +2422(/)S +2530(2\))S +2692(+)S +2800(\(ny)S +3016(/)S +3124(2\),)S +3826(/*)S +9 I +3988(Y)S +4065(trans.)S +9 C +4489(*/)S +5620 V +1666(z1,)S +1882(z2,)S +2098(CDL_LINEAR\);)S +3826(/*)S +9 I +3988(Z)S +4065(transform)S +9 C +4474(*/)S +5820 V +1450(/*)S +9 I +1612(Finally,)S +1922(display)S +2209(the)S +2346(pixels.)S +9 C +2687(*/)S +5920 V +1450(if)S +1612(\()S +9 B +1666(cdl_writeSubRaster)S +9 R +2458(\(cdl,)S +2648(lx,)S +2768(ly,)S +2888(nx,)S +3028(ny,)S +3168(pix\)\))S +6020 V +1558(status)S +1790(=)S +1867(1;)S +6120 V +1283(})S +1353(else)S +6220 V +1450(status)S +1682(=)S +1759(1;)S +6320 V +1175(})S +1245(else)S +1412({)S +6420 V +1283(if)S +1365(\(access)S +1652(\(fname,)S +1957(F_OK\))S +2239(==)S +2366(0\))S +6520 V +1450(fprintf)S +1707(\(stderr,)S +1992("'%s':)S +2251(unknown)S +2613(image)S +2860(format.\\n",)S +3280(fname\);)S +6620 V +1283(else)S +6720 V +1450(fprintf)S +1707(\(stderr,)S +1992("'%s':)S +2251(image)S +2498(does)S +2690(not)S +2832(exist.\\n",)S +3182(fname\);)S +6820 V +1283(status)S +1515(=)S +1592(1;)S +6920 V +1175(})S +7120 V +1175(/*)S +9 I +1272(Now)S +1464(just)S +1621(free)S +1788(the)S +1925(pixel)S +2127(pointer)S +2414(to)S +2511(clean)S +2733(up.)S +9 R +2873(*/)S +7220 V +1175(if)S +1257(\(pix\))S +7920 V +EP +%%Page: 26 29 +BP +/slant 0 def +/height 1.000000 def +9 R +9 R +460 V +11 R +2936(- 26 -)S +820 V +9 R +1283(free)S +1450(\(\(unsigned)S +1862(char)S +2044(*\))S +2146(pix\);)S +920 V +9 B +1175(cdl_close)S +9 R +1547(\(cdl\);)S +2275(/*)S +9 I +2372(close)S +2584(the)S +2721(package)S +9 R +3048(*/)S +1020 V +1175(exit)S +1337(\(status\);)S +1120 V +900(})S +7920 V +EP +%%Page: 27 30 +BP +/slant 0 def +/height 1.000000 def +9 R +9 R +480 V +11 R +2936(- 27 -)S +840 V +11 B +900(12.2.)S +1187(Interactive)S +1730(Graphics)S +2198(Overlay)S +2609(Example)S +1076 V +9 C +900(#include)S +1386(<stdio.h>)S +1176 V +900(#include)S +1386(<unistd.h>)S +1276 V +900(#include)S +1386(<math.h>)S +1376 V +900(#include)S +1386("cdl.h")S +1576 V +900(/*)S +1676 V +9 I +954(*)S +1053(TVMARK)S +1430(--)S +1517(Example)S +1859(task)S +2031(for)S +2163(displaying)S +2565(an)S +2682(marking)S +3009(images.)S +3341(This)S +3523(program)S +1776 V +954(*)S +1053(can)S +1210(be)S +1322(used)S +1514(to)S +1611(either)S +1848(display)S +2135(an)S +2252(image)S +2499(and)S +2661(overlay)S +2958(points)S +3205(de\256ned)S +3492(in)S +1876 V +954(*)S +1053(a)S +1125(coordinate)S +1542(\256le,)S +1702(map)S +1884(an)S +2001(existing)S +2308(display)S +2595(frame)S +2832(for)S +2964(marking,)S +3314(or)S +3421(option-)S +1976 V +954(*)S +1053(ally)S +1215(enter)S +1427(a)S +1499(cursor)S +1761(command)S +2138(loop)S +2325(after)S +2522(either)S +2759(of)S +2856(these)S +3068(providing)S +3445(other)S +2076 V +954(*)S +1053(marking)S +1380(capability.)S +1817(All)S +1949(options)S +2241(support)S +2543(minimum)S +2905(match.)S +2176 V +954(*)S +2276 V +954(*)S +1053(Examples:)S +2376 V +954(*)S +1175(%)S +1277(tvmark)S +1554(dpix.\256ts)S +2476 V +954(*)S +1175(%)S +1277(tvmark)S +1554(-coords)S +1856(coords)S +2128(-color)S +2375(205)S +2537(dpix.\256ts)S +2576 V +954(*)S +1175(%)S +1277(tvmark)S +1554(-frame)S +1821(2)S +2676 V +954(*)S +1175(%)S +1277(tvmark)S +1554(-coords)S +1856(coords)S +2128(-interactive)S +2570(dpix.\256ts)S +2776 V +954(*)S +2876 V +954(*)S +1053(Usage:)S +2976 V +954(*)S +1175(tvmark)S +1452([-frame)S +1754(N])S +1876([-fbcon\256g)S +2258(N])S +2380([-coords)S +2717(<\256le>])S +3011([-size)S +3238(N])S +3360([-color)S +3642(N])S +3076 V +954(*)S +1310([-nolabel])S +1707([-\256ll])S +1929([-interactive])S +2441([image])S +3176 V +9 C +954(*/)S +3376 V +900(main)S +1170(\(argc,)S +1548(argv\))S +3476 V +900(int)S +1175(argc;)S +3576 V +900(char)S +1175(*argv[];)S +3676 V +900({)S +3776 V +1175(CDLPtr)S +1725(cdl;)S +3876 V +1175(char)S +1450(*fname)S +1828(=)S +1936(NULL,)S +2260(*cfname)S +2692(=)S +2800(NULL;)S +3976 V +1175(int)S +1450(i,)S +1612(status)S +1990(=)S +2098(0,)S +2260(fill)S +2530(=)S +2638(0,)S +2800(frame)S +3124(=)S +3232(1,)S +3394(fb)S +3556(=)S +3664(FB_AUTO,)S +4150(zscale)S +4528(=)S +4636(1;)S +4076 V +1175(int)S +1450(color)S +1774(=)S +1882(201,)S +2152(label)S +2476(=)S +2584(1,)S +2746(size)S +3016(=)S +3124(9,)S +3286(interactive)S +3934(=)S +4042(0;)S +4176 V +1175(float)S +1725(z1,)S +1941(z2;)S +4276 V +1175(int)S +1450(fb_w,)S +1774(fb_h,)S +2098(nf;)S +4376 V +1175(unsigned)S +1661(char)S +1931(*pix)S +2201(=)S +2309(NULL;)S +4576 V +1175(/*)S +9 I +1337(Process)S +1649(the)S +1786(command)S +2163(line)S +2325(options.)S +9 C +2667(*/)S +4676 V +1175(if)S +1337(\(argc)S +1661(>)S +1769(1\))S +1931({)S +4776 V +1391(for)S +1607(\(i=1;)S +1931(i)S +2039(<)S +2147(argc;)S +2471(i++\))S +2741({)S +4876 V +1548(if)S +1710(\(strncmp\(argv[i],)S +2682("-color",4\))S +3330(==)S +3492(0\))S +3654(color)S +3978(=)S +4086(atoi)S +4356(\(argv[++i]\);)S +4976 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-coords",4\))S +3654(==)S +3816(0\))S +3978(cfname)S +4356(=)S +4464(argv[++i];)S +5076 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-fbconfig",3\))S +3762(==)S +3924(0\))S +4086(fb)S +4248(=)S +4356(atoi)S +4626(\(argv[++i]\);)S +5176 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-fill",4\))S +3546(==)S +3708(0\))S +3870(fill)S +4140(=)S +4248(1;)S +5276 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-frame",3\))S +3600(==)S +3762(0\))S +3924(frame)S +4248(=)S +4356(atoi)S +4626(\(argv[++i]\);)S +5376 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-interactive",4\))S +3924(==)S +4086(0\))S +4248(interactive)S +4896(=)S +5004(1;)S +5476 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-nolabel",4\))S +3708(==)S +3870(0\))S +4032(label)S +4356(=)S +4464(0;)S +5576 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-nozscale",4\))S +3762(==)S +3924(0\))S +4086(zscale)S +4464(=)S +4572(0;)S +5676 V +1548(else)S +1818(if)S +1980(\(strncmp\(argv[i],)S +2952("-size",2\))S +3546(==)S +3708(0\))S +3870(size)S +4140(=)S +4248(atoi)S +4518(\(argv[++i]\);)S +5776 V +1391(else)S +5876 V +1607(fname)S +1931(=)S +2039(argv[i];)S +5976 V +1391(})S +6076 V +1175(})S +6276 V +1175(/*)S +9 I +1337(Open)S +1559(the)S +1696(package)S +2023(and)S +2185(a)S +2257(connection)S +2679(to)S +2776(the)S +2913(server.)S +9 C +3215(*/)S +6376 V +1175(if)S +1337(\(!\(cdl)S +1715(=)S +9 B +1823(cdl_open)S +9 C +2222(\(\(char)S +2600(*\)getenv\("IMTDEV"\)\)\))S +3734(\))S +6476 V +1337(exit)S +1607(\(-1\);)S +6676 V +1175(/*)S +9 I +1337(If)S +1419(an)S +1536(image)S +1783(was)S +1950(speci\256ed)S +2292(display)S +2579(it)S +2656(\256rst,)S +2846(otherwise)S +3223(assume)S +3515(the)S +6776 V +1229(*)S +1301(image)S +1548(has)S +1700(already)S +2002(been)S +2199(loaded)S +2471(in)S +2568(the)S +2705(frame)S +2942(and)S +3104(mark)S +3316(that.)S +6876 V +9 C +1229(*/)S +6976 V +1175(if)S +1337(\(fname\))S +1769({)S +7076 V +1391(if)S +1553(\()S +9 B +1607(cdl_isIRAF)S +9 C +2101(\(fname\)\))S +7176 V +1607(status)S +1985(=)S +9 B +2093(cdl_displayIRAF)S +9 C +2802(\(cdl,)S +3126(fname,)S +3504(1,)S +3666(frame,)S +4044(fb,)S +4260(zscale\);)S +7276 V +1391(else)S +1661(if)S +1823(\()S +9 B +1877(cdl_isFITS)S +9 C +2351(\(fname\)\))S +7920 V +EP +%%Page: 28 31 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 28 -)S +820 V +9 C +1607(status)S +1985(=)S +9 B +2093(cdl_displayFITS)S +9 C +2782(\(cdl,)S +3106(fname,)S +3484(frame,)S +3862(fb,)S +4078(zscale\);)S +920 V +1391(else)S +1661({)S +1020 V +1450(if)S +1612(\(access)S +2044(\(cfname,)S +2530(F_OK\))S +2854(==)S +3016(0\))S +1120 V +1823(fprintf)S +2255(\(stderr,)S +2741("'%s':)S +3119(unknown)S +3551(image)S +3875(format.\\n",)S +4523(fname\);)S +1220 V +1450(else)S +1320 V +1823(fprintf)S +2255(\(stderr,)S +2741("'%s':)S +3119(image)S +3443(doesn't)S +3875(exist.\\n",)S +4469(fname\);)S +1420 V +1607(status)S +1985(=)S +2093(1;)S +1520 V +1391(})S +1620 V +1391(if)S +1553(\(status\))S +2093(goto)S +2363(err_;)S +1720 V +1175(})S +1283(else)S +1553({)S +1920 V +1391(/*)S +9 I +1553(If)S +1635(we've)S +1872(requested)S +2249(a)S +2321(special)S +2603(frame)S +2840(bu)S +2930 H + (f)show 9 -.5 mul h (f)show +9 I +2976(er,)S +3101(set)S +3228(it)S +3305(now.)S +9 C +3532(*/)S +2020 V +1391(if)S +1553(\(fb)S +1769(>)S +1877(0\))S +2120 V +9 B +1558(cdl_setFBCon\256g)S +9 C +2247(\(cdl,)S +2571(fb\);)S +2320 V +1391(/*)S +9 I +1553(Map)S +1745(the)S +1882(current)S +2174(display)S +2461(frame)S +2698(for)S +2830(use)S +2977(as)S +3084(an)S +3201(image.)S +9 C +3498(*/)S +2420 V +9 B +1391(cdl_mapFrame)S +9 C +2030(\(cdl,)S +2354(frame\);)S +2520 V +1175(})S +2720 V +1175(/*)S +9 I +1337(If)S +1419(a)S +1491(coordinate)S +1908(\256le)S +2045(was)S +2212(speci\256ed)S +2554(read)S +2746(the)S +2883(\256le)S +3020(and)S +3182(mark)S +3394(those)S +2820 V +1229(*)S +1301(coords)S +1573(with)S +1755(points.)S +2920 V +9 C +1229(*/)S +3020 V +1175(if)S +1337(\(cfname\))S +3120 V +9 B +1548(cdl_markCoordsFile)S +9 C +2397(\(cdl,)S +2721(cfname,)S +3153(M_STAR,)S +3585(size,)S +3909(color,)S +4287(label\);)S +3320 V +1175(/*)S +9 I +1337(Lastly,)S +1607(start)S +1799(up)S +1916(an)S +2033(interactive)S +2445(cursor)S +2707(loop)S +2894(if)S +2971(needed.)S +9 C +3303(*/)S +3420 V +1175(if)S +1337(\(interactive\))S +3520 V +1391(tvmInteractive)S +2201(\(cdl,)S +2525(label,)S +2903(fill,)S +3227(color,)S +3605(size\);)S +3720 V +1175(/*)S +9 I +1337(Close)S +1569(the)S +1706(package)S +2033(and)S +2195(clean)S +2417(up.)S +9 C +2584(*/)S +3820 V +900(err_:)S +9 B +1175(cdl_close)S +9 C +1574(\(cdl\);)S +3920 V +1175(exit)S +1445(\(status\);)S +4020 V +900(})S +4220 V +900(/*)S +9 I +1116(TVMINTERACTIVE)S +1878(--)S +1965(Process)S +2277(commands)S +2689(interactively.)S +9 C +3270(*/)S +4420 V +900(tvmInteractive)S +1710(\(cdl,)S +2034(label,)S +2412(fill,)S +2736(color,)S +3114(size\))S +4520 V +900(CDLPtr)S +1450(cdl;)S +4620 V +900(int)S +1175(label,)S +1553(fill,)S +1877(color,)S +2255(size;)S +4720 V +900({)S +4820 V +1175(float)S +1607(angle)S +1931(=)S +2039(0.0,)S +2309(rx,)S +2525(ry,)S +2741(txsize)S +3119(=)S +3227(1.;)S +4920 V +1175(int)S +1607(nx,)S +1823(ny,)S +2039(i,)S +2201(x,)S +2363(y,)S +2525(x2,)S +2741(y2,)S +2957(wcs;)S +5020 V +1175(int)S +1607(number=1,)S +2147(radius=11,)S +2741(xrad=11,)S +3227(yrad=6,)S +3659(nannuli=3,)S +4253(sep=5;)S +5120 V +1175(char)S +1607(key,)S +1877(cmd[SZ_NAME],)S +2633(str[SZ_NAME];)S +5220 V +1175(unsigned)S +1661(char)S +1931(*pix;)S +5420 V +1175(/*)S +9 I +1337(Process)S +1649(commands)S +2061(until)S +2253(a)S +2325('q')S +2457(keystroke)S +2824(is)S +2911(hit.)S +9 C +3083(*/)S +5520 V +1175(while)S +1499(\()S +9 B +1553(cdl_readCursor)S +9 C +2217(\(cdl,)S +2541(0,)S +2703(&rx,)S +2973(&ry,)S +3243(&wcs,)S +3567(&key\))S +3891(!=)S +4053('q'\))S +4323({)S +5620 V +1391(x)S +1499(=)S +1607(\(int\))S +1931(\(rx)S +2147(+)S +2255(0.5\);)S +2550(/*)S +9 I +2712(convert)S +3009(to)S +3106(int)S +3228(pixels)S +9 C +3492(*/)S +5720 V +1391(y)S +1499(=)S +1607(\(int\))S +1931(\(ry)S +2147(+)S +2255(0.5\);)S +5920 V +1391(switch)S +1769(\(key\))S +2093({)S +6020 V +1391(case)S +1661(':':)S +2550(/*)S +9 I +2712(process)S +3014(a)S +3086(colon)S +3313(command)S +9 C +3717(*/)S +6120 V +1450(putchar)S +1882(\(':'\);)S +6220 V +1450(gets)S +1720(\(str\);)S +6320 V +1450(for)S +1666(\(i=0;)S +1990(str[i])S +2368(!=)S +2530(')S +2638(')S +2746(&&)S +2908(str[i];)S +3340(i++\))S +6420 V +1666(cmd[i])S +2044(=)S +2152(str[i];)S +6520 V +1450(cmd[i++])S +1936(=)S +2044(')S +2152(';)S +6720 V +1450(if)S +1612(\(strcmp)S +2044(\(cmd,)S +2368("angle"\))S +2854(==)S +3016(0\))S +3556(angle)S +3880(=)S +3988(atof)S +4258(\(&str[i]\);)S +6820 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("color"\))S +3124(==)S +3286(0\))S +3556(color)S +3880(=)S +3988(atoi)S +4258(\(&str[i]\);)S +6920 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("fill"\))S +3070(==)S +3232(0\))S +3556(fill)S +3826(=)S +3934(atoi)S +4204(\(&str[i]\);)S +7020 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("number"\))S +3178(==)S +3340(0\))S +3556(number)S +3934(=)S +4042(atoi)S +4312(\(&str[i]\);)S +7120 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("nannuli"\))S +3232(==)S +3394(0\))S +3556(nannuli)S +3988(=)S +4096(atoi)S +4366(\(&str[i]\);)S +7220 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("label"\))S +3124(==)S +3286(0\))S +3556(label)S +3880(=)S +3988(atoi)S +4258(\(&str[i]\);)S +7920 V +EP +%%Page: 29 32 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 29 -)S +820 V +9 C +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("sep"\))S +3016(==)S +3178(0\))S +3556(sep)S +3772(=)S +3880(atoi)S +4150(\(&str[i]\);)S +920 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("size"\))S +3070(==)S +3232(0\))S +3556(size)S +3826(=)S +3934(atoi)S +4204(\(&str[i]\);)S +1020 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("txsize"\))S +3178(==)S +3340(0\))S +3556(txsize)S +3934(=)S +4042(atof)S +4312(\(&str[i]\);)S +1120 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("xrad"\))S +3070(==)S +3232(0\))S +3556(xrad)S +3826(=)S +3934(atoi)S +4204(\(&str[i]\);)S +1220 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("yrad"\))S +3070(==)S +3232(0\))S +3556(yrad)S +3826(=)S +3934(atoi)S +4204(\(&str[i]\);)S +1320 V +1450(else)S +1720(if)S +1882(\(strcmp)S +2314(\(cmd,)S +2638("print"\))S +3124(==)S +3286(0\))S +3448({)S +1420 V +9 B +1666(cdl_readFrameBu)S +2366 H + (f)show 9 -.5 mul h (f)show +9 B +2421(er)S +9 C +2555(\(cdl,)S +2879(&pix,)S +3203(&nx,)S +3473(&ny\);)S +1520 V +9 B +1666(cdl_printPix)S +9 C +2200(\(cdl,)S +2524(NULL,)S +2848(pix,)S +3118(nx,)S +3334(ny,)S +3550(1\);)S +1620 V +1450(})S +1558(else)S +1828(if)S +1990(\(strcmp)S +2422(\(cmd,)S +2746("snap"\))S +3178(==)S +3340(0\))S +3502({)S +1720 V +9 B +1666(cdl_readFrameBu)S +2366 H + (f)show 9 -.5 mul h (f)show +9 B +2421(er)S +9 C +2555(\(cdl,)S +2879(&pix,)S +3203(&nx,)S +3473(&ny\);)S +1820 V +9 B +1666(cdl_printPixToFile)S +9 C +2450(\(cdl,)S +2774(&str[i],)S +3260(pix,)S +3530(nx,)S +3746(ny,)S +3962(1\);)S +1920 V +1450(})S +1558(else)S +1828(if)S +1990(\(strcmp)S +2422(\(cmd,)S +2746("status"\))S +3286(==)S +3448(0\))S +3610({)S +2020 V +1666(printf)S +2044(\("angle)S +2550(=)S +2658(%-5.3gcolor)S +3375(=)S +3483(%d",)S +3753(angle,)S +4131(color\);)S +2120 V +1666(printf)S +2044(\("fill)S +2550(=)S +2658(%-5dnumber)S +3375(=)S +3483(%d\\n",)S +3861(fill,)S +4185(number\);)S +2220 V +1666(printf)S +2044(\("nannuli)S +2550(=)S +2658(%-5dsep)S +3100(=)S +3208(%d",)S +3478(nannuli,)S +3964(sep\);)S +2320 V +1666(printf)S +2044(\("size)S +2550(=)S +2658(%-5dtxsize)S +3375(=)S +3483(%g\\n",)S +3861(size,)S +4185(txsize\);)S +2420 V +1666(printf)S +2044(\("xrad)S +2550(=)S +2658(%-5dyrad)S +3100(=)S +3208(%d",)S +3478(xrad,)S +3802(yrad\);)S +2520 V +1666(printf)S +2044(\("label)S +2550(=)S +2658(%-5d\\n",)S +3144(label\);)S +2620 V +1450(})S +2720 V +1450(break;)S +2920 V +1391(case)S +1661('?':)S +3020 V +1450(/*)S +1612(......)S +9 I +1936(help)S +2118(procedures)S +9 C +2577(*/)S +3120 V +1450(break;)S +3320 V +1391(case)S +1661('p':)S +2825(/*)S +9 I +2987(plus)S +3164(mark)S +9 C +3375(*/)S +3420 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_PLUS,)S +4779(color\);)S +3520 V +1450(break;)S +3620 V +1391(case)S +1661('x':)S +2825(/*)S +9 I +2987(cross)S +3204(mark)S +9 C +3650(*/)S +3720 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_CROSS,)S +4833(color\);)S +3820 V +1450(break;)S +3920 V +1391(case)S +1661('.':)S +2825(/*)S +9 I +2987(point)S +3199(mark)S +9 C +3650(*/)S +4020 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_POINT,)S +4833(color\);)S +4120 V +1450(break;)S +4220 V +1391(case)S +1661('*':)S +2825(/*)S +9 I +2987(star)S +3154(mark)S +9 C +3375(*/)S +4320 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_STAR,)S +4779(color\);)S +4420 V +1450(break;)S +4520 V +1391(case)S +1661('_':)S +2825(/*)S +9 I +2987(horiz)S +3199(dash)S +3396(mark)S +9 C +3581(*/)S +4620 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_HBLINE,)S +4887(color\);)S +4720 V +1450(break;)S +4820 V +1391(case)S +1661('|':)S +2825(/*)S +9 I +2987(vert)S +3154(dash)S +3351(mark)S +9 C +3650(*/)S +4920 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_VBLINE,)S +4887(color\);)S +5020 V +1450(break;)S +5120 V +1391(case)S +1661('o':)S +2825(/*)S +9 I +2987(circle)S +3219(mark)S +9 C +3650(*/)S +5220 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_CIRCLE|fill,)S +5157(color\);)S +5320 V +1450(break;)S +5420 V +1391(case)S +1661('s':)S +2825(/*)S +9 I +2987(square)S +3259(mark)S +9 C +3650(*/)S +5520 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_BOX|fill,)S +4995(color\);)S +5620 V +1450(break;)S +5720 V +1391(case)S +1661('v':)S +2825(/*)S +9 I +2987(diamond)S +3329(mark)S +9 C +3650(*/)S +5820 V +9 B +1450(cdl_markPoint)S +9 C +2079(\(cdl,)S +2403(x,)S +2565(y,)S +2727(\(label)S +3105(?)S +3213(number++)S +3699(:)S +3807(0\),)S +4023(size,)S +4347(M_DIAMOND|fill,)S +5211(color\);)S +5920 V +1450(break;)S +6120 V +1391(case)S +1661('b':)S +2825(/*)S +9 I +2987(Box)S +9 C +3650(*/)S +6220 V +1450(printf)S +1828(\("Hit)S +2152(another)S +2584(key)S +2800(to)S +2962(define)S +3340(the)S +3556(box...\\n"\);)S +6320 V +1450(\(void\))S +9 B +1828(cdl_readCursor)S +9 C +2492(\(cdl,)S +2816(0,)S +2978(&rx,)S +3248(&ry,)S +3518(&wcs,)S +3842(&key\);)S +6420 V +1450(x2)S +1612(=)S +1720(\(int\))S +2044(\(rx)S +2260(+)S +2368(0.5\);)S +3100(y2)S +3262(=)S +3370(\(int\))S +3694(\(ry)S +3910(+)S +4018(0.5\);)S +6520 V +9 B +1450(cdl_markBox)S +9 C +2024(\(cdl,)S +2348(x,)S +2510(y,)S +2672(x2,)S +2888(y2,)S +3104(fill,)S +3428(color\);)S +6620 V +1450(break;)S +6720 V +1391(case)S +1661('c':)S +2825(/*)S +9 I +2987(Circle)S +9 C +3650(*/)S +6820 V +1450(printf)S +1828(\("Hit)S +2152(another)S +2584(key)S +2800(to)S +2962(set)S +3178(radius)S +3556(...\\n"\);)S +6920 V +1450(\(void\))S +9 B +1828(cdl_readCursor)S +9 C +2492(\(cdl,)S +2816(0,)S +2978(&rx,)S +3248(&ry,)S +3518(&wcs,)S +3842(&key\);)S +7020 V +1450(x2)S +1612(=)S +1720(\(int\))S +2044(\(rx)S +2260(+)S +2368(0.5\);)S +3100(y2)S +3262(=)S +3370(\(int\))S +3694(\(ry)S +3910(+)S +4018(0.5\);)S +7120 V +1450(radius)S +1828(=)S +1936(\(int\))S +2260(sqrt)S +2530(\(\(double\))S +3070(\(\(x2-x\)*\(x2-x\))S +3880(+)S +3988(\(y2-y\)*\(y2-y\)\)\);)S +7220 V +9 B +1450(cdl_markCircle)S +9 C +2109(\(cdl,)S +2433(x,)S +2595(y,)S +2757(radius,)S +3189(fill,)S +3513(color\);)S +7920 V +EP +%%Page: 30 33 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 30 -)S +820 V +9 C +1450(break;)S +920 V +1391(case)S +1661('d':)S +2825(/*)S +9 I +2987(Delete)S +3249(marker)S +9 C +3650(*/)S +1020 V +9 B +1450(cdl_deleteMark)S +9 C +2109(\(cdl,)S +2433(x,)S +2595(y\);)S +1120 V +1450(break;)S +1220 V +1391(case)S +1661('e':)S +2825(/*)S +9 I +2987(Ellipse)S +9 C +3375(*/)S +1320 V +9 B +1450(cdl_markEllipse)S +9 C +2134(\(cdl,)S +2458(x,)S +2620(y,)S +2782(xrad,)S +3106(yrad,)S +3430(angle,)S +3808(fill,)S +4132(color\);)S +1420 V +1450(break;)S +1520 V +1391(case)S +1661('l':)S +2825(/*)S +9 I +2987(Line)S +9 C +3650(*/)S +1620 V +1450(printf)S +1828(\("Hit)S +2152(another)S +2584(key)S +2800(to)S +2962(set)S +3178(line)S +3448(endpoint...\\n"\);)S +1720 V +1450(\(void\))S +9 B +1828(cdl_readCursor)S +9 C +2492(\(cdl,)S +2816(0,)S +2978(&rx,)S +3248(&ry,)S +3518(&wcs,)S +3842(&key\);)S +1820 V +1450(x2)S +1612(=)S +1720(\(int\))S +2044(\(rx)S +2260(+)S +2368(0.5\);)S +3100(y2)S +3262(=)S +3370(\(int\))S +3694(\(ry)S +3910(+)S +4018(0.5\);)S +1920 V +9 B +1450(cdl_markLine)S +9 C +2049(\(cdl,)S +2373(x,)S +2535(y,)S +2697(x2,)S +2913(y2,)S +3129(color\);)S +2020 V +1450(break;)S +2120 V +1391(case)S +1661('t':)S +2825(/*)S +9 I +2987(Text)S +3169(string)S +9 C +3650(*/)S +2220 V +1450(printf)S +1828(\("Text)S +2206(string:)S +2638("\);)S +2320 V +1450(gets)S +1720(\(str\);)S +2420 V +9 B +1450(cdl_markText)S +9 C +2049(\(cdl,)S +2373(x,)S +2535(y,)S +2697(str,)S +2967(txsize,)S +3399(angle,)S +3777(color\);)S +2520 V +1450(break;)S +2620 V +1391(case)S +1661('C':)S +2825(/*)S +9 I +2987(Circular)S +3324(annuli)S +9 C +3554(*/)S +2720 V +9 B +1450(cdl_markCircAnnuli)S +9 C +2309(\(cdl,)S +2633(x,)S +2795(y,)S +2957(radius,)S +3389(nannuli,)S +3875(sep,)S +4145(color\);)S +2820 V +1450(break;)S +2920 V +1391(case)S +1661('D':)S +2825(/*)S +9 I +2987(Delete)S +3249(all)S +3371(markers)S +9 C +3666(*/)S +3020 V +9 B +1450(cdl_clearOverlay)S +9 C +2164(\(cdl\);)S +3120 V +1450(break;)S +3220 V +1391(case)S +1661('E':)S +2825(/*)S +9 I +2987(Elliptical)S +3349(annuli)S +9 C +3579(*/)S +3320 V +9 B +1450(cdl_markEllipAnnuli)S +9 C +2324(\(cdl,)S +2648(x,)S +2810(y,)S +2972(xrad,)S +3296(yrad,)S +3620(angle,)S +3998(nannuli,)S +4484(sep,)S +4754(color\);)S +3420 V +1450(break;)S +3520 V +1391(default:)S +3620 V +1450(break;)S +3720 V +1391(})S +3820 V +1175(})S +3920 V +900(})S +7920 V +EP +%%Page: 31 34 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +480 V +11 R +2936(- 31 -)S +840 V +11 B +900(12.3.)S +1187(Image)S +1512(Mosaic)S +1880(Example)S +976 V +9 R +1260(#include)S +1597(<stdio.h>)S +1076 V +1260(#include)S +1597(<unistd.h>)S +1176 V +1260(#)S +9 B +1305(include)S +1612("cdl.h")S +1376 V +9 R +1260(/*)S +9 I +1357(MOSAIC)S +1714(--)S +1801(Example)S +2143(task)S +2315(to)S +2412(mosaic)S +2694(several)S +2981(images)S +3263(on)S +3380(a)S +3452(display.)S +3762(Demonstrates)S +1476 V +1287(*)S +1359(usage)S +1596(of)S +1693(low-level)S +2050(routines)S +2372(for)S +2504(complex)S +2831(display)S +3118(operations.)S +1576 V +9 R +1287(*/)S +1776 V +1260(main)S +1467(\(argc,)S +1702(argv\))S +1876 V +1260(int)S +1535(argc;)S +1976 V +1260(char)S +1535(*argv[];)S +2076 V +1260({)S +2176 V +1535(CDLPtr)S +2085(cdl;)S +2276 V +1535(char)S +1810(*fname)S +2107(=)S +2184(NULL,)S +2474(title[128];)S +2376 V +1535(int)S +1810(i,)S +1885(j,)S +1960(k,)S +2055(status=0,)S +2405(label=0,)S +2725(frame=1,)S +3080(fb=FB_AUTO,)S +3660(zscale=1;)S +2476 V +1535(int)S +1810(sample=1,)S +2210(pad=0,)S +2485(col=204,)S +2830(imx,)S +3020(imy,)S +3210(bitpix,)S +3470(nimages,)S +3820(nim;)S +2576 V +1535(int)S +1810(ii,)S +1910(xinit,)S +2125(rowx,)S +2360(rowy,)S +2595(nnx,)S +2780(nny,)S +2965(fb_w,)S +3200(fb_h,)S +3415(nf,)S +3540(mx,)S +3705(my,)S +3870(nx,)S +4010(ny;)S +2676 V +1535(\257oat)S +1810(z1,)S +1945(z2;)S +2776 V +1535(unsigned)S +1887(char)S +2069(*pix)S +2256(=)S +2333(NULL;)S +2976 V +1535(/*)S +9 I +1632(Process)S +1944(the)S +2081(command)S +2458(line)S +2620(options.)S +9 R +2935(*/)S +3076 V +1535(if)S +1617(\(argc)S +1829(>)S +1906(1\))S +2008({)S +3176 V +1589(for)S +1721(\(i=1;)S +1923(i)S +1975(<)S +2052(argc;)S +2259(i++\))S +2441({)S +3276 V +1584(if)S +1666(\(strncmp)S +2013(\(argv[i],)S +2338("-fbcon\256g",3\))S +2867(==)S +2994(0\))S +3096(fb=atoi\(argv[++i]\);)S +3376 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-frame",3\))S +2976(==)S +3103(0\))S +3205(frame=atoi\(argv[++i]\);)S +3476 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-color",3\))S +2951(==)S +3078(0\))S +3180(col=atoi\(argv[++i]\);)S +3576 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-label",4\))S +2941(==)S +3068(0\))S +3170(label=1;)S +3676 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-nozscale",4\))S +3076(==)S +3203(0\))S +3305(zscale=0;)S +3776 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-nx",3\))S +2856(==)S +2983(0\))S +3085(nx=atoi\(argv[++i]\);)S +3876 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-ny",3\))S +2856(==)S +2983(0\))S +3085(ny=atoi\(argv[++i]\);)S +3976 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-pad",4\))S +2896(==)S +3023(0\))S +3125(pad=atoi\(argv[++i]\);)S +4076 V +1643(else)S +1810(if)S +1892(\(strncmp)S +2239(\(argv[i],"-sample",4\))S +3021(==)S +3148(0\))S +3250(sample=atoi\(argv[++i]\);)S +4176 V +1643(else)S +4276 V +1751(break;)S +4376 V +1589(})S +4476 V +1535(})S +4576 V +1535(nimages)S +1862(=)S +1939(argc)S +2121(-)S +2178(i;)S +4776 V +1535(/*)S +9 I +1632(Open)S +1854(the)S +1991(package)S +2318(and)S +2480(a)S +2552(connection)S +2974(to)S +3071(the)S +3208(server.)S +9 R +3483(*/)S +4876 V +1535(if)S +1617(\(!\(cdl)S +1844(=)S +9 B +1921(cdl_open)S +9 R +2293(\(\(char)S +2535(*\)getenv\("IMTDEV"\)\)\))S +3421(\))S +4976 V +1616(exit)S +1778(\(-1\);)S +5176 V +1535(/*)S +9 I +1632(Clear)S +1864(the)S +2001(frame)S +2238(to)S +2335(begin.)S +9 R +2585(*/)S +5276 V +1535(\(void\))S +9 B +1782(cdl_clearFrame)S +9 R +2414(\(cdl\);)S +5476 V +1535(/*)S +9 I +1632(Loop)S +1844(over)S +2031(each)S +2228(of)S +2325(the)S +2462(images)S +2744(in)S +2841(the)S +2978(list.)S +9 R +3138(*/)S +5576 V +1535(nim)S +1702(=)S +1779(rowx)S +1991(=)S +2068(rowy)S +2280(=)S +2357(nnx)S +2519(=)S +2596(nny)S +2758(=)S +2835(0;)S +5676 V +1535(for)S +1667(\(k=0;)S +1889(k)S +1961(<)S +2038(ny)S +2155(&&)S +2322(nim)S +2489(<)S +2566(nimages;)S +2918(k++\))S +3120({)S +5776 V +1643(rowy)S +1855(+=)S +1982(nny)S +2144(+)S +2221(pad;)S +5876 V +1643(for)S +1775(\(rowx)S +2017(=)S +2094(xinit,)S +2309(j=0;)S +2481(j)S +2533(<)S +2610(nx)S +2727(&&)S +2894(nim)S +3061(<)S +3138(nimages;)S +3490(j++\))S +3672({)S +6076 V +1810(/*)S +9 I +1907(Get)S +2064(the)S +2201(image)S +2448(name)S +2670(for)S +2802(display.)S +9 R +3112(*/)S +6176 V +1810(fname)S +2062(=)S +2139(argv[i++];)S +6376 V +1810(/*)S +9 I +1907(Figure)S +2179(out)S +2321(what)S +2523(kind)S +2705(of)S +2802(image)S +3049(it)S +3126(is)S +3213(and)S +3375(get)S +3512(the)S +3649(pixels.)S +9 R +3909(*/)S +6476 V +1810(if)S +1892(\(cdl_isIRAF)S +2369(\(fname\)\))S +6576 V +1918(status)S +2150(=)S +9 B +2227(cdl_readIRAF)S +9 R +2809(\(fname,)S +3114(1,)S +3209(&pix,)S +3444(&imx,)S +3704(&imy,)S +3964(&bitpix,)S +4294(title\);)S +6676 V +1810(else)S +1977(if)S +2059(\(cdl_isFITS)S +2516(\(fname\)\))S +6776 V +1918(status)S +2150(=)S +9 B +2227(cdl_readFITS)S +9 R +2789(\(fname,)S +3094(&pix,)S +3329(&imx,)S +3589(&imy,)S +3849(&bitpix,)S +4179(title\);)S +6876 V +1810(else)S +1977({)S +6976 V +1918(fprintf\(stderr,)S +2433("'%s':)S +2692(unknown)S +3054(or)S +3156(nonexistant)S +3598(image.\\n",)S +3998(fname\);)S +7076 V +1918(status)S +2150(=)S +2227(1;)S +7176 V +1810(})S +7276 V +1810(if)S +1892(\(status\))S +2211(goto)S +2398(err_;)S +7920 V +EP +%%Page: 32 35 +BP +/slant 0 def +/height 1.000000 def +9 R +9 R +460 V +11 R +2936(- 32 -)S +820 V +9 R +1810(/*)S +9 I +1907(Compute)S +2259(subsampled)S +2711(image)S +2958(size.)S +9 R +3143(*/)S +920 V +1810(if)S +1892(\(sample)S +2204(>)S +2281(1\))S +1020 V +1918(nnx)S +2080(=)S +2157(imx)S +2324(/)S +2376(sample,)S +2681(nny)S +2843(=)S +2920(imy)S +3087(/)S +3139(sample;)S +1120 V +1810(else)S +1220 V +1918(nnx)S +2080(=)S +2157(imx,)S +2347(nny)S +2509(=)S +2586(imy;)S +1420 V +1810(/*)S +9 I +1907(Unless)S +2179(we)S +2306(asked)S +2538(for)S +2670(a)S +2742(speci\256c)S +3039(FB)S +3176(size)S +3338(\256nd)S +3500(one)S +3657(large)S +3874(enough)S +1520 V +1837(*)S +1909(to)S +2006(handle)S +2278(the)S +2415(mosaic.)S +2747(We)S +2889(don't)S +3106(check)S +3338(to)S +3435(be)S +3547(sure)S +3729(what's)S +1620 V +1837(*)S +1909(returned)S +2246(is)S +2333(really)S +2570(large)S +2787(enough.)S +1720 V +9 R +1837(*/)S +1820 V +1810(if)S +1892(\(nim)S +2089(==)S +2216(0)S +2288(&&)S +2455(fb)S +2557(==)S +2684(FB_AUTO\))S +1920 V +9 B +1918(cdl_selectFB)S +9 R +2430(\(cdl,)S +2620(nx*nnx+\(pad*\(nx-1\)\),)S +3450(ny*nny+\(pad*\(ny-1\)\),)S +4280(&fb,)S +4475(&fb_w,)S +4780(&fb_h,)S +5065(&nf,)S +5260(1\);)S +2020 V +1810(else)S +1977({)S +2120 V +9 B +1918(cdl_setFBCon\256g)S +9 R +2580(\(cdl,)S +2770(fb\);)S +2220 V +9 B +1918(cdl_lookupFBSize)S +9 R +2640(\(cdl,)S +2830(fb,)S +2955(&fb_w,)S +3260(&fb_h,)S +3545(&nf\);)S +2320 V +1810(})S +2520 V +1810(/*)S +9 I +1907(De\256ne)S +2169(a)S +2241(WCS)S +2448(for)S +2580(the)S +2717(frame.)S +9 R +2977(*/)S +2620 V +9 B +1810(cdl_setWCS)S +9 R +2307(\(cdl,)S +2497("image)S +2781(mosaic",)S +3123(title,)S +3313(1.,)S +3431(0.,)S +3549(0.,)S +3667(-1.,)S +3815(0.,)S +3933(\(\257oat\))S +4180(ny*imy+\(pad*\(ny+1\)\),)S +5035(1.,)S +5153(255.,)S +5361(1\);)S +2820 V +1810(/*)S +9 I +1907(The)S +2069(\256rst)S +2236(time)S +2418(through)S +2730(\256gure)S +2967(out)S +3109(the)S +3246(placement)S +3643(so)S +3750(the)S +2920 V +1837(*)S +1909(entire)S +2146(mosaic)S +2428(is)S +2515(centered)S +2852(in)S +2949(the)S +3086(frame.)S +3020 V +9 R +1837(*/)S +3120 V +1810(if)S +1919(\(nim)S +2116(==)S +2243(0\))S +2345({)S +3220 V +1918(mx)S +2060(=)S +2137(\(nx)S +2284(*)S +2356(nnx\))S +2548(+)S +2625(pad)S +2782(*)S +2854(\(nx-1\);)S +3320 V +1918(my)S +2060(=)S +2137(\(ny)S +2284(*)S +2356(nny\))S +2548(+)S +2625(pad)S +2782(*)S +2854(\(ny-1\);)S +3420 V +1918(rowy)S +2130(=)S +2207(\(fb_h)S +2429(-)S +2486(my\))S +2658(/)S +2710(2;)S +3520 V +1918(xinit)S +2110(=)S +2187(rowx)S +2399(=)S +2476(\(fb_w)S +2718(-)S +2775(mx\))S +2947(/)S +2999(2;)S +3620 V +1810(})S +3820 V +1810(/*)S +9 I +1907(Compute)S +2259(the)S +2396(zscaled)S +2688(imaged)S +2980(pixels.)S +9 R +3240(*/)S +3920 V +1810(if)S +1892(\(zscale\))S +2199({)S +4020 V +9 B +1918(cdl_computeZscale)S +9 R +2680(\(cdl,)S +2870(pix,)S +3035(imx)S +3202(,imy,)S +3415(bitpix,)S +3675(&z1,)S +3880(&z2\);)S +4120 V +9 B +1918(cdl_zscaleImage)S +9 R +2570(\(cdl,)S +2760(&pix,)S +2995(imx)S +3162(,imy,)S +3375(bitpix,)S +3635(z1,)S +3770(z2\);)S +4220 V +1810(})S +4420 V +1810(/*)S +9 I +1907(Subsample)S +2324(the)S +2461(image)S +2708(if)S +2785(requested.)S +9 R +3185(*/)S +4520 V +1810(if)S +1892(\(sample)S +2204(>)S +2281(1\))S +2383({)S +4620 V +1918(int)S +2040(l,)S +2115(m,)S +2235(n=0;)S +4720 V +1918(for)S +2050(\(l=0;)S +2252(l)S +2304(<)S +2381(imy;)S +2573(l+=sample\))S +4820 V +2026(for)S +2158(\(m=0;)S +2405(m)S +2502(<)S +2579(imx;)S +2771(m+=sample\))S +4920 V +2134(pix[n++])S +2481(=)S +2558(pix[\(l*imx\)+m];)S +5020 V +1810(})S +5220 V +1810(/*)S +9 I +1907(Write)S +2134(the)S +2271(image)S +2518(to)S +2615(the)S +2752(frame)S +2989(bu)S +3079 H + (f)show 9 -.5 mul h (f)show +9 I +3125(er.)S +9 R +3250(*/)S +5320 V +1810(if)S +1892(\()S +9 B +1922(cdl_writeSubRaster)S +9 R +2714(\(cdl,)S +2904(rowx,)S +3139(rowy,)S +3374(nnx,)S +3559(nny,)S +3744(pix\)\))S +3946(goto)S +4133(err_;)S +5520 V +1810(/*)S +9 I +1907(Draw)S +2139(the)S +2276(image)S +2523(name)S +2745(as)S +2852(a)S +2924(label.)S +9 R +3154(*/)S +5620 V +1810(if)S +1892(\(label\))S +9 B +2154(cdl_markText)S +9 R +2726(\(cdl,)S +2916(rowx+10,)S +3291(rowy+10,)S +3666(fname,)S +3941(1.,)S +4059(0.,)S +4177(col\);)S +5820 V +1810(nim++;)S +2360(rowx)S +2572(+=)S +2699(nnx)S +2861(+)S +2938(pad;)S +5920 V +1643(})S +6020 V +1535(})S +6220 V +1535(/*)S +9 I +1632(Close)S +1864(the)S +2001(package)S +2328(and)S +2490(clean)S +2712(up.)S +9 R +2852(*/)S +6320 V +1260(err_:)S +9 B +1535(cdl_close)S +9 R +1907(\(cdl\);)S +6420 V +1535(exit)S +1697(\(status\);)S +6520 V +1260(})S +7920 V +EP +%%Page: 33 36 +BP +/slant 0 def +/height 1.000000 def +9 R +9 R +480 V +11 R +2936(- 33 -)S +840 V +11 B +900(13.)S +1104(Fortran)S +1541(Interface)S +1998(Summary)S +996 V +11 R +1260(include)S +1649(")S +11 B +1694(cdlftn.inc)S +11 R +2138(")S +1296 V +11 B +1910(cfopen)S +11 R +2386(\(imtdev,)S +2789(ier\))S +1416 V +11 B +1645(cfdisplayPix)S +11 R +2386(\(pix,)S +2624(nx,)S +2795(ny,)S +2966(bitpix,)S +3285(frame,)S +3600(fbcon\256g,)S +4027(zscale,)S +4354(ier\))S +1536 V +11 B +1589(cfreadCursor)S +11 R +2386(\(sample,)S +2794(x,)S +2910(y,)S +3026(key,)S +3245(ier\))S +1656 V +11 B +1675(cfsetCursor)S +11 R +2386(\(x,)S +2538(y,)S +2654(wcs,)S +2885(ier\))S +1776 V +11 B +1759(cfsetWCS)S +11 R +2386(\(name,)S +2720(title,)S +2953(a,)S +3062(b,)S +3178(c,)S +3287(d,)S +3403(tx,)S +3550(ty,)S +3697(z1,)S +3861(z2,)S +4025(zt,)S +4165(ier\))S +1896 V +11 B +1747(cfgetWCS)S +11 R +2386(\(name,)S +2720(title,)S +2953(a,)S +3062(b,)S +3178(c,)S +3287(d,)S +3403(tx,)S +3550(ty,)S +3697(z1,)S +3861(z2,)S +4025(zt,)S +4165(ier\))S +2016 V +11 B +1701(cfsetFrame)S +11 R +2386(\(frame\))S +2136 V +11 B +1598(cfclearFrame)S +11 R +2386(\(ier\))S +2256 V +11 B +1912(cfclose)S +11 R +2386(\(\))S +2496 V +11 B +1580(cfsetMapping)S +11 R +2386(\(region,)S +2763(sx,sy,snx,sny,)S +3410(dx,dy,dnx,dny,)S +4105(ref,)S +4286(ier\))S +2616 V +11 B +1568(cfgetMapping)S +11 R +2386(\(region,)S +2763(sx,sy,snx,sny,)S +3410(dx,dy,dnx,dny,)S +4105(ref,)S +4286(ier\))S +2736 V +11 B +1642(cfqueryMap)S +11 R +2386(\(wcs,)S +2653(region,)S +2994(sx,sy,snx,sny,)S +3641(dx,dy,dnx,dny,)S +4336(objref,)S +4658(ier\))S +2976 V +11 B +1530(cfdisplayIRAF)S +11 R +2386(\(fname,)S +2756(band,)S +3030(frame,)S +3345(fbcon\256g,)S +3772(zscale,)S +4099(ier\))S +3096 V +11 B +1800(c\256sIRAF)S +11 R +2386(\(fname,)S +2756(isiraf\))S +3216 V +11 B +1656(cfreadIRAF)S +11 R +2386(\(fname,)S +2756(band,)S +3030(pix,)S +3232(nx,)S +3403(ny,)S +3574(bitpix,)S +3893(title,)S +4126(ier\))S +3456 V +11 B +1552(cfdisplayFITS)S +11 R +2386(\(fname,)S +2756(frame,)S +3071(fbcon\256g,)S +3498(zscale,)S +3825(ier\))S +3576 V +11 B +1822(c\256sFITS)S +11 R +2386(\(fname,)S +2756(is\256ts\))S +3696 V +11 B +1678(cfreadFITS)S +11 R +2386(\(fname,)S +2756(pix,)S +2958(nx,)S +3129(ny,)S +3300(bitpix,)S +3619(title,)S +3852(ier\))S +3936 V +11 B +1436(cfcomputeZscale)S +11 R +2386(\(pix,)S +2624(nx,)S +2795(ny,)S +2966(bitpix,)S +3285(z1,)S +3449(z2\))S +4056 V +11 B +1572(cfzscaleImage)S +11 R +2386(\(pix,)S +2624(nx,)S +2795(ny,)S +2966(bitpix,)S +3285(z1,)S +3449(z2\))S +4296 V +11 B +1745(cfprintPix)S +11 R +2386(\(cmd,)S +2672(pix,)S +2874(nx,)S +3045(ny,)S +3216(annotate,)S +3648(ier\))S +4416 V +11 B +1439(cfprintPixToFile)S +11 R +2386(\(fname,)S +2756(pix,)S +2958(nx,)S +3129(ny,)S +3300(annotate,)S +3732(ier\))S +4656 V +11 B +1632(cfreadImage)S +11 R +2386(\(pix,)S +2624(nx,)S +2795(ny,)S +2966(ier\))S +4776 V +11 B +1316(cfreadFrameBu)S +2058 H + (f)show 11 -.5 mul h (f)show +11 B +2125(er)S +11 R +2386(\(pix,)S +2624(nx,)S +2795(ny,)S +2966(ier\))S +4896 V +11 B +1429(cfreadSubRaster)S +11 R +2386(\(lx,)S +2569(ly,)S +2716(nx,)S +2887(ny,)S +3058(pix,)S +3260(ier\))S +5016 V +11 B +1400(cfwriteSubRaster)S +11 R +2386(\(lx,)S +2569(ly,)S +2716(nx,)S +2887(ny,)S +3058(pix,)S +3260(ier\))S +5256 V +11 B +1742(cfselectFB)S +11 R +2386(\(nx,)S +2593(ny,)S +2764(fb,)S +2916(w,)S +3056(h,)S +3172(nf,)S +3324(reset\))S +5376 V +11 B +1556(cfsetFBCon\256g)S +11 R +2386(\(con\256gno\))S +5496 V +11 B +1544(cfgetFBCon\256g)S +11 R +2386(\(con\256gno,)S +2868(w,)S +3008(h,)S +3124(nf\))S +5616 V +11 B +1485(c\257ookupFBSize)S +11 R +2386(\(con\256gno,)S +2868(w,)S +3008(h,)S +3124(nf\))S +5856 V +11 B +1654(cfsetZTrans)S +11 R +2386(\(ztrans\))S +5976 V +11 B +1692(cfsetZScale)S +11 R +2386(\(z1,)S +2586(z2\))S +6096 V +11 B +1661(cfsetSample)S +11 R +2386(\(nsample\))S +6216 V +11 B +1403(cfsetSampleLines)S +11 R +2386(\(nlines\))S +6336 V +11 B +1596(cfsetContrast)S +11 R +2386(\(contrast\))S +6456 V +11 B +1737(cfsetName)S +11 R +2386(\(imname\))S +6576 V +11 B +1790(cfsetTitle)S +11 R +2386(\(imtitle\))S +6816 V +11 B +1689(cfgetFrame)S +11 R +2386(\(frame\))S +6936 V +11 B +1642(cfgetZTrans)S +11 R +2386(\(ztrans\))S +7056 V +11 B +1680(cfgetZScale)S +11 R +2386(\(z1,)S +2586(z2\))S +7176 V +11 B +1649(cfgetSample)S +11 R +2386(\(nsample\))S +7296 V +11 B +1391(cfgetSampleLines)S +11 R +2386(\(nlines\))S +7920 V +EP +%%Page: 34 37 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 34 -)S +840 V +11 B +1584(cfgetContrast)S +11 R +2386(\(contrast\))S +960 V +11 B +1725(cfgetName)S +11 R +2386(\(imname\))S +1080 V +11 B +1778(cfgetTitle)S +11 R +2386(\(imtitle\))S +1320 V +11 B +1620(cfmapFrame)S +11 R +2386(\(frame,)S +2737(ier\))S +1440 V +11 B +1630(cfmarkPoint)S +11 R +2386(\(x,)S +2538(y,)S +2654(number,)S +3050(size,)S +3281(type,)S +3531(color,)S +3817(ier\))S +1560 V +11 B +1429(cfmarkcoords\256le)S +11 R +2386(\(fname,)S +2756(type,)S +3006(size,)S +3237(color,)S +3523(label,)S +3797(ier\))S +1680 V +11 B +1360(cfmarkPointLabel)S +11 R +2386(\(x,)S +2538(y,)S +2654(label,)S +2928(size,)S +3159(type,)S +3409(color,)S +3695(ier\))S +1800 V +11 B +1666(cfmarkLine)S +11 R +2386(\(xs,)S +2581(ys,)S +2740(xe,)S +2904(ye,)S +3068(color,)S +3354(ier\))S +1920 V +11 B +1697(cfmarkBox)S +11 R +2386(\(lx,)S +2569(ly,)S +2716(ux,)S +2887(uy,)S +3058(\256ll,)S +3243(color,)S +3529(ier\))S +2040 V +11 B +1501(cfmarkPolygon)S +11 R +2386(\(xarray,)S +2761(yarray,)S +3100(npts,)S +3345(\256ll,)S +3530(color,)S +3816(ier\))S +2160 V +11 B +1501(cfmarkPolyline)S +11 R +2386(\(xarray,)S +2761(yarray,)S +3100(npts,)S +3345(color,)S +3631(ier\))S +2280 V +11 B +1596(cfmarkCircle)S +11 R +2386(\(x,)S +2538(y,)S +2654(radius,)S +2983(\256ll,)S +3168(color,)S +3454(ier\))S +2400 V +11 B +1348(cfmarkCircAnnuli)S +11 R +2386(\(x,)S +2538(y,)S +2654(radius,)S +2983(nannuli,)S +3374(sep,)S +3581(color,)S +3867(ier\))S +2520 V +11 B +1561(cfmarkEllipse)S +11 R +2386(\(x,)S +2538(y,)S +2654(xrad,)S +2909(yrad,)S +3164(rotang,)S +3505(\256ll,)S +3690(color,)S +3976(ier\))S +2640 V +11 B +1325(cfmarkEllipAnnuli)S +11 R +2386(\(x,)S +2538(y,)S +2654(xrad,)S +2909(yrad,)S +3164(ang,)S +3383(nannuli,)S +3774(sep,)S +3981(color,)S +4267(ier\))S +2760 V +11 B +1668(cfmarkText)S +11 R +2386(\(x,)S +2538(y,)S +2654(str,)S +2825(size,)S +3056(angle,)S +3354(color,)S +3640(ier\))S +2880 V +11 B +1821(cfsetfont)S +3000 V +1565(cfsettextwidth)S +11 R +2386(\(width\))S +3120 V +11 B +1709(cfsetlwidth)S +11 R +2386(\(width\))S +3240 V +11 B +1766(cfsetlstyle)S +11 R +2386(\(style\))S +3360 V +11 B +1596(cfdeleteMark)S +11 R +2386(\(x,)S +2538(y,)S +2654(ier\))S +3480 V +11 B +1529(cfclearOverlay)S +11 R +2386(\(ier\))S +3600 V +11 B +1419(cfredrawOverlay)S +11 R +2386(\(ier\))S +7920 V +EP +%%Page: 35 38 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 35 -)S +840 V +11 B +900(14.)S +1104(Fortran)S +1508(Example)S +1957(Tasks)S +996 V +11 R +1175(The)S +1381(examples)S +1831(shown)S +2154(here)S +2377(are)S +2545(for)S +2708(demonstration)S +3374(purposes)S +3801(only.)S +4095(They)S +4357(are)S +4526(based)S +4812(on)S +4959(work-)S +1116 V +900(ing)S +1079(example)S +1488(tasks)S +1746(in)S +1870(the)S +2042(CDL)S +2300(source)S +11 I +2622(examples)S +11 R +3066(subdirectory,)S +3679(see)S +3855(the)S +4026(programs)S +4477(there)S +4732(for)S +4896(the)S +5067(full)S +1236 V +900(program)S +1304(listing.)S +1596 V +11 B +900(14.1.)S +1187(Display)S +1576(Example)S +1796 V +9 C +1260(C)S +1368(========================================================================)S +1896 V +1260(C)S +1422(FDISPLAY)S +1908(--)S +2070(Example)S +2502(fortran)S +2934(program)S +3366(showing)S +3798(the)S +4014(use)S +4230(of)S +4392(the)S +4608(Client)S +1996 V +1260(C)S +1422(Display)S +1854(Library)S +2286(\(CDL\))S +2610(Fortran)S +3042(interface)S +3582(for)S +3798(displaying)S +4392(images.)S +2096 V +1260(C)S +1368(========================================================================)S +2296 V +1535(PROGRAM)S +1967(FDISPLAY)S +2396 V +1535(character*64)S +2345(imname)S +2596 V +1260(C)S +9 I +1535(Initialize)S +1882(the)S +2019(CDL)S +2221(package)S +2696 V +9 C +1535(call)S +9 B +1805(cfopen)S +9 C +2114(\(0,)S +2330(ier\))S +2796 V +1535(if)S +1697(\(ier)S +1967(.gt.)S +2237(0\))S +2399(then)S +2896 V +1751(write)S +2075(\(*,*\))S +2399('open:)S +2777(Error)S +3101(return)S +3479(from)S +3749(CDL')S +2996 V +1751(goto)S +2021(999)S +3096 V +1535(endif)S +3296 V +1535(write)S +1859(\(*,)S +2075("\('Image)S +2561(Name:)S +2885(',)S +3047($\)"\))S +3396 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(imname)S +3496 V +1535(write)S +1859(\(*,)S +2075("\('Frame)S +2561(Number:)S +2993(',)S +3155($\)"\))S +3596 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(iframe)S +3696 V +1535(write)S +1859(\(*,)S +2075("\('Frame)S +2561(buffer)S +2939(configuration)S +3695(number:)S +4127(',)S +4289($\)"\))S +3796 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(ifb)S +3996 V +1260(C)S +9 I +1535(If)S +1617(we've)S +1854(got)S +1996(a)S +2068(FITS)S +2275(format)S +2542(image,)S +2812(go)S +2929(ahead)S +3176(and)S +3338(display)S +3625(it.)S +4096 V +9 C +1535(call)S +9 B +1805(c\256sFITS)S +9 C +2184(\(imname,)S +2670(isfits\))S +4196 V +1535(if)S +1697(\(isfits)S +2129(.gt.)S +2399(0\))S +2561(then)S +4296 V +1751(call)S +9 B +2021(cfdisplayFITS)S +9 C +2620(\(imname,)S +3106(iframe,)S +3538(ifb,)S +3808(1,)S +3970(ier\))S +4396 V +1535(else)S +4496 V +1260(C)S +9 I +1751(We've)S +2003(got)S +2145(an)S +2262(IRAF)S +2484(format)S +2751(image,)S +3021(go)S +3138(ahead)S +3385(and)S +3547(display)S +3834(it.)S +4596 V +9 C +1751(call)S +9 B +2021(c\256sIRAF)S +9 C +2420(\(imname,)S +2906(isiraf\))S +4696 V +1751(if)S +1913(\(isiraf)S +2345(.gt.)S +2615(0\))S +2777(then)S +4796 V +1967(call)S +9 B +2237(cfdisplayIRAF)S +9 C +2856(\(imname,)S +3342(1,)S +3504(iframe,)S +3936(ifb,)S +4206(1,)S +4368(ier\))S +4896 V +1751(else)S +4996 V +1260(C)S +9 I +1810(Unrecognized)S +2342(image,)S +2612(punt)S +2799(and)S +2961(exit.)S +5096 V +9 C +1967(write)S +2291(\(*,*\))S +2615('Unrecognized)S +3371(image)S +3695(format')S +5196 V +1751(endif)S +5296 V +1535(endif)S +5496 V +1260(C)S +9 I +1535(Clean)S +1777(up)S +1894(and)S +2056(exit.)S +5596 V +9 C +1260(999)S +1535(continue)S +5696 V +1535(call)S +9 B +1805(cfclose)S +9 C +2114(\(ier\))S +5796 V +1535(end)S +7920 V +EP +%%Page: 36 39 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +480 V +11 R +2936(- 36 -)S +840 V +11 B +900(14.2.)S +1187(Interactive)S +1730(Graphics)S +2198(Overlay)S +2609(Example)S +1040 V +9 C +1260(C)S +1368(==========================================================================)S +1140 V +1260(C)S +1422(FTVMARK)S +1854(--)S +2070(Example)S +2502(fortran)S +2934(program)S +3366(showing)S +3798(the)S +4014(use)S +4230(of)S +4392(the)S +4608(Client)S +1240 V +1260(C)S +1422(Display)S +1854(Library)S +2286(\(CDL\))S +2610(Fortran)S +3042(interface)S +3582(for)S +3798(doing)S +4122(graphics)S +4608(overlay.)S +5094(No)S +1340 V +1260(C)S +1422(checking)S +1908(of)S +2070(the)S +2286(error)S +2610(flag)S +2880(is)S +3042(done)S +3312(here)S +3582(for)S +3798(space)S +4122(considerations.)S +1440 V +1260(C)S +1368(==========================================================================)S +1640 V +1535(PROGRAM)S +1967(FTVMARK)S +1740 V +1535(include)S +2085(")S +9 B +2139(cdlftn.inc)S +9 C +2502(")S +1840 V +1535(character*64)S +2360(imname)S +2040 V +1260(C)S +9 I +1535(Initialize)S +1882(the)S +2019(CDL)S +2221(package)S +2140 V +9 C +1535(call)S +9 B +1805(cfopen)S +9 C +2114(\(0,)S +2330(ier\))S +2340 V +1535(write)S +1859(\(*,)S +2075("\('Image)S +2561(Name:)S +2885(',)S +3047($\)"\))S +2440 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(imname)S +2540 V +1535(write)S +1859(\(*,)S +2075("\('Frame)S +2561(Number:)S +2993(',)S +3155($\)"\))S +2640 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(iframe)S +2740 V +1535(write)S +1859(\(*,)S +2075("\('Frame)S +2561(buffer)S +2939(configuration)S +3695(number:)S +4127(',)S +4289($\)"\))S +2840 V +1535(read)S +1805(\(5,)S +2021(*\))S +2183(ifb)S +3040 V +1260(C)S +9 I +1535(If)S +1617(we've)S +1854(got)S +1996(a)S +2068(FITS)S +2275(format)S +2542(image,)S +2812(go)S +2929(ahead)S +3176(and)S +3338(display)S +3625(it.)S +3140 V +9 C +1535(call)S +9 B +1805(c\256sFITS)S +9 C +2184(\(imname,)S +2670(isfits\))S +3240 V +1535(if)S +1697(\(isfits)S +2129(.gt.)S +2399(0\))S +2561(then)S +3340 V +1751(call)S +9 B +2021(cfdisplayFITS)S +9 C +2620(\(imname,)S +3106(iframe,)S +3538(ifb,)S +3808(1,)S +3970(ier\))S +3440 V +1535(else)S +3540 V +1260(C)S +9 I +1751(We've)S +2003(got)S +2145(an)S +2262(IRAF)S +2484(format)S +2751(image,)S +3021(go)S +3138(ahead)S +3385(and)S +3547(display)S +3834(it.)S +3640 V +9 C +1751(call)S +9 B +2021(c\256sIRAF)S +9 C +2420(\(imname,)S +2906(isiraf\))S +3740 V +1751(if)S +1913(\(isiraf)S +2345(.gt.)S +2615(0\))S +2777(then)S +3840 V +1967(call)S +9 B +2237(cfdisplayIRAF)S +9 C +2856(\(imname,)S +3342(1,)S +3504(iframe,)S +3936(ifb,)S +4206(1,)S +4368(ier\))S +3940 V +1751(else)S +4040 V +1260(C)S +9 I +1967(No)S +2099(valid)S +2306(image)S +2553(given,)S +2798(so)S +2905(map)S +3087(the)S +3224(current)S +3516(display)S +3803(for)S +3935(marking.)S +4140 V +9 C +1967(call)S +9 B +2237(cfmapFrame)S +9 C +2786(\(iframe\))S +4240 V +1751(endif)S +4340 V +1535(endif)S +4540 V +1260(C)S +9 I +1535(Now)S +1727(that)S +1894(we've)S +2131(got)S +2273(an)S +2390(image)S +2637(displayed)S +3009(or)S +3116(mapped,)S +3451(enter)S +3663(a)S +3735(cursor)S +3997(loop)S +4184(to)S +4281(mark)S +4493(the)S +4630(image.)S +4640 V +9 C +1535(call)S +1805(markInteractive)S +2669(\(\))S +4840 V +1260(C)S +9 I +1535(Clean)S +1777(up)S +1894(and)S +2056(exit)S +4940 V +9 C +1260(999)S +1535(continue)S +5040 V +1535(call)S +9 B +1805(cfclose)S +9 C +2114(\(ier\))S +5140 V +1535(end)S +5340 V +1260(C)S +9 I +1476(MARKINTERACTIVE)S +2303(--)S +2390(Subroutine)S +2812(for)S +2944(processing)S +3361(the)S +3498(cursor)S +3760(loop.)S +5440 V +9 C +1535(subroutine)S +2129(markInteractive)S +2993(\(\))S +5540 V +1535(include)S +2085(")S +9 B +2139(cdlftn.inc)S +9 C +2502(")S +5640 V +1535(real)S +2085(angle,)S +2463(rx,)S +2679(ry,)S +2895(txsize)S +5740 V +1535(integer)S +2360(nx,)S +2576(ny,)S +2792(x,)S +2954(y,)S +3116(x2,)S +3332(y2,)S +3548(fill,)S +3872(size,)S +4196(color)S +5840 V +1535(integer)S +2360(number,)S +2792(radius,)S +3224(xrad,)S +3548(yrad,)S +3872(nannuli,)S +4358(sep)S +5940 V +1535(character)S +2085(key)S +6040 V +1535(character*64)S +2360(cmd,)S +2630(str)S +6240 V +1260(C)S +9 I +1535(Allocate)S +1862(a)S +1934(1024x1024)S +2361(array)S +2588(for)S +2720(pixels.)S +6340 V +9 C +1535(character)S +2085(pix\(1048576\))S +6540 V +1260(C)S +9 I +1535(....Initialize)S +1974(the)S +2111(local)S +2318(parameters)S +2755(to)S +2852(use)S +6740 V +9 C +1260(C)S +9 I +1535(Read)S +1747(a)S +1819(cursor)S +2081(keystroke)S +2448(telling)S +2705(us)S +2812(what)S +3014(to)S +3111(do.)S +6840 V +9 C +1260(10)S +1535(call)S +9 B +1805(cfreadCursor)S +9 C +2379(\(0,)S +2595(rx,)S +2811(ry,)S +3027(key,)S +3297(ier\))S +7040 V +1260(C)S +9 I +1535(Round)S +1797(the)S +1934(real)S +2106(cursor)S +2368(position)S +2685(to)S +2782(integer)S +3064(pixel)S +3266(positions.)S +7140 V +9 C +1751(x)S +1859(=)S +1967(nint)S +2237(\(rx)S +2453(+)S +2561(0.5\))S +7240 V +1751(y)S +1859(=)S +1967(nint)S +2237(\(ry)S +2453(+)S +2561(0.5\))S +7920 V +EP +%%Page: 37 40 +BP +/slant 0 def +/height 1.000000 def +9 C +9 C +460 V +11 R +2936(- 37 -)S +820 V +9 C +1260(C)S +9 I +1535(Check)S +1787(the)S +1924(keystroke)S +2291(and)S +2453(take)S +2630(the)S +2767(appropriate)S +3224(action.)S +920 V +9 C +1260(C)S +9 I +1751(Colon)S +1998(Commands)S +1020 V +9 C +1751(if)S +1913(\(key)S +2183(.eq.)S +2453(':'\))S +2723(then)S +1120 V +1260(C)S +9 I +1810(Read)S +2022(a)S +2094(three)S +2306(character)S +2683(command)S +3060(and)S +3222(value)S +3444(\256eld)S +3626(and)S +3788(process)S +4090(the)S +4227(colon)S +4454(command)S +1220 V +9 C +1810(read)S +2080(\(*,'\(A3,)S +2566(i4\)'\))S +2890(cmd,)S +3160(ival)S +1320 V +1810(if)S +1972(\(cmd\(1:3\))S +2512(.eq.)S +2782('ang'\))S +3160(then)S +1420 V +2026(angle)S +2350(=)S +2458(real)S +2728(\(ival\))S +1520 V +1810(else)S +2080(if)S +2242(\(cmd\(1:3\))S +2782(.eq.)S +3052('col'\))S +3430(then)S +1620 V +2026(color)S +2350(=)S +2458(ival)S +1720 V +1810(else)S +2080(if)S +2242(\(cmd\(1:3\))S +2782(.eq.)S +3052('fil'\))S +3430(then)S +1820 V +2026(fill)S +2296(=)S +2404(ival)S +1920 V +9 I +2085(:)S +2020 V +2085(....and)S +2339(so)S +2446(on)S +2563(to)S +2660(set)S +2787(local)S +2994(variables)S +2120 V +2085(:)S +2220 V +9 R +1810(else)S +1977(if)S +2059(\(cmd\(1:3\))S +2446(.eq.)S +2604('pri'\))S +2821(then)S +2320 V +1260(C)S +9 I +1918(Print)S +2130(contents)S +2457(of)S +2554(the)S +2691(current)S +2983(frame)S +3220(bu)S +3310 H + (f)show 9 -.5 mul h (f)show +9 I +3356(er)S +2420 V +9 R +1918(call)S +9 B +2075(cfreadFrameBu)S +2685 H + (f)show 9 -.5 mul h (f)show +9 B +2740(er)S +9 R +2847(\(pix,)S +3042(nx,)S +3182(ny,)S +3322(ier\))S +2520 V +1918(call)S +9 B +2075(cfprintPix)S +9 R +2492(\("lpr",)S +2746(pix,)S +2911(nx,)S +3051(ny,)S +3191(1,)S +3286(ier\))S +2620 V +1810(else)S +1977(if)S +2059(\(cmd\(1:3\))S +2446(.eq.)S +2604('sta'\))S +2821(then)S +2720 V +9 I +2085(....print)S +2379(out)S +2521(the)S +2658(status)S +2895(\(value\))S +3177(of)S +3274(variables)S +2820 V +9 R +1810(endif)S +3020 V +1260(C)S +9 I +1643(Point)S +1865(Markers)S +3120 V +9 R +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('p'\))S +2399(then)S +3220 V +1810(call)S +9 B +1967(cfmarkPoint)S +9 R +2479(\(x,)S +2604(y,)S +2699(1,)S +2794(size,)S +2984(M_PLUS,)S +3379(color,)S +3614(ier\))S +3320 V +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('x'\))S +2399(then)S +3420 V +1810(call)S +9 B +1967(cfmarkPoint)S +9 R +2479(\(x,)S +2604(y,)S +2699(1,)S +2794(size,)S +2984(M_CROSS,)S +3444(color,)S +3679(ier\))S +3520 V +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('_'\))S +2399(then)S +3620 V +1810(call)S +9 B +1967(cfmarkPoint)S +9 R +2479(\(x,)S +2604(y,)S +2699(1,)S +2794(size,)S +2984(M_HBLINE,)S +3489(color,)S +3724(ier\))S +3720 V +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('o'\))S +2399(then)S +3820 V +1260(C)S +9 I +1810(Example)S +2152(of)S +2249(a)S +2321(\256lled)S +2528(point)S +2740(marker)S +3920 V +9 R +1810(call)S +9 B +1967(cfmarkPoint)S +9 R +2479(\(x,)S +2604(y,)S +2699(1,)S +2794(size,)S +2984(or\(M_CIRCLE,\256ll\),)S +3737(color,)S +3972(ier\))S +4020 V +9 I +2085(:)S +4120 V +2085(....and)S +2339(so)S +2446(on)S +2563(to)S +2660(set)S +2787(other)S +3004(types)S +3216(of)S +3313(point)S +3525(markers)S +4320 V +9 R +1260(C)S +9 I +1643(Other)S +1880(Markers)S +4420 V +9 R +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('b'\))S +2399(then)S +4520 V +1810(print)S +2007('\("Hit)S +2246(another)S +2543(key)S +2700(to)S +2797(de\256ne)S +3044(the)S +3181(box)S +3343(...."\)')S +4620 V +1810(call)S +9 B +1967(cfreadCursor)S +9 R +2514(\(0,)S +2639(rx,)S +2764(ry,)S +2889(key,)S +3069(ier\))S +4720 V +1810(x2)S +1927(=)S +2004(nint)S +2171(\(rx)S +2303(+)S +2380(0.5\))S +4820 V +1810(y2)S +1927(=)S +2004(nint)S +2171(\(ry)S +2303(+)S +2380(0.5\))S +4920 V +1810(call)S +9 B +1967(cfmarkBox)S +9 R +2424(\(x,)S +2549(y,)S +2644(x2,)S +2784(y2,)S +2924(\256ll,)S +3074(color,)S +3309(ier\))S +5020 V +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('d'\))S +2399(then)S +5120 V +1810(call)S +9 B +1967(cfdeleteMark)S +9 R +2509(\(x,)S +2634(y,)S +2729(ier\))S +5220 V +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('e'\))S +2394(then)S +5320 V +1810(call)S +9 B +1967(cfmarkEllipse)S +9 R +2534(\(x,)S +2659(y,)S +2754(xrad,)S +2964(yrad,)S +3174(angle,)S +3419(\256ll,)S +3569(color,)S +3804(ier\))S +5420 V +1584(else)S +1751(if)S +1833(\(key)S +2020(.eq.)S +2178('t'\))S +2320(then)S +5520 V +1692(print)S +1889('\("Text)S +2178(string:)S +2462(",)S +2549($\)')S +5620 V +1692(read)S +1874(\(*,'\(A64\)'\))S +2304(str)S +5720 V +1692(call)S +9 B +1849(cfmarkText)S +9 R +2331(\(x,)S +2456(y,)S +2551(str,)S +2691(txsize,)S +2951(angle,)S +3196(color,)S +3431(ier\))S +5820 V +9 I +2085(:)S +5920 V +2085(....and)S +2339(so)S +2446(on)S +2563(to)S +2660(set)S +2787(other)S +3004(types)S +3216(of)S +3313(markers)S +6120 V +9 R +1260(C)S +9 I +1643(Quit)S +6220 V +9 R +1643(else)S +1810(if)S +1892(\(key)S +2079(.eq.)S +2237('q'\))S +2399(then)S +6320 V +1810(goto)S +1997(998)S +6420 V +1643(endif)S +6620 V +1260(C)S +9 I +1535(Loop)S +1747(back)S +1944(until)S +2136(we)S +2263(want)S +2465(to)S +2562(quit)S +6720 V +9 R +1535(goto)S +1722(10)S +6820 V +1260(998)S +1535(continue)S +6920 V +1535(end)S +7920 V +EP +%%Page: 38 41 +BP +/slant 0 def +/height 1.000000 def +9 R +9 R +480 V +11 R +2936(- 38 -)S +840 V +11 B +900(15.)S +1104(SPP)S +1333(Interface)S +1790(Summary)S +996 V +11 R +1260(#include)S +1704(")S +11 B +1749(cdlspp.h)S +11 R +2147(")S +1296 V +11 B +1854(cdl_open)S +11 R +2442(\(imtdev,)S +2845(ier\))S +1416 V +11 B +1589(cdl_displayPix)S +11 R +2442(\(pix,)S +2680(nx,)S +2851(ny,)S +3022(bitpix,)S +3341(frame,)S +3656(fbcon\256g,)S +4083(zscale,)S +4410(ier\))S +1536 V +11 B +1533(cdl_readCursor)S +11 R +2442(\(sample,)S +2850(x,)S +2966(y,)S +3082(wcs,)S +3313(key,)S +3532(ier\))S +1656 V +11 B +1619(cdl_setCursor)S +11 R +2442(\(x,)S +2594(y,)S +2710(wcs,)S +2941(ier\))S +1776 V +11 B +1703(cdl_setWCS)S +11 R +2442(\(name,)S +2776(title,)S +3009(a,)S +3118(b,)S +3234(c,)S +3343(d,)S +3459(tx,)S +3606(ty,)S +3753(z1,)S +3917(z2,)S +4081(zt,)S +4221(ier\))S +1896 V +11 B +1691(cdl_getWCS)S +11 R +2442(\(name,)S +2776(title,)S +3009(a,)S +3118(b,)S +3234(c,)S +3343(d,)S +3459(tx,)S +3606(ty,)S +3753(z1,)S +3917(z2,)S +4081(zt,)S +4221(ier\))S +2016 V +11 B +1645(cdl_setFrame)S +11 R +2442(\(frame\))S +2136 V +11 B +1542(cdl_clearFrame)S +11 R +2442(\(ier\))S +2256 V +11 B +1856(cdl_close)S +11 R +2442(\(\))S +2496 V +11 B +1524(cdl_setMapping)S +11 R +2442(\(region,)S +2819(sx,sy,snx,sny,)S +3466(dx,dy,dnx,dny,)S +4161(ref,)S +4342(ier\))S +2616 V +11 B +1512(cdl_getMapping)S +11 R +2442(\(region,)S +2819(sx,sy,snx,sny,)S +3466(dx,dy,dnx,dny,)S +4161(ref,)S +4342(ier\))S +2736 V +11 B +1586(cdl_queryMap)S +11 R +2442(\(wcs,)S +2709(region,)S +3050(sx,sy,snx,sny,)S +3697(dx,dy,dnx,dny,)S +4392(objref,)S +4714(ier\))S +2976 V +11 B +1474(cdl_displayIRAF)S +11 R +2442(\(fname,)S +2812(band,)S +3086(frame,)S +3401(fbcon\256g,)S +3828(zscale,)S +4155(ier\))S +3096 V +11 B +1739(cdl_isIRAF)S +11 R +2442(\(fname,)S +2812(isiraf\))S +3216 V +11 B +1600(cdl_readIRAF)S +11 R +2442(\(fname,)S +2812(band,)S +3086(pix,)S +3288(nx,)S +3459(ny,)S +3630(bitpix,)S +3949(title,)S +4182(ier\))S +3456 V +11 B +1496(cdl_displayFITS)S +11 R +2442(\(fname,)S +2812(frame,)S +3127(fbcon\256g,)S +3554(zscale,)S +3881(ier\))S +3576 V +11 B +1761(cdl_isFITS)S +11 R +2442(\(fname,)S +2812(is\256ts\))S +3696 V +11 B +1622(cdl_readFITS)S +11 R +2442(\(fname,)S +2812(pix,)S +3014(nx,)S +3185(ny,)S +3356(bitpix,)S +3675(title,)S +3908(ier\))S +3936 V +11 B +1380(cdl_computeZscale)S +11 R +2442(\(pix,)S +2680(nx,)S +2851(ny,)S +3022(bitpix,)S +3341(z1,)S +3505(z2\))S +4056 V +11 B +1516(cdl_zscaleImage)S +11 R +2442(\(pix,)S +2680(nx,)S +2851(ny,)S +3022(bitpix,)S +3341(z1,)S +3505(z2\))S +4296 V +11 B +1689(cdl_printPix)S +11 R +2442(\(cmd,)S +2728(pix,)S +2930(nx,)S +3101(ny,)S +3272(annotate,)S +3704(ier\))S +4416 V +11 B +1383(cdl_printPixToFile)S +11 R +2442(\(fname,)S +2812(pix,)S +3014(nx,)S +3185(ny,)S +3356(annotate,)S +3788(ier\))S +4656 V +11 B +1576(cdl_readImage)S +11 R +2442(\(pix,)S +2680(nx,)S +2851(ny,)S +3022(ier\))S +4776 V +11 B +1260(cdl_readFrameBu)S +2114 H + (f)show 11 -.5 mul h (f)show +11 B +2181(er)S +11 R +2442(\(pix,)S +2680(nx,)S +2851(ny,)S +3022(ier\))S +4896 V +11 B +1373(cdl_readSubRaster)S +11 R +2442(\(lx,)S +2625(ly,)S +2772(nx,)S +2943(ny,)S +3114(pix,)S +3316(ier\))S +5016 V +11 B +1344(cdl_writeSubRaster)S +11 R +2442(\(lx,)S +2625(ly,)S +2772(nx,)S +2943(ny,)S +3114(pix,)S +3316(ier\))S +5256 V +11 B +1686(cdl_selectFB)S +11 R +2442(\(nx,)S +2649(ny,)S +2820(fb,)S +2972(w,)S +3112(h,)S +3228(nf,)S +3380(reset\))S +5376 V +11 B +1500(cdl_setFBCon\256g)S +11 R +2442(\(con\256gno\))S +5496 V +11 B +1488(cdl_getFBCon\256g)S +11 R +2442(\(con\256gno,)S +2924(w,)S +3064(h,)S +3180(nf\))S +5616 V +11 B +1424(cdl_lookupFBSize)S +11 R +2442(\(con\256gno,)S +2924(w,)S +3064(h,)S +3180(nf\))S +5856 V +11 B +1598(cdl_setZTrans)S +11 R +2442(\(ztrans\))S +5976 V +11 B +1636(cdl_setZScale)S +11 R +2442(\(z1,)S +2642(z2\))S +6096 V +11 B +1605(cdl_setSample)S +11 R +2442(\(nsample\))S +6216 V +11 B +1347(cdl_setSampleLines)S +11 R +2442(\(nlines\))S +6336 V +11 B +1540(cdl_setContrast)S +11 R +2442(\(contrast\))S +6456 V +11 B +1681(cdl_setName)S +11 R +2442(\(imname\))S +6576 V +11 B +1734(cdl_setTitle)S +11 R +2442(\(imtitle\))S +6816 V +11 B +1633(cdl_getFrame)S +11 R +2442(\(frame\))S +6936 V +11 B +1586(cdl_getZTrans)S +11 R +2442(\(ztrans\))S +7056 V +11 B +1624(cdl_getZScale)S +11 R +2442(\(z1,)S +2642(z2\))S +7176 V +11 B +1593(cdl_getSample)S +11 R +2442(\(nsample\))S +7296 V +11 B +1335(cdl_getSampleLines)S +11 R +2442(\(nlines\))S +7920 V +EP +%%Page: 39 42 +BP +/slant 0 def +/height 1.000000 def +11 R +11 R +480 V +2936(- 39 -)S +840 V +11 B +1528(cdl_getContrast)S +11 R +2442(\(contrast\))S +960 V +11 B +1669(cdl_getName)S +11 R +2442(\(imname\))S +1080 V +11 B +1722(cdl_getTitle)S +11 R +2442(\(imtitle\))S +1320 V +11 B +1564(cdl_mapFrame)S +11 R +2442(\(frame,)S +2793(ier\))S +1440 V +11 B +1306(cdl_markCoordsFile)S +11 R +2442(\(fname,)S +2812(type,)S +3062(size,)S +3293(color,)S +3579(label,)S +3853(ier\))S +1560 V +11 B +1574(cdl_markPoint)S +11 R +2442(\(x,)S +2594(y,)S +2710(number,)S +3106(size,)S +3337(type,)S +3587(color,)S +3873(ier\))S +1680 V +11 B +1304(cdl_markPointLabel)S +11 R +2442(\(x,)S +2594(y,)S +2710(label,)S +2984(size,)S +3215(type,)S +3465(color,)S +3751(ier\))S +1800 V +11 B +1610(cdl_markLine)S +11 R +2442(\(xs,)S +2637(ys,)S +2796(xe,)S +2960(ye,)S +3124(color,)S +3410(ier\))S +1920 V +11 B +1641(cdl_markBox)S +11 R +2442(\(lx,)S +2625(ly,)S +2772(ux,)S +2943(uy,)S +3114(\256ll,)S +3299(color,)S +3585(ier\))S +2040 V +11 B +1445(cdl_markPolygon)S +11 R +2442(\(xarray,)S +2817(yarray,)S +3156(npts,)S +3401(\256ll,)S +3586(color,)S +3872(ier\))S +2160 V +11 B +1445(cdl_markPolyline)S +11 R +2442(\(xarray,)S +2817(yarray,)S +3156(npts,)S +3401(color,)S +3687(ier\))S +2280 V +11 B +1540(cdl_markCircle)S +11 R +2442(\(x,)S +2594(y,)S +2710(radius,)S +3039(\256ll,)S +3224(color,)S +3510(ier\))S +2400 V +11 B +1292(cdl_markCircAnnuli)S +11 R +2442(\(x,)S +2594(y,)S +2710(radius,)S +3039(nannuli,)S +3430(sep,)S +3637(color,)S +3923(ier\))S +2520 V +11 B +1505(cdl_markEllipse)S +11 R +2442(\(x,)S +2594(y,)S +2710(xrad,)S +2965(yrad,)S +3220(rotang,)S +3561(\256ll,)S +3746(color,)S +4032(ier\))S +2640 V +11 B +1269(cdl_markEllipAnnuli)S +11 R +2442(\(x,)S +2594(y,)S +2710(xrad,)S +2965(yrad,)S +3220(ang,)S +3439(nannuli,)S +3830(sep,)S +4037(color,)S +4323(ier\))S +2760 V +11 B +1612(cdl_markText)S +11 R +2442(\(x,)S +2594(y,)S +2710(str,)S +2881(size,)S +3112(angle,)S +3410(color,)S +3696(ier\))S +2880 V +11 B +1734(cdl_setFont)S +11 R +2442(\(font\))S +3000 V +11 B +1440(cdl_setTextWidth)S +11 R +2442(\(width\))S +3120 V +11 B +1438(cdl_setLineWidth)S +11 R +2442(\(width\))S +3240 V +11 B +1507(cdl_setLineStyle)S +11 R +2442(\(style\))S +3360 V +11 B +1540(cdl_deleteMark)S +11 R +2442(\(x,)S +2594(y,)S +2710(ier\))S +3480 V +11 B +1473(cdl_clearOverlay)S +11 R +2442(\(ier\))S +3600 V +11 B +1363(cdl_redrawOverlay)S +11 R +2442(\(ier\))S +3720 V +11 B +1648(cdl_setDebug)S +11 R +2442(\(level\))S +7920 V +EP +%%Trailer +%%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier Troff +%%Pages: 42 +
\ No newline at end of file diff --git a/vendor/x11iraf/cdl/doc/greek.ps b/vendor/x11iraf/cdl/doc/greek.ps new file mode 100644 index 00000000..ab2728e0 --- /dev/null +++ b/vendor/x11iraf/cdl/doc/greek.ps @@ -0,0 +1,2521 @@ +%!PS +/devppi 300 def +/userppi 72 def +/pagewidth 8.5 def +/devpixtouser { userppi mul devppi div } def +/pagetolandscape 90 def +/setcoords { pagewidth userppi mul 0 translate + pagetolandscape rotate 1 devpixtouser 1 devpixtouser scale } def +/setjoins { 1 setlinejoin 1 setlinecap } def +erasepage initgraphics setcoords setjoins +/getpoint { + currentfile read pop 8#77 and 6 bitshift + currentfile read pop 8#77 and or + currentfile read pop 8#77 and 6 bitshift + currentfile read pop 8#77 and or + } def +/m { getpoint moveto } def +/d { getpoint lineto } def +02 setlinewidth +02 setlinewidth +m WCfG d WDfM d WDfA d WCfG d W@fK d V}fM d VyfM d VufK d VrfG d VpfC +d Voe} d Voes d Vpem d Vrej d Vuef d Vyed d V}ed d W@ef d WCef d WDed +d WDes m VsfG d VrfC d Vpe} d Vpes d Vrem d Vsej m VyfM d VvfK d VsfE +d Vre} d Vres d Vsek d Vvef d Vyed m WCeq d WCeh m WAes d WAeh d W@ef +m V}es d WHes m V?es d WAeq m W@es d WAeo m WFes d WDeo m WGes d WDeq +m VneV m W\e? d W\ed m W^e} d W^ef m WWe? d W`e? d W`ed m Wle{ d Wle} +d Wke} d Wkey d Wney d Wne} d Wle? d Wie? d Wee} d Waey d W`es m WWed +d Weed m WXe? d W\e} m WZe? d W\e{ m W\ef d WXed m W\eh d WZed m W`eh +d Waed m W`ef d Wced m WWeV m W|es d XNes d XNew d XLe{ d XKe} d XFe? +d XCe? d W~e} d Wzey d Wyes d Wyeo d Wzej d W~ef d XCed d XFed d XKef +d XNej m XLeu d XLew d XKe{ m W|ey d Wzeu d Wzem d W|ej m XKes d XKey +d XIe} d XFe? m XCe? d W?e} d W~e{ d W|eu d W|em d W~eh d W?ef d XCed +m WweV m X_es d Xqes d Xqew d Xpe{ d Xne} d Xie? d Xfe? d Xae} d X^ey +d X\es d X\eo d X^ej d Xaef d Xfed d Xied d Xnef d Xqej m Xpeu d Xpew +d Xne{ m X_ey d X^eu d X^em d X_ej m Xnes d Xney d Xle} d Xie? m Xfe? +d Xce} d Xae{ d X_eu d X_em d Xaeh d Xcef d Xfed m XZeV m YBfM d YBed +m YCfK d YCef m X}fM d YEfM d YEed m YRe} d YEek m YKes d YUed m YKeq +d YTed m YIeq d YRed m YNe? d YXe? m X}ed d YIed m YNed d YXed m X?fM +d YBfK m Y@fM d YBfI m YOe? d YRe} m YVe? d YRe} m YBef d X?ed m YBeh +d Y@ed m YEeh d YFed m YEef d YHed m YReh d YOed m YQeh d YVed m X}eV +m YefZ m YeeV m ZIfM d ZIed m ZJfK d ZJef m ZLfM d ZLed m ZDfM d Z]fM +d Z]fA m ZLey d ZUey m ZUfA d ZUeq m ZDed d ZQed m ZFfM d ZIfK m ZGfM +d ZIfI m ZNfM d ZLfI m ZOfM d ZLfK m ZUfM d Z]fK m ZYfM d Z]fI m ZZfM +d Z]fG m Z\fM d Z]fA m ZUfA d ZTey d ZUeq m ZUe} d ZRey d ZUeu m ZUe{ +d ZOey d ZUew m ZIef d ZFed m ZIeh d ZGed m ZLeh d ZNed m ZLef d ZOed +m ZDeV m Zte? d Zoe} d Zley d Zjes d Zjeo d Zlej d Zoef d Zted d Zwed +d Z|ef d Z?ej d [@eo d [@es d Z?ey d Z|e} d Zwe? d Zte? m Zmey d Zleu +d Zlem d Zmej m Z}ej d Z?em d Z?eu d Z}ey m Zte? d Zqe} d Zoe{ d Zmeu +d Zmem d Zoeh d Zqef d Zted m Zwed d Zzef d Z|eh d Z}em d Z}eu d Z|e{ +d Zze} d Zwe? m ZieV m [Re? d [Red m [Se} d [Sef m [Me? d [Te? d [Ted +m [Tew d [Ve{ d [We} d [Ze? d [^e? d [ae} d [ce{ d [deu d [ded m [ae{ +d [ceu d [cef m [^e? d [`e} d [aew d [aed m [Med d [Yed m []ed d [hed +m [Oe? d [Re} m [Pe? d [Re{ m [Ref d [Oed m [Reh d [Ped m [Teh d [Ved +m [Tef d [Wed m [aef d [^ed m [aeh d [`ed m [deh d [eed m [def d [ged +m [MeV m [|fI d [|em d [~eh d \@ef d \Ded d \Hed d \Lef d \Nej m [~fI +d [~ek d \@eh m [|fI d \@fM d \@ek d \Bef d \Ded m [we? d \He? m [weV +m \TfZ m \TeV m ]IfG d ]JfM d ]JfA d ]IfG d ]FfK d ]AfM d \|fM d \wfK +d \tfG d \tfA d \ve} d \{ey d ]Deu d ]Ges d ]Ieo d ]Iej d ]Gef m \vfA +d \we} d \{e{ d ]Dew d ]Geu d ]Ieq m \wfK d \vfG d \vfC d \we? d \{e} +d ]Dey d ]Ieu d ]Jeq d ]Jek d ]Ieh d ]Gef d ]Ced d \~ed d \yef d \vej +d \teo d \ted d \vej m \seV m ]\es d ]oes d ]oew d ]me{ d ]ke} d ]fe? +d ]ce? d ]^e} d ][ey d ]Yes d ]Yeo d ][ej d ]^ef d ]ced d ]fed d ]kef +d ]oej m ]meu d ]mew d ]ke{ m ]\ey d ][eu d ][em d ]\ej m ]kes d ]key +d ]je} d ]fe? m ]ce? d ]`e} d ]^e{ d ]\eu d ]\em d ]^eh d ]`ef d ]ced +m ]WeV m ^AfI d ^Aem d ^Beh d ^Eef d ^Ied d ^Led d ^Pef d ^Rej m ^BfI +d ^Bek d ^Eeh m ^AfI d ^EfM d ^Eek d ^Fef d ^Ied m ]{e? d ^Le? m ]{eV +m Fwcf d Fycd d Fwcb d Fvcd d Fvcf d Fwcj d Fycl d F~cn d GDcn d GIcl +d GJch d GJcb d GIc^ d GDc\ d F?c\ m GDcn d GGcl d GIch d GIcb d GGc^ +d GDc\ m GDc\ d GGcZ d GJcV d GLcS d GLcM d GJcI d GIcG d GDcE d F~cE +d FycG d FwcI d FvcM d FvcO d FwcQ d FycO d FwcM m GIcX d GJcS d GJcM +d GIcI d GGcG d GDcE m Ftbw m G\cf d G]cd d G\cb d GZcd d GZcf d G\cj +d G]cl d Gbcn d Gicn d Gmcl d Gocj d Gpcf d Gpcb d Goc^ d GjcZ d GbcV +d G_cU d G\cQ d GZcK d GZcE m Gicn d Glcl d Gmcj d Gocf d Gocb d Gmc^ +d GicZ d GbcV m GZcI d G\cK d G_cK d GgcG d GlcG d GocI d GpcK m G_cK +d GgcE d GmcE d GocG d GpcK d GpcO m GYbw m G}c{ m G}bw m H\c{ m H\bw +m FwbW d FybU d FwbS d FvbU d FvbW d Fwb[ d Fyb] d F~b^ d GDb^ d GIb] +d GJbY d GJbS d GIbO d GDbM d F?bM m GDb^ d GGb] d GIbY d GIbS d GGbO +d GDbM m GDbM d GGbK d GJbG d GLbC d GLa} d GJaz d GIax d GDav d F~av +d Fyax d Fwaz d Fva} d Fva? d FwbA d Fya? d Fwa} m GIbI d GJbC d GJa} +d GIaz d GGax d GDav m Ftah m G\bW d G]bU d G\bS d GZbU d GZbW d G\b[ +d G]b] d Gbb^ d Gib^ d Gmb] d GobY d GobS d GmbO d GibM d GdbM m Gib^ +d Glb] d GmbY d GmbS d GlbO d GibM m GibM d GlbK d GobG d GpbC d Gpa} +d Goaz d Gmax d Giav d Gbav d G]ax d G\az d GZa} d GZa? d G\bA d G]a? +d G\a} m GmbI d GobC d Goa} d Gmaz d Glax d Giav m GYah m G}bl m G}ah +m H\bl m H\ah m ICb^ d I@b[ d ICbC d IFb[ d ICb^ m ICb[ d ICbO m ICaz +d I@ax d ICav d IFax d ICaz m H{ah m FwaG d FyaE d FwaC d FvaE d FvaG +d FwaK d FyaM d F~aO d GDaO d GIaM d GJaI d GJaC d GIa@ d GD`~ d F?`~ +m GDaO d GGaM d GIaI d GIaC d GGa@ +stroke +m GGa@ d GD`~ m GD`~ d GG`| d GJ`x d GL`t d GL`n d GJ`j d GI`h d GD`f +d F~`f d Fy`h d Fw`j d Fv`n d Fv`p d Fw`r d Fy`p d Fw`n m GI`z d GJ`t +d GJ`n d GI`j d GG`h d GD`f m Ft`Y m GiaK d Gi`f m GjaO d Gj`f m GjaO +d GY`r d Gr`r m Gd`f d Go`f m GY`Y m G}a] m G}`Y m H\a] m H\`Y m ICaB +d I@a@ d IC`~ d IFa@ d ICaB m IC`f d I@`h d IC`j d IF`h d IF`d d IC`a +d I@`_ m H{`Y m Fw_x d Fy_v d Fw_t d Fv_v d Fv_x d Fw_| d Fy_~ d F~`@ +d GD`@ d GI_~ d GJ_z d GJ_t d GI_p d GD_n d F?_n m GD`@ d GG_~ d GI_z +d GI_t d GG_p d GD_n m GD_n d GG_l d GJ_i d GL_e d GL__ d GJ_[ d GI_Y +d GD_W d F~_W d Fy_Y d Fw_[ d Fv__ d Fv_a d Fw_c d Fy_a d Fw__ m GI_j +d GJ_e d GJ__ d GI_[ d GG_Y d GD_W m Ft_I m G]`@ d GZ_l m GZ_l d G]_p +d Gb_r d Gg_r d Gl_p d Go_l d Gp_g d Gp_c d Go_] d Gl_Y d Gg_W d Gb_W +d G]_Y d G\_[ d GZ__ d GZ_a d G\_c d G]_a d G\__ m Gg_r d Gj_p d Gm_l +d Go_g d Go_c d Gm_] d Gj_Y d Gg_W m G]`@ d Gm`@ m G]_~ d Ge_~ d Gm`@ +m GY_I m G}`M m G}_I m H\`M m H\_I m II`@ d H~_I m IR`@ d IG_I m H~_j +d IS_j m H}__ d IR__ m H{_I m Fw^i d Fy^g d Fw^e d Fv^g d Fv^i d Fw^m +d Fy^o d F~^p d GD^p d GI^o d GJ^k d GJ^e d GI^a d GD^_ d F?^_ m GD^p +d GG^o d GI^k d GI^e d GG^a d GD^_ m GD^_ d GG^] d GJ^Y d GL^U d GL^O +d GJ^K d GI^J d GD^H d F~^H d Fy^J d Fw^K d Fv^O d Fv^Q d Fw^S d Fy^Q +d Fw^O m GI^[ d GJ^U d GJ^O d GI^K d GG^J d GD^H m Ft]z m Gm^k d Gl^i +d Gm^g d Go^i d Go^k d Gm^o d Gj^p d Ge^p d Ga^o d G]^k d G\^g d GZ^_ +d GZ^S d G\^M d G_^J d Gd^H d Gg^H d Gl^J d Go^M d Gp^S d Gp^U d Go^[ +d Gl^_ d Gg^a d Ge^a d Ga^_ d G]^[ d G\^U m Ge^p d Gb^o d G_^k d G]^g +d G\^_ d G\^S d G]^M d Ga^J d Gd^H m Gg^H d Gj^J d Gm^M d Go^S d Go^U +d Gm^[ d Gj^_ d Gg^a m GY]z m G}^~ m G}]z m H\^~ m H\]z m IE^x d IE^@ +m IK^x d IK^@ m IQ^k d IP^i d IQ^g d IS^i d IS^k d IP^o d IK^p d IE^p +d I@^o d H}^k d H}^g d H~^c d I@^a d IC^_ d IL^[ d IP^Y d IS^U m H}^g +d I@^c d IC^a d IL^] d IP^[ d IQ^Y d IS^U d IS^M d IP^J d IK^H d IE^H +d I@^J d H}^M d H}^O d H~^Q d I@^O d H~^M m H{]z m Fw]Y d Fy]W d Fw]U +d Fv]W d Fv]Y d Fw]] d Fy]_ d F~]a d GD]a d GI]_ d GJ][ d GJ]U d GI]R +d GD]P d F?]P m GD]a d GG]_ d GI][ d GI]U d GG]R d GD]P m GD]P d GG]N +d GJ]J d GL]F d GL]@ d GJ\| d GI\z d GD\x d F~\x d Fy\z d Fw\| d Fv]@ +d Fv]B d Fw]D d Fy]B d Fw]@ m GI]L d GJ]F d GJ]@ d GI\| d GG\z d GD\x +m Ft\k m GZ]a d GZ]U m GZ]Y d G\]] d G_]a d Gb]a d Gj][ d Gm][ d Go]] +d Gp]a m G\]] d G_]_ d Gb]_ d Gj][ m Gp]a d Gp][ d Go]U d Gi]L d Gg]H +d Ge]B d Ge\x m Go]U d Gg]L d Ge]H d Gd]B d Gd\x m GY\k m G}]o m G}\k +m H\]o m H\\k m IU]a d H|\x m IC]a d IF]] d IF]Y d IE]U d IB]S d H?]S +d H|]W d H|][ d H~]_ d IA]a d IC]a d IF]_ d IJ]] d IN]] d IR]_ d IU]a +m IP]F d IM]D d IK]@ d IK\| d IN\x d IQ\x d IT\z d IU\~ d IU]B d IR]F +d IP]F m H{\k m Fw\J d Fy\H d Fw\F d Fv\H d Fv\J d Fw\N d Fy\P d F~\R +d GD\R d GI\P d GJ\L d GJ\F d GI\B d GD\@ d F?\@ m GD\R d GG\P d GI\L +d GI\F d GG\B d GD\@ m GD\@ d GG[~ d GJ[{ d GL[w d GL[q d GJ[m d GI[k +d GD[i d F~[i d Fy[k d Fw[m d Fv[q d Fv[s d Fw[u d Fy[s d Fw[q m GI[| +d GJ[w d GJ[q d GI[m d GG[k d GD[i m Ft[[ m Gb\R d G]\P d G\\L d G\\F +d G]\B d Gb\@ d Gi\@ d Gm\B d Go\F d Go\L d Gm\P d Gi\R d Gb\R m Gb\R +d G_\P d G]\L d G]\F d G_\B d Gb\@ m Gi\@ d Gl\B d Gm\F d Gm\L d Gl\P +d Gi\R m Gb\@ d G][~ d G\[| d GZ[y d GZ[q d G\[m d G][k d Gb[i d Gi[i +d Gm[k d Go[m d Gp[q d Gp[y d Go[| d Gm[~ d Gi\@ m Gb\@ d G_[~ d G][| +d G\[y d G\[q d G][m d G_[k d Gb[i m Gi[i d Gl[k d Gm[m d Go[q d Go[y +d Gm[| d Gl[~ d Gi\@ m GY[[ m G}\_ m G}[[ m H\\_ m H\[[ m IT\B d IS\@ +d IT[~ d IU\@ d IU\B d IT\D d IS\D d IR\B d IP[~ d IN[u d IK[o d IH[k +d IF[i d IB[i d H~[k d H|[o d H|[u d H~[y d IF\@ d IH\D d IJ\H d IJ\L +d IH\P d IF\R d IC\P d IB\L d IB\H d IC\B d IF[| d IL[o d IO[k d IS[i +d IT[i d IU[k d IU[m m IB[i d H?[k d H~[o d H~[u d H?[y d IB[| m IB\H +d IC\D d IN[o d IP[k d IS[i m H{[[ m FwZ{ d FyZy d FwZw d FvZy d FvZ{ +d FwZ? d Fy[A d F~[C d GD[C d GI[A d GJZ} d GJZw d GIZs d GDZq d F?Zq +m GD[C d GG[A d GIZ} d GIZw d GGZs d GDZq m GDZq d GGZo d GJZk d GLZg +d GLZa d GJZ^ d GIZ\ d GDZZ d F~ZZ d FyZ\ d FwZ^ d FvZa d FvZc d FwZe +d FyZc d FwZa m GIZm d GJZg d GJZa d GIZ^ d GGZ\ d GDZZ m FtZL m GoZu +d GmZo d GjZk d GeZi d GdZi d G_Zk d G\Zo d GZZu d GZZw d G\Z} d G_[A +d Gd[C d Gg[C d Gl[A d GoZ} d GpZw d GpZk d GoZc d GmZ` d GjZ\ d GeZZ +d GaZZ d G]Z\ d G\Z` d G\Za d G]Zc d G_Za d G]Z` m GdZi d GaZk d G]Zo +d G\Zu d G\Zw d G]Z} +stroke +m G]Z} d Ga[A d Gd[C m Gg[C d Gj[A d GmZ} d GoZw d GoZk d GmZc d GlZ` +d GiZ\ d GeZZ m GYZL m G}[P m G}ZL m H\[P m H\ZL m ICZ? d I@[A d IC[C +d IF[A d IFZ} d ICZy d I@Zw m H{ZL m GDYo d GDYJ m GEYs d GEYJ m GEYs +d FtYV d GMYV m F?YJ d GJYJ m FtX} m GdYs d G_Yq d G\Yk d GZYb d GZY\ +d G\YR d G_YL d GdYJ d GgYJ d GlYL d GoYR d GpY\ d GpYb d GoYk d GlYq +d GgYs d GdYs m GdYs d GaYq d G_Yo d G]Yk d G\Yb d G\Y\ d G]YR d G_YN +d GaYL d GdYJ m GgYJ d GjYL d GlYN d GmYR d GoY\ d GoYb d GmYk d GlYo +d GjYq d GgYs m GYX} m G}ZA m G}X} m H\ZA m H\X} m INY{ d IJYw d IEYq +d IAYi d H?Y` d H?YX d IAYN d IEYF d IJYA d INX} m IJYw d IEYo d ICYi +d IAY` d IAYX d ICYN d IEYH d IJYA m H{X} m GDX` d GDW{ m GEXd d GEW{ +m GEXd d FtXG d GMXG m F?W{ d GJW{ m FtWm m G_X\ d GbX^ d GgXd d GgW{ +m GeXb d GeW{ m G_W{ d GmW{ m GYWm m G}Xq m G}Wm m H\Xq m H\Wm m H}Xl +d IAXh d IEXb d IJXZ d ILXP d ILXI d IJW? d IEWw d IAWq d H}Wm m IAXh +d IEX` d IHXZ d IJXP d IJXI d IHW? d IEWy d IAWq m H{Wm m GDWQ d GDVl +m GEWT d GEVl m GEWT d FtVw d GMVw m F?Vl d GJVl m FtV^ m G\WM d G]WK +d G\WI d GZWK d GZWM d G\WQ d G]WS d GbWT d GiWT d GmWS d GoWQ d GpWM +d GpWI d GoWE d GjWA d GbV} d G_V{ d G\Vw d GZVq d GZVl m GiWT d GlWS +d GmWQ d GoWM d GoWI d GmWE d GiWA d GbV} m GZVp d G\Vq d G_Vq d GgVn +d GlVn d GoVp d GpVq m G_Vq d GgVl d GmVl d GoVn d GpVq d GpVu m GYV^ +m G}Wb m G}V^ m H\Wb m H\V^ m H~WK d ISVp m ISWK d H~Vp m H{V^ m GDVA +d GDU\ m GEVE d GEU\ m GEVE d FtUh d GMUh m F?U\ d GJU\ m FtUO m G\U} +d G]U{ d G\Uy d GZU{ d GZU} d G\VA d G]VC d GbVE d GiVE d GmVC d GoU? +d GoUy d GmUv d GiUt d GdUt m GiVE d GlVC d GmU? d GmUy d GlUv d GiUt +m GiUt d GlUr d GoUn d GpUj d GpUd d GoU` d GmU^ d GiU\ d GbU\ d G]U^ +d G\U` d GZUd d GZUf d G\Uh d G]Uf d G\Ud m GmUp d GoUj d GoUd d GmU` +d GlU^ d GiU\ m GYUO m G}VS m G}UO m H\VS m H\UO m IIU} d IIU\ m H~Un +d ITUn m H~U\ d ITU\ m H{UO m GDTr d GDTM m GETv d GETM m GETv d FtTY +d GMTY m F?TM d GJTM m FtS? m GiTr d GiTM m GjTv d GjTM m GjTv d GYTY +d GrTY m GdTM d GoTM m GYS? m G}UC m G}S? m H\UC m H\S? m ITTU d IRTU +d IOTW d ILT[ d IHTb d IGTd d IDTf d IBTf d H?Td d H~T` d H~T] d H?TY +d IBTW d IDTW d IGTY d IHT[ d ILTb d IOTf d IRTh d ITTh m H{S? m GDSc +d GDR~ m GESf d GER~ m GESf d FtSI d GMSI m F?R~ d GJR~ m FtRp m G]Sf +d GZSS m GZSS d G]SW d GbSY d GgSY d GlSW d GoSS d GpSM d GpSI d GoSC +d GlS@ d GgR~ d GbR~ d G]S@ d G\SB d GZSE d GZSG d G\SI d G]SG d G\SE +m GgSY d GjSW d GmSS d GoSM d GoSI d GmSC d GjS@ d GgR~ m G]Sf d GmSf +m G]Se d GeSe d GmSf m GYRp m G}St m G}Rp m H\St m H\Rp m IIS_ d IIR~ +m H~S_ d ITS_ m H~SO d ITSO m H{Rp m GDRS d GDQn m GERW d GEQn m GERW +d FtQz d GMQz m F?Qn d GJQn m FtQa m GmRQ d GlRO d GmRM d GoRO d GoRQ +d GmRU d GjRW d GeRW d GaRU d G]RQ d G\RM d GZRF d GZQz d G\Qt d G_Qp +d GdQn d GgQn d GlQp d GoQt d GpQz d GpQ| d GoRB d GlRF d GgRH d GeRH +d GaRF d G]RB d G\Q| m GeRW d GbRU d G_RQ d G]RM d G\RF d G\Qz d G]Qt +d GaQp d GdQn m GgQn d GjQp d GmQt d GoQz d GoQ| d GmRB d GjRF d GgRH +m GYQa m G}Re m G}Qa m H\Re m H\Qa m ICQr d I@Qp d ICQn d IFQp d ICQr +m H{Qa m GDQD d GDP_ m GEQH d GEP_ m GEQH d FtPk d GMPk m F?P_ d GJP_ +m FtPQ m GZQH d GZP| m GZQ@ d G\QD d G_QH d GbQH d GjQB d GmQB d GoQD +d GpQH m G\QD d G_QF d GbQF d GjQB m GpQH d GpQB d GoP| d GiPr d GgPo +d GePi d GeP_ m GoP| d GgPr d GePo d GdPi d GdP_ m GYPQ m G}QU m G}PQ +m H\QU m H\PQ m IIQB d IHQ@ d IIP~ d IJQ@ d IIQB m H~Pq d IUPq m IIPc +d IHPa d IIP_ d IJPa d IIPc m H{PQ m GDOu d GDOP m GEOy d GEOP m GEOy +d FtO[ d GMO[ m F?OP d GJOP m FtOB m GbOy d G]Ow d G\Os d G\Om d G]Oi +d GbOg d GiOg d GmOi d GoOm d GoOs d GmOw d GiOy d GbOy m GbOy d G_Ow +d G]Os d G]Om d G_Oi d GbOg m GiOg d GlOi d GmOm d GmOs d GlOw d GiOy +m GbOg d G]Oe d G\Oc d GZO_ d GZOW d G\OT d G]OR d GbOP d GiOP d GmOR +d GoOT d GpOW d GpO_ d GoOc d GmOe d GiOg m GbOg d G_Oe d G]Oc d G\O_ +d G\OW d G]OT d G_OR d GbOP m GiOP d GlOR d GmOT d GoOW d GoO_ d GmOc +d GlOe d GiOg m GYOB m G}PF m G}OB m H\PF m H\OB m IFOy d IAOw d H~Oq +d H}Og d H}Oa d H~OW d IAOR d IFOP d IIOP d INOR d IQOW d ISOa d ISOg +d IQOq d INOw d IIOy d IFOy m IFOy d ICOw d IAOu d I@Oq d H~Og d H~Oa +d I@OW d IAOT d ICOR d IFOP m IIOP d ILOR d INOT d IPOW d IQOa d IQOg +d IPOq d INOu d ILOw d IIOy m H{OB m GDNe d GDN@ m GENi d GEN@ m GENi +d FtNL d GMNL m F?N@ d GJN@ m FtMs m GoN[ d GmNV d GjNR d GeNP d GdNP +d G_NR d G\NV d GZN[ d GZN] d G\Nc d G_Ng d GdNi d GgNi d GlNg d GoNc +d GpN] d GpNR d GoNJ d GmNF d GjNB d GeN@ d GaN@ d G]NB d G\NF d G\NH +d G]NJ d G_NH d G]NF m GdNP d GaNR d G]NV d G\N[ d G\N] d G]Nc d GaNg +d GdNi m GgNi d GjNg d GmNc d GoN] d GoNR d GmNJ d GlNF d GiNB d GeN@ +m GYMs m G}Nw m G}Ms m H\Nw m H\Ms m IANa d IENc d IINi d IIN@ m IHNg +d IHN@ m IAN@ d IPN@ m H{Ms m FyMZ d FvMF m FvMF d FyMJ d F~ML d GBML +d GGMJ d GJMF d GLMA d GLL} d GJLw d GGLs d GBLq d F~Lq d FyLs d FwLu +d FvLy d FvL{ d FwL} d FyL{ d FwLy m GBML d GEMJ d GIMF d GJMA d GJL} +d GILw d GELs d GBLq m FyMZ d GIMZ m FyMX d GAMX d GIMZ m FtLc m GdMZ +d G_MX d G\MR +stroke +m G\MR d GZMH d GZMC d G\Ly d G_Ls d GdLq d GgLq d GlLs d GoLy d GpMC +d GpMH d GoMR d GlMX d GgMZ d GdMZ m GdMZ d GaMX d G_MV d G]MR d G\MH +d G\MC d G]Ly d G_Lu d GaLs d GdLq m GgLq d GjLs d GlLu d GmLy d GoMC +d GoMH d GmMR d GlMV d GjMX d GgMZ m GYLc m G}Mg m G}Lc m H\Mg m H\Lc +m H~MR d I@MP d H~MN d H}MP d H}MR d H~MV d I@MX d IEMZ d IKMZ d IPMX +d IQMV d ISMR d ISMN d IQMJ d ILMF d IEMC d IAMA d H~L} d H}Lw d H}Lq +m IKMZ d INMX d IPMV d IQMR d IQMN d IPMJ d IKMF d IEMC m H}Lu d H~Lw +d IALw d IILs d INLs d IQLu d ISLw m IALw d IILq d IPLq d IQLs d ISLw +d ISL{ m H{Lc m FyLK d FvKw m FvKw d FyK{ d F~K} d GBK} d GGK{ d GJKw +d GLKq d GLKm d GJKg d GGKd d GBKb d F~Kb d FyKd d FwKf d FvKi d FvKk +d FwKm d FyKk d FwKi m GBK} d GEK{ d GIKw d GJKq d GJKm d GIKg d GEKd +d GBKb m FyLK d GILK m FyLI d GALI d GILK m FtKT m G_LC d GbLE d GgLK +d GgKb m GeLI d GeKb m G_Kb d GmKb m GYKT m G}LX m G}KT m H\LX m H\KT +m H~LC d I@LA d H~K? d H}LA d H}LC d H~LG d I@LI d IELK d IKLK d IPLI +d IQLE d IQK? d IPK{ d IKKy d IFKy m IKLK d INLI d IPLE d IPK? d INK{ +d IKKy m IKKy d INKw d IQKs d ISKo d ISKi d IQKf d IPKd d IKKb d IEKb +d I@Kd d H~Kf d H}Ki d H}Kk d H~Km d I@Kk d H~Ki m IPKu d IQKo d IQKi +d IPKf d INKd d IKKb m H{KT m FyJ{ d FvJh m FvJh d FyJl d F~Jn d GBJn +d GGJl d GJJh d GLJb d GLJ^ d GJJX d GGJT d GBJR d F~JR d FyJT d FwJV +d FvJZ d FvJ\ d FwJ^ d FyJ\ d FwJZ m GBJn d GEJl d GIJh d GJJb d GJJ^ +d GIJX d GEJT d GBJR m FyJ{ d GIJ{ m FyJy d GAJy d GIJ{ m FtJE m G\Js +d G]Jq d G\Jo d GZJq d GZJs d G\Jw d G]Jy d GbJ{ d GiJ{ d GmJy d GoJw +d GpJs d GpJo d GoJl d GjJh d GbJd d G_Jb d G\J^ d GZJX d GZJR m GiJ{ +d GlJy d GmJw d GoJs d GoJo d GmJl d GiJh d GbJd m GZJV d G\JX d G_JX +d GgJT d GlJT d GoJV d GpJX m G_JX d GgJR d GmJR d GoJT d GpJX d GpJ\ +m GYJE m G}KI m G}JE m H\KI m H\JE m IKJw d IKJR m ILJ{ d ILJR m ILJ{ +d H{J^ d ITJ^ m IFJR d IQJR m H{JE m FyIl d FvIX m FvIX d FyI\ d F~I^ +d GBI^ d GGI\ d GJIX d GLIS d GLIO d GJII d GGIE d GBIC d F~IC d FyIE +d FwIG d FvIK d FvIM d FwIO d FyIM d FwIK m GBI^ d GEI\ d GIIX d GJIS +d GJIO d GIII d GEIE d GBIC m FyIl d GIIl m FyIj d GAIj d GIIl m FtHu +m G\Id d G]Ib d G\I` d GZIb d GZId d G\Ih d G]Ij d GbIl d GiIl d GmIj +d GoIf d GoI` d GmI\ d GiIZ d GdIZ m GiIl d GlIj d GmIf d GmI` d GlI\ +d GiIZ m GiIZ d GlIX d GoIT d GpIQ d GpIK d GoIG d GmIE d GiIC d GbIC +d G]IE d G\IG d GZIK d GZIM d G\IO d G]IM d G\IK m GmIV d GoIQ d GoIK +d GmIG d GlIE d GiIC m GYHu m G}Iy m G}Hu m H\Iy m H\Hu m I@Il d H}IX +m H}IX d I@I\ d IEI^ d III^ d INI\ d IQIX d ISIS d ISIO d IQII d INIE +d IIIC d IEIC d I@IE d H~IG d H}IK d H}IM d H~IO d I@IM d H~IK m III^ +d ILI\ d IPIX d IQIS d IQIO d IPII d ILIE d IIIC m I@Il d IPIl m I@Ij +d IHIj d IPIl m H{Hu m FyH\ d FvHI m FvHI d FyHM d F~HO d GBHO d GGHM +d GJHI d GLHC d GLG? d GJGy d GGGv d GBGt d F~Gt d FyGv d FwGx d FvG{ +d FvG} d FwG? d FyG} d FwG{ m GBHO d GEHM d GIHI d GJHC d GJG? d GIGy +d GEGv d GBGt m FyH\ d GIH\ m FyH[ d GAH[ d GIH\ m FtGf m GiHY d GiGt +m GjH\ d GjGt m GjH\ d GYG? d GrG? m GdGt d GoGt m GYGf m G}Hj m G}Gf +m H\Hj m H\Gf m IPHW d INHU d IPHS d IQHU d IQHW d IPH[ d ILH\ d IHH\ +d ICH[ d I@HW d H~HS d H}HK d H}G? d H~Gy d IAGv d IFGt d IIGt d INGv +d IQGy d ISG? d ISHA d IQHG d INHK d IIHM d IHHM d ICHK d I@HG d H~HA +m IHH\ d IEH[ d IAHW d I@HS d H~HK d H~G? d I@Gy d ICGv d IFGt m IIGt +d ILGv d IPGy d IQG? d IQHA d IPHG d ILHK d IIHM m H{Gf m FyGM d FvFz +m FvFz d FyF~ d F~G@ d GBG@ d GGF~ d GJFz d GLFt d GLFp d GJFj d GGFf +d GBFd d F~Fd d FyFf d FwFh d FvFl d FvFn d FwFp d FyFn d FwFl m GBG@ +d GEF~ d GIFz d GJFt d GJFp d GIFj d GEFf d GBFd m FyGM d GIGM m FyGK +d GAGK d GIGM m FtFW m G]GM d GZFz m GZFz d G]F~ d GbG@ d GgG@ d GlF~ +d GoFz d GpFt d GpFp d GoFj d GlFf d GgFd d GbFd d G]Ff d G\Fh d GZFl +d GZFn d G\Fp d G]Fn d G\Fl m GgG@ d GjF~ d GmFz d GoFt d GoFp d GmFj +d GjFf d GgFd m G]GM d GmGM m G]GK d GeGK d GmGM m GYFW m G}G[ m G}FW +m H\G[ m H\FW m H}GM d H}GA m H}GE d H~GI d IAGM d IEGM d ILGG d IPGG +d IQGI d ISGM m H~GI d IAGK d IEGK d ILGG m ISGM d ISGG d IQGA d IKFx +d IIFt d IHFn d IHFd m IQGA d IIFx d IHFt d IFFn d IFFd m H{FW m RTcn +d RQcZ m RQcZ d RTc^ d RYc` d R^c` d Rbc^ d RfcZ d RgcU d RgcQ d RfcK +d RbcG d R^cE d RYcE d RTcG d RRcI d RQcM d RQcO d RRcQ d RTcO d RRcM +m R^c` d Rac^ d RdcZ d RfcU d RfcQ d RdcK d RacG d R^cE m RTcn d Rdcn +m RTcl d R\cl d Rdcn m RObw m SIch d SGcf d SIcd d SJcf d SJch d SIcl +d SEcn d SAcn d R|cl d Rych d Rwcd d Rvc\ d RvcQ d RwcK d RzcG d R?cE +d SBcE d SGcG d SJcK d SLcQ +stroke +m SLcQ d SLcS d SJcX d SGc\ d SBc^ d SAc^ d R|c\ d RycX d RwcS m SAcn +d R~cl d Rzch d Rycd d Rwc\ d RwcQ d RycK d R|cG d R?cE m SBcE d SEcG +d SIcK d SJcQ d SJcS d SIcX d SEc\ d SBc^ m Rtbw m SYc{ m SYbw m Sxc{ +m Sxbw m T`cn d T[cl d TZch d TZcb d T[c^ d T`c\ d Tfc\ d Tkc^ d Tmcb +d Tmch d Tkcl d Tfcn d T`cn m T`cn d T]cl d T[ch d T[cb d T]c^ d T`c\ +m Tfc\ d Tic^ d Tkcb d Tkch d Ticl d Tfcn m T`c\ d T[cZ d TZcX d TXcU +d TXcM d TZcI d T[cG d T`cE d TfcE d TkcG d TmcI d TncM d TncU d TmcX +d TkcZ d Tfc\ m T`c\ d T]cZ d T[cX d TZcU d TZcM d T[cI d T]cG d T`cE +m TfcE d TicG d TkcI d TmcM d TmcU d TkcX d TicZ d Tfc\ m TVbw m RTb^ +d RQbK m RQbK d RTbO d RYbQ d R^bQ d RbbO d RfbK d RgbE d RgbA d Rfa{ +d Rbax d R^av d RYav d RTax d RRaz d RQa} d RQa? d RRbA d RTa? d RRa} +m R^bQ d RabO d RdbK d RfbE d RfbA d Rda{ d Raax d R^av m RTb^ d Rdb^ +m RTb] d R\b] d Rdb^ m ROah m Rvb^ d RvbS m RvbW d Rwb[ d Rzb^ d R~b^ +d SEbY d SIbY d SJb[ d SLb^ m Rwb[ d Rzb] d R~b] d SEbY m SLb^ d SLbY +d SJbS d SDbI d SBbE d SAa? d SAav m SJbS d SBbI d SAbE d R?a? d R?av +m Rtah m SYbl m SYah m Sxbl m Sxah m TmbQ d TkbK d ThbG d TcbE d TbbE +d T]bG d TZbK d TXbQ d TXbS d TZbY d T]b] d Tbb^ d Teb^ d Tib] d TmbY +d TnbS d TnbG d Tma? d Tka{ d Thax d Tcav d T^av d T[ax d TZa{ d TZa} +d T[a? d T]a} d T[a{ m TbbE d T^bG d T[bK d TZbQ d TZbS d T[bY d T^b] +d Tbb^ m Teb^ d Thb] d TkbY d TmbS d TmbG d Tka? d Tia{ d Tfax d Tcav +m TVah m RTaO d RQ`| m RQ`| d RTa@ d RYaB d R^aB d Rba@ d Rf`| d Rg`v +d Rg`r d Rf`l d Rb`h d R^`f d RY`f d RT`h d RR`j d RQ`n d RQ`p d RR`r +d RT`p d RR`n m R^aB d Raa@ d Rd`| d Rf`v d Rf`r d Rd`l d Ra`h d R^`f +m RTaO d RdaO m RTaM d R\aM d RdaO m RO`Y m R~aO d RyaM d RwaI d RwaC +d Rya@ d R~`~ d SD`~ d SIa@ d SJaC d SJaI d SIaM d SDaO d R~aO m R~aO +d RzaM d RyaI d RyaC d Rza@ d R~`~ m SD`~ d SGa@ d SIaC d SIaI d SGaM +d SDaO m R~`~ d Ry`| d Rw`z d Rv`v d Rv`n d Rw`j d Ry`h d R~`f d SD`f +d SI`h d SJ`j d SL`n d SL`v d SJ`z d SI`| d SD`~ m R~`~ d Rz`| d Ry`z +d Rw`v d Rw`n d Ry`j d Rz`h d R~`f m SD`f d SG`h d SI`j d SJ`n d SJ`v +d SI`z d SG`| d SD`~ m Rt`Y m SYa] m SY`Y m Sxa] m Sx`Y m TpaU d ToaS +d TpaQ d TraS d TraU d TpaW d TnaW d TkaU d ThaQ d TgaM d TeaG d Tda@ +d Ta`h d T``a d T_`] m TjaS d ThaO d TgaG d Td`p d Tc`h d Ta`b d T``_ +d T]`[ d T[`Y d TX`Y d TV`[ d TV`] d TX`_ d TY`] d TX`[ m TV`Y m RT`@ +d RQ_l m RQ_l d RT_p d RY_r d R^_r d Rb_p d Rf_l d Rg_g d Rg_c d Rf_] +d Rb_Y d R^_W d RY_W d RT_Y d RR_[ d RQ__ d RQ_a d RR_c d RT_a d RR__ +m R^_r d Ra_p d Rd_l d Rf_g d Rf_c d Rd_] d Ra_Y d R^_W m RT`@ d Rd`@ +m RT_~ d R\_~ d Rd`@ m RO_I m SJ_r d SI_l d SE_i d SA_g d R?_g d Rz_i +d Rw_l d Rv_r d Rv_t d Rw_z d Rz_~ d R?`@ d SB`@ d SG_~ d SJ_z d SL_t +d SL_i d SJ_a d SI_] d SE_Y d SA_W d R|_W d Ry_Y d Rw_] d Rw__ d Ry_a +d Rz__ d Ry_] m R?_g d R|_i d Ry_l d Rw_r d Rw_t d Ry_z d R|_~ d R?`@ +m SB`@ d SE_~ d SI_z d SJ_t d SJ_i d SI_a d SG_] d SD_Y d SA_W m Rt_I +m SY`M m SY_I m Sx`M m Sx_I m T^_r d T\_p d T^_n d Ta_p d T^_r m T^_W +d T\_Y d T^_[ d Ta_Y d Ta_U d T^_Q d T\_O m TV_I m Rd^k d Rb^i d Rd^g +d Rf^i d Rf^k d Rd^o d Ra^p d R\^p d RW^o d RT^k d RR^g d RQ^_ d RQ^S +d RR^M d RV^J d RZ^H d R^^H d Rb^J d Rf^M d Rg^S d Rg^U d Rf^[ d Rb^_ +d R^^a d R\^a d RW^_ d RT^[ d RR^U m R\^p d RY^o d RV^k d RT^g d RR^_ +d RR^S d RT^M d RW^J d RZ^H m R^^H d Ra^J d Rd^M d Rf^S d Rf^U d Rd^[ +d Ra^_ d R^^a m RO]z m R?^p d Rz^o d Rw^i d Rv^_ d Rv^Y d Rw^O d Rz^J +d R?^H d SB^H d SG^J d SJ^O d SL^Y d SL^_ d SJ^i d SG^o d SB^p d R?^p +m R?^p d R|^o d Rz^m d Ry^i d Rw^_ d Rw^Y d Ry^O d Rz^K d R|^J d R?^H +m SB^H d SE^J d SG^K d SI^O d SJ^Y d SJ^_ d SI^i d SG^m d SE^o d SB^p +m Rt]z m SY^~ m SY]z m Sx^~ m Sx]z m To^p d TY^c d To^U m TY^Q d To^Q +m TY^H d To^H m TV]z m Rd][ d Rb]Y d Rd]W d Rf]Y d Rf][ d Rd]_ d Ra]a +d R\]a d RW]_ d RT][ d RR]W d RQ]P d RQ]D d RR\~ d RV\z d RZ\x d R^\x +d Rb\z d Rf\~ d Rg]D d Rg]F d Rf]L d Rb]P d R^]R d R\]R d RW]P d RT]L +d RR]F m R\]a d RY]_ d RV][ d RT]W d RR]P d RR]D d RT\~ d RW\z d RZ\x +m R^\x d Ra\z d Rd\~ d Rf]D d Rf]F d Rd]L d Ra]P d R^]R m RO\k m Rz]Y +d R~][ d SB]a d SB\x m SA]_ d SA\x m Rz\x d SI\x m Rt\k m SY]o m SY\k +m Sx]o m Sx\k m TY]S d Tp]S m TY]J d Tp]J m TY]@ d Tp]@ m TV\k m Rd\L +d Rb\J d Rd\H d Rf\J d Rf\L d Rd\P d Ra\R d R\\R d RW\P d RT\L d RR\H +d RQ\@ d RQ[u d RR[o d RV[k d RZ[i d R^[i d Rb[k d Rf[o d Rg[u d Rg[w +d Rf[| d Rb\@ d R^\B d R\\B d RW\@ d RT[| d RR[w m R\\R d RY\P +stroke +m RY\P d RV\L d RT\H d RR\@ d RR[u d RT[o d RW[k d RZ[i m R^[i d Ra[k +d Rd[o d Rf[u d Rf[w d Rd[| d Ra\@ d R^\B m RO[[ m Rw\J d Ry\H d Rw\F +d Rv\H d Rv\J d Rw\N d Ry\P d R~\R d SD\R d SI\P d SJ\N d SL\J d SL\F +d SJ\B d SE[~ d R~[{ d Rz[y d Rw[u d Rv[o d Rv[i m SD\R d SG\P d SI\N +d SJ\J d SJ\F d SI\B d SD[~ d R~[{ m Rv[m d Rw[o d Rz[o d SB[k d SG[k +d SJ[m d SL[o m Rz[o d SB[i d SI[i d SJ[k d SL[o d SL[s m Rt[[ m SY\_ +m SY[[ m Sx\_ m Sx[[ m TY\R d To\D d TY[w m TY[s d To[s m TY[i d To[i +m TV[[ m RdZ} d RbZ{ d RdZy d RfZ{ d RfZ} d Rd[A d Ra[C d R\[C d RW[A +d RTZ} d RRZy d RQZq d RQZe d RRZ` d RVZ\ d RZZZ d R^ZZ d RbZ\ d RfZ` +d RgZe d RgZg d RfZm d RbZq d R^Zs d R\Zs d RWZq d RTZm d RRZg m R\[C +d RY[A d RVZ} d RTZy d RRZq d RRZe d RTZ` d RWZ\ d RZZZ m R^ZZ d RaZ\ +d RdZ` d RfZe d RfZg d RdZm d RaZq d R^Zs m ROZL m RwZ{ d RyZy d RwZw +d RvZy d RvZ{ d RwZ? d Ry[A d R~[C d SD[C d SI[A d SJZ} d SJZw d SIZs +d SDZq d R?Zq m SD[C d SG[A d SIZ} d SIZw d SGZs d SDZq m SDZq d SGZo +d SJZk d SLZg d SLZa d SJZ^ d SIZ\ d SDZZ d R~ZZ d RyZ\ d RwZ^ d RvZa +d RvZc d RwZe d RyZc d RwZa m SIZm d SJZg d SJZa d SIZ^ d SGZ\ d SDZZ +m RtZL m SY[P m SYZL m Sx[P m SxZL m TmZ} d T[ZZ m TYZq d TpZq m TYZe +d TpZe m TVZL m RdYm d RbYk d RdYi d RfYk d RfYm d RdYq d RaYs d R\Ys +d RWYq d RTYm d RRYi d RQYb d RQYV d RRYP d RVYL d RZYJ d R^YJ d RbYL +d RfYP d RgYV d RgYX d RfY^ d RbYb d R^Yd d R\Yd d RWYb d RTY^ d RRYX +m R\Ys d RYYq d RVYm d RTYi d RRYb d RRYV d RTYP d RWYL d RZYJ m R^YJ +d RaYL d RdYP d RfYV d RfYX d RdY^ d RaYb d R^Yd m ROX} m SDYo d SDYJ +m SEYs d SEYJ m SEYs d RtYV d SMYV m R?YJ d SJYJ m RtX} m SYZA m SYX} +m SxZA m SxX} m TjYd d TiYg d TgYi d TcYi d T`Yg d T_Ye d T^Y` d T^YZ +d T_YV d TbYT d TeYT d ThYV d TiYZ m TcYi d T`Ye d T_Y` d T_YZ d T`YV +d TbYT m TjYi d TiYZ d TiYV d TlYT d TnYT d TpYX d TrY^ d TrYb d TpYg +d ToYk d TmYo d TjYq d TgYs d TcYs d T_Yq d T]Yo d TZYk d TYYg d TXYb +d TXY\ d TYYV d TZYR d T]YN d T_YL d TcYJ d TgYJ d TjYL d TmYN d TnYP +m TlYi d TjYZ d TjYV d TlYT m TVX} m RdX^ d RbX\ d RdXZ d RfX\ d RfX^ +d RdXb d RaXd d R\Xd d RWXb d RTX^ d RRXZ d RQXR d RQXG d RRXA d RVW} +d RZW{ d R^W{ d RbW} d RfXA d RgXG d RgXI d RfXN d RbXR d R^XT d R\XT +d RWXR d RTXN d RRXI m R\Xd d RYXb d RVX^ d RTXZ d RRXR d RRXG d RTXA +d RWW} d RZW{ m R^W{ d RaW} d RdXA d RfXG d RfXI d RdXN d RaXR d R^XT +m ROWm m RyXd d RvXP m RvXP d RyXT d R~XV d SBXV d SGXT d SJXP d SLXK +d SLXG d SJXA d SGW} d SBW{ d R~W{ d RyW} d RwW? d RvXC d RvXE d RwXG +d RyXE d RwXC m SBXV d SEXT d SIXP d SJXK d SJXG d SIXA d SEW} d SBW{ +m RyXd d SIXd m RyXb d SAXb d SIXd m RtWm m SYXq m SYWm m SxXq m SxWm +m TbX^ d TXW{ m TeX^ d TnW{ m TcX^ d TmW{ m T[XG d TiXG m TVW{ d T^W{ +m ThW{ d TqW{ m TbXl d T^Xj d T]Xf d T]Xb d T^X^ d TbX\ d TeX\ d ThX^ +d TiXb d TiXf d ThXj d TeXl d TbXl m TVWm m RdWO d RbWM d RdWK d RfWM +d RfWO d RdWS d RaWT d R\WT d RWWS d RTWO d RRWK d RQWC d RQVw d RRVq +d RVVn d RZVl d R^Vl d RbVn d RfVq d RgVw d RgVy d RfV? d RbWC d R^WE +d R\WE d RWWC d RTV? d RRVy m R\WT d RYWS d RVWO d RTWK d RRWC d RRVw +d RTVq d RWVn d RZVl m R^Vl d RaVn d RdVq d RfVw d RfVy d RdV? d RaWC +d R^WE m ROV^ m SIWO d SGWM d SIWK d SJWM d SJWO d SIWS d SEWT d SAWT +d R|WS d RyWO d RwWK d RvWC d RvVw d RwVq d RzVn d R?Vl d SBVl d SGVn +d SJVq d SLVw d SLVy d SJV? d SGWC d SBWE d SAWE d R|WC d RyV? d RwVy +m SAWT d R~WS d RzWO d RyWK d RwWC d RwVw d RyVq d R|Vn d R?Vl m SBVl +d SEVn d SIVq d SJVw d SJVy d SIV? d SEWC d SBWE m RtV^ m SYWb m SYV^ +m SxWb m SxV^ m TqV{ d TpVw d TmVu d TjVu d ThVw d TfVy d TbWA d TaWC +d T^WE d T\WE d TYWC d TXV? d TXV{ d TYVw d T\Vu d T^Vu d TaVw d TbVy +d TfWA d ThWC d TjWE d TmWE d TpWC d TqV? d TqV{ m TVV^ m RdU? d RbU} +d RdU{ d RfU} d RfU? d RdVC d RaVE d R\VE d RWVC d RTU? d RRU{ d RQUt +d RQUh d RRUb d RVU^ d RZU\ d R^U\ d RbU^ d RfUb d RgUh d RgUj d RfUp +d RbUt d R^Uv d R\Uv d RWUt d RTUp d RRUj m R\VE d RYVC d RVU? d RTU{ +d RRUt d RRUh d RTUb d RWU^ d RZU\ m R^U\ d RaU^ d RdUb d RfUh d RfUj +d RdUp d RaUt d R^Uv m ROUO m RvVE d RvUy m RvU} d RwVA d RzVE d R~VE +d SEU? d SIU? d SJVA d SLVE m RwVA d RzVC d R~VC d SEU? m SLVE d SLU? +d SJUy d SDUp d SBUl d SAUf d SAU\ m SJUy d SBUp d SAUl d R?Uf d R?U\ +m RtUO m SYVS m SYUO m SxVS m SxUO m TVVS m TVUO m RdTp d RbTn d RdTl +d RfTn d RfTp d RdTt d RaTv d R\Tv d RWTt d RTTp d RRTl d RQTd d RQTY +d RRTS d RVTO d RZTM d R^TM d RbTO d RfTS d RgTY +stroke +m RgTY d RgT[ d RfT` d RbTd d R^Tf d R\Tf d RWTd d RTT` d RRT[ m R\Tv +d RYTt d RVTp d RTTl d RRTd d RRTY d RTTS d RWTO d RZTM m R^TM d RaTO +d RdTS d RfTY d RfT[ d RdT` d RaTd d R^Tf m ROS? m R~Tv d RyTt d RwTp +d RwTj d RyTf d R~Td d SDTd d SITf d SJTj d SJTp d SITt d SDTv d R~Tv +m R~Tv d RzTt d RyTp d RyTj d RzTf d R~Td m SDTd d SGTf d SITj d SITp +d SGTt d SDTv m R~Td d RyTb d RwT` d RvT] d RvTU d RwTQ d RyTO d R~TM +d SDTM d SITO d SJTQ d SLTU d SLT] d SJT` d SITb d SDTd m R~Td d RzTb +d RyT` d RwT] d RwTU d RyTQ d RzTO d R~TM m SDTM d SGTO d SITQ d SJTU +d SJT] d SIT` d SGTb d SDTd m RtS? m SYUC m SYS? m SxUC m SxS? m TcTv +d TVTM m TcTv d TpTM m TcTp d TnTM m TXTO d TnTO m TVTM d TpTM m TVS? +m RdSa d RbS_ d RdS] d RfS_ d RfSa d RdSe d RaSf d R\Sf d RWSe d RTSa +d RRS] d RQSU d RQSI d RRSC d RVS@ d RZR~ d R^R~ d RbS@ d RfSC d RgSI +d RgSK d RfSQ d RbSU d R^SW d R\SW d RWSU d RTSQ d RRSK m R\Sf d RYSe +d RVSa d RTS] d RRSU d RRSI d RTSC d RWS@ d RZR~ m R^R~ d RaS@ d RdSC +d RfSI d RfSK d RdSQ d RaSU d R^SW m RORp m SJSY d SISS d SESO d SASM +d R?SM d RzSO d RwSS d RvSY d RvS[ d RwSa d RzSe d R?Sf d SBSf d SGSe +d SJSa d SLS[ d SLSO d SJSG d SISC d SES@ d SAR~ d R|R~ d RyS@ d RwSC +d RwSE d RySG d RzSE d RySC m R?SM d R|SO d RySS d RwSY d RwS[ d RySa +d R|Se d R?Sf m SBSf d SESe d SISa d SJS[ d SJSO d SISG d SGSC d SDS@ +d SAR~ m RtRp m SYSt m SYRp m SxSt m SxRp m ToS_ d TeS_ d T`S] d T]S[ +d T[SW d TYSQ d TYSM d T[SG d T]SC d T`SB d TeS@ d ToS@ m TYSO d TjSO +m TVRp m RQRW d RQRK m RQRO d RRRS d RVRW d RYRW d RaRQ d RdRQ d RfRS +d RgRW m RRRS d RVRU d RYRU d RaRQ m RgRW d RgRQ d RfRK d R_RB d R^Q~ +d R\Qx d R\Qn m RfRK d R^RB d R\Q~ d RZQx d RZQn m ROQa m R?RW d RzRU +d RwRO d RvRF d RvR@ d RwQv d RzQp d R?Qn d SBQn d SGQp d SJQv d SLR@ +d SLRF d SJRO d SGRU d SBRW d R?RW m R?RW d R|RU d RzRS d RyRO d RwRF +d RwR@ d RyQv d RzQr d R|Qp d R?Qn m SBQn d SEQp d SGQr d SIQv d SJR@ +d SJRF d SIRO d SGRS d SERU d SBRW m RtQa m SYRe m SYQa m SxRe m SxQa +m TcRW d TcQn m TdRW d TdQn m T`RM d T[RK d TYRJ d TXRF d TXR@ d TYQ| +d T[Qz d T`Qx d TgQx d TlQz d TmQ| d ToR@ d ToRF d TmRJ d TlRK d TgRM +d T`RM m T`RM d T\RK d T[RJ d TYRF d TYR@ d T[Q| d T\Qz d T`Qx m TgQx +d TjQz d TlQ| d TmR@ d TmRF d TlRJ d TjRK d TgRM m T^RW d TiRW m T^Qn +d TiQn m TVQa m RQQH d RQP| m RQQ@ d RRQD d RVQH d RYQH d RaQB d RdQB +d RfQD d RgQH m RRQD d RVQF d RYQF d RaQB m RgQH d RgQB d RfP| d R_Pr +d R^Po d R\Pi d R\P_ m RfP| d R^Pr d R\Po d RZPi d RZP_ m ROPQ m RzQ@ +d R~QB d SBQH d SBP_ m SAQF d SAP_ m RzP_ d SIP_ m RtPQ m SYQU m SYPQ +m SxQU m SxPQ m T\QH d T\P_ m T]QH d T]P_ m TVQH d TpQH d TpP| d ToQH +m TVP_ d TbP_ m TVPQ m RQOy d RQOm m RQOq d RROu d RVOy d RYOy d RaOs +d RdOs d RfOu d RgOy m RROu d RVOw d RYOw d RaOs m RgOy d RgOs d RfOm +d R_Oc d R^O_ d R\OY d R\OP m RfOm d R^Oc d R\O_ d RZOY d RZOP m ROOB +m RwOq d RyOo d RwOm d RvOo d RvOq d RwOu d RyOw d R~Oy d SDOy d SIOw +d SJOu d SLOq d SLOm d SJOi d SEOe d R~Oa d RzO_ d RwO[ d RvOV d RvOP +m SDOy d SGOw d SIOu d SJOq d SJOm d SIOi d SDOe d R~Oa m RvOT d RwOV +d RzOV d SBOR d SGOR d SJOT d SLOV m RzOV d SBOP d SIOP d SJOR d SLOV +d SLOY m RtOB m SYPF m SYOB m SxPF m SxOB m TdP@ d TYOB m TmP@ d TcOB +m TYOg d ToOg m TXO[ d TmO[ m TVOB m RQNi d RQN] m RQNa d RRNe d RVNi +d RYNi d RaNc d RdNc d RfNe d RgNi m RRNe d RVNg d RYNg d RaNc m RgNi +d RgNc d RfN] d R_NT d R^NP d R\NJ d R\N@ m RfN] d R^NT d R\NP d RZNJ +d RZN@ m ROMs m RwNa d RyN_ d RwN] d RvN_ d RvNa d RwNe d RyNg d R~Ni +d SDNi d SINg d SJNc d SJN] d SINZ d SDNX d R?NX m SDNi d SGNg d SINc +d SIN] d SGNZ d SDNX m SDNX d SGNV d SJNR d SLNN d SLNH d SJND d SINB +d SDN@ d R~N@ d RyNB d RwND d RvNH d RvNJ d RwNL d RyNJ d RwNH m SINT +d SJNN d SJNH d SIND d SGNB d SDN@ m RtMs m SYNw m SYMs m SxNw m SxMs +m T[Nq d T[Ms m TgNq d TgMs m TVMs m RQMZ d RQMN m RQMR d RRMV d RVMZ +d RYMZ d RaMT d RdMT d RfMV d RgMZ m RRMV d RVMX d RYMX d RaMT m RgMZ +d RgMT d RfMN d R_MD d R^MA d R\L{ d R\Lq m RfMN d R^MD d R\MA d RZL{ +d RZLq m ROLc m SDMV d SDLq m SEMZ d SELq m SEMZ d RtL} d SML} m R?Lq +d SJLq m RtLc m SYMg m SYLc m SxMg m SxLc m TVMZ d TcLq m TXMZ d TcLu +m TpMZ d TcLq m TVMZ d TpMZ m TXMX d TnMX m TVLc m RQLK d RQK? m RQLC +d RRLG d RVLK d RYLK d RaLE d RdLE d RfLG d RgLK m RRLG d RVLI d RYLI +d RaLE m RgLK d RgLE d RfK? d R_Ku d R^Kq d R\Kk d R\Kb m RfK? d R^Ku +d R\Kq d RZKk d RZKb m ROKT m RyLK d RvKw m RvKw d RyK{ d R~K} d SBK} +d SGK{ d SJKw d SLKq d SLKm d SJKg d SGKd d SBKb d R~Kb d RyKd d RwKf +d RvKi d RvKk d RwKm d RyKk d RwKi m SBK} d SEK{ d SIKw d SJKq d SJKm +d SIKg d SEKd d SBKb m RyLK d SILK m RyLI d SALI d SILK m RtKT m SYLX +m SYKT m SxLX m SxKT m TVLX m TVKT m RQJ{ d RQJo m RQJs d RRJw d RVJ{ +d RYJ{ d RaJu d RdJu d RfJw d RgJ{ m RRJw d RVJy d RYJy d RaJu m RgJ{ +d RgJu +stroke +m RgJu d RfJo d R_Jf d R^Jb d R\J\ d R\JR m RfJo d R^Jf d R\Jb d RZJ\ +d RZJR m ROJE m SIJu d SGJs d SIJq d SJJs d SJJu d SIJy d SEJ{ d SAJ{ +d R|Jy d RyJu d RwJq d RvJj d RvJ^ d RwJX d RzJT d R?JR d SBJR d SGJT +d SJJX d SLJ^ d SLJ` d SJJf d SGJj d SBJl d SAJl d R|Jj d RyJf d RwJ` +m SAJ{ d R~Jy d RzJu d RyJq d RwJj d RwJ^ d RyJX d R|JT d R?JR m SBJR +d SEJT d SIJX d SJJ^ d SJJ` d SIJf d SEJj d SBJl m RtJE m SYKI m SYJE +m SxKI m SxJE m TcJ{ d TXJR m TcJ{ d TnJR m TcJu d TmJR m TVJR d T^JR +m ThJR d TqJR m TVJE m RQIl d RQI` m RQId d RRIh d RVIl d RYIl d RaIf +d RdIf d RfIh d RgIl m RRIh d RVIj d RYIj d RaIf m RgIl d RgIf d RfI` +d R_IV d R^IS d R\IM d R\IC m RfI` d R^IV d R\IS d RZIM d RZIC m ROHu +m RvIl d RvI` m RvId d RwIh d RzIl d R~Il d SEIf d SIIf d SJIh d SLIl +m RwIh d RzIj d R~Ij d SEIf m SLIl d SLIf d SJI` d SDIV d SBIS d SAIM +d SAIC m SJI` d SBIV d SAIS d R?IM d R?IC m RtHu m SYIy m SYHu m SxIy +m SxHu m T^I` d TbIf d TeI` m TXIZ d TbId d TkIZ m TbId d TbIC m TVHu +m RQH\ d RQHQ m RQHU d RRHY d RVH\ d RYH\ d RaHW d RdHW d RfHY d RgH\ +m RRHY d RVH[ d RYH[ d RaHW m RgH\ d RgHW d RfHQ d R_HG d R^HC d R\G} +d R\Gt m RfHQ d R^HG d R\HC d RZG} d RZGt m ROGf m R~H\ d RyH[ d RwHW +d RwHQ d RyHM d R~HK d SDHK d SIHM d SJHQ d SJHW d SIH[ d SDH\ d R~H\ +m R~H\ d RzH[ d RyHW d RyHQ d RzHM d R~HK m SDHK d SGHM d SIHQ d SIHW +d SGH[ d SDH\ m R~HK d RyHI d RwHG d RvHC d RvG{ d RwGx d RyGv d R~Gt +d SDGt d SIGv d SJGx d SLG{ d SLHC d SJHG d SIHI d SDHK m R~HK d RzHI +d RyHG d RwHC d RwG{ d RyGx d RzGv d R~Gt m SDGt d SGGv d SIGx d SJG{ +d SJHC d SIHG d SGHI d SDHK m RtGf m SYHj m SYGf m SxHj m SxGf m T^Gy +d TbGt d TeGy m TXG? d TbGv d TkG? m TbHW d TbGv m TVGf m RQGM d RQGA +m RQGE d RRGI d RVGM d RYGM d RaGG d RdGG d RfGI d RgGM m RRGI d RVGK +d RYGK d RaGG m RgGM d RgGG d RfGA d R_Fx d R^Ft d R\Fn d R\Fd m RfGA +d R^Fx d R\Ft d RZFn d RZFd m ROFW m SJG@ d SIFz d SEFv d SAFt d R?Ft +d RzFv d RwFz d RvG@ d RvGA d RwGG d RzGK d R?GM d SBGM d SGGK d SJGG +d SLGA d SLFv d SJFn d SIFj d SEFf d SAFd d R|Fd d RyFf d RwFj d RwFl +d RyFn d RzFl d RyFj m R?Ft d R|Fv d RyFz d RwG@ d RwGA d RyGG d R|GK +d R?GM m SBGM d SEGK d SIGG d SJGA d SJFv d SIFn d SGFj d SDFf d SAFd +m RtFW m SYG[ m SYFW m SxG[ m SxFW m TbGM d T^GK d T[GG d TYGC d TXF| +d TXFv d TYFn d T[Fj d T^Ff d TbFd d TeFd d TiFf d TlFj d TnFn d ToFv +d ToF| d TnGC d TlGG d TiGK d TeGM d TbGM m TbGM d T_GK d T\GG d T[GC +d TYF| d TYFv d T[Fn d T\Fj d T_Ff d TbFd m TeFd d ThFf d TkFj d TlFn +d TnFv d TnF| d TlGC d TkGG d ThGK d TeGM m TVFW m ]Kc{ m ]Kbw m ]scn +d ]ocl d ]mch d ]mcb d ]oc^ d ]sc\ d ]zc\ d ]~c^ d ^@cb d ^@ch d ]~cl +d ]zcn d ]scn m ]scn d ]pcl d ]och d ]ocb d ]pc^ d ]sc\ m ]zc\ d ]}c^ +d ]~cb d ]~ch d ]}cl d ]zcn m ]sc\ d ]ocZ d ]mcX d ]kcU d ]kcM d ]mcI +d ]ocG d ]scE d ]zcE d ]~cG d ^@cI d ^BcM d ^BcU d ^@cX d ]~cZ d ]zc\ +m ]sc\ d ]pcZ d ]ocX d ]mcU d ]mcM d ]ocI d ]pcG d ]scE m ]zcE d ]}cG +d ]~cI d ^@cM d ^@cU d ]~cX d ]}cZ d ]zc\ m ]jbw m ^Zcn d ^Ucl d ^Rcf +d ^Pc\ d ^PcV d ^RcM d ^UcG d ^ZcE d ^]cE d ^bcG d ^ecM d ^fcV d ^fc\ +d ^ecf d ^bcl d ^]cn d ^Zcn m ^Zcn d ^Vcl d ^Ucj d ^Scf d ^Rc\ d ^RcV +d ^ScM d ^UcI d ^VcG d ^ZcE m ^]cE d ^`cG d ^bcI d ^ccM d ^ecV d ^ec\ +d ^ccf d ^bcj d ^`cl d ^]cn m ^Obw m ^sc{ m ^sbw m _Rc{ m _Rbw m _ucn +d _ucE m _vcn d _vcE m `Gcn d `GcE m `Hcn d `HcE m _qcn d `Lcn m _qcE +d _zcE m `CcE d `LcE m _qbw m ]Kbl m ]Kah m ]sb^ d ]ob] d ]mbY d ]mbS +d ]obO d ]sbM d ]zbM d ]~bO d ^@bS d ^@bY d ]~b] d ]zb^ d ]sb^ m ]sb^ +d ]pb] d ]obY d ]obS d ]pbO d ]sbM m ]zbM d ]}bO d ]~bS d ]~bY d ]}b] +d ]zb^ m ]sbM d ]obK d ]mbI d ]kbE d ]ka} d ]maz d ]oax d ]sav d ]zav +d ]~ax d ^@az d ^Ba} d ^BbE d ^@bI d ]~bK d ]zbM m ]sbM d ]pbK d ]obI +d ]mbE d ]ma} d ]oaz d ]pax d ]sav m ]zav d ]}ax d ]~az d ^@a} d ^@bE +d ]~bI d ]}bK d ]zbM m ]jah m ^UbW d ^XbY d ^]b^ d ^]av m ^[b] d ^[av +m ^Uav d ^cav m ^Oah m ^sbl m ^sah m _Rbl m _Rah m _}b^ d _xb] d _ubY +d _tbU d _rbM d _rbG d _ta? d _ua{ d _xax d _}av d `@av d `Dax d `Ga{ +d `Ha? d `JbG d `JbM d `HbU d `GbY d `Db] d `@b^ d _}b^ m _}b^ d _zb] +d _wbY d _ubU d _tbM d _tbG d _ua? d _wa{ d _zax d _}av m `@av d `Cax +d `Fa{ d `Ga? d `HbG d `HbM d `GbU d `FbY d `Cb] d `@b^ m _zbQ d _zbC +m `CbQ d `CbC m _zbK d `CbK m _zbI d `CbI m _qah m ]Ka] m ]K`Y m ]saO +d ]oaM d ]maI d ]maC d ]oa@ d ]s`~ d ]z`~ d ]~a@ d ^@aC d ^@aI d ]~aM +d ]zaO d ]saO m ]saO d ]paM d ]oaI d ]oaC d ]pa@ d ]s`~ m ]z`~ d ]}a@ +d ]~aC d ]~aI d ]}aM d ]zaO m ]s`~ d ]o`| d ]m`z d ]k`v d ]k`n d ]m`j +d ]o`h d ]s`f d ]z`f d ]~`h d ^@`j d ^B`n d ^B`v d ^@`z d ]~`| d ]z`~ +m ]s`~ d ]p`| d ]o`z d ]m`v d ]m`n d ]o`j +stroke +m ]o`j d ]p`h d ]s`f m ]z`f d ]}`h d ]~`j d ^@`n d ^@`v d ]~`z d ]}`| +d ]z`~ m ]j`Y m ^RaG d ^SaE d ^RaC d ^PaE d ^PaG d ^RaK d ^SaM d ^XaO +d ^^aO d ^caM d ^eaK d ^faG d ^faC d ^ea@ d ^``| d ^X`x d ^U`v d ^R`r +d ^P`l d ^P`f m ^^aO d ^baM d ^caK d ^eaG d ^eaC d ^ca@ d ^^`| d ^X`x +m ^P`j d ^R`l d ^U`l d ^]`h d ^b`h d ^e`j d ^f`l m ^U`l d ^]`f d ^c`f +d ^e`h d ^f`l d ^f`p m ^O`Y m ^sa] m ^s`Y m _Ra] m _R`Y m `KaO d _r`f +m _yaO d _|aK d _|aG d _zaC d _xaB d _uaB d _raE d _raI d _taM d _vaO +d _yaO d _|aM d `@aK d `DaK d `HaM d `KaO m `E`t d `C`r d `A`n d `A`j +d `D`f d `G`f d `I`h d `K`l d `K`p d `H`t d `E`t m _q`Y m ]K`M m ]K_I +m ]s`@ d ]o_~ d ]m_z d ]m_t d ]o_p d ]s_n d ]z_n d ]~_p d ^@_t d ^@_z +d ]~_~ d ]z`@ d ]s`@ m ]s`@ d ]p_~ d ]o_z d ]o_t d ]p_p d ]s_n m ]z_n +d ]}_p d ]~_t d ]~_z d ]}_~ d ]z`@ m ]s_n d ]o_l d ]m_j d ]k_g d ]k__ +d ]m_[ d ]o_Y d ]s_W d ]z_W d ]~_Y d ^@_[ d ^B__ d ^B_g d ^@_j d ]~_l +d ]z_n m ]s_n d ]p_l d ]o_j d ]m_g d ]m__ d ]o_[ d ]p_Y d ]s_W m ]z_W +d ]}_Y d ]~_[ d ^@__ d ^@_g d ]~_j d ]}_l d ]z_n m ]j_I m ^R_x d ^S_v +d ^R_t d ^P_v d ^P_x d ^R_| d ^S_~ d ^X`@ d ^^`@ d ^c_~ d ^e_z d ^e_t +d ^c_p d ^^_n d ^Z_n m ^^`@ d ^b_~ d ^c_z d ^c_t d ^b_p d ^^_n m ^^_n +d ^b_l d ^e_i d ^f_e d ^f__ d ^e_[ d ^c_Y d ^^_W d ^X_W d ^S_Y d ^R_[ +d ^P__ d ^P_a d ^R_c d ^S_a d ^R__ m ^c_j d ^e_e d ^e__ d ^c_[ d ^b_Y +d ^^_W m ^O_I m ^s`M m ^s_I m _R`M m _R_I m _r`@ d _}_l d _q_W m _q`@ +d _|_l m _q`@ d `H`@ d `I_t d `F`@ m _r_Y d `F_Y m _q_W d `H_W d `I_c +d `F_W m _q_I m ]K^~ m ]K]z m ]s^p d ]o^o d ]m^k d ]m^e d ]o^a d ]s^_ +d ]z^_ d ]~^a d ^@^e d ^@^k d ]~^o d ]z^p d ]s^p m ]s^p d ]p^o d ]o^k +d ]o^e d ]p^a d ]s^_ m ]z^_ d ]}^a d ]~^e d ]~^k d ]}^o d ]z^p m ]s^_ +d ]o^] d ]m^[ d ]k^W d ]k^O d ]m^K d ]o^J d ]s^H d ]z^H d ]~^J d ^@^K +d ^B^O d ^B^W d ^@^[ d ]~^] d ]z^_ m ]s^_ d ]p^] d ]o^[ d ]m^W d ]m^O +d ]o^K d ]p^J d ]s^H m ]z^H d ]}^J d ]~^K d ^@^O d ^@^W d ]~^[ d ]}^] +d ]z^_ m ]j]z m ^^^m d ^^^H m ^`^p d ^`^H m ^`^p d ^O^S d ^h^S m ^Z^H +d ^e^H m ^O]z m ^s^~ m ^s]z m _R^~ m _R]z m _u^x d _u]z m `B^x d `B]z +m _q]z m ]K]o m ]K\k m ]s]a d ]o]_ d ]m][ d ]m]U d ]o]R d ]s]P d ]z]P +d ]~]R d ^@]U d ^@][ d ]~]_ d ]z]a d ]s]a m ]s]a d ]p]_ d ]o][ d ]o]U +d ]p]R d ]s]P m ]z]P d ]}]R d ]~]U d ]~][ d ]}]_ d ]z]a m ]s]P d ]o]N +d ]m]L d ]k]H d ]k]@ d ]m\| d ]o\z d ]s\x d ]z\x d ]~\z d ^@\| d ^B]@ +d ^B]H d ^@]L d ]~]N d ]z]P m ]s]P d ]p]N d ]o]L d ]m]H d ]m]@ d ]o\| +d ]p\z d ]s\x m ]z\x d ]}\z d ]~\| d ^@]@ d ^@]H d ]~]L d ]}]N d ]z]P +m ]j\k m ^S]a d ^P]N m ^P]N d ^S]R d ^X]S d ^]]S d ^b]R d ^e]N d ^f]H +d ^f]D d ^e\~ d ^b\z d ^]\x d ^X\x d ^S\z d ^R\| d ^P]@ d ^P]B d ^R]D +d ^S]B d ^R]@ m ^]]S d ^`]R d ^c]N d ^e]H d ^e]D d ^c\~ d ^`\z d ^]\x +m ^S]a d ^c]a m ^S]_ d ^[]_ d ^c]a m ^O\k m ^s]o m ^s\k m _R]o m _R\k +m _q]W d _q][ d _s]_ d _t]a d _x]a d _y]_ d _{][ d _|]S d _|\x m _q][ +d _t]_ d _x]_ d _{][ m `J]W d `J][ d `H]_ d `F]a d `C]a d `A]_ d `@][ +d _~]S d _~\x m `J][ d `F]_ d `C]_ d `@][ m _x\x d `C\x m _q\k m ]K\_ +m ]K[[ m ]s\R d ]o\P d ]m\L d ]m\F d ]o\B d ]s\@ d ]z\@ d ]~\B d ^@\F +d ^@\L d ]~\P d ]z\R d ]s\R m ]s\R d ]p\P d ]o\L d ]o\F d ]p\B d ]s\@ +m ]z\@ d ]}\B d ]~\F d ]~\L d ]}\P d ]z\R m ]s\@ d ]o[~ d ]m[| d ]k[y +d ]k[q d ]m[m d ]o[k d ]s[i d ]z[i d ]~[k d ^@[m d ^B[q d ^B[y d ^@[| +d ]~[~ d ]z\@ m ]s\@ d ]p[~ d ]o[| d ]m[y d ]m[q d ]o[m d ]p[k d ]s[i +m ]z[i d ]}[k d ]~[m d ^@[q d ^@[y d ]~[| d ]}[~ d ]z\@ m ]j[[ m ^c\L +d ^b\J d ^c\H d ^e\J d ^e\L d ^c\P d ^`\R d ^[\R d ^V\P d ^S\L d ^R\H +d ^P\@ d ^P[u d ^R[o d ^U[k d ^Z[i d ^][i d ^b[k d ^e[o d ^f[u d ^f[w +d ^e[| d ^b\@ d ^]\B d ^[\B d ^V\@ d ^S[| d ^R[w m ^[\R d ^X\P d ^U\L +d ^S\H d ^R\@ d ^R[u d ^S[o d ^V[k d ^Z[i m ^][i d ^`[k d ^c[o d ^e[u +d ^e[w d ^c[| d ^`\@ d ^]\B m ^O[[ m ^s\_ m ^s[[ m _R\_ m _R[[ m _|\L +d _r[i m _?\L d `I[i m _~\L d `G[i m _v[u d `D[u m _q[i d _y[i m `B[i +d `L[i m _|\Z d _y\X d _w\T d _w\P d _y\L d _|\J d _?\J d `B\L d `D\P +d `D\T d `B\X d _?\Z d _|\Z m _q[[ m ]K[P m ]KZL m ]s[C d ]o[A d ]mZ} +d ]mZw d ]oZs d ]sZq d ]zZq d ]~Zs d ^@Zw d ^@Z} d ]~[A d ]z[C d ]s[C +m ]s[C d ]p[A d ]oZ} d ]oZw d ]pZs d ]sZq m ]zZq d ]}Zs d ]~Zw d ]~Z} +d ]}[A d ]z[C m ]sZq d ]oZo d ]mZm d ]kZi d ]kZa d ]mZ^ d ]oZ\ d ]sZZ +d ]zZZ d ]~Z\ d ^@Z^ d ^BZa d ^BZi d ^@Zm d ]~Zo d ]zZq m ]sZq d ]pZo +d ]oZm d ]mZi d ]mZa d ]oZ^ d ]pZ\ d ]sZZ m ]zZZ d ]}Z\ d ]~Z^ d ^@Za +d ^@Zi d ]~Zm d ]}Zo d ]zZq m ]jZL m ^P[C d ^PZw m ^PZ{ d ^RZ? d ^U[C +d ^X[C d ^`Z} d ^cZ} d ^eZ? d ^f[C m ^RZ? d ^U[A d ^X[A d ^`Z} m ^f[C +d ^fZ} d ^eZw d ^^Zm d ^]Zi d ^[Zc d ^[ZZ m ^eZw d ^]Zm +stroke +m ^]Zm d ^[Zi d ^ZZc d ^ZZZ m ^OZL m ^s[P m ^sZL m _R[P m _RZL m _rZ` +d _tZZ d _zZZ d _wZa d _tZi d _rZo d _rZw d _tZ} d _w[A d _{[C d `A[C +d `F[A d `HZ} d `JZw d `JZo d `HZi d `FZa d `CZZ d `HZZ d `JZ` m _wZa +d _uZg d _tZo d _tZw d _uZ} d _x[A d _{[C m `A[C d `D[A d `GZ} d `HZw +d `HZo d `GZg d `FZa m _tZ\ d _xZ\ m `DZ\ d `HZ\ m _qZL m ]KZA m ]KX} +m ]sYs d ]oYq d ]mYm d ]mYg d ]oYd d ]sYb d ]zYb d ]~Yd d ^@Yg d ^@Ym +d ]~Yq d ]zYs d ]sYs m ]sYs d ]pYq d ]oYm d ]oYg d ]pYd d ]sYb m ]zYb +d ]}Yd d ]~Yg d ]~Ym d ]}Yq d ]zYs m ]sYb d ]oY` d ]mY^ d ]kYZ d ]kYR +d ]mYN d ]oYL d ]sYJ d ]zYJ d ]~YL d ^@YN d ^BYR d ^BYZ d ^@Y^ d ]~Y` +d ]zYb m ]sYb d ]pY` d ]oY^ d ]mYZ d ]mYR d ]oYN d ]pYL d ]sYJ m ]zYJ +d ]}YL d ]~YN d ^@YR d ^@YZ d ]~Y^ d ]}Y` d ]zYb m ]jX} m ^XYs d ^SYq +d ^RYm d ^RYg d ^SYd d ^XYb d ^^Yb d ^cYd d ^eYg d ^eYm d ^cYq d ^^Ys +d ^XYs m ^XYs d ^UYq d ^SYm d ^SYg d ^UYd d ^XYb m ^^Yb d ^bYd d ^cYg +d ^cYm d ^bYq d ^^Ys m ^XYb d ^SY` d ^RY^ d ^PYZ d ^PYR d ^RYN d ^SYL +d ^XYJ d ^^YJ d ^cYL d ^eYN d ^fYR d ^fYZ d ^eY^ d ^cY` d ^^Yb m ^XYb +d ^UY` d ^SY^ d ^RYZ d ^RYR d ^SYN d ^UYL d ^XYJ m ^^YJ d ^bYL d ^cYN +d ^eYR d ^eYZ d ^cY^ d ^bY` d ^^Yb m ^OX} m ^sZA m ^sX} m _RZA m _RX} +m _tYu d _rYk m `JYu d `HYk m _zYd d _xYZ m `DYd d `CYZ m _tYR d _rYH +m `JYR d `HYH m _tYq d `HYq m _tYo d `HYo m _zY` d `CY` m _zY^ d `CY^ +m _tYN d `HYN m _tYL d `HYL m _qX} m ]KXq m ]KWm m ]sXd d ]oXb d ]mX^ +d ]mXX d ]oXT d ]sXR d ]zXR d ]~XT d ^@XX d ^@X^ d ]~Xb d ]zXd d ]sXd +m ]sXd d ]pXb d ]oX^ d ]oXX d ]pXT d ]sXR m ]zXR d ]}XT d ]~XX d ]~X^ +d ]}Xb d ]zXd m ]sXR d ]oXP d ]mXN d ]kXK d ]kXC d ]mW? d ]oW} d ]sW{ +d ]zW{ d ]~W} d ^@W? d ^BXC d ^BXK d ^@XN d ]~XP d ]zXR m ]sXR d ]pXP +d ]oXN d ]mXK d ]mXC d ]oW? d ]pW} d ]sW{ m ]zW{ d ]}W} d ]~W? d ^@XC +d ^@XK d ]~XN d ]}XP d ]zXR m ]jWm m ^eXV d ^cXP d ^`XM d ^[XK d ^ZXK +d ^UXM d ^RXP d ^PXV d ^PXX d ^RX^ d ^UXb d ^ZXd d ^]Xd d ^bXb d ^eX^ +d ^fXX d ^fXM d ^eXE d ^cXA d ^`W} d ^[W{ d ^VW{ d ^SW} d ^RXA d ^RXC +d ^SXE d ^UXC d ^SXA m ^ZXK d ^VXM d ^SXP d ^RXV d ^RXX d ^SX^ d ^VXb +d ^ZXd m ^]Xd d ^`Xb d ^cX^ d ^eXX d ^eXM d ^cXE d ^bXA d ^^W} d ^[W{ +m ^OWm m ^sXq m ^sWm m _RXq m _RWm m _~Xd d _~W{ m _?Xd d _?W{ m _qXV +d _rXX d _uXV d _wXN d _xXK d _yXI d _|XG m _rXX d _tXV d _uXN d _wXK +d _xXI d _|XG d `@XG d `EXI d `FXK d `HXN d `IXV d `JXX m `@XG d `CXI +d `EXK d `FXN d `HXV d `JXX d `LXV m _yXd d `CXd m _yW{ d `CW{ m _qWm +m ]KWb m ]KV^ m ^@WG d ]~WA d ]{V} d ]vV{ d ]uV{ d ]pV} d ]mWA d ]kWG +d ]kWI d ]mWO d ]pWS d ]uWT d ]xWT d ]}WS d ^@WO d ^BWI d ^BV} d ^@Vu +d ]~Vq d ]{Vn d ]vVl d ]rVl d ]oVn d ]mVq d ]mVs d ]oVu d ]pVs d ]oVq +m ]uV{ d ]rV} d ]oWA d ]mWG d ]mWI d ]oWO d ]rWS d ]uWT m ]xWT d ]{WS +d ]~WO d ^@WI d ^@V} d ]~Vu d ]}Vq d ]zVn d ]vVl m ]jV^ m ^ZWT d ^UWS +d ^RWM d ^PWC d ^PV} d ^RVs d ^UVn d ^ZVl d ^]Vl d ^bVn d ^eVs d ^fV} +d ^fWC d ^eWM d ^bWS d ^]WT d ^ZWT m ^ZWT d ^VWS d ^UWQ d ^SWM d ^RWC +d ^RV} d ^SVs d ^UVp d ^VVn d ^ZVl m ^]Vl d ^`Vn d ^bVp d ^cVs d ^eV} +d ^eWC d ^cWM d ^bWQ d ^`WS d ^]WT m ^OV^ m ^sWb m ^sV^ m _RWb m _RV^ +m _qWb m _qV^ m ]KVS m ]KUO m ^@Ux d ]~Ur d ]{Un d ]vUl d ]uUl d ]pUn +d ]mUr d ]kUx d ]kUy d ]mU? d ]pVC d ]uVE d ]xVE d ]}VC d ^@U? d ^BUy +d ^BUn d ^@Uf d ]~Ub d ]{U^ d ]vU\ d ]rU\ d ]oU^ d ]mUb d ]mUd d ]oUf +d ]pUd d ]oUb m ]uUl d ]rUn d ]oUr d ]mUx d ]mUy d ]oU? d ]rVC d ]uVE +m ]xVE d ]{VC d ]~U? d ^@Uy d ^@Un d ]~Uf d ]}Ub d ]zU^ d ]vU\ m ]jUO +m ^UU} d ^XU? d ^]VE d ^]U\ m ^[VC d ^[U\ m ^UU\ d ^cU\ m ^OUO m ^sVS +m ^sUO m _RVS m _RUO m _uVM d _uUO m _wVM d _wUO m _uVM d `DVM m _uUO +d `DUO m _qUO m ]KUC m ]KS? m ^@Th d ]~Tb d ]{T^ d ]vT] d ]uT] d ]pT^ +d ]mTb d ]kTh d ]kTj d ]mTp d ]pTt d ]uTv d ]xTv d ]}Tt d ^@Tp d ^BTj +d ^BT^ d ^@TW d ]~TS d ]{TO d ]vTM d ]rTM d ]oTO d ]mTS d ]mTU d ]oTW +d ]pTU d ]oTS m ]uT] d ]rT^ d ]oTb d ]mTh d ]mTj d ]oTp d ]rTt d ]uTv +m ]xTv d ]{Tt d ]~Tp d ^@Tj d ^@T^ d ]~TW d ]}TS d ]zTO d ]vTM m ]jS? +m ^RTn d ^STl d ^RTj d ^PTl d ^PTn d ^RTr d ^STt d ^XTv d ^^Tv d ^cTt +d ^eTr d ^fTn d ^fTj d ^eTf d ^`Tb d ^XT^ d ^UT] d ^RTY d ^PTS d ^PTM +m ^^Tv d ^bTt d ^cTr d ^eTn d ^eTj d ^cTf d ^^Tb d ^XT^ m ^PTQ d ^RTS +d ^UTS d ^]TO d ^bTO d ^eTQ d ^fTS m ^UTS d ^]TM d ^cTM d ^eTO d ^fTS +d ^fTW m ^OS? m ^sUC m ^sS? m _RUC m _RS? m _qTv d `JTG m _qS? m ]KSt +m ]KRp m ^@SY d ]~SS d ]{SO d ]vSM d ]uSM d ]pSO d ]mSS d ]kSY d ]kS[ +d ]mSa d ]pSe d ]uSf d ]xSf d ]}Se d ^@Sa d ^BS[ d ^BSO d ^@SG d ]~SC +d ]{S@ d ]vR~ d ]rR~ d ]oS@ d ]mSC d ]mSE d ]oSG d ]pSE d ]oSC m ]uSM +d ]rSO d ]oSS d ]mSY d ]mS[ d ]oSa d ]rSe d ]uSf m ]xSf d ]{Se d ]~Sa +stroke +m ]~Sa d ^@S[ d ^@SO d ]~SG d ]}SC d ]zS@ d ]vR~ m ]jRp m ^RS_ d ^SS] +d ^RS[ d ^PS] d ^PS_ d ^RSc d ^SSe d ^XSf d ^^Sf d ^cSe d ^eSa d ^eS[ +d ^cSW d ^^SU d ^ZSU m ^^Sf d ^bSe d ^cSa d ^cS[ d ^bSW d ^^SU m ^^SU +d ^bSS d ^eSO d ^fSK d ^fSE d ^eSB d ^cS@ d ^^R~ d ^XR~ d ^SS@ d ^RSB +d ^PSE d ^PSG d ^RSI d ^SSG d ^RSE m ^cSQ d ^eSK d ^eSE d ^cSB d ^bS@ +d ^^R~ m ^ORp m ^sSt m ^sRp m _RSt m _RRp m _?Sn d _?Rp m `BSn d `BRp +m _sSn d `BSn m _sRp d `BRp m _qRp m ]KRe m ]KQa m ^@RJ d ]~RD d ]{R@ +d ]vQ~ d ]uQ~ d ]pR@ d ]mRD d ]kRJ d ]kRK d ]mRQ d ]pRU d ]uRW d ]xRW +d ]}RU d ^@RQ d ^BRK d ^BR@ d ^@Qx d ]~Qt d ]{Qp d ]vQn d ]rQn d ]oQp +d ]mQt d ]mQv d ]oQx d ]pQv d ]oQt m ]uQ~ d ]rR@ d ]oRD d ]mRJ d ]mRK +d ]oRQ d ]rRU d ]uRW m ]xRW d ]{RU d ]~RQ d ^@RK d ^@R@ d ]~Qx d ]}Qt +d ]zQp d ]vQn m ]jQa m ^^RS d ^^Qn m ^`RW d ^`Qn m ^`RW d ^OQz d ^hQz +m ^ZQn d ^eQn m ^OQa m ^sRe m ^sQa m _RRe m _RQa m _qRe m _qQa m ]KQU +m ]KPQ m ^@Pz d ]~Pt d ]{Pq d ]vPo d ]uPo d ]pPq d ]mPt d ]kPz d ]kP| +d ]mQB d ]pQF d ]uQH d ]xQH d ]}QF d ^@QB d ^BP| d ^BPq d ^@Pi d ]~Pe +d ]{Pa d ]vP_ d ]rP_ d ]oPa d ]mPe d ]mPg d ]oPi d ]pPg d ]oPe m ]uPo +d ]rPq d ]oPt d ]mPz d ]mP| d ]oQB d ]rQF d ]uQH m ]xQH d ]{QF d ]~QB +d ^@P| d ^@Pq d ]~Pi d ]}Pe d ]zPa d ]vP_ m ]jPQ m ^SQH d ^PPt m ^PPt +d ^SPx d ^XPz d ^]Pz d ^bPx d ^ePt d ^fPo d ^fPk d ^ePe d ^bPa d ^]P_ +d ^XP_ d ^SPa d ^RPc d ^PPg d ^PPi d ^RPk d ^SPi d ^RPg m ^]Pz d ^`Px +d ^cPt d ^ePo d ^ePk d ^cPe d ^`Pa d ^]P_ m ^SQH d ^cQH m ^SQF d ^[QF +d ^cQH m ^OPQ m ^sQU m ^sPQ m _RQU m _RPQ m `GPt d `JPq d `GPm m `CPz +d `IPq d `CPg m _sPq d `IPq m _qPQ m ]KPF m ]KOB m ^@Ok d ]~Oe d ]{Oa +d ]vO_ d ]uO_ d ]pOa d ]mOe d ]kOk d ]kOm d ]mOs d ]pOw d ]uOy d ]xOy +d ]}Ow d ^@Os d ^BOm d ^BOa d ^@OY d ]~OV d ]{OR d ]vOP d ]rOP d ]oOR +d ]mOV d ]mOW d ]oOY d ]pOW d ]oOV m ]uO_ d ]rOa d ]oOe d ]mOk d ]mOm +d ]oOs d ]rOw d ]uOy m ]xOy d ]{Ow d ]~Os d ^@Om d ^@Oa d ]~OY d ]}OV +d ]zOR d ]vOP m ]jOB m ^cOs d ^bOq d ^cOo d ^eOq d ^eOs d ^cOw d ^`Oy +d ^[Oy d ^VOw d ^SOs d ^ROo d ^POg d ^PO[ d ^ROV d ^UOR d ^ZOP d ^]OP +d ^bOR d ^eOV d ^fO[ d ^fO] d ^eOc d ^bOg d ^]Oi d ^[Oi d ^VOg d ^SOc +d ^RO] m ^[Oy d ^XOw d ^UOs d ^SOo d ^ROg d ^RO[ d ^SOV d ^VOR d ^ZOP +m ^]OP d ^`OR d ^cOV d ^eO[ d ^eO] d ^cOc d ^`Og d ^]Oi m ^OOB m ^sPF +m ^sOB m _RPF m _ROB m _rOk d _xOk d `AOT m _wOk d `AOP m `NP@ d `AOP +m _qOB m ]KNw m ]KMs m ^@N[ d ]~NV d ]{NR d ]vNP d ]uNP d ]pNR d ]mNV +d ]kN[ d ]kN] d ]mNc d ]pNg d ]uNi d ]xNi d ]}Ng d ^@Nc d ^BN] d ^BNR +d ^@NJ d ]~NF d ]{NB d ]vN@ d ]rN@ d ]oNB d ]mNF d ]mNH d ]oNJ d ]pNH +d ]oNF m ]uNP d ]rNR d ]oNV d ]mN[ d ]mN] d ]oNc d ]rNg d ]uNi m ]xNi +d ]{Ng d ]~Nc d ^@N] d ^@NR d ]~NJ d ]}NF d ]zNB d ]vN@ m ]jMs m ^PNi +d ^PN] m ^PNa d ^RNe d ^UNi d ^XNi d ^`Nc d ^cNc d ^eNe d ^fNi m ^RNe +d ^UNg d ^XNg d ^`Nc m ^fNi d ^fNc d ^eN] d ^^NT d ^]NP d ^[NJ d ^[N@ +m ^eN] d ^]NT d ^[NP d ^ZNJ d ^ZN@ m ^OMs m ^sNw m ^sMs m _RNw m _RMs +m _|N[ d _xNZ d _uNV d _tNR d _rNL d _rNF d _tNB d _xN@ d _{N@ d _~NB +d `BNH d `ENN d `HNV d `IN[ m _|N[ d _yNZ d _wNV d _uNR d _tNL d _tNF +d _uNB d _xN@ m _|N[ d _?N[ d `BNZ d `CNV d `FNF d `HNB d `IN@ m _?N[ +d `@NZ d `BNV d `ENF d `FNB d `IN@ d `JN@ m _qMs m ]KMg m ]KLc m ^@ML +d ]~MF d ]{MC d ]vMA d ]uMA d ]pMC d ]mMF d ]kML d ]kMN d ]mMT d ]pMX +d ]uMZ d ]xMZ d ]}MX d ^@MT d ^BMN d ^BMC d ^@L{ d ]~Lw d ]{Ls d ]vLq +d ]rLq d ]oLs d ]mLw d ]mLy d ]oL{ d ]pLy d ]oLw m ]uMA d ]rMC d ]oMF +d ]mML d ]mMN d ]oMT d ]rMX d ]uMZ m ]xMZ d ]{MX d ]~MT d ^@MN d ^@MC +d ]~L{ d ]}Lw d ]zLs d ]vLq m ]jLc m ^XMZ d ^SMX d ^RMT d ^RMN d ^SMJ +d ^XMH d ^^MH d ^cMJ d ^eMN d ^eMT d ^cMX d ^^MZ d ^XMZ m ^XMZ d ^UMX +d ^SMT d ^SMN d ^UMJ d ^XMH m ^^MH d ^bMJ d ^cMN d ^cMT d ^bMX d ^^MZ +m ^XMH d ^SMF d ^RMD d ^PMA d ^PLy d ^RLu d ^SLs d ^XLq d ^^Lq d ^cLs +d ^eLu d ^fLy d ^fMA d ^eMD d ^cMF d ^^MH m ^XMH d ^UMF d ^SMD d ^RMA +d ^RLy d ^SLu d ^ULs d ^XLq m ^^Lq d ^bLs d ^cLu d ^eLy d ^eMA d ^cMD +d ^bMF d ^^MH m ^OLc m ^sMg m ^sLc m _RMg m _RLc m `BMZ d _}MX d _zMT +d _wML d _uMF d _tL? d _rLs d _qLc m `BMZ d _?MX d _|MT d _yML d _wMF +d _uL? d _tLs d _rLc m `BMZ d `EMZ d `HMX d `IMV d `IMP d `HML d `FMJ +d `BMH d _|MH m `EMZ d `HMV d `HMP d `FML d `EMJ d `BMH m _|MH d `BMF +d `EMC d `FL? d `FLy d `ELu d `CLs d _?Lq d _|Lq d _yLs d _wLu d _uL{ +m _|MH d `@MF d `CMC d `EL? d `ELy d `CLu d `BLs d _?Lq m _qLc m ]KLX +m ]KKT m ^@K} d ]~Kw d ]{Ks d ]vKq d ]uKq d ]pKs d ]mKw d ]kK} d ]kK? +d ]mLE d ]pLI d ]uLK d ]xLK d ]}LI d ^@LE d ^BK? d ^BKs d ^@Kk d ]~Kg +d ]{Kd d ]vKb +stroke +m ]vKb d ]rKb d ]oKd d ]mKg d ]mKi d ]oKk d ]pKi d ]oKg m ]uKq d ]rKs +d ]oKw d ]mK} d ]mK? d ]oLE d ]rLI d ]uLK m ]xLK d ]{LI d ]~LE d ^@K? +d ^@Ks d ]~Kk d ]}Kg d ]zKd d ]vKb m ]jKT m ^eK} d ^cKw d ^`Ks d ^[Kq +d ^ZKq d ^UKs d ^RKw d ^PK} d ^PK? d ^RLE d ^ULI d ^ZLK d ^]LK d ^bLI +d ^eLE d ^fK? d ^fKs d ^eKk d ^cKg d ^`Kd d ^[Kb d ^VKb d ^SKd d ^RKg +d ^RKi d ^SKk d ^UKi d ^SKg m ^ZKq d ^VKs d ^SKw d ^RK} d ^RK? d ^SLE +d ^VLI d ^ZLK m ^]LK d ^`LI d ^cLE d ^eK? d ^eKs d ^cKk d ^bKg d ^^Kd +d ^[Kb m ^OKT m ^sLX m ^sKT m _RLX m _RKT m _qK} d _tK} d _xK{ d _yKw +d `BKZ d `DKV d `FKT m _tK} d _vK{ d _xKw d `@KZ d `BKV d `FKT d `IKT +m `KK} d `IKy d `FKs d _tK^ d _qKX d _qKT m _qKT m ]QJs d ]TJu d ]YJ{ +d ]YJR m ]XJy d ]XJR m ]QJR d ]`JR m ]KJE m ]{J{ d ]vJy d ]sJs d ]qJj +d ]qJd d ]sJZ d ]vJT d ]{JR d ]~JR d ^CJT d ^FJZ d ^GJd d ^GJj d ^FJs +d ^CJy d ]~J{ d ]{J{ m ]{J{ d ]xJy d ]vJw d ]tJs d ]sJj d ]sJd d ]tJZ +d ]vJV d ]xJT d ]{JR m ]~JR d ^AJT d ^CJV d ^DJZ d ^FJd d ^FJj d ^DJs +d ^CJw d ^AJy d ]~J{ m ]pJE m ^_J{ d ^[Jy d ^WJs d ^VJj d ^VJd d ^WJZ +d ^[JT d ^_JR d ^cJR d ^gJT d ^kJZ d ^lJd d ^lJj d ^kJs d ^gJy d ^cJ{ +d ^_J{ m ^_J{ d ^\Jy d ^[Jw d ^YJs d ^WJj d ^WJd d ^YJZ d ^[JV d ^\JT +d ^_JR m ^cJR d ^fJT d ^gJV d ^iJZ d ^kJd d ^kJj d ^iJs d ^gJw d ^fJy +d ^cJ{ m ^TJE m ^yKI m ^yJE m _XKI m _XJE m `IJl d `FJn d `BJn d _}Jl +d _zJf d _xJ` d _xJZ d _zJV d _|JT d _?JR d `BJR d `GJT d `KJZ d `LJ` +d `LJf d `KJj d `DJs d `BJw d `BJ{ d `DJ} d `GJ} d `KJ{ d `NJw m `BJn +d _?Jl d _|Jf d _zJ` d _zJX d _|JT m `BJR d `FJT d `IJZ d `KJ` d `KJh +d `IJl d `FJq d `DJu d `DJy d `FJ{ d `IJ{ d `NJw m _wJE m ]QId d ]TIf +d ]YIl d ]YIC m ]XIj d ]XIC m ]QIC d ]`IC m ]KHu m ]{Il d ]vIj d ]sId +d ]qIZ d ]qIT d ]sIK d ]vIE d ]{IC d ]~IC d ^CIE d ^FIK d ^GIT d ^GIZ +d ^FId d ^CIj d ]~Il d ]{Il m ]{Il d ]xIj d ]vIh d ]tId d ]sIZ d ]sIT +d ]tIK d ]vIG d ]xIE d ]{IC m ]~IC d ^AIE d ^CIG d ^DIK d ^FIT d ^FIZ +d ^DId d ^CIh d ^AIj d ]~Il m ]pHu m ^[Id d ^^If d ^cIl d ^cIC m ^aIj +d ^aIC m ^[IC d ^iIC m ^THu m ^yIy m ^yHu m _XIy m _XHu m `MIX d `JI\ +d `FI^ d _?I^ d _|I\ d _|IX d _?IT d `EIS m _?I^ d _~I\ d _~IX d `AIT +d `EIS m `EIS d _|IQ d _xIM d _xII d _zIE d _?IC d `EIC d `HIE d `KII +m `EIS d _~IQ d _zIM d _zII d _|IE d _?IC m _wHu m ]QHU d ]THW d ]YH\ +d ]YGt m ]XH[ d ]XGt m ]QGt d ]`Gt m ]KGf m ]{H\ d ]vH[ d ]sHU d ]qHK +d ]qHE d ]sG{ d ]vGv d ]{Gt d ]~Gt d ^CGv d ^FG{ d ^GHE d ^GHK d ^FHU +d ^CH[ d ]~H\ d ]{H\ m ]{H\ d ]xH[ d ]vHY d ]tHU d ]sHK d ]sHE d ]tG{ +d ]vGx d ]xGv d ]{Gt m ]~Gt d ^AGv d ^CGx d ^DG{ d ^FHE d ^FHK d ^DHU +d ^CHY d ^AH[ d ]~H\ m ]pGf m ^WHU d ^YHS d ^WHQ d ^VHS d ^VHU d ^WHY +d ^YH[ d ^^H\ d ^dH\ d ^iH[ d ^kHY d ^lHU d ^lHQ d ^kHM d ^fHI d ^^HE +d ^[HC d ^WG? d ^VGy d ^VGt m ^dH\ d ^gH[ d ^iHY d ^kHU d ^kHQ d ^iHM +d ^dHI d ^^HE m ^VGx d ^WGy d ^[Gy d ^cGv d ^gGv d ^kGx d ^lGy m ^[Gy +d ^cGt d ^iGt d ^kGv d ^lGy d ^lG} m ^TGf m ^yHj m ^yGf m _XHj m _XGf +m _?HM d _}HK d _zHG d _xHA d _xG{ d _zGx d _{Gv d _~Gt d `CGt d `GGv +d `KGy d `NG? d `PHE d `PHK d `MHO d `JHO d `GHK d `DHC d `AGy d _}Gf +m _xG{ d _{Gx d _~Gv d `CGv d `GGx d `KG{ d `NG? m `PHK d `MHM d `JHM +d `GHI d `DHC d `AGx d _~Gf m _wGf m ]QGE d ]TGG d ]YGM d ]YFd m ]XGK +d ]XFd m ]QFd d ]`Fd m ]KFW m ]{GM d ]vGK d ]sGE d ]qF| d ]qFv d ]sFl +d ]vFf d ]{Fd d ]~Fd d ^CFf d ^FFl d ^GFv d ^GF| d ^FGE d ^CGK d ]~GM +d ]{GM m ]{GM d ]xGK d ]vGI d ]tGE d ]sF| d ]sFv d ]tFl d ]vFh d ]xFf +d ]{Fd m ]~Fd d ^AFf d ^CFh d ^DFl d ^FFv d ^FF| d ^DGE d ^CGI d ^AGK +d ]~GM m ]pFW m ^WGE d ^YGC d ^WGA d ^VGC d ^VGE d ^WGI d ^YGK d ^^GM +d ^dGM d ^iGK d ^kGG d ^kGA d ^iF~ d ^dF| d ^_F| m ^dGM d ^gGK d ^iGG +d ^iGA d ^gF~ d ^dF| m ^dF| d ^gFz d ^kFv d ^lFr d ^lFl d ^kFh d ^iFf +d ^dFd d ^^Fd d ^YFf d ^WFh d ^VFl d ^VFn d ^WFp d ^YFn d ^WFl m ^iFx +d ^kFr d ^kFl d ^iFh d ^gFf d ^dFd m ^TFW m ^yG[ m ^yFW m _XG[ m _XFW +m _}G@ d _zFd m _?G@ d _}Ft d _|Fj d _zFd m `OG@ d `MFx d `JFp m `PG@ +d `OFz d `MFv d `JFp d `GFl d `BFh d _?Ff d _zFd m _xG@ d _?G@ m _wFW +m ilcf d ipch d itcn d itcE m iscl d iscE m ilcE d i{cE m ifbw m jVcn +d jQcl d jNcf d jLc\ d jLcV d jNcM d jQcG d jVcE d jYcE d j^cG d jacM +d jbcV d jbc\ d jacf d j^cl d jYcn d jVcn m jVcn d jScl d jQcj d jOcf +d jNc\ d jNcV d jOcM d jQcI d jScG d jVcE m jYcE d j\cG d j^cI d j_cM +d jacV d jac\ d j_cf d j^cj d j\cl d jYcn m jKbw m j?cj d j?cE m kAcn +d kAcE m kAcn d jocQ d kIcQ m jzcE d kFcE m jobw m kTc{ m kTbw m ksc{ +m ksbw m lRcX d lRc\ d lUc` d lYc` d l[c^ d l[cZ d lYcS d lVcE m lXc` +d lYc^ d lYcZ d lXcS +stroke +m lXcS d lUcE m lYcS d l\cZ d l_c^ d lbc` d lec` d lhc^ d lic\ d licV +d lhcM d lcbw m lec` d lhc\ d lhcV d lfcM d lbbw m lRbw m ilbW d ipbY +d itb^ d itav m isb] d isav m ilav d i{av m ifah m jVb^ d jQb] d jNbW +d jLbM d jLbG d jNa} d jQax d jVav d jYav d j^ax d jaa} d jbbG d jbbM +d jabW d j^b] d jYb^ d jVb^ m jVb^ d jSb] d jQb[ d jObW d jNbM d jNbG +d jOa} d jQaz d jSax d jVav m jYav d j\ax d j^az d j_a} d jabG d jabM +d j_bW d j^b[ d j\b] d jYb^ m jKah m jtb^ d jqbK m jqbK d jtbO d jybQ +d j~bQ d kBbO d kFbK d kGbE d kGbA d kFa{ d kBax d j~av d jyav d jtax +d jraz d jqa} d jqa? d jrbA d jta? d jra} m j~bQ d kAbO d kDbK d kFbE +d kFbA d kDa{ d kAax d j~av m jtb^ d kDb^ m jtb] d j|b] d kDb^ m joah +m kTbl m kTah m ksbl m ksah m l[bQ d lVbC d lTa{ d lTax d lVav d l]av +d lbaz d lda} m l]bQ d lYbC d lVa{ d lVax d lYav m lRah m ilaG d ipaI +d itaO d it`f m isaM d is`f m il`f d i{`f m if`Y m jVaO d jQaM d jNaG +d jL`~ d jL`x d jN`n d jQ`h d jV`f d jY`f d j^`h d ja`n d jb`x d jb`~ +d jaaG d j^aM d jYaO d jVaO m jVaO d jSaM d jQaK d jOaG d jN`~ d jN`x +d jO`n d jQ`j d jS`h d jV`f m jY`f d j\`h d j^`j d j_`n d ja`x d ja`~ +d j_aG d j^aK d j\aM d jYaO m jK`Y m kDaI d kBaG d kDaE d kFaG d kFaI +d kDaM d kAaO d j|aO d jwaM d jtaI d jraE d jq`~ d jq`r d jr`l d jv`h +d jz`f d j~`f d kB`h d kF`l d kG`r d kG`t d kF`z d kB`~ d j~a@ d j|a@ +d jw`~ d jt`z d jr`t m j|aO d jyaM d jvaI d jtaE d jr`~ d jr`r d jt`l +d jw`h d jz`f m j~`f d kA`h d kD`l d kF`r d kF`t d kD`z d kA`~ d j~a@ +m jo`Y m kTa] m kT`Y m ksa] m ks`Y m lg`x d lf`~ d lda@ d laaB d l]aB +d lXa@ d lU`z d lS`t d lS`n d lU`j d lW`h d lZ`f d l]`f d lb`h d lf`l +d lg`r d li`| d liaE d lgaK d lfaM d lbaO d l]aO d lZaM d lXaK d lXaI +d lZaI d lZaK m l]aB d lZa@ d lW`z d lU`t d lU`l d lW`h m l]`f d la`h +d ld`l d lf`r d lg`| d lgaE d lfaK d lbaO m lR`Y m il_x d ip_z d it`@ +d it_W m is_~ d is_W m il_W d i{_W m if_I m jV`@ d jQ_~ d jN_x d jL_n +d jL_i d jN__ d jQ_Y d jV_W d jY_W d j^_Y d ja__ d jb_i d jb_n d ja_x +d j^_~ d jY`@ d jV`@ m jV`@ d jS_~ d jQ_| d jO_x d jN_n d jN_i d jO__ +d jQ_[ d jS_Y d jV_W m jY_W d j\_Y d j^_[ d j___ d ja_i d ja_n d j__x +d j^_| d j\_~ d jY`@ m jK_I m jq`@ d jq_t m jq_x d jr_| d jv`@ d jy`@ +d kA_z d kD_z d kF_| d kG`@ m jr_| d jv_~ d jy_~ d kA_z m kG`@ d kG_z +d kF_t d j?_j d j~_g d j|_a d j|_W m kF_t d j~_j d j|_g d jz_a d jz_W +m jo_I m kT`M m kT_I m ks`M m ks_I m lX_r d lR_W m lZ_r d lS_W m lh_r +d lj_p d lk_p d lj_r d lf_r d lc_p d l]_i d lZ_g d lW_g m lZ_g d l]_e +d l`_Y d lb_W m lZ_g d l[_e d l^_Y d l`_W d lc_W d lf_Y d lj__ m lR_I +m il^i d ip^k d it^p d it^H m is^o d is^H m il^H d i{^H m if]z m jV^p +d jQ^o d jN^i d jL^_ d jL^Y d jN^O d jQ^J d jV^H d jY^H d j^^J d ja^O +d jb^Y d jb^_ d ja^i d j^^o d jY^p d jV^p m jV^p d jS^o d jQ^m d jO^i +d jN^_ d jN^Y d jO^O d jQ^K d jS^J d jV^H m jY^H d j\^J d j^^K d j_^O +d ja^Y d ja^_ d j_^i d j^^m d j\^o d jY^p m jK]z m jy^p d jt^o d jr^k +d jr^e d jt^a d jy^_ d j?^_ d kD^a d kF^e d kF^k d kD^o d j?^p d jy^p +m jy^p d jv^o d jt^k d jt^e d jv^a d jy^_ m j?^_ d kB^a d kD^e d kD^k +d kB^o d j?^p m jy^_ d jt^] d jr^[ d jq^W d jq^O d jr^K d jt^J d jy^H +d j?^H d kD^J d kF^K d kG^O d kG^W d kF^[ d kD^] d j?^_ m jy^_ d jv^] +d jt^[ d jr^W d jr^O d jt^K d jv^J d jy^H m j?^H d kB^J d kD^K d kF^O +d kF^W d kD^[ d kB^] d j?^_ m jo]z m kT^~ m kT]z m ks^~ m ks]z m lS^p +d lW^p d lZ^o d l[^m d l]^i d lf^M d lh^J d lj^H m lW^p d lZ^m d l[^i +d le^M d lf^J d lj^H d lk^H m l^^c d lR^H m l^^c d lS^H m lR]z m il]Y +d ip][ d it]a d it\x m is]_ d is\x m il\x d i{\x m if\k m jV]a d jQ]_ +d jN]Y d jL]P d jL]J d jN]@ d jQ\z d jV\x d jY\x d j^\z d ja]@ d jb]J +d jb]P d ja]Y d j^]_ d jY]a d jV]a m jV]a d jS]_ d jQ]] d jO]Y d jN]P +d jN]J d jO]@ d jQ\| d jS\z d jV\x m jY\x d j\\z d j^\| d j_]@ d ja]J +d ja]P d j_]Y d j^]] d j\]_ d jY]a m jK\k m kF]S d kD]N d kA]J d j|]H +d jz]H d jv]J d jr]N d jq]S d jq]U d jr][ d jv]_ d jz]a d j~]a d kB]_ +d kF][ d kG]U d kG]J d kF]B d kD\~ d kA\z d j|\x d jw\x d jt\z d jr\~ +d jr]@ d jt]B d jv]@ d jt\~ m jz]H d jw]J d jt]N d jr]S d jr]U d jt][ +d jw]_ d jz]a m j~]a d kA]_ d kD][ d kF]U d kF]J d kD]B d kB\~ d j?\z +d j|\x m jo\k m kT]o m kT\k m ks]o m ks\k m lY]S d lR\k m lZ]S d lR\k +m lY]N d lW]B d lW\| d lZ\x d l]\x d l`\z d lc\~ d lf]D m lh]S d ld\~ +d ld\z d lf\x d lj\x d lm\| d ln]@ m lj]S d lf\~ d lf\z d lg\x m lR\k +m il\J d ip\L d it\R d it[i m is\P d is[i m il[i d i{[i m if[[ m jQ\J +d jT\L d jY\R d jY[i m jW\P d jW[i m jQ[i d j_[i m jK[[ m jz\R d jv\P +d jr\J d jq\@ d jq[{ d jr[q d jv[k d jz[i d j~[i +stroke +m j~[i d kB[k d kF[q d kG[{ d kG\@ d kF\J d kB\P d j~\R d jz\R m jz\R +d jw\P d jv\N d jt\J d jr\@ d jr[{ d jt[q d jv[m d jw[k d jz[i m j~[i +d kA[k d kB[m d kD[q d kF[{ d kF\@ d kD\J d kB\N d kA\P d j~\R m jo[[ +m kT\_ m kT[[ m ks\_ m ks[[ m lX\D d lU[i m lZ\D d lX[y d lW[o d lU[i +m lj\D d lh[| d le[u m lk\D d lj[~ d lh[{ d le[u d lb[q d l][m d lZ[k +d lU[i m lS\D d lZ\D m lR[[ m ilZ{ d ipZ} d it[C d itZZ m is[A d isZZ +m ilZZ d i{ZZ m ifZL m jQZ{ d jTZ} d jY[C d jYZZ m jW[A d jWZZ m jQZZ +d j_ZZ m jKZL m jvZ{ d jyZ} d j~[C d j~ZZ m j|[A d j|ZZ m jvZZ d kDZZ +m joZL m kT[P m kTZL m ks[P m ksZL m l^Zu d lYZs d lUZm d lSZg d lSZa +d lUZ^ d lWZ\ d lZZZ d l^ZZ d lcZ\ d lfZa d lhZg d lhZm d lfZq d leZs +d laZu d l^Zu m l^Zu d lZZs d lWZm d lUZg d lUZ` d lWZ\ m l^ZZ d laZ\ +d leZa d lfZg d lfZo d leZs m lRZL m ilYk d ipYm d itYs d itYJ m isYq +d isYJ m ilYJ d i{YJ m ifX} m jQYk d jTYm d jYYs d jYYJ m jWYq d jWYJ +m jQYJ d j_YJ m jKX} m jrYk d jtYi d jrYg d jqYi d jqYk d jrYo d jtYq +d jyYs d j?Ys d kDYq d kFYo d kGYk d kGYg d kFYd d kAY` d jyY\ d jvYZ +d jrYV d jqYP d jqYJ m j?Ys d kBYq d kDYo d kFYk d kFYg d kDYd d j?Y` +d jyY\ m jqYN d jrYP d jvYP d j~YL d kBYL d kFYN d kGYP m jvYP d j~YJ +d kDYJ d kFYL d kGYP d kGYT m joX} m kTZA m kTX} m ksZA m ksX} m l\Yd +d lVYJ m l\Yd d lXYJ m leYd d leYJ m leYd d lfYJ m lRY` d lUYd d lYYe +d llYe m lRY` d lUYb d lYYd d llYd m lRX} m ilX\ d ipX^ d itXd d itW{ +m isXb d isW{ m ilW{ d i{W{ m ifWm m jQX\ d jTX^ d jYXd d jYW{ m jWXb +d jWW{ m jQW{ d j_W{ m jKWm m jrX\ d jtXZ d jrXX d jqXZ d jqX\ d jrX` +d jtXb d jyXd d j?Xd d kDXb d kFX^ d kFXX d kDXT d j?XR d jzXR m j?Xd +d kBXb d kDX^ d kDXX d kBXT d j?XR m j?XR d kBXP d kFXM d kGXI d kGXC +d kFW? d kDW} d j?W{ d jyW{ d jtW} d jrW? d jqXC d jqXE d jrXG d jtXE +d jrXC m kDXN d kFXI d kFXC d kDW? d kBW} d j?W{ m joWm m kTXq m kTWm +m ksXq m ksWm m lRXN d lRXR d lUXV d lYXV d lZXT d lZXP d lYXG d lYXA +d lZW} d l\W{ m lWXV d lYXT d lYXP d lWXG d lWXA d lYW} d l\W{ d l^W{ +d laW} d ldXA d lgXG d lhXM d ljXV d ljX^ d lhXb d lfXd d lcXd d l`X` +d l`X\ d laXV d ldXP d lgXM d lkXI m laW} d ldXC d lfXG d lgXM d lhXV +d lhX^ d lgXb d lfXd m lRWm m ilWM d ipWO d itWT d itVl m isWS d isVl +m ilVl d i{Vl m ifV^ m jQWM d jTWO d jYWT d jYVl m jWWS d jWVl m jQVl +d j_Vl m jKV^ m j?WQ d j?Vl m kAWT d kAVl m kAWT d joVw d kIVw m jzVl +d kFVl m joV^ m kTWb m kTV^ m ksWb m ksV^ m lUVu d lWVp d lXVn d l\Vl +d l_Vl d ldVn d lgVs d liVy d liV? d lgWC d lfWE d lbWG d l_WG d lZWE +d lWV? d lUVy d lRV^ m l_Vl d lbVn d lfVs d lgVy d lgWA d lfWE m l_WG +d l\WE d lXV? d lWVy d lRV^ m lRV^ m ilU} d ipU? d itVE d itU\ m isVC +d isU\ m ilU\ d i{U\ m ifUO m jQU} d jTU? d jYVE d jYU\ m jWVC d jWU\ +m jQU\ d j_U\ m jKUO m jtVE d jqUr m jqUr d jtUv d jyUx d j~Ux d kBUv +d kFUr d kGUl d kGUh d kFUb d kBU^ d j~U\ d jyU\ d jtU^ d jrU` d jqUd +d jqUf d jrUh d jtUf d jrUd m j~Ux d kAUv d kDUr d kFUl d kFUh d kDUb +d kAU^ d j~U\ m jtVE d kDVE m jtVC d j|VC d kDVE m joUO m kTVS m kTUO +m ksVS m ksUO m llUx d l\Ux d lXUv d lUUp d lSUj d lSUd d lUU` d lVU^ +d lYU\ d l\U\ d laU^ d ldUd d lfUj d lfUp d ldUt d lcUv d l_Ux m l\Ux +d lYUv d lVUp d lUUj d lUUb d lVU^ m l\U\ d l_U^ d lcUd d ldUj d ldUr +d lcUv m lcUv d llUv m lRUO m ilTn d ipTp d itTv d itTM m isTt d isTM +m ilTM d i{TM m ifS? m jQTn d jTTp d jYTv d jYTM m jWTt d jWTM m jQTM +d j_TM m jKS? m kDTp d kBTn d kDTl d kFTn d kFTp d kDTt d kATv d j|Tv +d jwTt d jtTp d jrTl d jqTd d jqTY d jrTS d jvTO d jzTM d j~TM d kBTO +d kFTS d kGTY d kGT[ d kFT` d kBTd d j~Tf d j|Tf d jwTd d jtT` d jrT[ +m j|Tv d jyTt d jvTp d jtTl d jrTd d jrTY d jtTS d jwTO d jzTM m j~TM +d kATO d kDTS d kFTY d kFT[ d kDT` d kATd d j~Tf m joS? m kTUC m kTS? +m ksUC m ksS? m l`Tf d l[TM m l`Tf d l]TM m lRTb d lUTf d lZTh d lkTh +m lRTb d lUTd d lZTf d lkTf m lRS? m ilS_ d ipSa d itSf d itR~ m isSe +d isR~ m ilR~ d i{R~ m ifRp m jQS_ d jTSa d jYSf d jYR~ m jWSe d jWR~ +m jQR~ d j_R~ m jKRp m jqSf d jqS[ m jqS_ d jrSc d jvSf d jySf d kASa +d kDSa d kFSc d kGSf m jrSc d jvSe d jySe d kASa m kGSf d kGSa d kFS[ +d j?SQ d j~SM d j|SG d j|R~ m kFS[ d j~SQ d j|SM d jzSG d jzR~ m joRp +m kTSt m kTRp m ksSt m ksRp m lRSQ d lRSU d lUSY d lZSY d l[SW d l[SS +d lXSG d lXSB d l[R~ m lXSY d lZSW d lZSS d lWSG d lWSB d lXS@ d l[R~ +d l]R~ d lbS@ d leSC d lhSI d ljSO d ljSU d lhSY d lfSW d lhSU d ljSO +m lhSI d ljSU m lRRp m ilRO d ipRQ d itRW d itQn m isRU d isQn m ilQn +d i{Qn m ifQa m jQRO d jTRQ d jYRW d jYQn m jWRU d jWQn m jQQn d j_Qn +m jKQa m jyRW d jtRU d jrRQ d jrRK d jtRH d jyRF d j?RF d kDRH d kFRK +d kFRQ d kDRU d j?RW d jyRW m jyRW d jvRU d jtRQ d jtRK d jvRH d jyRF +m j?RF d kBRH d kDRK d kDRQ d kBRU d j?RW m jyRF d jtRD d jrRB d jqQ~ +d jqQv d jrQr d jtQp d jyQn d j?Qn d kDQp d kFQr d kGQv d kGQ~ d kFRB +d kDRD d j?RF m jyRF d jvRD d jtRB d jrQ~ d jrQv d jtQr d jvQp d jyQn +m j?Qn d kBQp d kDQr d kFQv d kFQ~ d kDRB d kBRD d j?RF m joQa m kTRe +m kTQa m ksRe m ksQa m lRRe m lRQa m ilQ@ d ipQB d itQH d itP_ m isQF +d isP_ m ilP_ d i{P_ +stroke +m i{P_ m ifPQ m jQQ@ d jTQB d jYQH d jYP_ m jWQF d jWP_ m jQP_ d j_P_ +m jKPQ m kFPz d kDPt d kAPq d j|Po d jzPo d jvPq d jrPt d jqPz d jqP| +d jrQB d jvQF d jzQH d j~QH d kBQF d kFQB d kGP| d kGPq d kFPi d kDPe +d kAPa d j|P_ d jwP_ d jtPa d jrPe d jrPg d jtPi d jvPg d jtPe m jzPo +d jwPq d jtPt d jrPz d jrP| d jtQB d jwQF d jzQH m j~QH d kAQF d kDQB +d kFP| d kFPq d kDPi d kBPe d j?Pa d j|P_ m joPQ m kTQU m kTPQ m ksQU +m ksPQ m lUPr d lWPv d l\Px d lZPz d lWPx d lUPr d lSPm d lSPg d lUPa +d lVP_ d lYP_ d l\Pa d l^Pg d l`Pm m lSPg d lUPc d lVPa d lYPa d l\Pc +d l^Pg m l^Pm d l^Pg d l`Pa d laP_ d ldP_ d lgPa d ljPg d lkPm d lkPr +d ljPx d lhPz d lgPx d ljPv d lkPr m l^Pg d l`Pc d laPa d ldPa d lgPc +d ljPg m lRPQ m ilOq d ipOs d itOy d itOP m isOw d isOP m ilOP d i{OP +m ifOB m jNOq d jOOo d jNOm d jLOo d jLOq d jNOu d jOOw d jTOy d j[Oy +d j_Ow d jaOu d jbOq d jbOm d jaOi d j\Oe d jTOa d jQO_ d jNO[ d jLOV +d jLOP m j[Oy d j^Ow d j_Ou d jaOq d jaOm d j_Oi d j[Oe d jTOa m jLOT +d jNOV d jQOV d jYOR d j^OR d jaOT d jbOV m jQOV d jYOP d j_OP d jaOR +d jbOV d jbOY m jKOB m jzOy d jvOw d jrOq d jqOg d jqOa d jrOW d jvOR +d jzOP d j~OP d kBOR d kFOW d kGOa d kGOg d kFOq d kBOw d j~Oy d jzOy +m jzOy d jwOw d jvOu d jtOq d jrOg d jrOa d jtOW d jvOT d jwOR d jzOP +m j~OP d kAOR d kBOT d kDOW d kFOa d kFOg d kDOq d kBOu d kAOw d j~Oy +m joOB m kTPF m kTOB m ksPF m ksOB m lbOy d l^Ow d l]Ou d l]Os d l^Oq +d ldOo d liOo m ldOo d l]Om d lYOk d lWOg d lWOc d l[O_ d l`O] d lfO] +m ldOo d l^Om d l[Ok d lYOg d lYOc d l]O_ d l`O] m l`O] d lYO[ d lUOY +d lTOV d lTOR d lWON d l`OJ d lbOH d lbOD d l^OB d l[OB m l`O] d l[O[ +d lWOY d lUOV d lUOR d lYON d l`OJ m lROB m ilNa d ipNc d itNi d itN@ +m isNg d isN@ m ilN@ d i{N@ m ifMs m jNNa d jON_ d jNN] d jLN_ d jLNa +d jNNe d jONg d jTNi d j[Ni d j_Ng d jaNe d jbNa d jbN] d jaNZ d j\NV +d jTNR d jQNP d jNNL d jLNF d jLN@ m j[Ni d j^Ng d j_Ne d jaNa d jaN] +d j_NZ d j[NV d jTNR m jLND d jNNF d jQNF d jYNB d j^NB d jaND d jbNF +m jQNF d jYN@ d j_N@ d jaNB d jbNF d jbNJ m jKMs m jvNa d jyNc d j~Ni +d j~N@ m j|Ng d j|N@ m jvN@ d kDN@ m joMs m kTNw m kTMs m ksNw m ksMs +m ldNi d l\Ms m lfNi d lZMs m lRNT d lRNX d lUN[ d lYN[ d lZNZ d lZNV +d lYNL d lYNF d l\NB d l`NB d lcND d lgNJ d ljNP m lWN[ d lYNZ d lYNV +d lWNL d lWNF d lYNB d l\N@ d l`N@ d lcNB d lfNF d lhNL d ljNP d lmN[ +m lRMs m ilMR d ipMT d itMZ d itLq m isMX d isLq m ilLq d i{Lq m ifLc +m jNMR d jOMP d jNMN d jLMP d jLMR d jNMV d jOMX d jTMZ d j[MZ d j_MX +d jaMV d jbMR d jbMN d jaMJ d j\MF d jTMC d jQMA d jNL} d jLLw d jLLq +m j[MZ d j^MX d j_MV d jaMR d jaMN d j_MJ d j[MF d jTMC m jLLu d jNLw +d jQLw d jYLs d j^Ls d jaLu d jbLw m jQLw d jYLq d j_Lq d jaLs d jbLw +d jbL{ m jKLc m jrMR d jtMP d jrMN d jqMP d jqMR d jrMV d jtMX d jyMZ +d j?MZ d kDMX d kFMV d kGMR d kGMN d kFMJ d kAMF d jyMC d jvMA d jrL} +d jqLw d jqLq m j?MZ d kBMX d kDMV d kFMR d kFMN d kDMJ d j?MF d jyMC +m jqLu d jrLw d jvLw d j~Ls d kBLs d kFLu d kGLw m jvLw d j~Lq d kDLq +d kFLs d kGLw d kGL{ m joLc m kTMg m kTLc m ksMg m ksLc m laMZ d l^MX +d l\MV d l\MT d l^MR d lcMP d llMP d llMR d lfMP d l`ML d lZMH d lUMC +d lSL} d lSLy d lULu d lZLq d l`Lm d laLi d laLe d l`Lc d l\Lc d lZLe +m lcMN d l\MH d lWMC d lUL} d lULy d lWLu d lZLq m lRLc m ilLC d ipLE +d itLK d itKb m isLI d isKb m ilKb d i{Kb m ifKT m jNLC d jOLA d jNK? +d jLLA d jLLC d jNLG d jOLI d jTLK d j[LK d j_LI d jaLG d jbLC d jbK? +d jaK{ d j\Kw d jTKs d jQKq d jNKm d jLKg d jLKb m j[LK d j^LI d j_LG +d jaLC d jaK? d j_K{ d j[Kw d jTKs m jLKf d jNKg d jQKg d jYKd d j^Kd +d jaKf d jbKg m jQKg d jYKb d j_Kb d jaKd d jbKg d jbKk m jKKT m jrLC +d jtLA d jrK? d jqLA d jqLC d jrLG d jtLI d jyLK d j?LK d kDLI d kFLE +d kFK? d kDK{ d j?Ky d jzKy m j?LK d kBLI d kDLE d kDK? d kBK{ d j?Ky +m j?Ky d kBKw d kFKs d kGKo d kGKi d kFKf d kDKd d j?Kb d jyKb d jtKd +d jrKf d jqKi d jqKk d jrKm d jtKk d jrKi m kDKu d kFKo d kFKi d kDKf +d kBKd d j?Kb m joKT m kTLX m kTKT m ksLX m ksKT m l`LR d l\LP d lZLN +d lXLK d lXLG d lZLC d l\LA d l^K} d l^Ky d lZKu m l\LP d lZLL d lZLI +d l\LE d l^LC d l`K? d l`K{ d l^Kw d lVKs d l^Ko d l`Kk d l`Kg d l^Kd +d l\Kb d lZK^ d lZKZ d l\KV m lZKq d l^Km d l^Ki d l\Kf d lZKd d lXK` +d lXK\ d lZKX d l\KV d l`KT m lRKT m ilJs d ipJu d itJ{ d itJR m isJy +d isJR m ilJR d i{JR m ifJE m jNJs d jOJq d jNJo d jLJq d jLJs d jNJw +d jOJy d jTJ{ d j[J{ d j_Jy d jaJw d jbJs d jbJo d jaJl d j\Jh d jTJd +d jQJb d jNJ^ d jLJX d jLJR m j[J{ d j^Jy +stroke +m j^Jy d j_Jw d jaJs d jaJo d j_Jl d j[Jh d jTJd m jLJV d jNJX d jQJX +d jYJT d j^JT d jaJV d jbJX m jQJX d jYJR d j_JR d jaJT d jbJX d jbJ\ +m jKJE m j?Jw d j?JR m kAJ{ d kAJR m kAJ{ d joJ^ d kIJ^ m jzJR d kFJR +m joJE m kTKI m kTJE m ksKI m ksJE m lVKC d lVJE m lbKC d lbJE m lRJE +m ilId d ipIf d itIl d itIC m isIj d isIC m ilIC d i{IC m ifHu m jNId +d jOIb d jNI` d jLIb d jLId d jNIh d jOIj d jTIl d j[Il d j_Ij d jaIh +d jbId d jbI` d jaI\ d j\IX d jTIT d jQIS d jNIO d jLII d jLIC m j[Il +d j^Ij d j_Ih d jaId d jaI` d j_I\ d j[IX d jTIT m jLIG d jNII d jQII +d jYIE d j^IE d jaIG d jbII m jQII d jYIC d j_IC d jaIE d jbII d jbIM +m jKHu m jtIl d jqIX m jqIX d jtI\ d jyI^ d j~I^ d kBI\ d kFIX d kGIS +d kGIO d kFII d kBIE d j~IC d jyIC d jtIE d jrIG d jqIK d jqIM d jrIO +d jtIM d jrIK m j~I^ d kAI\ d kDIX d kFIS d kFIO d kDII d kAIE d j~IC +m jtIl d kDIl m jtIj d j|Ij d kDIl m joHu m kTIy m kTHu m ksIy m ksHu +m lXIt d l\Ir d l^Ip d l`Il d l`Ih d l^Id d l\Ib d lZI^ d lZIZ d l^IV +m l\Ir d l^In d l^Ij d l\If d lZId d lXI` d lXI\ d lZIX d lbIT d lZIQ +d lXIM d lXII d lZIE d l\IC d l^H? d l^H{ d l\Hw m l^IS d lZIO d lZIK +d l\IG d l^IE d l`IA d l`H} d l^Hy d l\Hw d lXHu m lRHu m ilHU d ipHW +d itH\ d itGt m isH[ d isGt m ilGt d i{Gt m ifGf m jNHU d jOHS d jNHQ +d jLHS d jLHU d jNHY d jOH[ d jTH\ d j[H\ d j_H[ d jaHY d jbHU d jbHQ +d jaHM d j\HI d jTHE d jQHC d jNG? d jLGy d jLGt m j[H\ d j^H[ d j_HY +d jaHU d jaHQ d j_HM d j[HI d jTHE m jLGx d jNGy d jQGy d jYGv d j^Gv +d jaGx d jbGy m jQGy d jYGt d j_Gt d jaGv d jbGy d jbG} m jKGf m kDHW +d kBHU d kDHS d kFHU d kFHW d kDH[ d kAH\ d j|H\ d jwH[ d jtHW d jrHS +d jqHK d jqG? d jrGy d jvGv d jzGt d j~Gt d kBGv d kFGy d kGG? d kGHA +d kFHG d kBHK d j~HM d j|HM d jwHK d jtHG d jrHA m j|H\ d jyH[ d jvHW +d jtHS d jrHK d jrG? d jtGy d jwGv d jzGt m j~Gt d kAGv d kDGy d kFG? +d kFHA d kDHG d kAHK d j~HM m joGf m kTHj m kTGf m ksHj m ksGf m lXHI +d lTHE d lXHA m l\HO d lVHE d l\G{ m lVHE d lkHE m lRGf m ilGE d ipGG +d itGM d itFd m isGK d isFd m ilFd d i{Fd m ifFW m jNGE d jOGC d jNGA +d jLGC d jLGE d jNGI d jOGK d jTGM d j[GM d j_GK d jaGI d jbGE d jbGA +d jaF~ d j\Fz d jTFv d jQFt d jNFp d jLFj d jLFd m j[GM d j^GK d j_GI +d jaGE d jaGA d j_F~ d j[Fz d jTFv m jLFh d jNFj d jQFj d jYFf d j^Ff +d jaFh d jbFj m jQFj d jYFd d j_Fd d jaFf d jbFj d jbFn m jKFW m jqGM +d jqGA m jqGE d jrGI d jvGM d jyGM d kAGG d kDGG d kFGI d kGGM m jrGI +d jvGK d jyGK d kAGG m kGGM d kGGG d kFGA d j?Fx d j~Ft d j|Fn d j|Fd +m kFGA d j~Fx d j|Ft d jzFn d jzFd m joFW m kTG[ m kTFW m ksG[ m ksFW +m Fwcf d Fwcd d Fycd d Fycf d Fwcf m Fwch d Fych d Fzcf d Fzcd d Fycb +d Fwcb d Fvcd d Fvcf d Fwcj d Fycl d F~cn d GDcn d GIcl d GJch d GJcb +d GIc^ d GDc\ m GGcl d GIch d GIcb d GGc^ m GBcn d GEcl d GGch d GGcb +d GEc^ d GBc\ m F?c\ d GDc\ d GGcZ d GJcV d GLcS d GLcM d GJcI d GIcG +d GDcE d F~cE d FycG d FwcI d FvcM d FvcO d FwcQ d FycQ d FzcO d FzcM +d FycK d FwcK m GIcV d GJcS d GJcM d GIcI m GBc\ d GEcZ d GGcX d GIcS +d GIcM d GGcG d GDcE m FwcO d FwcM d FycM d FycO d FwcO m Ftbw m G\cf +d G\cd d G]cd d G]cf d G\cf m G\ch d G]ch d G_cf d G_cd d G]cb d G\cb +d GZcd d GZcf d G\cj d G]cl d Gbcn d Gicn d Gmcl d Gocj d Gpcf d Gpcb +d Goc^ d GjcZ d GbcV d G_cU d G\cQ d GZcK d GZcE m Gmcj d Gocf d Gocb +d Gmc^ m Gicn d Glcl d Gmcf d Gmcb d Glc^ d GicZ d GbcV m GZcI d G\cK +d G_cK d GgcI d GmcI d GpcK m G_cK d GgcG d GmcG d GocI m G_cK d GgcE +d GmcE d GocG d GpcK d GpcO m GYbw m G}c{ m G}bw m H\c{ m H\bw m FwbW +d FwbU d FybU d FybW d FwbW m FwbY d FybY d FzbW d FzbU d FybS d FwbS +d FvbU d FvbW d Fwb[ d Fyb] d F~b^ d GDb^ d GIb] d GJbY d GJbS d GIbO +d GDbM m GGb] d GIbY d GIbS d GGbO m GBb^ d GEb] d GGbY d GGbS d GEbO +d GBbM m F?bM d GDbM d GGbK d GJbG d GLbC d GLa} d GJaz d GIax d GDav +d F~av d Fyax d Fwaz d Fva} d Fva? d FwbA d FybA d Fza? d Fza} d Fya{ +d Fwa{ m GIbG d GJbC d GJa} d GIaz m GBbM d GEbK d GGbI d GIbC d GIa} +d GGax d GDav m Fwa? d Fwa} d Fya} d Fya? d Fwa? m Ftah m G\bW d G\bU +d G]bU d G]bW d G\bW m G\bY d G]bY d G_bW d G_bU d G]bS d G\bS d GZbU +d GZbW d G\b[ d G]b] d Gbb^ d Gib^ d Gmb] d GobY d GobS d GmbO d GibM +m Glb] d GmbY d GmbS d GlbO m Ggb^ d Gjb] d GlbY d GlbS d GjbO d GgbM +m GdbM d GibM d GlbK d GobG d GpbC d Gpa} d Goaz d Gmax d Giav d Gbav +d G]ax d G\az d GZa} d GZa? d G\bA d G]bA d G_a? d G_a} d G]a{ d G\a{ +m GmbG d GobC d Goa} d Gmaz m GgbM d GjbK d GlbI d GmbC d Gma} d Glax +d Giav m G\a? d G\a} d G]a} d G]a? d G\a? m GYah m G}bl m G}ah m H\bl +m H\ah m H{bl m H{ah m IZbl m IZah m Iybl m Iyah m J_b^ d J]b] d J]bY +d J_bI m J_b^ d J_bC +stroke +m J_bC d JbbC m J_b^ d Jbb^ d JbbC m Jbb^ d Jdb] d JdbY d JbbI m J_a{ +d J]az d J]ax d J_av d Jbav d Jdax d Jdaz d Jba{ d J_a{ m J_az d J_ax +d Jbax d Jbaz d J_az m JXah m FwaG d FwaE d FyaE d FyaG d FwaG m FwaI +d FyaI d FzaG d FzaE d FyaC d FwaC d FvaE d FvaG d FwaK d FyaM d F~aO +d GDaO d GIaM d GJaI d GJaC d GIa@ d GD`~ m GGaM d GIaI d GIaC d GGa@ +m GBaO d GEaM d GGaI d GGaC d GEa@ d GB`~ m F?`~ d GD`~ d GG`| d GJ`x +d GL`t d GL`n d GJ`j d GI`h d GD`f d F~`f d Fy`h d Fw`j d Fv`n d Fv`p +d Fw`r d Fy`r d Fz`p d Fz`n d Fy`l d Fw`l m GI`x d GJ`t d GJ`n d GI`j +m GB`~ d GE`| d GG`z d GI`t d GI`n d GG`h d GD`f m Fw`p d Fw`n d Fy`n +d Fy`p d Fw`p m Ft`Y m GgaI d Gg`f m GiaK d Gi`h m GjaO d Gj`f m GjaO +d GY`r d Gr`r m Gb`f d Go`f m Gg`h d Gd`f m Gg`j d Ge`f m Gj`j d Gl`f +m Gj`h d Gm`f m GY`Y m G}a] m G}`Y m H\a] m H\`Y m H{a] m H{`Y m IZa] +m IZ`Y m Iya] m Iy`Y m J]aO d J[aM d J[aB m J]aM d J[aB m J]aO d J_aM +d J[aB m JlaO d JkaM d JkaB m JlaM d JkaB m JlaO d JnaM d JkaB m JX`Y +m Fw_x d Fw_v d Fy_v d Fy_x d Fw_x m Fw_z d Fy_z d Fz_x d Fz_v d Fy_t +d Fw_t d Fv_v d Fv_x d Fw_| d Fy_~ d F~`@ d GD`@ d GI_~ d GJ_z d GJ_t +d GI_p d GD_n m GG_~ d GI_z d GI_t d GG_p m GB`@ d GE_~ d GG_z d GG_t +d GE_p d GB_n m F?_n d GD_n d GG_l d GJ_i d GL_e d GL__ d GJ_[ d GI_Y +d GD_W d F~_W d Fy_Y d Fw_[ d Fv__ d Fv_a d Fw_c d Fy_c d Fz_a d Fz__ +d Fy_] d Fw_] m GI_i d GJ_e d GJ__ d GI_[ m GB_n d GE_l d GG_j d GI_e +d GI__ d GG_Y d GD_W m Fw_a d Fw__ d Fy__ d Fy_a d Fw_a m Ft_I m G]`@ +d GZ_l d G]_p d Gb_r d Gg_r d Gl_p d Go_l d Gp_g d Gp_c d Go_] d Gl_Y +d Gg_W d Gb_W d G]_Y d G\_[ d GZ__ d GZ_a d G\_c d G]_c d G__a d G___ +d G]_] d G\_] m Gm_l d Go_i d Go_a d Gm_] m Gg_r d Gj_p d Gl_n d Gm_i +d Gm_a d Gl_[ d Gj_Y d Gg_W m G\_a d G\__ d G]__ d G]_a d G\_a m G]`@ +d Gm`@ m G]_~ d Gj_~ m G]_| d Gd_| d Gj_~ d Gm`@ m GY_I m G}`M m G}_I +m H\`M m H\_I m H{`M m H{_I m IZ`M m IZ_I m Iy`M m Iy_I m Je`@ d J[_I +m Jn`@ d Jd_I m J[_j d Jp_j m JY__ d Jn__ m JX_I m Fw^i d Fw^g d Fy^g +d Fy^i d Fw^i m Fw^k d Fy^k d Fz^i d Fz^g d Fy^e d Fw^e d Fv^g d Fv^i +d Fw^m d Fy^o d F~^p d GD^p d GI^o d GJ^k d GJ^e d GI^a d GD^_ m GG^o +d GI^k d GI^e d GG^a m GB^p d GE^o d GG^k d GG^e d GE^a d GB^_ m F?^_ +d GD^_ d GG^] d GJ^Y d GL^U d GL^O d GJ^K d GI^J d GD^H d F~^H d Fy^J +d Fw^K d Fv^O d Fv^Q d Fw^S d Fy^S d Fz^Q d Fz^O d Fy^M d Fw^M m GI^Y +d GJ^U d GJ^O d GI^K m GB^_ d GE^] d GG^[ d GI^U d GI^O d GG^J d GD^H +m Fw^Q d Fw^O d Fy^O d Fy^Q d Fw^Q m Ft]z m Gl^k d Gl^i d Gm^i d Gm^k +d Gl^k m Gm^m d Gl^m d Gj^k d Gj^i d Gl^g d Gm^g d Go^i d Go^k d Gm^o +d Gj^p d Ge^p d Ga^o d G]^k d G\^g d GZ^_ d GZ^S d G\^M d G_^J d Gd^H +d Gg^H d Gl^J d Go^M d Gp^S d Gp^U d Go^[ d Gl^_ d Gg^a d Gd^a d Ga^_ +d G_^] d G]^Y m G_^k d G]^g d G\^_ d G\^S d G]^M d G_^K m Gm^M d Go^Q +d Go^W d Gm^[ m Ge^p d Gb^o d Ga^m d G_^i d G]^a d G]^S d G_^M d Ga^J +d Gd^H m Gg^H d Gj^J d Gl^K d Gm^Q d Gm^W d Gl^] d Gj^_ d Gg^a m GY]z +m G}^~ m G}]z m H\^~ m H\]z m H{^~ m H{]z m IZ^~ m IZ]z m Iy^~ m Iy]z +m Ja^x d Ja^@ m Jg^x d Jg^@ m Jn^g d Jn^i d Jl^i d Jl^e d Jo^e d Jo^i +d Jn^m d Jl^o d Jg^p d Ja^p d J\^o d JY^k d JY^e d J[^a d J`^] d Ji^Y +d Jl^W d Jn^S d Jn^M d Jl^J m J[^e d J\^a d J`^_ d Ji^[ d Jl^Y d Jn^U +m J\^o d J[^k d J[^g d J\^c d J`^a d Ji^] d Jn^Y d Jo^U d Jo^O d Jn^K +d Jl^J d Jg^H d Ja^H d J\^J d J[^K d JY^O d JY^S d J\^S d J\^O d J[^O +d J[^Q m JX]z m Fw]Y d Fw]W d Fy]W d Fy]Y d Fw]Y m Fw][ d Fy][ d Fz]Y +d Fz]W d Fy]U d Fw]U d Fv]W d Fv]Y d Fw]] d Fy]_ d F~]a d GD]a d GI]_ +d GJ][ d GJ]U d GI]R d GD]P m GG]_ d GI][ d GI]U d GG]R m GB]a d GE]_ +d GG][ d GG]U d GE]R d GB]P m F?]P d GD]P d GG]N d GJ]J d GL]F d GL]@ +d GJ\| d GI\z d GD\x d F~\x d Fy\z d Fw\| d Fv]@ d Fv]B d Fw]D d Fy]D +d Fz]B d Fz]@ d Fy\~ d Fw\~ m GI]J d GJ]F d GJ]@ d GI\| m GB]P d GE]N +d GG]L d GI]F d GI]@ d GG\z d GD\x m Fw]B d Fw]@ d Fy]@ d Fy]B d Fw]B +m Ft\k m GZ]a d GZ]U m Gp]a d Gp][ d Go]U d Gi]L d Gg]H d Ge]@ d Ge\x +m Gg]J d Ge]F d Gd]@ d Gd\x m Go]U d Gg]L d Gd]F d Gb]@ d Gb\x d Ge\x +m GZ]Y d G\]] d G_]a d Gb]a d Gj][ d Gm][ d Go]] d Gp]a m G]]] d G_]_ +d Gb]_ d Ge]] m GZ]Y d G\][ d G_]] d Gb]] d Gj][ m GY\k m G}]o m G}\k +m H\]o m H\\k m H{]o m H{\k m IZ]o m IZ\k m Iy]o m Iy\k m Jr]a d JY\x +m J`]a d Jc]] d Jc]Y d Ja]U d J^]S d J\]S d JY]W d JY][ d JZ]_ d J]]a +d J`]a d Jc]_ d Jg]] d Jk]] d Jo]_ d Jr]a m Jl]F d Ji]D d Jh]@ d Jh\| +d Jk\x d Jn\x d Jp\z d Jr\~ d Jr]B d Jo]F d Jl]F m JX\k m Fw\J d Fw\H +d Fy\H d Fy\J d Fw\J m Fw\L d Fy\L d Fz\J d Fz\H d Fy\F d Fw\F d Fv\H +d Fv\J d Fw\N d Fy\P d F~\R d GD\R d GI\P d GJ\L d GJ\F d GI\B d GD\@ +m GG\P d GI\L d GI\F d GG\B m GB\R d GE\P d GG\L d GG\F d GE\B d GB\@ +m F?\@ d GD\@ d GG[~ d GJ[{ d GL[w +stroke +m GL[w d GL[q d GJ[m d GI[k d GD[i d F~[i d Fy[k d Fw[m d Fv[q d Fv[s +d Fw[u d Fy[u d Fz[s d Fz[q d Fy[o d Fw[o m GI[{ d GJ[w d GJ[q d GI[m +m GB\@ d GE[~ d GG[| d GI[w d GI[q d GG[k d GD[i m Fw[s d Fw[q d Fy[q +d Fy[s d Fw[s m Ft[[ m Gb\R d G]\P d G\\L d G\\F d G]\B d Gb\@ d Gi\@ +d Gm\B d Go\F d Go\L d Gm\P d Gi\R d Gb\R m G_\P d G]\L d G]\F d G_\B +m Gl\B d Gm\F d Gm\L d Gl\P m Gb\R d Ga\P d G_\L d G_\F d Ga\B d Gb\@ +m Gi\@ d Gj\B d Gl\F d Gl\L d Gj\P d Gi\R m Gb\@ d G][~ d G\[| d GZ[y +d GZ[q d G\[m d G][k d Gb[i d Gi[i d Gm[k d Go[m d Gp[q d Gp[y d Go[| +d Gm[~ d Gi\@ m G][| d G\[y d G\[q d G][m m Gm[m d Go[q d Go[y d Gm[| +m Gb\@ d G_[~ d G][y d G][q d G_[k d Gb[i m Gi[i d Gl[k d Gm[q d Gm[y +d Gl[~ d Gi\@ m GY[[ m G}\_ m G}[[ m H\\_ m H\[[ m H{\_ m H{[[ m IZ\_ +m IZ[[ m Iy\_ m Iy[[ m Jq\@ d Jq\B d Jp\B d Jp[~ d Js[~ d Js\B d Jq\D +d Jp\D d Jo\B d Jm[~ d Jk[u d Jh[o d Jf[k d Jc[i d J^[i d J[[k d JZ[o +d JZ[u d J[[y d Jc\@ d Jf\D d Jg\H d Jg\L d Jf\P d Jc\R d Ja\P d J_\L +d J_\F d Ja\@ d Jc[{ d Jh[q d Jl[k d Jo[i d Jq[i d Js[m d Js[o m J][k +d J[[o d J[[u d J][y d J^[{ m Jf\D d Jg\L m Jg\H d Jf\P m Ja\P d J_\H +m Ja\B d Jc[| d Jh[s d Jl[m d Jo[k m Ja[i d J^[k d J][o d J][u d J^[y +d Jc\@ m J_\L d Ja\D d Jd[| d Jj[s d Jm[m d Jp[k d Jq[k d Js[m m JX[[ +m FwZ{ d FwZy d FyZy d FyZ{ d FwZ{ m FwZ} d FyZ} d FzZ{ d FzZy d FyZw +d FwZw d FvZy d FvZ{ d FwZ? d Fy[A d F~[C d GD[C d GI[A d GJZ} d GJZw +d GIZs d GDZq m GG[A d GIZ} d GIZw d GGZs m GB[C d GE[A d GGZ} d GGZw +d GEZs d GBZq m F?Zq d GDZq d GGZo d GJZk d GLZg d GLZa d GJZ^ d GIZ\ +d GDZZ d F~ZZ d FyZ\ d FwZ^ d FvZa d FvZc d FwZe d FyZe d FzZc d FzZa +d FyZ` d FwZ` m GIZk d GJZg d GJZa d GIZ^ m GBZq d GEZo d GGZm d GIZg +d GIZa d GGZ\ d GDZZ m FwZc d FwZa d FyZa d FyZc d FwZc m FtZL m G]Za +d G]Z` d G_Z` d G_Za d G]Za m GmZq d GlZm d GjZk d GgZi d GdZi d G_Zk +d G\Zo d GZZu d GZZw d G\Z} d G_[A d Gd[C d Gg[C d Gl[A d GoZ} d GpZw +d GpZk d GoZc d GmZ` d GjZ\ d GeZZ d GaZZ d G]Z\ d G\Z` d G\Za d G]Zc +d G_Zc d GaZa d GaZ` d G_Z^ d G]Z^ m G]Zo d G\Zs d G\Zy d G]Z} m GlZ? +d GmZ} d GoZw d GoZk d GmZc d GlZ` m GdZi d GaZk d G_Zm d G]Zs d G]Zy +d G_Z? d Ga[A d Gd[C m Gg[C d Gj[A d GlZ} d GmZw d GmZi d GlZa d GjZ^ +d GiZ\ d GeZZ m GYZL m G}[P m G}ZL m H\[P m H\ZL m H{[P m H{ZL m IZ[P +m IZZL m Iy[P m IyZL m JdZ? d JbZ} d J_Z} d J]Z? d J][A d J_[C d Jb[C +d Jd[A d JdZ{ d JbZw d J]Zu m J_[A d J_Z? d JbZ? d Jb[A d J_[A m JbZ} +d JdZ{ m JdZ? d JbZw m JXZL m GBYm d GBYJ m GDYo d GDYL m GEYs d GEYJ +m GEYs d FtYV d GMYV m F~YJ d GJYJ m GBYL d F?YJ m GBYN d GAYJ m GEYN +d GGYJ m GEYL d GIYJ m FtX} m GdYs d G_Yq d G\Yk d GZYb d GZY\ d G\YR +d G_YL d GdYJ d GgYJ d GlYL d GoYR d GpY\ d GpYb d GoYk d GlYq d GgYs +d GdYs m G_Yo d G]Yk d G\Yd d G\YZ d G]YR d G_YN m GlYN d GmYR d GoYZ +d GoYd d GmYk d GlYo m GdYs d GaYq d G_Ym d G]Yd d G]YZ d G_YP d GaYL +d GdYJ m GgYJ d GjYL d GlYP d GmYZ d GmYd d GlYm d GjYq d GgYs m GYX} +m G}ZA m G}X} m H\ZA m H\X} m H{ZA m H{X} m IZZA m IZX} m IyZA m IyX} +m JhY{ d JdYw d J`Yq d J\Yi d JZY` d JZYX d J\YN d J`YF d JdYA d JhX} +m J`Yo d J^Yi d J\Yb d J\YV d J^YN d J`YH m JdYw d JbYs d J`Ym d J^Yb +d J^YV d J`YJ d JbYE d JdYA m JXX} m GBX^ d GBW{ m GDX` d GDW} m GEXd +d GEW{ m GEXd d FtXG d GMXG m F~W{ d GJW{ m GBW} d F?W{ m GBW? d GAW{ +m GEW? d GGW{ m GEW} d GIW{ m FtWm m GdX` d GdW{ m GeX` d GeW} m GgXd +d GgW{ m GgXd d GbX^ d G_X\ m G]W{ d GmW{ m GdW} d GaW{ m GdW? d GbW{ +m GgW? d GiW{ m GgW} d GjW{ m GYWm m G}Xq m G}Wm m H\Xq m H\Wm m H{Xq +m H{Wm m IZXq m IZWm m IyXq m IyWm m J\Xl d J`Xh d JdXb d JhXZ d JjXP +d JjXI d JhW? d JdWw d J`Wq d J\Wm m JdX` d JfXZ d JhXR d JhXG d JfW? +d JdWy m J`Xh d JbXd d JdX^ d JfXR d JfXG d JdW{ d JbWu d J`Wq m JXWm +m GBWO d GBVl m GDWQ d GDVn m GEWT d GEVl m GEWT d FtVw d GMVw m F~Vl +d GJVl m GBVn d F?Vl m GBVp d GAVl m GEVp d GGVl m GEVn d GIVl m FtV^ +m G\WM d G\WK d G]WK d G]WM d G\WM m G\WO d G]WO d G_WM d G_WK d G]WI +d G\WI d GZWK d GZWM d G\WQ d G]WS d GbWT d GiWT d GmWS d GoWQ d GpWM +d GpWI d GoWE d GjWA d GbV} d G_V{ d G\Vw d GZVq d GZVl m GmWQ d GoWM +d GoWI d GmWE m GiWT d GlWS d GmWM d GmWI d GlWE d GiWA d GbV} m GZVp +d G\Vq d G_Vq d GgVp d GmVp d GpVq m G_Vq d GgVn d GmVn d GoVp m G_Vq +d GgVl d GmVl d GoVn d GpVq d GpVu m GYV^ m G}Wb m G}V^ m H\Wb m H\V^ +m H{Wb m H{V^ m IZWb m IZV^ m IyWb m IyV^ m JcWT d JaWS d JeV? d JcV} +m JcWT d JcV} m JcWT d JeWS d JaV? d JcV} m JZWO d J[WO d JkWC d JlWC +m JZWO d JlWC m JZWO d JZWM d JlWE d JlWC m JlWO d JkWO d J[WC d JZWC +m JlWO d JZWC m JlWO d JlWM d JZWE d JZWC m JXV^ m GBU? d GBU\ m GDVA +d GDU^ m GEVE d GEU\ m GEVE d FtUh d GMUh m F~U\ d GJU\ m GBU^ d F?U\ +m GBU` d GAU\ m GEU` d GGU\ m GEU^ d GIU\ m FtUO m G\U} d G\U{ d G]U{ +d G]U} d G\U} m G\U? d G]U? d G_U} d G_U{ d G]Uy d G\Uy d GZU{ d GZU} +d G\VA d G]VC d GbVE d GiVE d GmVC d GoU? d GoUy d GmUv d GiUt m GlVC +d GmU? d GmUy d GlUv m GgVE d GjVC d GlU? d GlUy d GjUv d GgUt m GdUt +d GiUt d GlUr d GoUn d GpUj d GpUd d GoU` +stroke +m GoU` d GmU^ d GiU\ d GbU\ d G]U^ d G\U` d GZUd d GZUf d G\Uh d G]Uh +d G_Uf d G_Ud d G]Ub d G\Ub m GmUn d GoUj d GoUd d GmU` m GgUt d GjUr +d GlUp d GmUj d GmUd d GlU^ d GiU\ m G\Uf d G\Ud d G]Ud d G]Uf d G\Uf +m GYUO m G}VS m G}UO m H\VS m H\UO m H{VS m H{UO m IZVS m IZUO m IyVS +m IyUO m JeU? d JeU^ d JfU^ m JeU? d JfU? d JfU^ m JZUp d JqUp d JqUn +m JZUp d JZUn d JqUn m JXUO m GBTp d GBTM m GDTr d GDTO m GETv d GETM +m GETv d FtTY d GMTY m F~TM d GJTM m GBTO d F?TM m GBTQ d GATM m GETQ +d GGTM m GETO d GITM m FtS? m GgTp d GgTM m GiTr d GiTO m GjTv d GjTM +m GjTv d GYTY d GrTY m GbTM d GoTM m GgTO d GdTM m GgTQ d GeTM m GjTQ +d GlTM m GjTO d GmTM m GYS? m G}UC m G}S? m H\UC m H\S? m H{UC m H{S? +m IZUC m IZS? m IyUC m IyS? m JdTO d JbTM d J_TM d J]TO d J]TQ d J_TS +d JbTS d JdTQ d JdTK d JbTG d J]TE m J_TQ d J_TO d JbTO d JbTQ d J_TQ +m JbTM d JdTK m JdTO d JbTG m JXS? m GBSa d GBR~ m GDSc d GDS@ m GESf +d GER~ m GESf d FtSI d GMSI m F~R~ d GJR~ m GBS@ d F?R~ m GBSB d GAR~ +m GESB d GGR~ m GES@ d GIR~ m FtRp m G]Sf d GZSS d G]SW d GbSY d GgSY +d GlSW d GoSS d GpSM d GpSI d GoSC d GlS@ d GgR~ d GbR~ d G]S@ d G\SB +d GZSE d GZSG d G\SI d G]SI d G_SG d G_SE d G]SC d G\SC m GmSS d GoSO +d GoSG d GmSC m GgSY d GjSW d GlSU d GmSO d GmSG d GlSB d GjS@ d GgR~ +m G\SG d G\SE d G]SE d G]SG d G\SG m G]Sf d GmSf m G]Se d GjSe m G]Sc +d GdSc d GjSe d GmSf m GYRp m G}St m G}Rp m H\St m H\Rp m H{St m H{Rp +m IZSt m IZRp m IySt m IyRp m JZSQ d JqSQ d JqSO m JZSQ d JZSO d JqSO +m JXRp m GBRQ d GBQn m GDRS d GDQp m GERW d GEQn m GERW d FtQz d GMQz +m F~Qn d GJQn m GBQp d F?Qn m GBQr d GAQn m GEQr d GGQn m GEQp d GIQn +m FtQa m GlRQ d GlRO d GmRO d GmRQ d GlRQ m GmRS d GlRS d GjRQ d GjRO +d GlRM d GmRM d GoRO d GoRQ d GmRU d GjRW d GeRW d GaRU d G]RQ d G\RM +d GZRF d GZQz d G\Qt d G_Qp d GdQn d GgQn d GlQp d GoQt d GpQz d GpQ| +d GoRB d GlRF d GgRH d GdRH d GaRF d G_RD d G]R@ m G_RQ d G]RM d G\RF +d G\Qz d G]Qt d G_Qr m GmQt d GoQx d GoQ~ d GmRB m GeRW d GbRU d GaRS +d G_RO d G]RH d G]Qz d G_Qt d GaQp d GdQn m GgQn d GjQp d GlQr d GmQx +d GmQ~ d GlRD d GjRF d GgRH m GYQa m G}Re m G}Qa m H\Re m H\Qa m H{Re +m H{Qa m IZRe m IZQa m IyRe m IyQa m J_Qt d J]Qr d J]Qp d J_Qn d JbQn +d JdQp d JdQr d JbQt d J_Qt m J_Qr d J_Qp d JbQp d JbQr d J_Qr m JXQa +m GBQB d GBP_ m GDQD d GDPa m GEQH d GEP_ m GEQH d FtPk d GMPk m F~P_ +d GJP_ m GBPa d F?P_ m GBPc d GAP_ m GEPc d GGP_ m GEPa d GIP_ m FtPQ +m GZQH d GZP| m GpQH d GpQB d GoP| d GiPr d GgPo d GePg d GeP_ m GgPq +d GePm d GdPg d GdP_ m GoP| d GgPr d GdPm d GbPg d GbP_ d GeP_ m GZQ@ +d G\QD d G_QH d GbQH d GjQB d GmQB d GoQD d GpQH m G]QD d G_QF d GbQF +d GeQD m GZQ@ d G\QB d G_QD d GbQD d GjQB m GYPQ m G}QU m G}PQ m H\QU +m H\PQ m H{QU m H{PQ m IZQU m IZPQ m IyQU m IyPQ m JqQP d JXPQ d JYPQ +m JqQP d JsQP d JYPQ m JXPQ m GBOs d GBOP m GDOu d GDOR m GEOy d GEOP +m GEOy d FtO[ d GMO[ m F~OP d GJOP m GBOR d F?OP m GBOT d GAOP m GEOT +d GGOP m GEOR d GIOP m FtOB m GbOy d G]Ow d G\Os d G\Om d G]Oi d GbOg +d GiOg d GmOi d GoOm d GoOs d GmOw d GiOy d GbOy m G_Ow d G]Os d G]Om +d G_Oi m GlOi d GmOm d GmOs d GlOw m GbOy d GaOw d G_Os d G_Om d GaOi +d GbOg m GiOg d GjOi d GlOm d GlOs d GjOw d GiOy m GbOg d G]Oe d G\Oc +d GZO_ d GZOW d G\OT d G]OR d GbOP d GiOP d GmOR d GoOT d GpOW d GpO_ +d GoOc d GmOe d GiOg m G]Oc d G\O_ d G\OW d G]OT m GmOT d GoOW d GoO_ +d GmOc m GbOg d G_Oe d G]O_ d G]OW d G_OR d GbOP m GiOP d GlOR d GmOW +d GmO_ d GlOe d GiOg m GYOB m G}PF m G}OB m H\PF m H\OB m H{PF m H{OB +m IZPF m IZOB m IyPF m IyOB m JcOy d J^Ow d J[Oq d JYOg d JYOa d J[OW +d J^OR d JcOP d JfOP d JkOR d JnOW d JoOa d JoOg d JnOq d JkOw d JfOy +d JcOy m J^Ou d J\Oq d J[Oi d J[O_ d J\OW d J^OT m JkOT d JlOW d JnO_ +d JnOi d JlOq d JkOu m JcOy d J`Ow d J^Os d J\Oi d J\O_ d J^OV d J`OR +d JcOP m JfOP d JiOR d JkOV d JlO_ d JlOi d JkOs d JiOw d JfOy m JXOB +m GBNc d GBN@ m GDNe d GDNB m GENi d GEN@ m GENi d FtNL d GMNL m F~N@ +d GJN@ m GBNB d F?N@ m GBND d GAN@ m GEND d GGN@ m GENB d GIN@ m FtMs +m G]NH d G]NF d G_NF d G_NH d G]NH m GmNX d GlNT d GjNR d GgNP d GdNP +d G_NR d G\NV d GZN[ d GZN] d G\Nc d G_Ng d GdNi d GgNi d GlNg d GoNc +d GpN] d GpNR d GoNJ d GmNF d GjNB d GeN@ d GaN@ d G]NB d G\NF d G\NH +d G]NJ d G_NJ d GaNH d GaNF d G_ND d G]ND m G]NV d G\NZ d G\N_ d G]Nc +m GlNe d GmNc d GoN] d GoNR d GmNJ d GlNF m GdNP d GaNR d G_NT d G]NZ +d G]N_ d G_Ne d GaNg d GdNi m GgNi d GjNg d GlNc d GmN] d GmNP d GlNH +d GjND d GiNB d GeN@ m GYMs m G}Nw m G}Ms m H\Nw m H\Ms m H{Nw m H{Ms +m IZNw m IZMs m IyNw m IyMs m JcNe d JcN@ m JdNe d JdNB m JfNi d JfN@ +m JfNi d JaNc d J^Na m J\N@ d JlN@ m JcNB d J`N@ m JcND d JaN@ m JfND +d JgN@ m JfNB d JiN@ m JXMs m FyMZ d FvMF d FyMJ d F~ML d GBML d GGMJ +d GJMF d GLMA d GLL} d GJLw d GGLs d GBLq d F~Lq d FyLs d FwLu d FvLy +d FvL{ d FwL} d FyL} d FzL{ d FzLy d FyLw d FwLw m GIMF d GJMC d GJL{ +d GILw m GBML d GEMJ d GGMH d GIMC d GIL{ d GGLu d GELs d GBLq m FwL{ +d FwLy d FyLy d FyL{ d FwL{ m FyMZ d GIMZ m FyMX d GEMX m FyMV d F?MV +d GEMX d GIMZ m FtLc m GdMZ d G_MX d G\MR d GZMH d GZMC d G\Ly d G_Ls +d GdLq d GgLq d GlLs d GoLy d GpMC d GpMH d GoMR d GlMX d GgMZ d GdMZ +m G_MV d G]MR d G\MJ d G\MA d G]Ly d G_Lu m GlLu d GmLy d GoMA d GoMJ +d GmMR d GlMV m GdMZ d GaMX d G_MT d G]MJ d G]MA d G_Lw d GaLs d GdLq +m GgLq d GjLs d GlLw d GmMA d GmMJ d GlMT d GjMX +stroke +m GjMX d GgMZ m GYLc m G}Mg m G}Lc m H\Mg m H\Lc m H{Mg m H{Lc m IZMg +m IZLc m IyMg m IyLc m J[MR d J[MP d J\MP d J\MR d J[MR m J[MT d J\MT +d J^MR d J^MP d J\MN d J[MN d JYMP d JYMR d J[MV d J\MX d JaMZ d JgMZ +d JlMX d JnMV d JoMR d JoMN d JnMJ d JiMF d JaMC d J^MA d J[L} d JYLw +d JYLq m JlMV d JnMR d JnMN d JlMJ m JgMZ d JkMX d JlMR d JlMN d JkMJ +d JgMF d JaMC m JYLu d J[Lw d J^Lw d JfLu d JlLu d JoLw m J^Lw d JfLs +d JlLs d JnLu m J^Lw d JfLq d JlLq d JnLs d JoLw d JoL{ m JXLc m FyLK +d FvKw d FyK{ d F~K} d GBK} d GGK{ d GJKw d GLKq d GLKm d GJKg d GGKd +d GBKb d F~Kb d FyKd d FwKf d FvKi d FvKk d FwKm d FyKm d FzKk d FzKi +d FyKg d FwKg m GIKw d GJKs d GJKk d GIKg m GBK} d GEK{ d GGKy d GIKs +d GIKk d GGKf d GEKd d GBKb m FwKk d FwKi d FyKi d FyKk d FwKk m FyLK +d GILK m FyLI d GELI m FyLG d F?LG d GELI d GILK m FtKT m GdLG d GdKb +m GeLG d GeKd m GgLK d GgKb m GgLK d GbLE d G_LC m G]Kb d GmKb m GdKd +d GaKb m GdKf d GbKb m GgKf d GiKb m GgKd d GjKb m GYKT m G}LX m G}KT +m H\LX m H\KT m H{LX m H{KT m IZLX m IZKT m IyLX m IyKT m J[LC d J[LA +d J\LA d J\LC d J[LC m J[LE d J\LE d J^LC d J^LA d J\K? d J[K? d JYLA +d JYLC d J[LG d J\LI d JaLK d JgLK d JlLI d JnLE d JnK? d JlK{ d JgKy +m JkLI d JlLE d JlK? d JkK{ m JfLK d JiLI d JkLE d JkK? d JiK{ d JfKy +m JcKy d JgKy d JkKw d JnKs d JoKo d JoKi d JnKf d JlKd d JgKb d JaKb +d J\Kd d J[Kf d JYKi d JYKk d J[Km d J\Km d J^Kk d J^Ki d J\Kg d J[Kg +m JlKs d JnKo d JnKi d JlKf m JfKy d JiKw d JkKu d JlKo d JlKi d JkKd +d JgKb m J[Kk d J[Ki d J\Ki d J\Kk d J[Kk m JXKT m FyJ{ d FvJh d FyJl +d F~Jn d GBJn d GGJl d GJJh d GLJb d GLJ^ d GJJX d GGJT d GBJR d F~JR +d FyJT d FwJV d FvJZ d FvJ\ d FwJ^ d FyJ^ d FzJ\ d FzJZ d FyJX d FwJX +m GIJh d GJJd d GJJ\ d GIJX m GBJn d GEJl d GGJj d GIJd d GIJ\ d GGJV +d GEJT d GBJR m FwJ\ d FwJZ d FyJZ d FyJ\ d FwJ\ m FyJ{ d GIJ{ m FyJy +d GEJy m FyJw d F?Jw d GEJy d GIJ{ m FtJE m G\Js d G\Jq d G]Jq d G]Js +d G\Js m G\Ju d G]Ju d G_Js d G_Jq d G]Jo d G\Jo d GZJq d GZJs d G\Jw +d G]Jy d GbJ{ d GiJ{ d GmJy d GoJw d GpJs d GpJo d GoJl d GjJh d GbJd +d G_Jb d G\J^ d GZJX d GZJR m GmJw d GoJs d GoJo d GmJl m GiJ{ d GlJy +d GmJs d GmJo d GlJl d GiJh d GbJd m GZJV d G\JX d G_JX d GgJV d GmJV +d GpJX m G_JX d GgJT d GmJT d GoJV m G_JX d GgJR d GmJR d GoJT d GpJX +d GpJ\ m GYJE m G}KI m G}JE m H\KI m H\JE m H{KI m H{JE m IZKI m IZJE +m IyKI m IyJE m JfJu d JfJR m JgJw d JgJT m JiJ{ d JiJR m JiJ{ d JXJ^ +d JqJ^ m JaJR d JnJR m JfJT d JcJR m JfJV d JdJR m JiJV d JkJR m JiJT +d JlJR m JXJE m FyIl d FvIX d FyI\ d F~I^ d GBI^ d GGI\ d GJIX d GLIS +d GLIO d GJII d GGIE d GBIC d F~IC d FyIE d FwIG d FvIK d FvIM d FwIO +d FyIO d FzIM d FzIK d FyII d FwII m GIIX d GJIT d GJIM d GIII m GBI^ +d GEI\ d GGIZ d GIIT d GIIM d GGIG d GEIE d GBIC m FwIM d FwIK d FyIK +d FyIM d FwIM m FyIl d GIIl m FyIj d GEIj m FyIh d F?Ih d GEIj d GIIl +m FtHu m G\Id d G\Ib d G]Ib d G]Id d G\Id m G\If d G]If d G_Id d G_Ib +d G]I` d G\I` d GZIb d GZId d G\Ih d G]Ij d GbIl d GiIl d GmIj d GoIf +d GoI` d GmI\ d GiIZ m GlIj d GmIf d GmI` d GlI\ m GgIl d GjIj d GlIf +d GlI` d GjI\ d GgIZ m GdIZ d GiIZ d GlIX d GoIT d GpIQ d GpIK d GoIG +d GmIE d GiIC d GbIC d G]IE d G\IG d GZIK d GZIM d G\IO d G]IO d G_IM +d G_IK d G]II d G\II m GmIT d GoIQ d GoIK d GmIG m GgIZ d GjIX d GlIV +d GmIQ d GmIK d GlIE d GiIC m G\IM d G\IK d G]IK d G]IM d G\IM m GYHu +m G}Iy m G}Hu m H\Iy m H\Hu m H{Iy m H{Hu m IZIy m IZHu m IyIy m IyHu +m J\Il d JYIX d J\I\ d JaI^ d JfI^ d JkI\ d JnIX d JoIS d JoIO d JnII +d JkIE d JfIC d JaIC d J\IE d J[IG d JYIK d JYIM d J[IO d J\IO d J^IM +d J^IK d J\II d J[II m JlIX d JnIT d JnIM d JlII m JfI^ d JiI\ d JkIZ +d JlIT d JlIM d JkIG d JiIE d JfIC m J[IM d J[IK d J\IK d J\IM d J[IM +m J\Il d JlIl m J\Ij d JiIj m J\Ih d JcIh d JiIj d JlIl m JXHu m FyH\ +d FvHI d FyHM d F~HO d GBHO d GGHM d GJHI d GLHC d GLG? d GJGy d GGGv +d GBGt d F~Gt d FyGv d FwGx d FvG{ d FvG} d FwG? d FyG? d FzG} d FzG{ +d FyGy d FwGy m GIHI d GJHE d GJG} d GIGy m GBHO d GEHM d GGHK d GIHE +d GIG} d GGGx d GEGv d GBGt m FwG} d FwG{ d FyG{ d FyG} d FwG} m FyH\ +d GIH\ m FyH[ d GEH[ m FyHY d F?HY d GEH[ d GIH\ m FtGf m GgHW d GgGt +m GiHY d GiGv m GjH\ d GjGt m GjH\ d GYG? d GrG? m GbGt d GoGt m GgGv +d GdGt m GgGx d GeGt m GjGx d GlGt m GjGv d GmGt m GYGf m G}Hj m G}Gf +m H\Hj m H\Gf m H{Hj m H{Gf m IZHj m IZGf m IyHj m IyGf m JkHW d JkHU +d JlHU d JlHW d JkHW m JlHY d JkHY d JiHW d JiHU d JkHS d JlHS d JnHU +d JnHW d JlH[ d JiH\ d JdH\ d J`H[ d J\HW d J[HS d JYHK d JYG? d J[Gy +d J^Gv d JcGt d JfGt d JkGv d JnGy d JoG? d JoHA d JnHG d JkHK d JfHM +d JcHM d J`HK d J^HI d J\HE m J^HW d J\HS d J[HK d J[G? d J\Gy d J^Gx +m JlGy d JnG} d JnHC d JlHG m JdH\ d JaH[ d J`HY d J^HU d J\HM d J\G? +d J^Gy d J`Gv d JcGt m JfGt d JiGv d JkGx d JlG} d JlHC d JkHI d JiHK +d JfHM m JXGf m FyGM d FvFz d FyF~ d F~G@ d GBG@ +stroke +m GBG@ d GGF~ d GJFz d GLFt d GLFp d GJFj d GGFf d GBFd d F~Fd d FyFf +d FwFh d FvFl d FvFn d FwFp d FyFp d FzFn d FzFl d FyFj d FwFj m GIFz +d GJFv d GJFn d GIFj m GBG@ d GEF~ d GGF| d GIFv d GIFn d GGFh d GEFf +d GBFd m FwFn d FwFl d FyFl d FyFn d FwFn m FyGM d GIGM m FyGK d GEGK +m FyGI d F?GI d GEGK d GIGM m FtFW m G]GM d GZFz d G]F~ d GbG@ d GgG@ +d GlF~ d GoFz d GpFt d GpFp d GoFj d GlFf d GgFd d GbFd d G]Ff d G\Fh +d GZFl d GZFn d G\Fp d G]Fp d G_Fn d G_Fl d G]Fj d G\Fj m GmFz d GoFv +d GoFn d GmFj m GgG@ d GjF~ d GlF| d GmFv d GmFn d GlFh d GjFf d GgFd +m G\Fn d G\Fl d G]Fl d G]Fn d G\Fn m G]GM d GmGM m G]GK d GjGK m G]GI +d GdGI d GjGK d GmGM m GYFW m G}G[ m G}FW m H\G[ m H\FW m H{G[ m H{FW +m IZG[ m IZFW m IyG[ m IyFW m JYGM d JYGA m JoGM d JoGG d JnGA d JgFx +d JfFt d JdFl d JdFd m JfFv d JdFr d JcFl d JcFd m JnGA d JfFx d JcFr +d JaFl d JaFd d JdFd m JYGE d J[GI d J^GM d JaGM d JiGG d JlGG d JnGI +d JoGM m J\GI d J^GK d JaGK d JdGI m JYGE d J[GG d J^GI d JaGI d JiGG +m JXFW m RTcn d RQcZ d RTc^ d RYc` d R^c` d Rbc^ d RfcZ d RgcU d RgcQ +d RfcK d RbcG d R^cE d RYcE d RTcG d RRcI d RQcM d RQcO d RRcQ d RTcQ +d RVcO d RVcM d RTcK d RRcK m RdcZ d RfcV d RfcO d RdcK m R^c` d Rac^ +d Rbc\ d RdcV d RdcO d RbcI d RacG d R^cE m RRcO d RRcM d RTcM d RTcO +d RRcO m RTcn d Rdcn m RTcl d Racl m RTcj d RZcj d Racl d Rdcn m RObw +m SGch d SGcf d SIcf d SIch d SGch m SIcj d SGcj d SEch d SEcf d SGcd +d SIcd d SJcf d SJch d SIcl d SEcn d SAcn d R|cl d Rych d Rwcd d Rvc\ +d RvcQ d RwcK d RzcG d R?cE d SBcE d SGcG d SJcK d SLcQ d SLcS d SJcX +d SGc\ d SBc^ d R?c^ d R|c\ d RzcZ d RycV m Rzch d Rycd d Rwc\ d RwcQ +d RycK d RzcI m SIcK d SJcO d SJcU d SIcX m SAcn d R~cl d R|cj d Rzcf +d Ryc^ d RycQ d RzcK d R|cG d R?cE m SBcE d SEcG d SGcI d SIcO d SIcU +d SGcZ d SEc\ d SBc^ m Rtbw m SYc{ m SYbw m Sxc{ m Sxbw m TVc{ m TVbw +m Tuc{ m Tubw m UTc{ m UTbw m U}cn d Uxcl d Uvch d Uvcb d Uxc^ d U}c\ +d VCc\ d VHc^ d VIcb d VIch d VHcl d VCcn d U}cn m Uycl d Uxch d Uxcb +d Uyc^ m VFc^ d VHcb d VHch d VFcl m U}cn d U{cl d Uych d Uycb d U{c^ +d U}c\ m VCc\ d VDc^ d VFcb d VFch d VDcl d VCcn m U}c\ d UxcZ d UvcX +d UucU d UucM d UvcI d UxcG d U}cE d VCcE d VHcG d VIcI d VKcM d VKcU +d VIcX d VHcZ d VCc\ m UxcX d UvcU d UvcM d UxcI m VHcI d VIcM d VIcU +d VHcX m U}c\ d UycZ d UxcU d UxcM d UycG d U}cE m VCcE d VFcG d VHcM +d VHcU d VFcZ d VCc\ m Usbw m RTb^ d RQbK d RTbO d RYbQ d R^bQ d RbbO +d RfbK d RgbE d RgbA d Rfa{ d Rbax d R^av d RYav d RTax d RRaz d RQa} +d RQa? d RRbA d RTbA d RVa? d RVa} d RTa{ d RRa{ m RdbK d RfbG d Rfa? +d Rda{ m R^bQ d RabO d RbbM d RdbG d Rda? d Rbaz d Raax d R^av m RRa? +d RRa} d RTa} d RTa? d RRa? m RTb^ d Rdb^ m RTb] d Rab] m RTb[ d RZb[ +d Rab] d Rdb^ m ROah m Rvb^ d RvbS m SLb^ d SLbY d SJbS d SDbI d SBbE +d SAa} d SAav m SBbG d SAbC d R?a} d R?av m SJbS d SBbI d R?bC d R~a} +d R~av d SAav m RvbW d Rwb[ d Rzb^ d R~b^ d SEbY d SIbY d SJb[ d SLb^ +m Ryb[ d Rzb] d R~b] d SAb[ m RvbW d RwbY d Rzb[ d R~b[ d SEbY m Rtah +m SYbl m SYah m Sxbl m Sxah m TVbl m TVah m Tubl m Tuah m UTbl m UTah +m Uxa} d Uxa{ d Uya{ d Uya} d Uxa} m VHbM d VFbI d VDbG d VAbE d U~bE +d UybG d UvbK d UubQ d UubS d UvbY d Uyb] d U~b^ d VAb^ d VFb] d VIbY +d VKbS d VKbG d VIa? d VHa{ d VDax d V@av d U{av d Uxax d Uva{ d Uva} +d Uxa? d Uya? d U{a} d U{a{ d Uyaz d Uxaz m UxbK d UvbO d UvbU d UxbY +m VFb[ d VHbY d VIbS d VIbG d VHa? d VFa{ m U~bE d U{bG d UybI d UxbO +d UxbU d Uyb[ d U{b] d U~b^ m VAb^ d VDb] d VFbY d VHbS d VHbE d VFa} +d VDaz d VCax d V@av m Usah m RTaO d RQ`| d RTa@ d RYaB d R^aB d Rba@ +d Rf`| d Rg`v d Rg`r d Rf`l d Rb`h d R^`f d RY`f d RT`h d RR`j d RQ`n +d RQ`p d RR`r d RT`r d RV`p d RV`n d RT`l d RR`l m Rd`| d Rf`x d Rf`p +d Rd`l m R^aB d Raa@ d Rb`~ d Rd`x d Rd`p d Rb`j d Ra`h d R^`f m RR`p +d RR`n d RT`n d RT`p d RR`p m RTaO d RdaO m RTaM d RaaM m RTaK d RZaK +d RaaM d RdaO m RO`Y m R~aO d RyaM d RwaI d RwaC d Rya@ d R~`~ d SD`~ +d SIa@ d SJaC d SJaI d SIaM d SDaO d R~aO m RzaM d RyaI d RyaC d Rza@ +m SGa@ d SIaC d SIaI d SGaM m R~aO d R|aM d RzaI d RzaC d R|a@ d R~`~ +m SD`~ d SEa@ d SGaC d SGaI d SEaM d SDaO m R~`~ d Ry`| d Rw`z d Rv`v +d Rv`n d Rw`j d Ry`h d R~`f d SD`f d SI`h d SJ`j d SL`n d SL`v d SJ`z +d SI`| d SD`~ m Ry`z d Rw`v d Rw`n d Ry`j m SI`j d SJ`n d SJ`v d SI`z +m R~`~ d Rz`| d Ry`v d Ry`n d Rz`h d R~`f m SD`f d SG`h d SI`n d SI`v +d SG`| d SD`~ m Rt`Y m SYa] m SY`Y m Sxa] m Sx`Y m TVa] m TV`Y m Tua] +m Tu`Y m UTa] m UT`Y m UzaB d Uxa@ d Ux`~ d Uz`| d U}`| d U?`~ d U?a@ +d U}aB d UzaB m Uza@ d Uz`~ d U}`~ d U}a@ d Uza@ m Uz`l d Ux`j d Ux`h +d Uz`f d U}`f d U?`h d U?`j d U}`l d Uz`l m Uz`j d Uz`h d U}`h +stroke +m U}`h d U}`j d Uz`j m Us`Y m RT`@ d RQ_l d RT_p d RY_r d R^_r d Rb_p +d Rf_l d Rg_g d Rg_c d Rf_] d Rb_Y d R^_W d RY_W d RT_Y d RR_[ d RQ__ +d RQ_a d RR_c d RT_c d RV_a d RV__ d RT_] d RR_] m Rd_l d Rf_i d Rf_a +d Rd_] m R^_r d Ra_p d Rb_n d Rd_i d Rd_a d Rb_[ d Ra_Y d R^_W m RR_a +d RR__ d RT__ d RT_a d RR_a m RT`@ d Rd`@ m RT_~ d Ra_~ m RT_| d RZ_| +d Ra_~ d Rd`@ m RO_I m Ry__ d Ry_] d Rz_] d Rz__ d Ry__ m SI_n d SG_j +d SE_i d SB_g d R?_g d Rz_i d Rw_l d Rv_r d Rv_t d Rw_z d Rz_~ d R?`@ +d SB`@ d SG_~ d SJ_z d SL_t d SL_i d SJ_a d SI_] d SE_Y d SA_W d R|_W +d Ry_Y d Rw_] d Rw__ d Ry_a d Rz_a d R|__ d R|_] d Rz_[ d Ry_[ m Ry_l +d Rw_p d Rw_v d Ry_z m SG_| d SI_z d SJ_t d SJ_i d SI_a d SG_] m R?_g +d R|_i d Rz_j d Ry_p d Ry_v d Rz_| d R|_~ d R?`@ m SB`@ d SE_~ d SG_z +d SI_t d SI_g d SG__ d SE_[ d SD_Y d SA_W m Rt_I m SY`M m SY_I m Sx`M +m Sx_I m TV`M m TV_I m Tu`M m Tu_I m UT`M m UT_I m Uz_r d Ux_p d Ux_n +d Uz_l d U}_l d U?_n d U?_p d U}_r d Uz_r m Uz_p d Uz_n d U}_n d U}_p +d Uz_p m U?_Y d U}_W d Uz_W d Ux_Y d Ux_[ d Uz_] d U}_] d U?_[ d U?_U +d U}_Q d Ux_O m Uz_[ d Uz_Y d U}_Y d U}_[ d Uz_[ m U}_W d U?_U m U?_Y +d U}_Q m Us_I m Rb^k d Rb^i d Rd^i d Rd^k d Rb^k m Rd^m d Rb^m d Ra^k +d Ra^i d Rb^g d Rd^g d Rf^i d Rf^k d Rd^o d Ra^p d R\^p d RW^o d RT^k +d RR^g d RQ^_ d RQ^S d RR^M d RV^J d RZ^H d R^^H d Rb^J d Rf^M d Rg^S +d Rg^U d Rf^[ d Rb^_ d R^^a d RZ^a d RW^_ d RV^] d RT^Y m RV^k d RT^g +d RR^_ d RR^S d RT^M d RV^K m Rd^M d Rf^Q d Rf^W d Rd^[ m R\^p d RY^o +d RW^m d RV^i d RT^a d RT^S d RV^M d RW^J d RZ^H m R^^H d Ra^J d Rb^K +d Rd^Q d Rd^W d Rb^] d Ra^_ d R^^a m RO]z m R?^p d Rz^o d Rw^i d Rv^_ +d Rv^Y d Rw^O d Rz^J d R?^H d SB^H d SG^J d SJ^O d SL^Y d SL^_ d SJ^i +d SG^o d SB^p d R?^p m Rz^m d Ry^i d Rw^a d Rw^W d Ry^O d Rz^K m SG^K +d SI^O d SJ^W d SJ^a d SI^i d SG^m m R?^p d R|^o d Rz^k d Ry^a d Ry^W +d Rz^M d R|^J d R?^H m SB^H d SE^J d SG^M d SI^W d SI^a d SG^k d SE^o +d SB^p m Rt]z m SY^~ m SY]z m Sx^~ m Sx]z m TV^~ m TV]z m Tu^~ m Tu]z +m UT^~ m UT]z m VL^k d Uv^Y d VL^H m Us]z m Rb][ d Rb]Y d Rd]Y d Rd][ +d Rb][ m Rd]] d Rb]] d Ra][ d Ra]Y d Rb]W d Rd]W d Rf]Y d Rf][ d Rd]_ +d Ra]a d R\]a d RW]_ d RT][ d RR]W d RQ]P d RQ]D d RR\~ d RV\z d RZ\x +d R^\x d Rb\z d Rf\~ d Rg]D d Rg]F d Rf]L d Rb]P d R^]R d RZ]R d RW]P +d RV]N d RT]J m RV][ d RT]W d RR]P d RR]D d RT\~ d RV\| m Rd\~ d Rf]B +d Rf]H d Rd]L m R\]a d RY]_ d RW]] d RV]Y d RT]R d RT]D d RV\~ d RW\z +d RZ\x m R^\x d Ra\z d Rb\| d Rd]B d Rd]H d Rb]N d Ra]P d R^]R m RO\k +m R?]] d R?\x m SA]] d SA\z m SB]a d SB\x m SB]a d R~][ d Rz]Y m Ry\x +d SI\x m R?\z d R|\x m R?\| d R~\x m SB\| d SD\x m SB\z d SE\x m Rt\k +m SY]o m SY\k m Sx]o m Sx\k m TV]o m TV\k m Tu]o m Tu\k m UT]o m UT\k +m Uv]S d VL]S d VL]R m Uv]S d Uv]R d VL]R m Uv]D d VL]D d VL]B m Uv]D +d Uv]B d VL]B m Us\k m Rb\L d Rb\J d Rd\J d Rd\L d Rb\L m Rd\N d Rb\N +d Ra\L d Ra\J d Rb\H d Rd\H d Rf\J d Rf\L d Rd\P d Ra\R d R\\R d RW\P +d RT\L d RR\H d RQ\@ d RQ[u d RR[o d RV[k d RZ[i d R^[i d Rb[k d Rf[o +d Rg[u d Rg[w d Rf[| d Rb\@ d R^\B d RZ\B d RW\@ d RV[~ d RT[{ m RV\L +d RT\H d RR\@ d RR[u d RT[o d RV[m m Rd[o d Rf[s d Rf[y d Rd[| m R\\R +d RY\P d RW\N d RV\J d RT\B d RT[u d RV[o d RW[k d RZ[i m R^[i d Ra[k +d Rb[m d Rd[s d Rd[y d Rb[~ d Ra\@ d R^\B m RO[[ m Rw\J d Rw\H d Ry\H +d Ry\J d Rw\J m Rw\L d Ry\L d Rz\J d Rz\H d Ry\F d Rw\F d Rv\H d Rv\J +d Rw\N d Ry\P d R~\R d SD\R d SI\P d SJ\N d SL\J d SL\F d SJ\B d SE[~ +d R~[{ d Rz[y d Rw[u d Rv[o d Rv[i m SI\N d SJ\J d SJ\F d SI\B m SD\R +d SG\P d SI\J d SI\F d SG\B d SD[~ d R~[{ m Rv[m d Rw[o d Rz[o d SB[m +d SI[m d SL[o m Rz[o d SB[k d SI[k d SJ[m m Rz[o d SB[i d SI[i d SJ[k +d SL[o d SL[s m Rt[[ m SY\_ m SY[[ m Sx\_ m Sx[[ m TV\_ m TV[[ m Tu\_ +m Tu[[ m UT\_ m UT[[ m Uv\L d VL[{ d Uv[i m Us[[ m RbZ} d RbZ{ d RdZ{ +d RdZ} d RbZ} m RdZ? d RbZ? d RaZ} d RaZ{ d RbZy d RdZy d RfZ{ d RfZ} +d Rd[A d Ra[C d R\[C d RW[A d RTZ} d RRZy d RQZq d RQZe d RRZ` d RVZ\ +d RZZZ d R^ZZ d RbZ\ d RfZ` d RgZe d RgZg d RfZm d RbZq d R^Zs d RZZs +d RWZq d RVZo d RTZk m RVZ} d RTZy d RRZq d RRZe d RTZ` d RVZ^ m RdZ` +d RfZc d RfZi d RdZm m R\[C d RY[A d RWZ? d RVZ{ d RTZs d RTZe d RVZ` +d RWZ\ d RZZZ m R^ZZ d RaZ\ d RbZ^ d RdZc d RdZi d RbZo d RaZq d R^Zs +m ROZL m RwZ{ d RwZy d RyZy d RyZ{ d RwZ{ m RwZ} d RyZ} d RzZ{ d RzZy +d RyZw d RwZw d RvZy d RvZ{ d RwZ? d Ry[A d R~[C d SD[C d SI[A d SJZ} +d SJZw d SIZs d SDZq m SG[A d SIZ} d SIZw d SGZs m SB[C d SE[A d SGZ} +d SGZw d SEZs d SBZq m R?Zq d SDZq d SGZo d SJZk d SLZg d SLZa d SJZ^ +d SIZ\ d SDZZ d R~ZZ d RyZ\ d RwZ^ d RvZa d RvZc d RwZe d RyZe d RzZc +d RzZa d RyZ` d RwZ` +stroke +m RwZ` m SIZk d SJZg d SJZa d SIZ^ m SBZq d SEZo d SGZm d SIZg d SIZa +d SGZ\ d SDZZ m RwZc d RwZa d RyZa d RyZc d RwZc m RtZL m SY[P m SYZL +m Sx[P m SxZL m TV[P m TVZL m Tu[P m TuZL m UT[P m UTZL m UvZy d UvZ{ +d UxZ{ d UxZw d UuZw d UuZ{ d UvZ? d Ux[A d U{[C d VB[C d VG[A d VHZ? +d VJZ{ d VJZw d VHZs d VGZq d V@Zm m VGZ? d VHZ} d VHZu d VGZs m VB[C +d VE[A d VGZ} d VGZu d VEZq d VDZo m U?Zm d U?Zg d V@Zg d V@Zm d U?Zm +m U?Z` d U}Z^ d U}Z\ d U?ZZ d V@ZZ d VBZ\ d VBZ^ d V@Z` d U?Z` m U?Z^ +d U?Z\ d V@Z\ d V@Z^ d U?Z^ m UsZL m RbYm d RbYk d RdYk d RdYm d RbYm +m RdYo d RbYo d RaYm d RaYk d RbYi d RdYi d RfYk d RfYm d RdYq d RaYs +d R\Ys d RWYq d RTYm d RRYi d RQYb d RQYV d RRYP d RVYL d RZYJ d R^YJ +d RbYL d RfYP d RgYV d RgYX d RfY^ d RbYb d R^Yd d RZYd d RWYb d RVY` +d RTY\ m RVYm d RTYi d RRYb d RRYV d RTYP d RVYN m RdYP d RfYT d RfYZ +d RdY^ m R\Ys d RYYq d RWYo d RVYk d RTYd d RTYV d RVYP d RWYL d RZYJ +m R^YJ d RaYL d RbYN d RdYT d RdYZ d RbY` d RaYb d R^Yd m ROX} m SBYm +d SBYJ m SDYo d SDYL m SEYs d SEYJ m SEYs d RtYV d SMYV m R~YJ d SJYJ +m SBYL d R?YJ m SBYN d SAYJ m SEYN d SGYJ m SEYL d SIYJ m RtX} m SYZA +m SYX} m SxZA m SxX} m TVZA m TVX} m TuZA m TuX} m UTZA m UTX} m VGYd +d VFYg d VCYi d U?Yi d U}Yg d U|Ye d UzY` d UzYZ d U|YV d U~YT d VBYT +d VDYV d VFYZ m U?Yi d U}Ye d U|Y` d U|YZ d U}YV d U~YT m VGYi d VFYZ +d VFYV d VHYT d VKYT d VMYX d VNY^ d VNYb d VMYg d VLYk d VIYo d VGYq +d VCYs d U?Ys d U|Yq d UyYo d UwYk d UuYg d UtYb d UtY\ d UuYV d UwYR +d UyYN d U|YL d U?YJ d VCYJ d VGYL d VIYN d VKYP m VHYi d VGYZ d VGYV +d VHYT m UsX} m RbX^ d RbX\ d RdX\ d RdX^ d RbX^ m RdX` d RbX` d RaX^ +d RaX\ d RbXZ d RdXZ d RfX\ d RfX^ d RdXb d RaXd d R\Xd d RWXb d RTX^ +d RRXZ d RQXR d RQXG d RRXA d RVW} d RZW{ d R^W{ d RbW} d RfXA d RgXG +d RgXI d RfXN d RbXR d R^XT d RZXT d RWXR d RVXP d RTXM m RVX^ d RTXZ +d RRXR d RRXG d RTXA d RVW? m RdXA d RfXE d RfXK d RdXN m R\Xd d RYXb +d RWX` d RVX\ d RTXT d RTXG d RVXA d RWW} d RZW{ m R^W{ d RaW} d RbW? +d RdXE d RdXK d RbXP d RaXR d R^XT m ROWm m RyXd d RvXP d RyXT d R~XV +d SBXV d SGXT d SJXP d SLXK d SLXG d SJXA d SGW} d SBW{ d R~W{ d RyW} +d RwW? d RvXC d RvXE d RwXG d RyXG d RzXE d RzXC d RyXA d RwXA m SIXP +d SJXM d SJXE d SIXA m SBXV d SEXT d SGXR d SIXM d SIXE d SGW? d SEW} +d SBW{ m RwXE d RwXC d RyXC d RyXE d RwXE m RyXd d SIXd m RyXb d SEXb +m RyX` d R?X` d SEXb d SIXd m RtWm m SYXq m SYWm m SxXq m SxWm m TVXq +m TVWm m TuXq m TuWm m UTXq m UTWm m V@Xd d UuW} m U~X^ d VHW{ m V@X^ +d VIW{ m V@Xd d VKW{ m UxXG d VFXG m UsW{ d U{W{ m VCW{ d VNW{ m UuW} +d UsW{ m UuW} d UxW{ m VHW} d VDW{ m VHW? d VFW{ m VIW? d VLW{ m UsWm +m RbWO d RbWM d RdWM d RdWO d RbWO m RdWQ d RbWQ d RaWO d RaWM d RbWK +d RdWK d RfWM d RfWO d RdWS d RaWT d R\WT d RWWS d RTWO d RRWK d RQWC +d RQVw d RRVq d RVVn d RZVl d R^Vl d RbVn d RfVq d RgVw d RgVy d RfV? +d RbWC d R^WE d RZWE d RWWC d RVWA d RTV} m RVWO d RTWK d RRWC d RRVw +d RTVq d RVVp m RdVq d RfVu d RfV{ d RdV? m R\WT d RYWS d RWWQ d RVWM +d RTWE d RTVw d RVVq d RWVn d RZVl m R^Vl d RaVn d RbVp d RdVu d RdV{ +d RbWA d RaWC d R^WE m ROV^ m SGWO d SGWM d SIWM d SIWO d SGWO m SIWQ +d SGWQ d SEWO d SEWM d SGWK d SIWK d SJWM d SJWO d SIWS d SEWT d SAWT +d R|WS d RyWO d RwWK d RvWC d RvVw d RwVq d RzVn d R?Vl d SBVl d SGVn +d SJVq d SLVw d SLVy d SJV? d SGWC d SBWE d R?WE d R|WC d RzWA d RyV} +m RzWO d RyWK d RwWC d RwVw d RyVq d RzVp m SIVq d SJVu d SJV{ d SIV? +m SAWT d R~WS d R|WQ d RzWM d RyWE d RyVw d RzVq d R|Vn d R?Vl m SBVl +d SEVn d SGVp d SIVu d SIV{ d SGWA d SEWC d SBWE m RtV^ m SYWb m SYV^ +m SxWb m SxV^ m TVWb m TVV^ m TuWb m TuV^ m UTWb m UTV^ m UwWT d UwVl +m UyWS d UyVn m UzWT d UzVl m UsWT d VEWT d VIWS d VKWQ d VLWM d VLWI +d VKWE d VIWC d VEWA m VIWQ d VKWM d VKWI d VIWE m VEWT d VHWS d VIWO +d VIWG d VHWC d VEWA m UzWA d VEWA d VIV? d VKV} d VLVy d VLVs d VKVp +d VIVn d VEVl d UsVl m VIV} d VKVy d VKVs d VIVp m VEWA d VHV? d VIV{ +d VIVq d VHVn d VEVl m UtWT d UwWS m UvWT d UwWQ m U|WT d UzWQ m U}WT +d UzWS m UwVn d UtVl m UwVp d UvVl m UzVp d U|Vl m UzVn d U}Vl m UsV^ +m RbU? d RbU} d RdU} d RdU? d RbU? m RdVA d RbVA d RaU? d RaU} d RbU{ +d RdU{ d RfU} d RfU? d RdVC d RaVE d R\VE d RWVC d RTU? d RRU{ d RQUt +d RQUh d RRUb d RVU^ d RZU\ d R^U\ d RbU^ d RfUb d RgUh d RgUj d RfUp +d RbUt d R^Uv d RZUv d RWUt d RVUr d RTUn m RVU? d RTU{ d RRUt d RRUh +d RTUb d RVU` m RdUb d RfUf d RfUl d RdUp m R\VE d RYVC d RWVA d RVU} +d RTUv d RTUh d RVUb d RWU^ d RZU\ m R^U\ d RaU^ d RbU` d RdUf d RdUl +d RbUr d RaUt d R^Uv m ROUO m RvVE d RvUy m SLVE d SLU? d SJUy d SDUp +d SBUl d SAUd d SAU\ m SBUn d SAUj d R?Ud d R?U\ m SJUy d SBUp d R?Uj +d R~Ud d R~U\ d SAU\ m RvU} d RwVA d RzVE d R~VE d SEU? d SIU? +stroke +m SIU? d SJVA d SLVE m RyVA d RzVC d R~VC d SAVA m RvU} d RwU? d RzVA +d R~VA d SEU? m RtUO m SYVS m SYUO m SxVS m SxUO m TVVS m TVUO m TuVS +m TuUO m UTVS m UTUO m VJU? d VKVE d VKUy d VJU? d VGVC d VDVE d U?VE +d U{VC d UxU? d UvU{ d UtUv d UtUl d UvUf d UxUb d U{U^ d U?U\ d VDU\ +d VGU^ d VJUb d VKUf m UyU? d UxU{ d UvUv d UvUl d UxUf d UyUb m U?VE +d U|VC d UyU} d UxUv d UxUl d UyUd d U|U^ d U?U\ m UsUO m RbTp d RbTn +d RdTn d RdTp d RbTp m RdTr d RbTr d RaTp d RaTn d RbTl d RdTl d RfTn +d RfTp d RdTt d RaTv d R\Tv d RWTt d RTTp d RRTl d RQTd d RQTY d RRTS +d RVTO d RZTM d R^TM d RbTO d RfTS d RgTY d RgT[ d RfT` d RbTd d R^Tf +d RZTf d RWTd d RVTb d RTT^ m RVTp d RTTl d RRTd d RRTY d RTTS d RVTQ +m RdTS d RfTW d RfT] d RdT` m R\Tv d RYTt d RWTr d RVTn d RTTf d RTTY +d RVTS d RWTO d RZTM m R^TM d RaTO d RbTQ d RdTW d RdT] d RbTb d RaTd +d R^Tf m ROS? m R~Tv d RyTt d RwTp d RwTj d RyTf d R~Td d SDTd d SITf +d SJTj d SJTp d SITt d SDTv d R~Tv m RzTt d RyTp d RyTj d RzTf m SGTf +d SITj d SITp d SGTt m R~Tv d R|Tt d RzTp d RzTj d R|Tf d R~Td m SDTd +d SETf d SGTj d SGTp d SETt d SDTv m R~Td d RyTb d RwT` d RvT] d RvTU +d RwTQ d RyTO d R~TM d SDTM d SITO d SJTQ d SLTU d SLT] d SJT` d SITb +d SDTd m RyT` d RwT] d RwTU d RyTQ m SITQ d SJTU d SJT] d SIT` m R~Td +d RzTb d RyT] d RyTU d RzTO d R~TM m SDTM d SGTO d SITU d SIT] d SGTb +d SDTd m RtS? m SYUC m SYS? m SxUC m SxS? m TVUC m TVS? m TuUC m TuS? +m UTUC m UTS? m UwTv d UwTM m UyTt d UyTO m UzTv d UzTM m UsTv d VBTv +d VFTt d VITp d VKTl d VLTf d VLT] d VKTW d VITS d VFTO d VBTM d UsTM +m VHTp d VITl d VKTf d VKT] d VITW d VHTS m VBTv d VETt d VHTn d VITf +d VIT] d VHTU d VETO d VBTM m UtTv d UwTt m UvTv d UwTr m U|Tv d UzTr +m U}Tv d UzTt m UwTO d UtTM m UwTQ d UvTM m UzTQ d U|TM m UzTO d U}TM +m UsS? m RbSa d RbS_ d RdS_ d RdSa d RbSa m RdSc d RbSc d RaSa d RaS_ +d RbS] d RdS] d RfS_ d RfSa d RdSe d RaSf d R\Sf d RWSe d RTSa d RRS] +d RQSU d RQSI d RRSC d RVS@ d RZR~ d R^R~ d RbS@ d RfSC d RgSI d RgSK +d RfSQ d RbSU d R^SW d RZSW d RWSU d RVSS d RTSO m RVSa d RTS] d RRSU +d RRSI d RTSC d RVSB m RdSC d RfSG d RfSM d RdSQ m R\Sf d RYSe d RWSc +d RVS_ d RTSW d RTSI d RVSC d RWS@ d RZR~ m R^R~ d RaS@ d RbSB d RdSG +d RdSM d RbSS d RaSU d R^SW m RORp m RySE d RySC d RzSC d RzSE d RySE +m SISU d SGSQ d SESO d SBSM d R?SM d RzSO d RwSS d RvSY d RvS[ d RwSa +d RzSe d R?Sf d SBSf d SGSe d SJSa d SLS[ d SLSO d SJSG d SISC d SES@ +d SAR~ d R|R~ d RyS@ d RwSC d RwSE d RySG d RzSG d R|SE d R|SC d RzSB +d RySB m RySS d RwSW d RwS] d RySa m SGSc d SISa d SJS[ d SJSO d SISG +d SGSC m R?SM d R|SO d RzSQ d RySW d RyS] d RzSc d R|Se d R?Sf m SBSf +d SESe d SGSa d SIS[ d SISM d SGSE d SESB d SDS@ d SAR~ m RtRp m SYSt +m SYRp m SxSt m SxRp m TVSt m TVRp m TuSt m TuRp m UTSt m UTRp m UxSf +d UxR~ m UySe d UyS@ m U{Sf d U{R~ m UsSf d VKSf d VKS[ m U{SS d VDSS +m VDS[ d VDSK m UsR~ d VKR~ d VKSI m UtSf d UxSe m UvSf d UxSc m U|Sf +d U{Sc m U~Sf d U{Se m VDSf d VKSe m VGSf d VKSc m VHSf d VKSa m VJSf +d VKS[ m VDS[ d VBSS d VDSK m VDSW d VASS d VDSO m VDSU d U~SS d VDSQ +m UxS@ d UtR~ m UxSB d UvR~ m U{SB d U|R~ m U{S@ d U~R~ m VDR~ d VKS@ +m VGR~ d VKSB m VHR~ d VKSC m VJR~ d VKSI m UsRp m RQRW d RQRK m RgRW +d RgRQ d RfRK d R_RB d R^Q~ d R\Qv d R\Qn m R^R@ d R\Q| d RZQv d RZQn +m RfRK d R^RB d RZQ| d RYQv d RYQn d R\Qn m RQRO d RRRS d RVRW d RYRW +d RaRQ d RdRQ d RfRS d RgRW m RTRS d RVRU d RYRU d R\RS m RQRO d RRRQ +d RVRS d RYRS d RaRQ m ROQa m R?RW d RzRU d RwRO d RvRF d RvR@ d RwQv +d RzQp d R?Qn d SBQn d SGQp d SJQv d SLR@ d SLRF d SJRO d SGRU d SBRW +d R?RW m RzRS d RyRO d RwRH d RwQ~ d RyQv d RzQr m SGQr d SIQv d SJQ~ +d SJRH d SIRO d SGRS m R?RW d R|RU d RzRQ d RyRH d RyQ~ d RzQt d R|Qp +d R?Qn m SBQn d SEQp d SGQt d SIQ~ d SIRH d SGRQ d SERU d SBRW m RtQa +m SYRe m SYQa m SxRe m SxQa m TVRe m TVQa m TuRe m TuQa m UTRe m UTQa +m UxRW d UxQn m UyRU d UyQp m U{RW d U{Qn m UsRW d VLRW d VLRK m U{RD +d VDRD m VDRK d VDQ| m UsQn d V@Qn m UuRW d UxRU m UvRW d UxRS m U}RW +d U{RS m U~RW d U{RU m VDRW d VLRU m VHRW d VLRS m VIRW d VLRQ m VKRW +d VLRK m VDRK d VCRD d VDQ| m VDRH d VARD d VDR@ m VDRF d U~RD d VDRB +m UxQp d UuQn m UxQr d UvQn m U{Qr d U}Qn m U{Qp d U~Qn m UsQa m RQQH +d RQP| m RgQH d RgQB d RfP| d R_Pr d R^Po d R\Pg d R\P_ m R^Pq d R\Pm +d RZPg d RZP_ m RfP| d R^Pr d RZPm d RYPg d RYP_ d R\P_ m RQQ@ d RRQD +d RVQH d RYQH d RaQB d RdQB d RfQD d RgQH m RTQD d RVQF d RYQF d R\QD +m RQQ@ d RRQB d RVQD d RYQD d RaQB m ROPQ m R?QD d R?P_ m SAQD d SAPa +m SBQH d SBP_ m SBQH d R~QB d RzQ@ m RyP_ d SIP_ m R?Pa d R|P_ m R?Pc +d R~P_ m SBPc d SDP_ m SBPa d SEP_ m RtPQ m SYQU m SYPQ m SxQU m SxPQ +m TVQU m TVPQ m TuQU m TuPQ m UTQU m UTPQ m VHQB d VJQH d VJP| d VHQB +d VEQF d VCQH d U~QH d UzQF d UwQB d UvP~ d UtPx d UtPo d UvPi d UwPe +d UzPa d U~P_ d VCP_ d VEPa d VHPa d VJP_ d VJPo m UyQB d UwP~ d UvPx +d UvPo d UwPi d UyPe m U~QH d U{QF d UyQ@ d UwPx d UwPo d UyPg d U{Pa +d U~P_ m VHPm d VHPc m VGPo d VGPc d VEPa m VCPo d VNPo m VDPo d VGPm +m VEPo d VGPk m VKPo d VJPk m VLPo d VJPm m UsPQ m RQOy d RQOm m RgOy +d RgOs d RfOm d R_Oc +stroke +m R_Oc d R^O_ d R\OW d R\OP m R^Oa d R\O] d RZOW d RZOP m RfOm d R^Oc +d RZO] d RYOW d RYOP d R\OP m RQOq d RROu d RVOy d RYOy d RaOs d RdOs +d RfOu d RgOy m RTOu d RVOw d RYOw d R\Ou m RQOq d RROs d RVOu d RYOu +d RaOs m ROOB m RwOq d RwOo d RyOo d RyOq d RwOq m RwOs d RyOs d RzOq +d RzOo d RyOm d RwOm d RvOo d RvOq d RwOu d RyOw d R~Oy d SDOy d SIOw +d SJOu d SLOq d SLOm d SJOi d SEOe d R~Oa d RzO_ d RwO[ d RvOV d RvOP +m SIOu d SJOq d SJOm d SIOi m SDOy d SGOw d SIOq d SIOm d SGOi d SDOe +d R~Oa m RvOT d RwOV d RzOV d SBOT d SIOT d SLOV m RzOV d SBOR d SIOR +d SJOT m RzOV d SBOP d SIOP d SJOR d SLOV d SLOY m RtOB m SYPF m SYOB +m SxPF m SxOB m TVPF m TVOB m TuPF m TuOB m UTPF m UTOB m UwOy d UwOP +m UxOw d UxOR m UzOy d UzOP m VHOy d VHOP m VIOw d VIOR m VJOy d VJOP +m UsOy d U~Oy m VCOy d VNOy m UzOe d VHOe m UsOP d U~OP m VCOP d VNOP +m UtOy d UwOw m UvOy d UwOu m U{Oy d UzOu m U}Oy d UzOw m VEOy d VHOw +m VFOy d VHOu m VLOy d VJOu m VMOy d VJOw m UwOR d UtOP m UwOT d UvOP +m UzOT d U{OP m UzOR d U}OP m VHOR d VEOP m VHOT d VFOP m VJOT d VLOP +m VJOR d VMOP m UsOB m RQNi d RQN] m RgNi d RgNc d RfN] d R_NT d R^NP +d R\NH d R\N@ m R^NR d R\NN d RZNH d RZN@ m RfN] d R^NT d RZNN d RYNH +d RYN@ d R\N@ m RQNa d RRNe d RVNi d RYNi d RaNc d RdNc d RfNe d RgNi +m RTNe d RVNg d RYNg d R\Ne m RQNa d RRNc d RVNe d RYNe d RaNc m ROMs +m RwNa d RwN_ d RyN_ d RyNa d RwNa m RwNc d RyNc d RzNa d RzN_ d RyN] +d RwN] d RvN_ d RvNa d RwNe d RyNg d R~Ni d SDNi d SINg d SJNc d SJN] +d SINZ d SDNX m SGNg d SINc d SIN] d SGNZ m SBNi d SENg d SGNc d SGN] +d SENZ d SBNX m R?NX d SDNX d SGNV d SJNR d SLNN d SLNH d SJND d SINB +d SDN@ d R~N@ d RyNB d RwND d RvNH d RvNJ d RwNL d RyNL d RzNJ d RzNH +d RyNF d RwNF m SINR d SJNN d SJNH d SIND m SBNX d SENV d SGNT d SINN +d SINH d SGNB d SDN@ m RwNJ d RwNH d RyNH d RyNJ d RwNJ m RtMs m SYNw +m SYMs m SxNw m SxMs m TVNw m TVMs m TuNw m TuMs m UTNw m UTMs m UzNi +d UzN@ m U|Ng d U|NB m U?Ni d U?N@ m UsNi d VFNi m UsN@ d VFN@ m UuNi +d UzNg m UxNi d UzNe m VANi d U?Ne m VCNi d U?Ng m UzNB d UuN@ m UzND +d UxN@ m U?ND d VAN@ m U?NB d VCN@ m UsMs m RQMZ d RQMN m RgMZ d RgMT +d RfMN d R_MD d R^MA d R\Ly d R\Lq m R^MC d R\L? d RZLy d RZLq m RfMN +d R^MD d RZL? d RYLy d RYLq d R\Lq m RQMR d RRMV d RVMZ d RYMZ d RaMT +d RdMT d RfMV d RgMZ m RTMV d RVMX d RYMX d R\MV m RQMR d RRMT d RVMV +d RYMV d RaMT m ROLc m SBMT d SBLq m SDMV d SDLs m SEMZ d SELq m SEMZ +d RtL} d SML} m R~Lq d SJLq m SBLs d R?Lq m SBLu d SALq m SELu d SGLq +m SELs d SILq m RtLc m SYMg m SYLc m SxMg m SxLc m TVMg m TVLc m TuMg +m TuLc m UTMg m UTLc m V@MZ d V@Ly d U~Ls d U|Lq m VBMX d VBLy d V@Ls +m VDMZ d VDLy d VBLs d U|Lq d UyLq d UuLs d UsLw d UsL{ d UuL} d UwL} +d UyL{ d UyLy d UwLw d UuLw m UuL{ d UuLy d UwLy d UwL{ d UuL{ m U{MZ +d VJMZ m U|MZ d V@MX m U~MZ d V@MV m VFMZ d VDMV m VHMZ d VDMX m UsLc +m RQLK d RQK? m RgLK d RgLE d RfK? d R_Ku d R^Kq d R\Ki d R\Kb m R^Ks +d R\Ko d RZKi d RZKb m RfK? d R^Ku d RZKo d RYKi d RYKb d R\Kb m RQLC +d RRLG d RVLK d RYLK d RaLE d RdLE d RfLG d RgLK m RTLG d RVLI d RYLI +d R\LG m RQLC d RRLE d RVLG d RYLG d RaLE m ROKT m RyLK d RvKw d RyK{ +d R~K} d SBK} d SGK{ d SJKw d SLKq d SLKm d SJKg d SGKd d SBKb d R~Kb +d RyKd d RwKf d RvKi d RvKk d RwKm d RyKm d RzKk d RzKi d RyKg d RwKg +m SIKw d SJKs d SJKk d SIKg m SBK} d SEK{ d SGKy d SIKs d SIKk d SGKf +d SEKd d SBKb m RwKk d RwKi d RyKi d RyKk d RwKk m RyLK d SILK m RyLI +d SELI m RyLG d R?LG d SELI d SILK m RtKT m SYLX m SYKT m SxLX m SxKT +m TVLX m TVKT m TuLX m TuKT m UTLX m UTKT m UwLK d UwKb m UyLI d UyKd +m UzLK d UzKb m VKLI d UzKs m U?Kw d VIKb m V@Kw d VKKb m V@K{ d VLKb +m UsLK d U?LK m VFLK d VOLK m UsKb d U?Kb m VEKb d VOKb m UtLK d UwLI +m UvLK d UwLG m U|LK d UzLG m U}LK d UzLI m VILK d VKLI m VMLK d VKLI +m UwKd d UtKb m UwKf d UvKb m UzKf d U|Kb m UzKd d U}Kb m VIKf d VFKb +m VIKf d VMKb m UsKT m RQJ{ d RQJo m RgJ{ d RgJu d RfJo d R_Jf d R^Jb +d R\JZ d R\JR m R^Jd d R\J` d RZJZ d RZJR m RfJo d R^Jf d RZJ` d RYJZ +d RYJR d R\JR m RQJs d RRJw d RVJ{ d RYJ{ d RaJu d RdJu d RfJw d RgJ{ +m RTJw d RVJy d RYJy d R\Jw m RQJs d RRJu d RVJw d RYJw d RaJu m ROJE +m SGJu d SGJs d SIJs d SIJu d SGJu m SIJw d SGJw d SEJu d SEJs d SGJq +d SIJq d SJJs d SJJu d SIJy d SEJ{ d SAJ{ d R|Jy d RyJu d RwJq d RvJj +d RvJ^ d RwJX d RzJT d R?JR d SBJR d SGJT d SJJX d SLJ^ d SLJ` d SJJf +d SGJj d SBJl d R?Jl d R|Jj d RzJh d RyJd m RzJu d RyJq d RwJj d RwJ^ +d RyJX d RzJV m SIJX d SJJ\ d SJJb d SIJf m SAJ{ d R~Jy d R|Jw d RzJs +d RyJl d RyJ^ d RzJX d R|JT d R?JR m SBJR d SEJT d SGJV d SIJ\ d SIJb +d SGJh d SEJj d SBJl m RtJE m SYKI m SYJE m SxKI m SxJE m TVKI m TVJE +m TuKI m TuJE m UTKI m UTJE m UxJ{ d UxJR m UzJy d UzJT m U|J{ d U|JR +m UsJ{ d VAJ{ m UsJR d VMJR d VMJ^ m UuJ{ d UxJy m UvJ{ d UxJw m U}J{ +d U|Jw m U?J{ d U|Jy m UxJT d UuJR m UxJV d UvJR m U|JV d U}JR m U|JT +d U?JR m VDJR d VMJT m VHJR d VMJV m VIJR d VMJX m VKJR d VMJ^ m UsJE +m RQIl d RQI` m RgIl d RgIf d RfI` d R_IV d R^IS d R\IK d R\IC m R^IT +d R\IQ d RZIK d RZIC m RfI` d R^IV d RZIQ d RYIK d RYIC d R\IC m RQId +d RRIh d RVIl d RYIl d RaIf d RdIf d RfIh d RgIl m RTIh d RVIj d RYIj +d R\Ih m RQId d RRIf d RVIh d RYIh d RaIf m ROHu m RvIl d RvI` m SLIl +d SLIf d SJI` d SDIV d SBIS d SAIK d SAIC m SBIT d SAIQ d R?IK d R?IC +m SJI` d SBIV d R?IQ d R~IK d R~IC d SAIC m RvId d RwIh d RzIl d R~Il +d SEIf +stroke +m SEIf d SIIf d SJIh d SLIl m RyIh d RzIj d R~Ij d SAIh m RvId d RwIf +d RzIh d R~Ih d SEIf m RtHu m SYIy m SYHu m SxIy m SxHu m TVIy m TVHu +m TuIy m TuHu m UTIy m UTHu m UwIl d UwIE m UwIl d V@IC m UxIl d V@II +m UyIl d VAII m VIIl d V@IC m VIIl d VIIC m VJIj d VJIE m VKIl d VKIC +m UsIl d UyIl m VIIl d VOIl m UsIC d U{IC m VEIC d VOIC m UtIl d UwIj +m VMIl d VKIh m VNIl d VKIj m UwIE d UtIC m UwIE d UyIC m VIIE d VFIC +m VIIG d VHIC m VKIG d VMIC m VKIE d VNIC m UsHu m RQH\ d RQHQ m RgH\ +d RgHW d RfHQ d R_HG d R^HC d R\G{ d R\Gt m R^HE d R\HA d RZG{ d RZGt +m RfHQ d R^HG d RZHA d RYG{ d RYGt d R\Gt m RQHU d RRHY d RVH\ d RYH\ +d RaHW d RdHW d RfHY d RgH\ m RTHY d RVH[ d RYH[ d R\HY m RQHU d RRHW +d RVHY d RYHY d RaHW m ROGf m R~H\ d RyH[ d RwHW d RwHQ d RyHM d R~HK +d SDHK d SIHM d SJHQ d SJHW d SIH[ d SDH\ d R~H\ m RzH[ d RyHW d RyHQ +d RzHM m SGHM d SIHQ d SIHW d SGH[ m R~H\ d R|H[ d RzHW d RzHQ d R|HM +d R~HK m SDHK d SEHM d SGHQ d SGHW d SEH[ d SDH\ m R~HK d RyHI d RwHG +d RvHC d RvG{ d RwGx d RyGv d R~Gt d SDGt d SIGv d SJGx d SLG{ d SLHC +d SJHG d SIHI d SDHK m RyHG d RwHC d RwG{ d RyGx m SIGx d SJG{ d SJHC +d SIHG m R~HK d RzHI d RyHC d RyG{ d RzGv d R~Gt m SDGt d SGGv d SIG{ +d SIHC d SGHI d SDHK m RtGf m SYHj m SYGf m SxHj m SxGf m TVHj m TVGf +m TuHj m TuGf m UTHj m UTGf m UwH\ d UwGv m UwH\ d VJGt m UxH\ d VIGy +m UzH\ d VJGy m VJH[ d VJGt m UsH\ d UzH\ m VFH\ d VNH\ m UsGt d U{Gt +m UtH\ d UwH[ m VHH\ d VJH[ m VMH\ d VJH[ m UwGv d UtGt m UwGv d UzGt +m UsGf m RQGM d RQGA m RgGM d RgGG d RfGA d R_Fx d R^Ft d R\Fl d R\Fd +m R^Fv d R\Fr d RZFl d RZFd m RfGA d R^Fx d RZFr d RYFl d RYFd d R\Fd +m RQGE d RRGI d RVGM d RYGM d RaGG d RdGG d RfGI d RgGM m RTGI d RVGK +d RYGK d R\GI m RQGE d RRGG d RVGI d RYGI d RaGG m ROFW m RyFl d RyFj +d RzFj d RzFl d RyFl m SIF| d SGFx d SEFv d SBFt d R?Ft d RzFv d RwFz +d RvG@ d RvGA d RwGG d RzGK d R?GM d SBGM d SGGK d SJGG d SLGA d SLFv +d SJFn d SIFj d SEFf d SAFd d R|Fd d RyFf d RwFj d RwFl d RyFn d RzFn +d R|Fl d R|Fj d RzFh d RyFh m RyFz d RwF~ d RwGC d RyGG m SGGI d SIGG +d SJGA d SJFv d SIFn d SGFj m R?Ft d R|Fv d RzFx d RyF~ d RyGC d RzGI +d R|GK d R?GM m SBGM d SEGK d SGGG d SIGA d SIFt d SGFl d SEFh d SDFf +d SAFd m RtFW m SYG[ m SYFW m SxG[ m SxFW m TVG[ m TVFW m TuG[ m TuFW +m UTG[ m UTFW m U?GM d UzGK d UwGG d UvGC d UtF| d UtFv d UvFn d UwFj +d UzFf d U?Fd d VBFd d VFFf d VIFj d VKFn d VLFv d VLF| d VKGC d VIGG +d VFGK d VBGM d U?GM m UyGG d UwGC d UvF~ d UvFt d UwFn d UyFj m VHFj +d VIFn d VKFt d VKF~ d VIGC d VHGG m U?GM d U|GK d UyGE d UwF~ d UwFt +d UyFl d U|Ff d U?Fd m VBFd d VEFf d VHFl d VIFt d VIF~ d VHGE d VEGK +d VBGM m UsFW m ]Kc{ m ]Kbw m ]scn d ]ocl d ]mch d ]mcb d ]oc^ d ]sc\ +d ]zc\ d ]~c^ d ^@cb d ^@ch d ]~cl d ]zcn d ]scn m ]pcl d ]och d ]ocb +d ]pc^ m ]}c^ d ]~cb d ]~ch d ]}cl m ]scn d ]rcl d ]pch d ]pcb d ]rc^ +d ]sc\ m ]zc\ d ]{c^ d ]}cb d ]}ch d ]{cl d ]zcn m ]sc\ d ]ocZ d ]mcX +d ]kcU d ]kcM d ]mcI d ]ocG d ]scE d ]zcE d ]~cG d ^@cI d ^BcM d ^BcU +d ^@cX d ]~cZ d ]zc\ m ]ocX d ]mcU d ]mcM d ]ocI m ]~cI d ^@cM d ^@cU +d ]~cX m ]sc\ d ]pcZ d ]ocU d ]ocM d ]pcG d ]scE m ]zcE d ]}cG d ]~cM +d ]~cU d ]}cZ d ]zc\ m ]jbw m ^Zcn d ^Ucl d ^Rcf d ^Pc\ d ^PcV d ^RcM +d ^UcG d ^ZcE d ^]cE d ^bcG d ^ecM d ^fcV d ^fc\ d ^ecf d ^bcl d ^]cn +d ^Zcn m ^Ucj d ^Scf d ^Rc^ d ^RcU d ^ScM d ^UcI m ^bcI d ^ccM d ^ecU +d ^ec^ d ^ccf d ^bcj m ^Zcn d ^Vcl d ^Uch d ^Sc^ d ^ScU d ^UcK d ^VcG +d ^ZcE m ^]cE d ^`cG d ^bcK d ^ccU d ^cc^ d ^bch d ^`cl d ^]cn m ^Obw +m ^sc{ m ^sbw m _Rc{ m _Rbw m _qc{ m _qbw m `Pc{ m `Pbw m `oc{ m `obw +m aRcn d aRcE m aScl d aScG m aUcn d aUcE m aNcn d a_cn d adcl d aecj +d afcf d afc` d aec\ d adcZ d a_cX d aUcX m adcj d aecf d aec` d adc\ +m a_cn d abcl d adch d adc^ d abcZ d a_cX m aNcE d aYcE m aOcn d aRcl +m aPcn d aRcj m aVcn d aUcj m aXcn d aUcl m aRcG d aOcE m aRcI d aPcE +m aUcI d aVcE m aUcG d aXcE m aNbw m ]Kbl m ]Kah m ]sb^ d ]ob] d ]mbY +d ]mbS d ]obO d ]sbM d ]zbM d ]~bO d ^@bS d ^@bY d ]~b] d ]zb^ d ]sb^ +m ]pb] d ]obY d ]obS d ]pbO m ]}bO d ]~bS d ]~bY d ]}b] m ]sb^ d ]rb] +d ]pbY d ]pbS d ]rbO d ]sbM m ]zbM d ]{bO d ]}bS d ]}bY d ]{b] d ]zb^ +m ]sbM d ]obK d ]mbI d ]kbE d ]ka} d ]maz d ]oax d ]sav d ]zav d ]~ax +d ^@az d ^Ba} d ^BbE d ^@bI d ]~bK d ]zbM m ]obI d ]mbE d ]ma} d ]oaz +m ]~az d ^@a} d ^@bE d ]~bI m ]sbM d ]pbK d ]obE d ]oa} d ]pax d ]sav +m ]zav d ]}ax d ]~a} d ]~bE d ]}bK d ]zbM m ]jah m ^Zb[ d ^Zav m ^[b[ +d ^[ax m ^]b^ d ^]av m ^]b^ d ^XbY d ^UbW m ^Sav d ^cav m ^Zax d ^Vav +m ^Zaz d ^Xav m ^]az d ^^av m ^]ax d ^`av m ^Oah m ^sbl m ^sah m _Rbl +m _Rah m _qbl m _qah m `Pbl m `Pah m `obl m `oah m aYb^ d aUb] d aRbY +d aPbU d aObM d aObG d aPa? d aRa{ d aUax d aYav d a\av d aaax d ada{ +d aea? d afbG d afbM d aebU d adbY d aab] d a\b^ d aYb^ m aSbY d aRbU +d aPbO d aPbE d aRa? d aSa{ m aba{ d ada? d aebE d aebO d adbU d abbY +m aYb^ d aVb] d aSbW d aRbO d aRbE d aSa} d aVax d aYav m a\av d a_ax +d aba} d adbE d adbO d abbW d a_b] d a\b^ m aUa{ d aVa? d aYbA d a[bA +d a^a? d a_a{ d aaap d abal d aeal d afap d afat +stroke +m afat m aaat d abap d adan d aean m a_a{ d abar d adap d aeap d afar +m aNah m ]Ka] m ]K`Y m ]saO d ]oaM d ]maI d ]maC d ]oa@ d ]s`~ d ]z`~ +d ]~a@ d ^@aC d ^@aI d ]~aM d ]zaO d ]saO m ]paM d ]oaI d ]oaC d ]pa@ +m ]}a@ d ]~aC d ]~aI d ]}aM m ]saO d ]raM d ]paI d ]paC d ]ra@ d ]s`~ +m ]z`~ d ]{a@ d ]}aC d ]}aI d ]{aM d ]zaO m ]s`~ d ]o`| d ]m`z d ]k`v +d ]k`n d ]m`j d ]o`h d ]s`f d ]z`f d ]~`h d ^@`j d ^B`n d ^B`v d ^@`z +d ]~`| d ]z`~ m ]o`z d ]m`v d ]m`n d ]o`j m ]~`j d ^@`n d ^@`v d ]~`z +m ]s`~ d ]p`| d ]o`v d ]o`n d ]p`h d ]s`f m ]z`f d ]}`h d ]~`n d ]~`v +d ]}`| d ]z`~ m ]j`Y m ^RaG d ^RaE d ^SaE d ^SaG d ^RaG m ^RaI d ^SaI +d ^UaG d ^UaE d ^SaC d ^RaC d ^PaE d ^PaG d ^RaK d ^SaM d ^XaO d ^^aO +d ^caM d ^eaK d ^faG d ^faC d ^ea@ d ^``| d ^X`x d ^U`v d ^R`r d ^P`l +d ^P`f m ^caK d ^eaG d ^eaC d ^ca@ m ^^aO d ^baM d ^caG d ^caC d ^ba@ +d ^^`| d ^X`x m ^P`j d ^R`l d ^U`l d ^]`j d ^c`j d ^f`l m ^U`l d ^]`h +d ^c`h d ^e`j m ^U`l d ^]`f d ^c`f d ^e`h d ^f`l d ^f`p m ^O`Y m ^sa] +m ^s`Y m _Ra] m _R`Y m _qa] m _q`Y m `Pa] m `P`Y m `oa] m `o`Y m aRaO +d aR`f m aSaM d aS`h m aUaO d aU`f m aNaO d a_aO d adaM d aeaK d afaG +d afaC d aea@ d ad`~ d a_`| d aU`| m adaK d aeaG d aeaC d ada@ m a_aO +d abaM d adaI d adaB d ab`~ d a_`| m a[`| d a^`z d a_`v d ab`j d ad`f +d af`f d ah`j d ah`n m ab`n d ad`j d ae`h d af`h m a^`z d a_`x d ad`l +d ae`j d af`j d ah`l m aN`f d aY`f m aOaO d aRaM m aPaO d aRaK m aVaO +d aUaK m aXaO d aUaM m aR`h d aO`f m aR`j d aP`f m aU`j d aV`f m aU`h +d aX`f m aN`Y m ]K`M m ]K_I m ]s`@ d ]o_~ d ]m_z d ]m_t d ]o_p d ]s_n +d ]z_n d ]~_p d ^@_t d ^@_z d ]~_~ d ]z`@ d ]s`@ m ]p_~ d ]o_z d ]o_t +d ]p_p m ]}_p d ]~_t d ]~_z d ]}_~ m ]s`@ d ]r_~ d ]p_z d ]p_t d ]r_p +d ]s_n m ]z_n d ]{_p d ]}_t d ]}_z d ]{_~ d ]z`@ m ]s_n d ]o_l d ]m_j +d ]k_g d ]k__ d ]m_[ d ]o_Y d ]s_W d ]z_W d ]~_Y d ^@_[ d ^B__ d ^B_g +d ^@_j d ]~_l d ]z_n m ]o_j d ]m_g d ]m__ d ]o_[ m ]~_[ d ^@__ d ^@_g +d ]~_j m ]s_n d ]p_l d ]o_g d ]o__ d ]p_Y d ]s_W m ]z_W d ]}_Y d ]~__ +d ]~_g d ]}_l d ]z_n m ]j_I m ^R_x d ^R_v d ^S_v d ^S_x d ^R_x m ^R_z +d ^S_z d ^U_x d ^U_v d ^S_t d ^R_t d ^P_v d ^P_x d ^R_| d ^S_~ d ^X`@ +d ^^`@ d ^c_~ d ^e_z d ^e_t d ^c_p d ^^_n m ^b_~ d ^c_z d ^c_t d ^b_p +m ^]`@ d ^`_~ d ^b_z d ^b_t d ^`_p d ^]_n m ^Z_n d ^^_n d ^b_l d ^e_i +d ^f_e d ^f__ d ^e_[ d ^c_Y d ^^_W d ^X_W d ^S_Y d ^R_[ d ^P__ d ^P_a +d ^R_c d ^S_c d ^U_a d ^U__ d ^S_] d ^R_] m ^c_i d ^e_e d ^e__ d ^c_[ +m ^]_n d ^`_l d ^b_j d ^c_e d ^c__ d ^b_Y d ^^_W m ^R_a d ^R__ d ^S__ +d ^S_a d ^R_a m ^O_I m ^s`M m ^s_I m _R`M m _R_I m _q`M m _q_I m `P`M +m `P_I m `o`M m `o_I m ad_z d ae`@ d ae_t d ad_z d aa_~ d a\`@ d aW`@ +d aR_~ d aO_z d aO_t d aQ_p d aU_l d a__i d ab_g d ad_c d ad_] d ab_Y +m aQ_t d aR_p d aU_n d a__j d ab_i d ad_e m aR_~ d aQ_z d aQ_v d aR_r +d aU_p d a__l d ad_i d ae_e d ae__ d ad_[ d ab_Y d a]_W d aY_W d aT_Y +d aQ_] d aO_c d aO_W d aQ_] m aN_I m ]K^~ m ]K]z m ]s^p d ]o^o d ]m^k +d ]m^e d ]o^a d ]s^_ d ]z^_ d ]~^a d ^@^e d ^@^k d ]~^o d ]z^p d ]s^p +m ]p^o d ]o^k d ]o^e d ]p^a m ]}^a d ]~^e d ]~^k d ]}^o m ]s^p d ]r^o +d ]p^k d ]p^e d ]r^a d ]s^_ m ]z^_ d ]{^a d ]}^e d ]}^k d ]{^o d ]z^p +m ]s^_ d ]o^] d ]m^[ d ]k^W d ]k^O d ]m^K d ]o^J d ]s^H d ]z^H d ]~^J +d ^@^K d ^B^O d ^B^W d ^@^[ d ]~^] d ]z^_ m ]o^[ d ]m^W d ]m^O d ]o^K +m ]~^K d ^@^O d ^@^W d ]~^[ m ]s^_ d ]p^] d ]o^W d ]o^O d ]p^J d ]s^H +m ]z^H d ]}^J d ]~^O d ]~^W d ]}^] d ]z^_ m ]j]z m ^]^k d ^]^H m ^^^m +d ^^^J m ^`^p d ^`^H m ^`^p d ^O^S d ^h^S m ^X^H d ^e^H m ^]^J d ^Z^H +m ^]^K d ^[^H m ^`^K d ^b^H m ^`^J d ^c^H m ^O]z m ^s^~ m ^s]z m _R^~ +m _R]z m _q^~ m _q]z m `P^~ m `P]z m `o^~ m `o]z m aN^p d aN^e m aY^p +d aY^H m aZ^o d aZ^J m a\^p d a\^H m ag^p d ag^e m aN^p d ag^p m aT^H +d aa^H m aO^p d aN^e m aQ^p d aN^k m aR^p d aN^m m aU^p d aN^o m a_^p +d ag^o m ab^p d ag^m m ad^p d ag^k m ae^p d ag^e m aY^J d aU^H m aY^K +d aW^H m a\^K d a]^H m a\^J d a_^H m aN]z m ]K]o m ]K\k m ]s]a d ]o]_ +d ]m][ d ]m]U d ]o]R d ]s]P d ]z]P d ]~]R d ^@]U d ^@][ d ]~]_ d ]z]a +d ]s]a m ]p]_ d ]o][ d ]o]U d ]p]R m ]}]R d ]~]U d ]~][ d ]}]_ m ]s]a +d ]r]_ d ]p][ d ]p]U d ]r]R d ]s]P m ]z]P d ]{]R d ]}]U d ]}][ d ]{]_ +d ]z]a m ]s]P d ]o]N d ]m]L d ]k]H d ]k]@ d ]m\| d ]o\z d ]s\x d ]z\x +d ]~\z d ^@\| d ^B]@ d ^B]H d ^@]L d ]~]N d ]z]P m ]o]L d ]m]H d ]m]@ +d ]o\| m ]~\| d ^@]@ d ^@]H d ]~]L m ]s]P d ]p]N d ]o]H d ]o]@ d ]p\z +d ]s\x m ]z\x d ]}\z d ]~]@ d ]~]H d ]}]N d ]z]P m ]j\k m ^S]a d ^P]N +d ^S]R d ^X]S d ^]]S d ^b]R d ^e]N d ^f]H d ^f]D d ^e\~ d ^b\z d ^]\x +d ^X\x d ^S\z d ^R\| d ^P]@ d ^P]B d ^R]D d ^S]D d ^U]B d ^U]@ d ^S\~ +d ^R\~ m ^c]N d ^e]J d ^e]B d ^c\~ m ^]]S d ^`]R d ^b]P d ^c]J d ^c]B +d ^b\| d ^`\z d ^]\x m ^R]B d ^R]@ d ^S]@ d ^S]B d ^R]B m ^S]a d ^c]a +m ^S]_ d ^`]_ m ^S]] d ^Z]] d ^`]_ d ^c]a m ^O\k m ^s]o m ^s\k m _R]o +m _R\k m _q]o m _q\k m `P]o m `P\k m `o]o m `o\k m aR]a d aR]D d aS\~ +d aV\z d aZ\x d a]\x d aa\z d ac\~ d ae]D d ae]_ m aS]_ d aS]B +stroke +m aS]B d aT\~ m aT]a d aT]B d aV\| d aW\z d aZ\x m aN]a d aX]a m aa]a +d ai]a m aO]a d aR]_ m aP]a d aR]] m aV]a d aT]] m aW]a d aT]_ m ab]a +d ae]_ m ag]a d ae]_ m aN\k m ]K\_ m ]K[[ m ]s\R d ]o\P d ]m\L d ]m\F +d ]o\B d ]s\@ d ]z\@ d ]~\B d ^@\F d ^@\L d ]~\P d ]z\R d ]s\R m ]p\P +d ]o\L d ]o\F d ]p\B m ]}\B d ]~\F d ]~\L d ]}\P m ]s\R d ]r\P d ]p\L +d ]p\F d ]r\B d ]s\@ m ]z\@ d ]{\B d ]}\F d ]}\L d ]{\P d ]z\R m ]s\@ +d ]o[~ d ]m[| d ]k[y d ]k[q d ]m[m d ]o[k d ]s[i d ]z[i d ]~[k d ^@[m +d ^B[q d ^B[y d ^@[| d ]~[~ d ]z\@ m ]o[| d ]m[y d ]m[q d ]o[m m ]~[m +d ^@[q d ^@[y d ]~[| m ]s\@ d ]p[~ d ]o[y d ]o[q d ]p[k d ]s[i m ]z[i +d ]}[k d ]~[q d ]~[y d ]}[~ d ]z\@ m ]j[[ m ^b\L d ^b\J d ^c\J d ^c\L +d ^b\L m ^c\N d ^b\N d ^`\L d ^`\J d ^b\H d ^c\H d ^e\J d ^e\L d ^c\P +d ^`\R d ^[\R d ^V\P d ^S\L d ^R\H d ^P\@ d ^P[u d ^R[o d ^U[k d ^Z[i +d ^][i d ^b[k d ^e[o d ^f[u d ^f[w d ^e[| d ^b\@ d ^]\B d ^Z\B d ^V\@ +d ^U[~ d ^S[{ m ^U\L d ^S\H d ^R\@ d ^R[u d ^S[o d ^U[m m ^c[o d ^e[s +d ^e[y d ^c[| m ^[\R d ^X\P d ^V\N d ^U\J d ^S\B d ^S[u d ^U[o d ^V[k +d ^Z[i m ^][i d ^`[k d ^b[m d ^c[s d ^c[y d ^b[~ d ^`\@ d ^]\B m ^O[[ +m ^s\_ m ^s[[ m _R\_ m _R[[ m _q\_ m _q[[ m `P\_ m `P[[ m `o\_ m `o[[ +m aO\R d aZ[i m aQ\R d aZ[o d aZ[i m aR\R d a\[o m ae\P d aZ[i m aN\R +d aW\R m a_\R d ai\R m aN\R d aQ\N m aT\R d aR\N m aU\R d aR\P m ab\R +d ae\P m ag\R d ae\P m aN[[ m ]K[P m ]KZL m ]s[C d ]o[A d ]mZ} d ]mZw +d ]oZs d ]sZq d ]zZq d ]~Zs d ^@Zw d ^@Z} d ]~[A d ]z[C d ]s[C m ]p[A +d ]oZ} d ]oZw d ]pZs m ]}Zs d ]~Zw d ]~Z} d ]}[A m ]s[C d ]r[A d ]pZ} +d ]pZw d ]rZs d ]sZq m ]zZq d ]{Zs d ]}Zw d ]}Z} d ]{[A d ]z[C m ]sZq +d ]oZo d ]mZm d ]kZi d ]kZa d ]mZ^ d ]oZ\ d ]sZZ d ]zZZ d ]~Z\ d ^@Z^ +d ^BZa d ^BZi d ^@Zm d ]~Zo d ]zZq m ]oZm d ]mZi d ]mZa d ]oZ^ m ]~Z^ +d ^@Za d ^@Zi d ]~Zm m ]sZq d ]pZo d ]oZi d ]oZa d ]pZ\ d ]sZZ m ]zZZ +d ]}Z\ d ]~Za d ]~Zi d ]}Zo d ]zZq m ]jZL m ^P[C d ^PZw m ^f[C d ^fZ} +d ^eZw d ^^Zm d ^]Zi d ^[Za d ^[ZZ m ^]Zk d ^[Zg d ^ZZa d ^ZZZ m ^eZw +d ^]Zm d ^ZZg d ^XZa d ^XZZ d ^[ZZ m ^PZ{ d ^RZ? d ^U[C d ^X[C d ^`Z} +d ^cZ} d ^eZ? d ^f[C m ^SZ? d ^U[A d ^X[A d ^[Z? m ^PZ{ d ^RZ} d ^UZ? +d ^XZ? d ^`Z} m ^OZL m ^s[P m ^sZL m _R[P m _RZL m _q[P m _qZL m `P[P +m `PZL m `o[P m `oZL m aP[C d aVZZ m aR[C d aVZc d aVZZ m aS[C d aWZc +m a[[C d aWZc d aVZZ m a[[C d aaZZ m a][C d aaZc d aaZZ m a^[C d abZc +m af[A d abZc d aaZZ m aN[C d aW[C m a[[C d a^[C m ab[C d aj[C m aN[C +d aR[A m aO[C d aRZ? m aT[C d aSZ? m aV[C d aS[A m ac[C d af[A m ai[C +d af[A m aNZL m ]KZA m ]KX} m ]sYs d ]oYq d ]mYm d ]mYg d ]oYd d ]sYb +d ]zYb d ]~Yd d ^@Yg d ^@Ym d ]~Yq d ]zYs d ]sYs m ]pYq d ]oYm d ]oYg +d ]pYd m ]}Yd d ]~Yg d ]~Ym d ]}Yq m ]sYs d ]rYq d ]pYm d ]pYg d ]rYd +d ]sYb m ]zYb d ]{Yd d ]}Yg d ]}Ym d ]{Yq d ]zYs m ]sYb d ]oY` d ]mY^ +d ]kYZ d ]kYR d ]mYN d ]oYL d ]sYJ d ]zYJ d ]~YL d ^@YN d ^BYR d ^BYZ +d ^@Y^ d ]~Y` d ]zYb m ]oY^ d ]mYZ d ]mYR d ]oYN m ]~YN d ^@YR d ^@YZ +d ]~Y^ m ]sYb d ]pY` d ]oYZ d ]oYR d ]pYL d ]sYJ m ]zYJ d ]}YL d ]~YR +d ]~YZ d ]}Y` d ]zYb m ]jX} m ^XYs d ^SYq d ^RYm d ^RYg d ^SYd d ^XYb +d ^^Yb d ^cYd d ^eYg d ^eYm d ^cYq d ^^Ys d ^XYs m ^UYq d ^SYm d ^SYg +d ^UYd m ^bYd d ^cYg d ^cYm d ^bYq m ^XYs d ^VYq d ^UYm d ^UYg d ^VYd +d ^XYb m ^^Yb d ^`Yd d ^bYg d ^bYm d ^`Yq d ^^Ys m ^XYb d ^SY` d ^RY^ +d ^PYZ d ^PYR d ^RYN d ^SYL d ^XYJ d ^^YJ d ^cYL d ^eYN d ^fYR d ^fYZ +d ^eY^ d ^cY` d ^^Yb m ^SY^ d ^RYZ d ^RYR d ^SYN m ^cYN d ^eYR d ^eYZ +d ^cY^ m ^XYb d ^UY` d ^SYZ d ^SYR d ^UYL d ^XYJ m ^^YJ d ^bYL d ^cYR +d ^cYZ d ^bY` d ^^Yb m ^OX} m ^sZA m ^sX} m _RZA m _RX} m _qZA m _qX} +m `PZA m `PX} m `oZA m `oX} m aOYs d abYJ m aQYs d adYJ m aRYs d aeYJ +m adYq d aQYL m aNYs d aWYs m a_Ys d aiYs m aNYJ d aUYJ m a]YJ d aiYJ +m aNYs d aRYo m aTYs d aRYo m aUYs d aRYq m aaYs d adYq m agYs d adYq +m aQYL d aNYJ m aQYL d aTYJ m abYL d a_YJ m abYN d aaYJ m abYN d agYJ +m aNX} m ]KXq m ]KWm m ]sXd d ]oXb d ]mX^ d ]mXX d ]oXT d ]sXR d ]zXR +d ]~XT d ^@XX d ^@X^ d ]~Xb d ]zXd d ]sXd m ]pXb d ]oX^ d ]oXX d ]pXT +m ]}XT d ]~XX d ]~X^ d ]}Xb m ]sXd d ]rXb d ]pX^ d ]pXX d ]rXT d ]sXR +m ]zXR d ]{XT d ]}XX d ]}X^ d ]{Xb d ]zXd m ]sXR d ]oXP d ]mXN d ]kXK +d ]kXC d ]mW? d ]oW} d ]sW{ d ]zW{ d ]~W} d ^@W? d ^BXC d ^BXK d ^@XN +d ]~XP d ]zXR m ]oXN d ]mXK d ]mXC d ]oW? m ]~W? d ^@XC d ^@XK d ]~XN +m ]sXR d ]pXP d ]oXK d ]oXC d ]pW} d ]sW{ m ]zW{ d ]}W} d ]~XC d ]~XK +d ]}XP d ]zXR m ]jWm m ^SXC d ^SXA d ^UXA d ^UXC d ^SXC m ^cXR d ^bXN +d ^`XM d ^]XK d ^ZXK d ^UXM d ^RXP d ^PXV d ^PXX d ^RX^ d ^UXb d ^ZXd +d ^]Xd d ^bXb d ^eX^ d ^fXX d ^fXM d ^eXE d ^cXA d ^`W} d ^[W{ d ^VW{ +d ^SW} d ^RXA d ^RXC d ^SXE d ^UXE d ^VXC d ^VXA d ^UW? d ^SW? m ^SXP +d ^RXT d ^RXZ d ^SX^ m ^bX` d ^cX^ d ^eXX d ^eXM d ^cXE d ^bXA m ^ZXK +d ^VXM d ^UXN d ^SXT d ^SXZ d ^UX` d ^VXb d ^ZXd m ^]Xd d ^`Xb d ^bX^ +d ^cXX d ^cXK d ^bXC d ^`W? d ^^W} d ^[W{ m ^OWm m ^sXq m ^sWm m _RXq +m _RWm m _qXq m _qWm m `PXq m `PWm m `oXq m `oWm m aOXd d aYXN d aYW{ +m aPXd d a[XN d a[W} m aRXd d a\XN d a\W{ m aeXb d a\XN m aNXd d aVXd +m aaXd d aiXd m aUW{ d aaW{ m aNXd d aPXb +stroke +m aPXb m aUXd d aRXb m abXd d aeXb m ahXd d aeXb m aYW} d aVW{ m aYW? +d aXW{ m a\W? d a^W{ m a\W} d a_W{ m aNWm m ]KWb m ]KV^ m ]oVs d ]oVq +d ]pVq d ]pVs d ]oVs m ]~WC d ]}V? d ]{V} d ]xV{ d ]uV{ d ]pV} d ]mWA +d ]kWG d ]kWI d ]mWO d ]pWS d ]uWT d ]xWT d ]}WS d ^@WO d ^BWI d ^BV} +d ^@Vu d ]~Vq d ]{Vn d ]vVl d ]rVl d ]oVn d ]mVq d ]mVs d ]oVu d ]pVu +d ]rVs d ]rVq d ]pVp d ]oVp m ]oWA d ]mWE d ]mWK d ]oWO m ]}WQ d ]~WO +d ^@WI d ^@V} d ]~Vu d ]}Vq m ]uV{ d ]rV} d ]pV? d ]oWE d ]oWK d ]pWQ +d ]rWS d ]uWT m ]xWT d ]{WS d ]}WO d ]~WI d ]~V{ d ]}Vs d ]{Vp d ]zVn +d ]vVl m ]jV^ m ^ZWT d ^UWS d ^RWM d ^PWC d ^PV} d ^RVs d ^UVn d ^ZVl +d ^]Vl d ^bVn d ^eVs d ^fV} d ^fWC d ^eWM d ^bWS d ^]WT d ^ZWT m ^UWQ +d ^SWM d ^RWE d ^RV{ d ^SVs d ^UVp m ^bVp d ^cVs d ^eV{ d ^eWE d ^cWM +d ^bWQ m ^ZWT d ^VWS d ^UWO d ^SWE d ^SV{ d ^UVq d ^VVn d ^ZVl m ^]Vl +d ^`Vn d ^bVq d ^cV{ d ^cWE d ^bWO d ^`WS d ^]WT m ^OV^ m ^sWb m ^sV^ +m _RWb m _RV^ m _qWb m _qV^ m `PWb m `PV^ m `oWb m `oV^ m aeWT d aOWT +d aOWI m abWT d aOVl m adWT d aQVl m aeWT d aRVl m aOVl d aeVl d aeVw +m aQWT d aOWI m aRWT d aOWO m aTWT d aOWQ m aWWT d aOWS m a]Vl d aeVn +m aaVl d aeVp m abVl d aeVq m adVl d aeVw m aNV^ m ]KVS m ]KUO m ]oUd +d ]oUb d ]pUb d ]pUd d ]oUd m ]~Ut d ]}Up d ]{Un d ]xUl d ]uUl d ]pUn +d ]mUr d ]kUx d ]kUy d ]mU? d ]pVC d ]uVE d ]xVE d ]}VC d ^@U? d ^BUy +d ^BUn d ^@Uf d ]~Ub d ]{U^ d ]vU\ d ]rU\ d ]oU^ d ]mUb d ]mUd d ]oUf +d ]pUf d ]rUd d ]rUb d ]pU` d ]oU` m ]oUr d ]mUv d ]mU{ d ]oU? m ]}VA +d ]~U? d ^@Uy d ^@Un d ]~Uf d ]}Ub m ]uUl d ]rUn d ]pUp d ]oUv d ]oU{ +d ]pVA d ]rVC d ]uVE m ]xVE d ]{VC d ]}U? d ]~Uy d ]~Ul d ]}Ud d ]{U` +d ]zU^ d ]vU\ m ]jUO m ^ZVA d ^ZU\ m ^[VA d ^[U^ m ^]VE d ^]U\ m ^]VE +d ^XU? d ^UU} m ^SU\ d ^cU\ m ^ZU^ d ^VU\ m ^ZU` d ^XU\ m ^]U` d ^^U\ +m ^]U^ d ^`U\ m ^OUO m ^sVS m ^sUO m _RVS m _RUO m _qVS m _qUO m `PVS +m `PUO m `oVS m `oUO m aRVM d aRUO m aTVM d aTUO m aRVM d a`VM m aRUO +d a`UO m aNUO m ]KUC m ]KS? m ]oTU d ]oTS d ]pTS d ]pTU d ]oTU m ]~Td +d ]}T` d ]{T^ d ]xT] d ]uT] d ]pT^ d ]mTb d ]kTh d ]kTj d ]mTp d ]pTt +d ]uTv d ]xTv d ]}Tt d ^@Tp d ^BTj d ^BT^ d ^@TW d ]~TS d ]{TO d ]vTM +d ]rTM d ]oTO d ]mTS d ]mTU d ]oTW d ]pTW d ]rTU d ]rTS d ]pTQ d ]oTQ +m ]oTb d ]mTf d ]mTl d ]oTp m ]}Tr d ]~Tp d ^@Tj d ^@T^ d ]~TW d ]}TS +m ]uT] d ]rT^ d ]pT` d ]oTf d ]oTl d ]pTr d ]rTt d ]uTv m ]xTv d ]{Tt +d ]}Tp d ]~Tj d ]~T] d ]}TU d ]{TQ d ]zTO d ]vTM m ]jS? m ^RTn d ^RTl +d ^STl d ^STn d ^RTn m ^RTp d ^STp d ^UTn d ^UTl d ^STj d ^RTj d ^PTl +d ^PTn d ^RTr d ^STt d ^XTv d ^^Tv d ^cTt d ^eTr d ^fTn d ^fTj d ^eTf +d ^`Tb d ^XT^ d ^UT] d ^RTY d ^PTS d ^PTM m ^cTr d ^eTn d ^eTj d ^cTf +m ^^Tv d ^bTt d ^cTn d ^cTj d ^bTf d ^^Tb d ^XT^ m ^PTQ d ^RTS d ^UTS +d ^]TQ d ^cTQ d ^fTS m ^UTS d ^]TO d ^cTO d ^eTQ m ^UTS d ^]TM d ^cTM +d ^eTO d ^fTS d ^fTW m ^OS? m ^sUC m ^sS? m _RUC m _RS? m _qUC m _qS? +m `PUC m `PS? m `oUC m `oS? m aNTv d agTG m aNS? m ]KSt m ]KRp m ]oSE +d ]oSC d ]pSC d ]pSE d ]oSE m ]~SU d ]}SQ d ]{SO d ]xSM d ]uSM d ]pSO +d ]mSS d ]kSY d ]kS[ d ]mSa d ]pSe d ]uSf d ]xSf d ]}Se d ^@Sa d ^BS[ +d ^BSO d ^@SG d ]~SC d ]{S@ d ]vR~ d ]rR~ d ]oS@ d ]mSC d ]mSE d ]oSG +d ]pSG d ]rSE d ]rSC d ]pSB d ]oSB m ]oSS d ]mSW d ]mS] d ]oSa m ]}Sc +d ]~Sa d ^@S[ d ^@SO d ]~SG d ]}SC m ]uSM d ]rSO d ]pSQ d ]oSW d ]oS] +d ]pSc d ]rSe d ]uSf m ]xSf d ]{Se d ]}Sa d ]~S[ d ]~SM d ]}SE d ]{SB +d ]zS@ d ]vR~ m ]jRp m ^RS_ d ^RS] d ^SS] d ^SS_ d ^RS_ m ^RSa d ^SSa +d ^US_ d ^US] d ^SS[ d ^RS[ d ^PS] d ^PS_ d ^RSc d ^SSe d ^XSf d ^^Sf +d ^cSe d ^eSa d ^eS[ d ^cSW d ^^SU m ^bSe d ^cSa d ^cS[ d ^bSW m ^]Sf +d ^`Se d ^bSa d ^bS[ d ^`SW d ^]SU m ^ZSU d ^^SU d ^bSS d ^eSO d ^fSK +d ^fSE d ^eSB d ^cS@ d ^^R~ d ^XR~ d ^SS@ d ^RSB d ^PSE d ^PSG d ^RSI +d ^SSI d ^USG d ^USE d ^SSC d ^RSC m ^cSO d ^eSK d ^eSE d ^cSB m ^]SU +d ^`SS d ^bSQ d ^cSK d ^cSE d ^bS@ d ^^R~ m ^RSG d ^RSE d ^SSE d ^SSG +d ^RSG m ^ORp m ^sSt m ^sRp m _RSt m _RRp m _qSt m _qRp m `PSt m `PRp +m `oSt m `oRp m a\Sn d a\Rp m a^Sn d a^Rp m aPSn d a^Sn m aPRp d a^Rp +m aNRp m ]KRe m ]KQa m ]oQv d ]oQt d ]pQt d ]pQv d ]oQv m ]~RF d ]}RB +d ]{R@ d ]xQ~ d ]uQ~ d ]pR@ d ]mRD d ]kRJ d ]kRK d ]mRQ d ]pRU d ]uRW +d ]xRW d ]}RU d ^@RQ d ^BRK d ^BR@ d ^@Qx d ]~Qt d ]{Qp d ]vQn d ]rQn +d ]oQp d ]mQt d ]mQv d ]oQx d ]pQx d ]rQv d ]rQt d ]pQr d ]oQr m ]oRD +d ]mRH d ]mRM d ]oRQ m ]}RS d ]~RQ d ^@RK d ^@R@ d ]~Qx d ]}Qt m ]uQ~ +d ]rR@ d ]pRB d ]oRH d ]oRM d ]pRS d ]rRU d ]uRW m ]xRW d ]{RU d ]}RQ +d ]~RK d ]~Q~ d ]}Qv d ]{Qr d ]zQp d ]vQn m ]jQa m ^]RQ d ^]Qn m ^^RS +d ^^Qp m ^`RW d ^`Qn m ^`RW d ^OQz d ^hQz m ^XQn d ^eQn m ^]Qp d ^ZQn +m ^]Qr d ^[Qn m ^`Qr d ^bQn m ^`Qp d ^cQn m ^OQa m ^sRe m ^sQa m _RRe +m _RQa m _qRe m _qQa m `PRe m `PQa m `oRe m `oQa m aURK d aYRQ d a]RK +m aORF d aYRO d abRF m aYRO d aYQn m aNQa m ]KQU m ]KPQ m ]oPg d ]oPe +d ]pPe d ]pPg d ]oPg m ]~Pv d ]}Pr d ]{Pq d ]xPo d ]uPo d ]pPq d ]mPt +d ]kPz d ]kP| d ]mQB d ]pQF d ]uQH d ]xQH d ]}QF d ^@QB d ^BP| d ^BPq +d ^@Pi d ]~Pe d ]{Pa d ]vP_ +stroke +m ]vP_ d ]rP_ d ]oPa d ]mPe d ]mPg d ]oPi d ]pPi d ]rPg d ]rPe d ]pPc +d ]oPc m ]oPt d ]mPx d ]mP~ d ]oQB m ]}QD d ]~QB d ^@P| d ^@Pq d ]~Pi +d ]}Pe m ]uPo d ]rPq d ]pPr d ]oPx d ]oP~ d ]pQD d ]rQF d ]uQH m ]xQH +d ]{QF d ]}QB d ]~P| d ]~Po d ]}Pg d ]{Pc d ]zPa d ]vP_ m ]jPQ m ^SQH +d ^PPt d ^SPx d ^XPz d ^]Pz d ^bPx d ^ePt d ^fPo d ^fPk d ^ePe d ^bPa +d ^]P_ d ^XP_ d ^SPa d ^RPc d ^PPg d ^PPi d ^RPk d ^SPk d ^UPi d ^UPg +d ^SPe d ^RPe m ^cPt d ^ePq d ^ePi d ^cPe m ^]Pz d ^`Px d ^bPv d ^cPq +d ^cPi d ^bPc d ^`Pa d ^]P_ m ^RPi d ^RPg d ^SPg d ^SPi d ^RPi m ^SQH +d ^cQH m ^SQF d ^`QF m ^SQD d ^ZQD d ^`QF d ^cQH m ^OPQ m ^sQU m ^sPQ +m _RQU m _RPQ m _qQU m _qPQ m `PQU m `PPQ m `oQU m `oPQ m aNP[ d ahP[ +m aNPQ m ]KPF m ]KOB m ]oOW d ]oOV d ]pOV d ]pOW d ]oOW m ]~Og d ]}Oc +d ]{Oa d ]xO_ d ]uO_ d ]pOa d ]mOe d ]kOk d ]kOm d ]mOs d ]pOw d ]uOy +d ]xOy d ]}Ow d ^@Os d ^BOm d ^BOa d ^@OY d ]~OV d ]{OR d ]vOP d ]rOP +d ]oOR d ]mOV d ]mOW d ]oOY d ]pOY d ]rOW d ]rOV d ]pOT d ]oOT m ]oOe +d ]mOi d ]mOo d ]oOs m ]}Ou d ]~Os d ^@Om d ^@Oa d ]~OY d ]}OV m ]uO_ +d ]rOa d ]pOc d ]oOi d ]oOo d ]pOu d ]rOw d ]uOy m ]xOy d ]{Ow d ]}Os +d ]~Om d ]~O_ d ]}OW d ]{OT d ]zOR d ]vOP m ]jOB m ^bOs d ^bOq d ^cOq +d ^cOs d ^bOs m ^cOu d ^bOu d ^`Os d ^`Oq d ^bOo d ^cOo d ^eOq d ^eOs +d ^cOw d ^`Oy d ^[Oy d ^VOw d ^SOs d ^ROo d ^POg d ^PO[ d ^ROV d ^UOR +d ^ZOP d ^]OP d ^bOR d ^eOV d ^fO[ d ^fO] d ^eOc d ^bOg d ^]Oi d ^ZOi +d ^VOg d ^UOe d ^SOa m ^UOs d ^SOo d ^ROg d ^RO[ d ^SOV d ^UOT m ^cOV +d ^eOY d ^eO_ d ^cOc m ^[Oy d ^XOw d ^VOu d ^UOq d ^SOi d ^SO[ d ^UOV +d ^VOR d ^ZOP m ^]OP d ^`OR d ^bOT d ^cOY d ^cO_ d ^bOe d ^`Og d ^]Oi +m ^OOB m ^sPF m ^sOB m _RPF m _ROB m _qPF m _qOB m `PPF m `POB m `oPF +m `oOB m aZOy d aUOw d aROs d aROm d aUOk d aWOk d aZOm d aZOo d aWOq +d aUOq d aROo m aUOo d aUOm d aWOm d aWOo d aUOo m aUOw d aROo m aROs +d aUOq m aNOB m ]KNw m ]KMs m ]oNH d ]oNF d ]pNF d ]pNH d ]oNH m ]~NX +d ]}NT d ]{NR d ]xNP d ]uNP d ]pNR d ]mNV d ]kN[ d ]kN] d ]mNc d ]pNg +d ]uNi d ]xNi d ]}Ng d ^@Nc d ^BN] d ^BNR d ^@NJ d ]~NF d ]{NB d ]vN@ +d ]rN@ d ]oNB d ]mNF d ]mNH d ]oNJ d ]pNJ d ]rNH d ]rNF d ]pND d ]oND +m ]oNV d ]mNZ d ]mN_ d ]oNc m ]}Ne d ]~Nc d ^@N] d ^@NR d ]~NJ d ]}NF +m ]uNP d ]rNR d ]pNT d ]oNZ d ]oN_ d ]pNe d ]rNg d ]uNi m ]xNi d ]{Ng +d ]}Nc d ]~N] d ]~NP d ]}NH d ]{ND d ]zNB d ]vN@ m ]jMs m ^PNi d ^PN] +m ^fNi d ^fNc d ^eN] d ^^NT d ^]NP d ^[NH d ^[N@ m ^]NR d ^[NN d ^ZNH +d ^ZN@ m ^eN] d ^]NT d ^ZNN d ^XNH d ^XN@ d ^[N@ m ^PNa d ^RNe d ^UNi +d ^XNi d ^`Nc d ^cNc d ^eNe d ^fNi m ^SNe d ^UNg d ^XNg d ^[Ne m ^PNa +d ^RNc d ^UNe d ^XNe d ^`Nc m ^OMs m ^sNw m ^sMs m _RNw m _RMs m _qNw +m _qMs m `PNw m `PMs m `oNw m `oMs m aRNV d aRNX d aTNX d aTNT d aQNT +d aQNX d aRNZ d aUN[ d a\N[ d a_NZ d aaNX d abNT d abNF d adNB d aeN@ +m a_NX d aaNT d aaNF d abNB m a\N[ d a]NZ d a_NV d a_NF d aaNB d aeN@ +d agN@ m a_NR d a]NP d aUNN d aQNL d aONH d aONF d aQNB d aUN@ d aZN@ +d a]NB d a_NF m aRNL d aQNH d aQNF d aRNB m a]NP d aWNN d aTNL d aRNH +d aRNF d aTNB d aUN@ m aNMs m ]KMg m ]KLc m ]oLy d ]oLw d ]pLw d ]pLy +d ]oLy m ]~MH d ]}MD d ]{MC d ]xMA d ]uMA d ]pMC d ]mMF d ]kML d ]kMN +d ]mMT d ]pMX d ]uMZ d ]xMZ d ]}MX d ^@MT d ^BMN d ^BMC d ^@L{ d ]~Lw +d ]{Ls d ]vLq d ]rLq d ]oLs d ]mLw d ]mLy d ]oL{ d ]pL{ d ]rLy d ]rLw +d ]pLu d ]oLu m ]oMF d ]mMJ d ]mMP d ]oMT m ]}MV d ]~MT d ^@MN d ^@MC +d ]~L{ d ]}Lw m ]uMA d ]rMC d ]pMD d ]oMJ d ]oMP d ]pMV d ]rMX d ]uMZ +m ]xMZ d ]{MX d ]}MT d ]~MN d ]~MA d ]}Ly d ]{Lu d ]zLs d ]vLq m ]jLc +m ^XMZ d ^SMX d ^RMT d ^RMN d ^SMJ d ^XMH d ^^MH d ^cMJ d ^eMN d ^eMT +d ^cMX d ^^MZ d ^XMZ m ^UMX d ^SMT d ^SMN d ^UMJ m ^bMJ d ^cMN d ^cMT +d ^bMX m ^XMZ d ^VMX d ^UMT d ^UMN d ^VMJ d ^XMH m ^^MH d ^`MJ d ^bMN +d ^bMT d ^`MX d ^^MZ m ^XMH d ^SMF d ^RMD d ^PMA d ^PLy d ^RLu d ^SLs +d ^XLq d ^^Lq d ^cLs d ^eLu d ^fLy d ^fMA d ^eMD d ^cMF d ^^MH m ^SMD +d ^RMA d ^RLy d ^SLu m ^cLu d ^eLy d ^eMA d ^cMD m ^XMH d ^UMF d ^SMA +d ^SLy d ^ULs d ^XLq m ^^Lq d ^bLs d ^cLy d ^cMA d ^bMF d ^^MH m ^OLc +m ^sMg m ^sLc m _RMg m _RLc m _qMg m _qLc m `PMg m `PLc m `oMg m `oLc +m aRMZ d aRLq d aTLs d aWLs m aTMX d aTLu m aNMZ d aUMZ d aULs m aUMF +d aWMJ d aZML d a]ML d aaMJ d adMF d afMA d afL} d adLw d aaLs d a]Lq +d aZLq d aWLs d aULw m acMF d adMC d adL{ d acLw m a]ML d a`MJ d aaMH +d acMC d acL{ d aaLu d a`Ls d a]Lq m aOMZ d aRMX m aQMZ d aRMV m aNLc +m ]KLX m ]KKT m ]oKi d ]oKg d ]pKg d ]pKi d ]oKi m ]~Ky d ]}Ku d ]{Ks +d ]xKq d ]uKq d ]pKs d ]mKw d ]kK} d ]kK? d ]mLE d ]pLI d ]uLK d ]xLK +d ]}LI d ^@LE d ^BK? d ^BKs d ^@Kk d ]~Kg d ]{Kd d ]vKb d ]rKb d ]oKd +d ]mKg d ]mKi d ]oKk d ]pKk d ]rKi d ]rKg d ]pKf +stroke +m ]pKf d ]oKf m ]oKw d ]mK{ d ]mLA d ]oLE m ]}LG d ]~LE d ^@K? d ^@Ks +d ]~Kk d ]}Kg m ]uKq d ]rKs d ]pKu d ]oK{ d ]oLA d ]pLG d ]rLI d ]uLK +m ]xLK d ]{LI d ]}LE d ]~K? d ]~Kq d ]}Ki d ]{Kf d ]zKd d ]vKb m ]jKT +m ^SKi d ^SKg d ^UKg d ^UKi d ^SKi m ^cKy d ^bKu d ^`Ks d ^]Kq d ^ZKq +d ^UKs d ^RKw d ^PK} d ^PK? d ^RLE d ^ULI d ^ZLK d ^]LK d ^bLI d ^eLE +d ^fK? d ^fKs d ^eKk d ^cKg d ^`Kd d ^[Kb d ^VKb d ^SKd d ^RKg d ^RKi +d ^SKk d ^UKk d ^VKi d ^VKg d ^UKf d ^SKf m ^SKw d ^RK{ d ^RLA d ^SLE +m ^bLG d ^cLE d ^eK? d ^eKs d ^cKk d ^bKg m ^ZKq d ^VKs d ^UKu d ^SK{ +d ^SLA d ^ULG d ^VLI d ^ZLK m ^]LK d ^`LI d ^bLE d ^cK? d ^cKq d ^bKi +d ^`Kf d ^^Kd d ^[Kb m ^OKT m ^sLX m ^sKT m _RLX m _RKT m _qLX m _qKT +m `PLX m `PKT m `oLX m `oKT m acKu d acKw d aaKw d aaKs d aeKs d aeKw +d aaK{ d a^K} d aYK} d aTK{ d aQKw d aOKq d aOKm d aQKg d aTKd d aYKb +d a\Kb d aaKd d aeKg m aRKw d aQKs d aQKk d aRKg m aYK} d aVK{ d aTKy +d aRKs d aRKk d aTKf d aVKd d aYKb m aNKT m ]VJw d ]VJR m ]XJw d ]XJT +m ]YJ{ d ]YJR m ]YJ{ d ]TJu d ]QJs m ]PJR d ]`JR m ]VJT d ]SJR m ]VJV +d ]TJR m ]YJV d ][JR m ]YJT d ]\JR m ]KJE m ]{J{ d ]vJy d ]sJs d ]qJj +d ]qJd d ]sJZ d ]vJT d ]{JR d ]~JR d ^CJT d ^FJZ d ^GJd d ^GJj d ^FJs +d ^CJy d ]~J{ d ]{J{ m ]vJw d ]tJs d ]sJl d ]sJb d ]tJZ d ]vJV m ^CJV +d ^DJZ d ^FJb d ^FJl d ^DJs d ^CJw m ]{J{ d ]xJy d ]vJu d ]tJl d ]tJb +d ]vJX d ]xJT d ]{JR m ]~JR d ^AJT d ^CJX d ^DJb d ^DJl d ^CJu d ^AJy +d ]~J{ m ]pJE m ^_J{ d ^[Jy d ^WJs d ^VJj d ^VJd d ^WJZ d ^[JT d ^_JR +d ^cJR d ^gJT d ^kJZ d ^lJd d ^lJj d ^kJs d ^gJy d ^cJ{ d ^_J{ m ^[Jw +d ^YJs d ^WJl d ^WJb d ^YJZ d ^[JV m ^gJV d ^iJZ d ^kJb d ^kJl d ^iJs +d ^gJw m ^_J{ d ^\Jy d ^[Ju d ^YJl d ^YJb d ^[JX d ^\JT d ^_JR m ^cJR +d ^fJT d ^gJX d ^iJb d ^iJl d ^gJu d ^fJy d ^cJ{ m ^TJE m ^yKI m ^yJE +m _XKI m _XJE m _wKI m _wJE m `VKI m `VJE m `tKI m `tJE m afJ{ d afJR +d amJR m agJy d agJT m aaJ{ d aiJ{ d aiJR m afJh d adJl d aaJn d a^Jn +d aYJl d aVJh d aUJb d aUJ^ d aVJX d aYJT d a^JR d aaJR d adJT d afJX +m aXJh d aVJd d aVJ\ d aXJX m a^Jn d a[Jl d aYJj d aXJd d aXJ\ d aYJV +d a[JT d a^JR m acJ{ d afJy m adJ{ d afJw m aiJV d ajJR m aiJT d alJR +m aSJE m ]VIh d ]VIC m ]XIh d ]XIE m ]YIl d ]YIC m ]YIl d ]TIf d ]QId +m ]PIC d ]`IC m ]VIE d ]SIC m ]VIG d ]TIC m ]YIG d ][IC m ]YIE d ]\IC +m ]KHu m ]{Il d ]vIj d ]sId d ]qIZ d ]qIT d ]sIK d ]vIE d ]{IC d ]~IC +d ^CIE d ^FIK d ^GIT d ^GIZ d ^FId d ^CIj d ]~Il d ]{Il m ]vIh d ]tId +d ]sI\ d ]sIS d ]tIK d ]vIG m ^CIG d ^DIK d ^FIS d ^FI\ d ^DId d ^CIh +m ]{Il d ]xIj d ]vIf d ]tI\ d ]tIS d ]vII d ]xIE d ]{IC m ]~IC d ^AIE +d ^CII d ^DIS d ^DI\ d ^CIf d ^AIj d ]~Il m ]pHu m ^_Ih d ^_IC m ^aIh +d ^aIE m ^cIl d ^cIC m ^cIl d ^^If d ^[Id m ^YIC d ^iIC m ^_IE d ^\IC +m ^_IG d ^^IC m ^cIG d ^dIC m ^cIE d ^fIC m ^THu m ^yIy m ^yHu m _XIy +m _XHu m _wIy m _wHu m `VIy m `VHu m `tIy m `tHu m aXIS d ajIS d ajIV +d aiIZ d agI\ d abI^ d a_I^ d aZI\ d aWIX d aUIS d aUIO d aWII d aZIE +d a_IC d abIC d agIE d ajII m aiIT d aiIV d agIZ m aXIX d aWIT d aWIM +d aXII m agIS d agIX d aeI\ d abI^ m a_I^ d a\I\ d aZIZ d aXIT d aXIM +d aZIG d a\IE d a_IC m aSHu m ]VHY d ]VGt m ]XHY d ]XGv m ]YH\ d ]YGt +m ]YH\ d ]THW d ]QHU m ]PGt d ]`Gt m ]VGv d ]SGt m ]VGx d ]TGt m ]YGx +d ][Gt m ]YGv d ]\Gt m ]KGf m ]{H\ d ]vH[ d ]sHU d ]qHK d ]qHE d ]sG{ +d ]vGv d ]{Gt d ]~Gt d ^CGv d ^FG{ d ^GHE d ^GHK d ^FHU d ^CH[ d ]~H\ +d ]{H\ m ]vHY d ]tHU d ]sHM d ]sHC d ]tG{ d ]vGx m ^CGx d ^DG{ d ^FHC +d ^FHM d ^DHU d ^CHY m ]{H\ d ]xH[ d ]vHW d ]tHM d ]tHC d ]vGy d ]xGv +d ]{Gt m ]~Gt d ^AGv d ^CGy d ^DHC d ^DHM d ^CHW d ^AH[ d ]~H\ m ]pGf +m ^WHU d ^WHS d ^YHS d ^YHU d ^WHU m ^WHW d ^YHW d ^[HU d ^[HS d ^YHQ +d ^WHQ d ^VHS d ^VHU d ^WHY d ^YH[ d ^^H\ d ^dH\ d ^iH[ d ^kHY d ^lHU +d ^lHQ d ^kHM d ^fHI d ^^HE d ^[HC d ^WG? d ^VGy d ^VGt m ^iHY d ^kHU +d ^kHQ d ^iHM m ^dH\ d ^gH[ d ^iHU d ^iHQ d ^gHM d ^dHI d ^^HE m ^VGx +d ^WGy d ^[Gy d ^cGx d ^iGx d ^lGy m ^[Gy d ^cGv d ^iGv d ^kGx m ^[Gy +d ^cGt d ^iGt d ^kGv d ^lGy d ^lG} m ^TGf m ^yHj m ^yGf m _XHj m _XGf +m _wHj m _wGf m `VHj m `VGf m `tHj m `tGf m ahHY d ahH[ d afH[ d afHW +d ajHW d ajH[ d ahH\ d abH\ d a^H[ d a\HY d aZHS d aZGt m a^HY d a\HS +d a\Gv m abH\ d a`H[ d a^HW d a^Gt m aSHO d afHO m aSGt d adGt m aZGv +d aUGt m aZGx d aXGt m a^Gx d a`Gt m a^Gv d abGt m aSGf m ]VGI d ]VFd +m ]XGI d ]XFf m ]YGM d ]YFd m ]YGM d ]TGG d ]QGE m ]PFd d ]`Fd m ]VFf +d ]SFd m ]VFh d ]TFd m ]YFh d ][Fd m ]YFf d ]\Fd m ]KFW m ]{GM d ]vGK +d ]sGE d ]qF| d ]qFv d ]sFl d ]vFf d ]{Fd d ]~Fd d ^CFf d ^FFl d ^GFv +d ^GF| d ^FGE d ^CGK d ]~GM d ]{GM m ]vGI d ]tGE d ]sF~ d ]sFt d ]tFl +d ]vFh m ^CFh d ^DFl d ^FFt d ^FF~ d ^DGE d ^CGI m ]{GM d ]xGK d ]vGG +d ]tF~ d ]tFt d ]vFj d ]xFf d ]{Fd m ]~Fd d ^AFf d ^CFj d ^DFt d ^DF~ +d ^CGG d ^AGK d ]~GM m ]pFW m ^WGE d ^WGC d ^YGC d ^YGE d ^WGE m ^WGG +d ^YGG d ^[GE d ^[GC d ^YGA d ^WGA d ^VGC d ^VGE d ^WGI d ^YGK d ^^GM +d ^dGM d ^iGK d ^kGG d ^kGA d ^iF~ d ^dF| m ^gGK d ^iGG +stroke +m ^iGG d ^iGA d ^gF~ m ^cGM d ^fGK d ^gGG d ^gGA d ^fF~ d ^cF| m ^_F| +d ^dF| d ^gFz d ^kFv d ^lFr d ^lFl d ^kFh d ^iFf d ^dFd d ^^Fd d ^YFf +d ^WFh d ^VFl d ^VFn d ^WFp d ^YFp d ^[Fn d ^[Fl d ^YFj d ^WFj m ^iFv +d ^kFr d ^kFl d ^iFh m ^cF| d ^fFz d ^gFx d ^iFr d ^iFl d ^gFf d ^dFd +m ^WFn d ^WFl d ^YFl d ^YFn d ^WFn m ^TFW m ^yG[ m ^yFW m _XG[ m _XFW +m _wG[ m _wFW m `VG[ m `VFW m `tG[ m `tFW m aiF~ d ajF| d alF~ d ajG@ +d aiG@ d aeF~ d adF| m a]G@ d aZF~ d aXF| d aWFx d aWFt d aXFp d aZFn +d a]Fl d aaFl d adFn d aeFp d agFt d agFx d aeF| d adF~ d aaG@ d a]G@ +m aZF| d aXFx d aXFt d aZFp m adFp d aeFt d aeFx d adF| m a]G@ d a\F~ +d aZFz d aZFr d a\Fn d a]Fl m aaFl d abFn d adFr d adFz d abF~ d aaG@ +m aXFp d aWFn d aUFj d aUFh d aWFd d aXFb d a]F` d adF` d aiF_ d ajF] +m aXFd d a]Fb d adFb d aiF` m aUFh d aWFf d a\Fd d adFd d aiFb d ajF_ +d ajF] d aiFY d adFW d aZFW d aUFY d aSF] d aSF_ d aUFb d aZFd m aZFW +d aWFY d aUF] d aUF_ d aWFb d aZFd m aSFW m iqcj d iqcE m iscj d iscG +m itcn d itcE m itcn d ipch d ilcf m ikcE d i{cE m iqcG d incE m iqcI +d ipcE m itcI d ivcE m itcG d iwcE m ifbw m jVcn d jQcl d jNcf d jLc\ +d jLcV d jNcM d jQcG d jVcE d jYcE d j^cG d jacM d jbcV d jbc\ d jacf +d j^cl d jYcn d jVcn m jQcj d jOcf d jNc^ d jNcU d jOcM d jQcI m j^cI +d j_cM d jacU d jac^ d j_cf d j^cj m jVcn d jScl d jQch d jOc^ d jOcU +d jQcK d jScG d jVcE m jYcE d j\cG d j^cK d j_cU d j_c^ d j^ch d j\cl +d jYcn m jKbw m j~ch d j~cE m j?cj d j?cG m kAcn d kAcE m kAcn d jocQ +d kIcQ m jycE d kFcE m j~cG d jzcE m j~cI d j|cE m kAcI d kBcE m kAcG +d kDcE m jobw m kTc{ m kTbw m ksc{ m ksbw m lRc{ m lRbw m lqc{ m lqbw +m mPc{ m mPbw m mscn d mscE m mtcl d mtcG m mncn d mucn d mucE m mucX +d mwc\ d mxc^ d m{c` d m?c` d nBc^ d nDc\ d nEcV d nEcE m nBc\ d nDcV +d nDcG m m?c` d nAc^ d nBcX d nBcE m mncE d mzcE m m~cE d nIcE m mpcn +d mscl m mqcn d mscj m mscG d mpcE m mscI d mqcE m mucI d mwcE m mucG +d mxcE m nBcG d m?cE m nBcI d nAcE m nEcI d nFcE m nEcG d nHcE m mnbw +m iqb[ d iqav m isb[ d isax m itb^ d itav m itb^ d ipbY d ilbW m ikav +d i{av m iqax d inav m iqaz d ipav m itaz d ivav m itax d iwav m ifah +m jVb^ d jQb] d jNbW d jLbM d jLbG d jNa} d jQax d jVav d jYav d j^ax +d jaa} d jbbG d jbbM d jabW d j^b] d jYb^ d jVb^ m jQb[ d jObW d jNbO +d jNbE d jOa} d jQaz m j^az d j_a} d jabE d jabO d j_bW d j^b[ m jVb^ +d jSb] d jQbY d jObO d jObE d jQa{ d jSax d jVav m jYav d j\ax d j^a{ +d j_bE d j_bO d j^bY d j\b] d jYb^ m jKah m jtb^ d jqbK d jtbO d jybQ +d j~bQ d kBbO d kFbK d kGbE d kGbA d kFa{ d kBax d j~av d jyav d jtax +d jraz d jqa} d jqa? d jrbA d jtbA d jva? d jva} d jta{ d jra{ m kDbK +d kFbG d kFa? d kDa{ m j~bQ d kAbO d kBbM d kDbG d kDa? d kBaz d kAax +d j~av m jra? d jra} d jta} d jta? d jra? m jtb^ d kDb^ m jtb] d kAb] +m jtb[ d jzb[ d kAb] d kDb^ m joah m kTbl m kTah m ksbl m ksah m lRbl +m lRah m lqbl m lqah m mPbl m mPah m mub^ d mub[ d mzb[ d mzb^ d mub^ +m mxb^ d mxb[ m mub] d mzb] m mubQ d muav m mxbO d mxax m mnbQ d mzbQ +d mzav m mnav d nAav m mqbQ d mubO m msbQ d mubM m muax d mqav m muaz +d msav m mzaz d m|av m mzax d m?av m mnah m iqaK d iq`f m isaK d is`h +m itaO d it`f m itaO d ipaI d ilaG m ik`f d i{`f m iq`h d in`f m iq`j +d ip`f m it`j d iv`f m it`h d iw`f m if`Y m jVaO d jQaM d jNaG d jL`~ +d jL`x d jN`n d jQ`h d jV`f d jY`f d j^`h d ja`n d jb`x d jb`~ d jaaG +d j^aM d jYaO d jVaO m jQaK d jOaG d jNa@ d jN`v d jO`n d jQ`j m j^`j +d j_`n d ja`v d jaa@ d j_aG d j^aK m jVaO d jSaM d jQaI d jOa@ d jO`v +d jQ`l d jS`h d jV`f m jY`f d j\`h d j^`l d j_`v d j_a@ d j^aI d j\aM +d jYaO m jK`Y m kBaI d kBaG d kDaG d kDaI d kBaI m kDaK d kBaK d kAaI +d kAaG d kBaE d kDaE d kFaG d kFaI d kDaM d kAaO d j|aO d jwaM d jtaI +d jraE d jq`~ d jq`r d jr`l d jv`h d jz`f d j~`f d kB`h d kF`l d kG`r +d kG`t d kF`z d kB`~ d j~a@ d jza@ d jw`~ d jv`| d jt`x m jvaI d jtaE +d jr`~ d jr`r d jt`l d jv`j m kD`l d kF`p d kF`v d kD`z m j|aO d jyaM +d jwaK d jvaG d jta@ d jt`r d jv`l d jw`h d jz`f m j~`f d kA`h d kB`j +d kD`p d kD`v d kB`| d kA`~ d j~a@ m jo`Y m kTa] m kT`Y m ksa] m ks`Y +m lRa] m lR`Y m lqa] m lq`Y m mPa] m mP`Y m myaO d myaK d m~aK d m~aO +d myaO m m|aO d m|aK m myaM d m~aM m myaB d my`a d mw`[ d mu`Y m m|a@ +d m|`b d my`] m msaB d m~aB d m~`b d m|`] d my`[ d mu`Y d mn`Y d mn`[ +d mn`_ d mq`_ d mq`[ d mn`[ d mn`] m muaB d mya@ m mwaB d my`~ m mn`Y +m iq_| d iq_W m is_| d is_Y m it`@ d it_W m it`@ d ip_z d il_x m ik_W +d i{_W m iq_Y d in_W m iq_[ d ip_W m it_[ d iv_W m it_Y d iw_W m if_I +m jV`@ d jQ_~ d jN_x d jL_n d jL_i d jN__ d jQ_Y d jV_W d jY_W d j^_Y +d ja__ d jb_i d jb_n d ja_x d j^_~ d jY`@ d jV`@ m jQ_| d jO_x d jN_p +d jN_g d jO__ d jQ_[ m j^_[ d j___ d ja_g d ja_p d j__x d j^_| m jV`@ +d jS_~ d jQ_z d jO_p d jO_g d jQ_] d jS_Y d jV_W m jY_W d j\_Y d j^_] +d j__g d j__p d j^_z d j\_~ d jY`@ m jK_I m jq`@ d jq_t m kG`@ d kG_z +d kF_t d j?_j d j~_g d j|__ d j|_W m j~_i d j|_e d jz__ d jz_W m kF_t +d j~_j d jz_e d jy__ d jy_W d j|_W m jq_x d jr_| d jv`@ d jy`@ d kA_z +d kD_z d kF_| d kG`@ m jt_| d jv_~ d jy_~ d j|_| m jq_x d jr_z +stroke +m jr_z d jv_| d jy_| d kA_z m jo_I m kT`M m kT_I m ks`M m ks_I m lR`M +m lR_I m lq`M m lq_I m mP`M m mP_I m ms`@ d ms_W m mt_~ d mt_Y m mn`@ +d mv`@ d mv_W m nC_p d mv__ m m|_g d nF_W m m|_e d nD_W m mz_e d nC_W +m m~_r d nI_r m mn_W d mz_W m m~_W d nI_W m mp`@ d ms_~ m mq`@ d ms_| +m n@_r d nC_p m nG_r d nC_p m ms_Y d mp_W m ms_[ d mq_W m mv_[ d mw_W +m mv_Y d my_W m nC_[ d n@_W m nA_[ d nG_W m mn_I m iq^m d iq^H m is^m +d is^J m it^p d it^H m it^p d ip^k d il^i m ik^H d i{^H m iq^J d in^H +m iq^K d ip^H m it^K d iv^H m it^J d iw^H m if]z m jV^p d jQ^o d jN^i +d jL^_ d jL^Y d jN^O d jQ^J d jV^H d jY^H d j^^J d ja^O d jb^Y d jb^_ +d ja^i d j^^o d jY^p d jV^p m jQ^m d jO^i d jN^a d jN^W d jO^O d jQ^K +m j^^K d j_^O d ja^W d ja^a d j_^i d j^^m m jV^p d jS^o d jQ^k d jO^a +d jO^W d jQ^M d jS^J d jV^H m jY^H d j\^J d j^^M d j_^W d j_^a d j^^k +d j\^o d jY^p m jK]z m jy^p d jt^o d jr^k d jr^e d jt^a d jy^_ d j?^_ +d kD^a d kF^e d kF^k d kD^o d j?^p d jy^p m jv^o d jt^k d jt^e d jv^a +m kB^a d kD^e d kD^k d kB^o m jy^p d jw^o d jv^k d jv^e d jw^a d jy^_ +m j?^_ d kA^a d kB^e d kB^k d kA^o d j?^p m jy^_ d jt^] d jr^[ d jq^W +d jq^O d jr^K d jt^J d jy^H d j?^H d kD^J d kF^K d kG^O d kG^W d kF^[ +d kD^] d j?^_ m jt^[ d jr^W d jr^O d jt^K m kD^K d kF^O d kF^W d kD^[ +m jy^_ d jv^] d jt^W d jt^O d jv^J d jy^H m j?^H d kB^J d kD^O d kD^W +d kB^] d j?^_ m jo]z m kT^~ m kT]z m ks^~ m ks]z m lR^~ m lR]z m lq^~ +m lq]z m mP^~ m mP]z m mu^p d mu^H m mx^o d mx^J m mn^p d mz^p d mz^H +m mn^H d nA^H m mq^p d mu^o m ms^p d mu^m m mu^J d mq^H m mu^K d ms^H +m mz^K d m|^H m mz^J d m?^H m mn]z m iq]] d iq\x m is]] d is\z m it]a +d it\x m it]a d ip][ d il]Y m ik\x d i{\x m iq\z d in\x m iq\| d ip\x +m it\| d iv\x m it\z d iw\x m if\k m jV]a d jQ]_ d jN]Y d jL]P d jL]J +d jN]@ d jQ\z d jV\x d jY\x d j^\z d ja]@ d jb]J d jb]P d ja]Y d j^]_ +d jY]a d jV]a m jQ]] d jO]Y d jN]R d jN]H d jO]@ d jQ\| m j^\| d j_]@ +d ja]H d ja]R d j_]Y d j^]] m jV]a d jS]_ d jQ][ d jO]R d jO]H d jQ\~ +d jS\z d jV\x m jY\x d j\\z d j^\~ d j_]H d j_]R d j^][ d j\]_ d jY]a +m jK\k m jt]@ d jt\~ d jv\~ d jv]@ d jt]@ m kD]P d kB]L d kA]J d j~]H +d jz]H d jv]J d jr]N d jq]S d jq]U d jr][ d jv]_ d jz]a d j~]a d kB]_ +d kF][ d kG]U d kG]J d kF]B d kD\~ d kA\z d j|\x d jw\x d jt\z d jr\~ +d jr]@ d jt]B d jv]B d jw]@ d jw\~ d jv\| d jt\| m jt]N d jr]R d jr]W +d jt][ m kB]] d kD][ d kF]U d kF]J d kD]B d kB\~ m jz]H d jw]J d jv]L +d jt]R d jt]W d jv]] d jw]_ d jz]a m j~]a d kA]_ d kB][ d kD]U d kD]H +d kB]@ d kA\| d j?\z d j|\x m jo\k m kT]o m kT\k m ks]o m ks\k m lR]o +m lR\k m lq]o m lq\k m mP]o m mP\k m mr]S d mr\x m ms]R d ms\z m mn]S +d mt]S d mt\x m mt]L d mv]P d mw]R d mz]S d m}]S d n@]R d nA]P d nB]J +d nB\x m n@]P d nA]J d nA\z m m}]S d m~]R d n@]L d n@\x m nB]L d nC]P +d nE]R d nG]S d nK]S d nM]R d nO]P d nP]J d nP\x m nM]P d nO]J d nO\z +m nK]S d nL]R d nM]L d nM\x m mn\x d mx\x m m|\x d nF\x m nJ\x d nT\x +m mp]S d mr]R m mq]S d mr]P m mr\z d mp\x m mr\| d mq\x m mt\| d mv\x +m mt\z d mw\x m n@\z d m}\x m n@\| d m~\x m nB\| d nC\x m nB\z d nE\x +m nM\z d nK\x m nM\| d nL\x m nP\| d nQ\x m nP\z d nR\x m mn\k m iq\N +d iq[i m is\N d is[k m it\R d it[i m it\R d ip\L d il\J m ik[i d i{[i +m iq[k d in[i m iq[m d ip[i m it[m d iv[i m it[k d iw[i m if[[ m jV\N +d jV[i m jW\N d jW[k m jY\R d jY[i m jY\R d jT\L d jQ\J m jO[i d j_[i +m jV[k d jS[i m jV[m d jT[i m jY[m d j[[i m jY[k d j\[i m jK[[ m jz\R +d jv\P d jr\J d jq\@ d jq[{ d jr[q d jv[k d jz[i d j~[i d kB[k d kF[q +d kG[{ d kG\@ d kF\J d kB\P d j~\R d jz\R m jv\N d jt\J d jr\B d jr[y +d jt[q d jv[m m kB[m d kD[q d kF[y d kF\B d kD\J d kB\N m jz\R d jw\P +d jv\L d jt\B d jt[y d jv[o d jw[k d jz[i m j~[i d kA[k d kB[o d kD[y +d kD\B d kB\L d kA\P d j~\R m jo[[ m kT\_ m kT[[ m ks\_ m ks[[ m lR\_ +m lR[[ m lq\_ m lq[[ m mP\_ m mP[[ m ms\D d ms[i m mt\B d mt[k m mn\D +d mu\D d mu[i m mu[| d mw\@ d mx\B d m{\D d m?\D d nB\B d nD\@ d nE[{ +d nE[i m nB\@ d nD[{ d nD[k m m?\D d nA\B d nB[| d nB[i m mn[i d mz[i +m m~[i d nI[i m mp\D d ms\B m mq\D d ms\@ m ms[k d mp[i m ms[m d mq[i +m mu[m d mw[i m mu[k d mx[i m nB[k d m?[i m nB[m d nA[i m nE[m d nF[i +m nE[k d nH[i m mn[[ m iqZ? d iqZZ m isZ? d isZ\ m it[C d itZZ m it[C +d ipZ} d ilZ{ m ikZZ d i{ZZ m iqZ\ d inZZ m iqZ^ d ipZZ m itZ^ d ivZZ +m itZ\ d iwZZ m ifZL m jVZ? d jVZZ m jWZ? d jWZ\ m jY[C d jYZZ m jY[C +d jTZ} d jQZ{ m jOZZ d j_ZZ m jVZ\ d jSZZ m jVZ^ d jTZZ m jYZ^ d j[ZZ +m jYZ\ d j\ZZ m jKZL m jzZ? d jzZZ m j|Z? d j|Z\ m j~[C d j~ZZ m j~[C +d jyZ} d jvZ{ m jtZZ d kDZZ m jzZ\ d jwZZ m jzZ^ d jyZZ m j~Z^ d j?ZZ +m j~Z\ d kAZZ m joZL m kT[P m kTZL m ks[P m ksZL m lR[P m lRZL m lq[P +m lqZL m mP[P m mPZL m myZu d muZs d mqZo d mpZi d mpZe d mqZ` d muZ\ +d myZZ d m}ZZ d nAZ\ d nEZ` d nFZe d nFZi d nEZo d nAZs d m}Zu d myZu +m msZo d mqZk d mqZc d msZ` m nCZ` d nEZc d nEZk d nCZo m myZu d mvZs +d muZq d msZk d msZc d muZ^ d mvZ\ d myZZ m m}ZZ d n@Z\ d nAZ^ d nCZc +d nCZk d nAZq d n@Zs d m}Zu m mnZL m iqYo d iqYJ m isYo d isYL m itYs +d itYJ m itYs d ipYm d ilYk m ikYJ d i{YJ m iqYL d inYJ m iqYN d ipYJ +m itYN d ivYJ m itYL d iwYJ m ifX} m jVYo d jVYJ m jWYo d jWYL m jYYs +d jYYJ m jYYs d jTYm d jQYk m jOYJ d j_YJ m jVYL d jSYJ m jVYN d jTYJ +m jYYN d j[YJ m jYYL d j\YJ m jKX} m jrYk d jrYi d jtYi d jtYk d jrYk +m jrYm d jtYm d jvYk d jvYi d jtYg d jrYg d jqYi d jqYk d jrYo d jtYq +d jyYs d j?Ys d kDYq d kFYo d kGYk d kGYg d kFYd d kAY` d jyY\ d jvYZ +d jrYV d jqYP d jqYJ m kDYo d kFYk d kFYg d kDYd m j?Ys d kBYq d kDYk +d kDYg d kBYd d j?Y` d jyY\ m jqYN d jrYP d jvYP d j~YN d kDYN d kGYP +stroke +m kGYP m jvYP d j~YL d kDYL d kFYN m jvYP d j~YJ d kDYJ d kFYL d kGYP +d kGYT m joX} m kTZA m kTX} m ksZA m ksX} m lRZA m lRX} m lqZA m lqX} +m mPZA m mPX} m msYe d msX} m mtYd d mtX? m mnYe d mvYe d mvX} m mvY` +d mwYd d m{Ye d m~Ye d nBYd d nEY` d nGYZ d nGYV d nEYP d nBYL d m~YJ +d m{YJ d mwYL d mvYP m nDY` d nEY\ d nEYT d nDYP m m~Ye d nAYd d nBYb +d nDY\ d nDYT d nBYN d nAYL d m~YJ m mnX} d m{X} m mpYe d msYd m mqYe +d msYb m msX? d mpX} m msYA d mqX} m mvYA d mwX} m mvX? d myX} m mnX} +m iqX` d iqW{ m isX` d isW} m itXd d itW{ m itXd d ipX^ d ilX\ m ikW{ +d i{W{ m iqW} d inW{ m iqW? d ipW{ m itW? d ivW{ m itW} d iwW{ m ifWm +m jVX` d jVW{ m jWX` d jWW} m jYXd d jYW{ m jYXd d jTX^ d jQX\ m jOW{ +d j_W{ m jVW} d jSW{ m jVW? d jTW{ m jYW? d j[W{ m jYW} d j\W{ m jKWm +m jrX\ d jrXZ d jtXZ d jtX\ d jrX\ m jrX^ d jtX^ d jvX\ d jvXZ d jtXX +d jrXX d jqXZ d jqX\ d jrX` d jtXb d jyXd d j?Xd d kDXb d kFX^ d kFXX +d kDXT d j?XR m kBXb d kDX^ d kDXX d kBXT m j~Xd d kAXb d kBX^ d kBXX +d kAXT d j~XR m jzXR d j?XR d kBXP d kFXM d kGXI d kGXC d kFW? d kDW} +d j?W{ d jyW{ d jtW} d jrW? d jqXC d jqXE d jrXG d jtXG d jvXE d jvXC +d jtXA d jrXA m kDXM d kFXI d kFXC d kDW? m j~XR d kAXP d kBXN d kDXI +d kDXC d kBW} d j?W{ m jrXE d jrXC d jtXC d jtXE d jrXE m joWm m kTXq +m kTWm m ksXq m ksWm m lRXq m lRWm m lqXq m lqWm m mPXq m mPWm m nAXT +d nAWm m nCXR d nCWo m n@XT d nCXT d nEXV d nEWm m nAXP d n@XT d m}XV +d myXV d muXT d mqXP d mpXK d mpXG d mqXA d muW} d myW{ d m}W{ d n@W} +d nAXA m msXP d mqXM d mqXE d msXA m myXV d mvXT d muXR d msXM d msXE +d muW? d mvW} d myW{ m m}Wm d nIWm m nAWo d m~Wm m nAWq d n@Wm m nEWq +d nFWm m nEWo d nHWm m mnWm m iqWQ d iqVl m isWQ d isVn m itWT d itVl +m itWT d ipWO d ilWM m ikVl d i{Vl m iqVn d inVl m iqVp d ipVl m itVp +d ivVl m itVn d iwVl m ifV^ m jVWQ d jVVl m jWWQ d jWVn m jYWT d jYVl +m jYWT d jTWO d jQWM m jOVl d j_Vl m jVVn d jSVl m jVVp d jTVl m jYVp +d j[Vl m jYVn d j\Vl m jKV^ m j~WO d j~Vl m j?WQ d j?Vn m kAWT d kAVl +m kAWT d joVw d kIVw m jyVl d kFVl m j~Vn d jzVl m j~Vp d j|Vl m kAVp +d kBVl m kAVn d kDVl m joV^ m kTWb m kTV^ m ksWb m ksV^ m lRWb m lRV^ +m lqWb m lqV^ m mPWb m mPV^ m mtWG d mtVl m mvWE d mvVn m mnWG d mwWG +d mwVl m nDWC d nDWE d nBWE d nBWA d nFWA d nFWE d nDWG d n@WG d m}WE +d myWA d mwV{ m mnVl d m}Vl m mpWG d mtWE m mrWG d mtWC m mtVn d mpVl +m mtVp d mrVl m mwVp d myVl m mwVn d m{Vl m mnV^ m iqVA d iqU\ m isVA +d isU^ m itVE d itU\ m itVE d ipU? d ilU} m ikU\ d i{U\ m iqU^ d inU\ +m iqU` d ipU\ m itU` d ivU\ m itU^ d iwU\ m ifUO m jVVA d jVU\ m jWVA +d jWU^ m jYVE d jYU\ m jYVE d jTU? d jQU} m jOU\ d j_U\ m jVU^ d jSU\ +m jVU` d jTU\ m jYU` d j[U\ m jYU^ d j\U\ m jKUO m jtVE d jqUr d jtUv +d jyUx d j~Ux d kBUv d kFUr d kGUl d kGUh d kFUb d kBU^ d j~U\ d jyU\ +d jtU^ d jrU` d jqUd d jqUf d jrUh d jtUh d jvUf d jvUd d jtUb d jrUb +m kDUr d kFUn d kFUf d kDUb m j~Ux d kAUv d kBUt d kDUn d kDUf d kBU` +d kAU^ d j~U\ m jrUf d jrUd d jtUd d jtUf d jrUf m jtVE d kDVE m jtVC +d kAVC m jtVA d jzVA d kAVC d kDVE m joUO m kTVS m kTUO m ksVS m ksUO +m lRVS m lRUO m lqVS m lqUO m mPVS m mPUO m nBUt d nDUx d nDUp d nBUt +d n@Uv d m}Ux d mvUx d mrUv d mpUt d mpUp d mrUl d mvUj d m?Uh d nBUf +d nDU` m mrUv d mpUp m mrUn d mvUl d m?Uj d nBUh m nDUf d nBU^ m mpUt +d mrUp d mvUn d m?Ul d nBUj d nDUf d nDU` d nBU^ d m?U\ d mwU\ d mtU^ +d mrU` d mpUd d mpU\ d mrU` m mnUO m iqTr d iqTM m isTr d isTO m itTv +d itTM m itTv d ipTp d ilTn m ikTM d i{TM m iqTO d inTM m iqTQ d ipTM +m itTQ d ivTM m itTO d iwTM m ifS? m jVTr d jVTM m jWTr d jWTO m jYTv +d jYTM m jYTv d jTTp d jQTn m jOTM d j_TM m jVTO d jSTM m jVTQ d jTTM +m jYTQ d j[TM m jYTO d j\TM m jKS? m kBTp d kBTn d kDTn d kDTp d kBTp +m kDTr d kBTr d kATp d kATn d kBTl d kDTl d kFTn d kFTp d kDTt d kATv +d j|Tv d jwTt d jtTp d jrTl d jqTd d jqTY d jrTS d jvTO d jzTM d j~TM +d kBTO d kFTS d kGTY d kGT[ d kFT` d kBTd d j~Tf d jzTf d jwTd d jvTb +d jtT^ m jvTp d jtTl d jrTd d jrTY d jtTS d jvTQ m kDTS d kFTW d kFT] +d kDT` m j|Tv d jyTt d jwTr d jvTn d jtTf d jtTY d jvTS d jwTO d jzTM +m j~TM d kATO d kBTQ d kDTW d kDT] d kBTb d kATd d j~Tf m joS? m kTUC +m kTS? m ksUC m ksS? m lRUC m lRS? m lqUC m lqS? m mPUC m mPS? m mtTr +d mtTW d mvTQ d mxTO d m|TM d n@TM d nDTO d nFTS m mvTr d mvTU d mxTQ +m mtTr d mxTv d mxTU d mzTO d m|TM m mnTh d n@Th m mnS? m iqSc d iqR~ +m isSc d isS@ m itSf d itR~ m itSf d ipSa d ilS_ m ikR~ d i{R~ m iqS@ +d inR~ m iqSB d ipR~ m itSB d ivR~ m itS@ d iwR~ m ifRp m jVSc d jVR~ +m jWSc d jWS@ m jYSf d jYR~ m jYSf d jTSa d jQS_ m jOR~ d j_R~ m jVS@ +d jSR~ m jVSB d jTR~ m jYSB d j[R~ m jYS@ d j\R~ m jKRp m jqSf d jqS[ +m kGSf d kGSa d kFS[ d j?SQ d j~SM d j|SE d j|R~ m j~SO d j|SK d jzSE +d jzR~ m kFS[ d j~SQ d jzSK d jySE d jyR~ d j|R~ m jqS_ d jrSc d jvSf +d jySf d kASa d kDSa d kFSc d kGSf m jtSc d jvSe d jySe d j|Sc m jqS_ +d jrSa d jvSc d jySc d kASa m joRp m kTSt m kTRp m ksSt m ksRp m lRSt +m lRRp m lqSt m lqRp m mPSt m mPRp m msSY d msSG d mtSB d muS@ d mxR~ +d m}R~ d m?S@ d nASB d nBSE m mtSW d mtSE d muSB m mnSY d muSY d muSE +d mwS@ d mxR~ m nBSY d nBR~ d nIR~ m nDSW d nDS@ m m~SY d nESY d nER~ +m mpSY d msSW m mqSY d msSU m nESB d nFR~ m nES@ d nHR~ m mnRp m iqRS +d iqQn m isRS d isQp m itRW d itQn m itRW d ipRQ d ilRO m ikQn d i{Qn +m iqQp d inQn m iqQr d ipQn m itQr d ivQn m itQp d iwQn m ifQa m jVRS +d jVQn m jWRS d jWQp m jYRW d jYQn m jYRW d jTRQ d jQRO m jOQn d j_Qn +m jVQp d jSQn m jVQr d jTQn m jYQr d j[Qn m jYQp d j\Qn m jKQa m jyRW +d jtRU d jrRQ d jrRK d jtRH d jyRF d j?RF d kDRH d kFRK d kFRQ d kDRU +d j?RW d jyRW m jvRU d jtRQ d jtRK d jvRH m kBRH d kDRK d kDRQ d kBRU +m jyRW d jwRU d jvRQ d jvRK d jwRH d jyRF m j?RF d kARH d kBRK d kBRQ +d kARU d j?RW m jyRF d jtRD d jrRB +stroke +m jrRB d jqQ~ d jqQv d jrQr d jtQp d jyQn d j?Qn d kDQp d kFQr d kGQv +d kGQ~ d kFRB d kDRD d j?RF m jtRB d jrQ~ d jrQv d jtQr m kDQr d kFQv +d kFQ~ d kDRB m jyRF d jvRD d jtQ~ d jtQv d jvQp d jyQn m j?Qn d kBQp +d kDQv d kDQ~ d kBRD d j?RF m joQa m kTRe m kTQa m ksRe m ksQa m lRRe +m lRQa m lqRe m lqQa m mPRe m mPQa m mpRJ d mzQn m mrRJ d mzQr m mtRJ +d m|Qr m nERH d m|Qr d mzQn m mnRJ d myRJ m m~RJ d nHRJ m mnRJ d mtRF +m mwRJ d mtRH m nARJ d nERH m nFRJ d nERH m mnQa m iqQD d iqP_ m isQD +d isPa m itQH d itP_ m itQH d ipQB d ilQ@ m ikP_ d i{P_ m iqPa d inP_ +m iqPc d ipP_ m itPc d ivP_ m itPa d iwP_ m ifPQ m jVQD d jVP_ m jWQD +d jWPa m jYQH d jYP_ m jYQH d jTQB d jQQ@ m jOP_ d j_P_ m jVPa d jSP_ +m jVPc d jTP_ m jYPc d j[P_ m jYPa d j\P_ m jKPQ m jtPg d jtPe d jvPe +d jvPg d jtPg m kDPv d kBPr d kAPq d j~Po d jzPo d jvPq d jrPt d jqPz +d jqP| d jrQB d jvQF d jzQH d j~QH d kBQF d kFQB d kGP| d kGPq d kFPi +d kDPe d kAPa d j|P_ d jwP_ d jtPa d jrPe d jrPg d jtPi d jvPi d jwPg +d jwPe d jvPc d jtPc m jtPt d jrPx d jrP~ d jtQB m kBQD d kDQB d kFP| +d kFPq d kDPi d kBPe m jzPo d jwPq d jvPr d jtPx d jtP~ d jvQD d jwQF +d jzQH m j~QH d kAQF d kBQB d kDP| d kDPo d kBPg d kAPc d j?Pa d j|P_ +m joPQ m kTQU m kTPQ m ksQU m ksPQ m lRQU m lRPQ m lqQU m lqPQ m mPQU +m mPPQ m mqPz d mwP_ m mrPz d mwPe m mtPz d mxPe m m|Pz d mxPe d mwP_ +m m|Pz d nAP_ m m}Pz d nAPe m m|Pz d m?Pz d nCPe m nGPx d nCPe d nAP_ +m mnPz d mxPz m nCPz d nKPz m mnPz d mrPx m mwPz d mtPx m nDPz d nGPx +m nJPz d nGPx m mnPQ m iqOu d iqOP m isOu d isOR m itOy d itOP m itOy +d ipOs d ilOq m ikOP d i{OP m iqOR d inOP m iqOT d ipOP m itOT d ivOP +m itOR d iwOP m ifOB m jNOq d jNOo d jOOo d jOOq d jNOq m jNOs d jOOs +d jQOq d jQOo d jOOm d jNOm d jLOo d jLOq d jNOu d jOOw d jTOy d j[Oy +d j_Ow d jaOu d jbOq d jbOm d jaOi d j\Oe d jTOa d jQO_ d jNO[ d jLOV +d jLOP m j_Ou d jaOq d jaOm d j_Oi m j[Oy d j^Ow d j_Oq d j_Om d j^Oi +d j[Oe d jTOa m jLOT d jNOV d jQOV d jYOT d j_OT d jbOV m jQOV d jYOR +d j_OR d jaOT m jQOV d jYOP d j_OP d jaOR d jbOV d jbOY m jKOB m jzOy +d jvOw d jrOq d jqOg d jqOa d jrOW d jvOR d jzOP d j~OP d kBOR d kFOW +d kGOa d kGOg d kFOq d kBOw d j~Oy d jzOy m jvOu d jtOq d jrOi d jrO_ +d jtOW d jvOT m kBOT d kDOW d kFO_ d kFOi d kDOq d kBOu m jzOy d jwOw +d jvOs d jtOi d jtO_ d jvOV d jwOR d jzOP m j~OP d kAOR d kBOV d kDO_ +d kDOi d kBOs d kAOw d j~Oy m joOB m kTPF m kTOB m ksPF m ksOB m lRPF +m lROB m lqPF m lqOB m mPPF m mPOB m mqOk d nAOP m msOk d nCOP m muOk +d nEOP m nCOi d msOR m mnOk d myOk m m~Ok d nHOk m mnOP d mxOP m m}OP +d nHOP m mpOk d msOi m mxOk d muOi m n@Ok d nCOi m nFOk d nCOi m msOR +d mpOP m msOR d mvOP m nAOR d m~OP m nCOR d nFOP m mnOB m iqNe d iqN@ +m isNe d isNB m itNi d itN@ m itNi d ipNc d ilNa m ikN@ d i{N@ m iqNB +d inN@ m iqND d ipN@ m itND d ivN@ m itNB d iwN@ m ifMs m jNNa d jNN_ +d jON_ d jONa d jNNa m jNNc d jONc d jQNa d jQN_ d jON] d jNN] d jLN_ +d jLNa d jNNe d jONg d jTNi d j[Ni d j_Ng d jaNe d jbNa d jbN] d jaNZ +d j\NV d jTNR d jQNP d jNNL d jLNF d jLN@ m j_Ne d jaNa d jaN] d j_NZ +m j[Ni d j^Ng d j_Na d j_N] d j^NZ d j[NV d jTNR m jLND d jNNF d jQNF +d jYND d j_ND d jbNF m jQNF d jYNB d j_NB d jaND m jQNF d jYN@ d j_N@ +d jaNB d jbNF d jbNJ m jKMs m jzNe d jzN@ m j|Ne d j|NB m j~Ni d j~N@ +m j~Ni d jyNc d jvNa m jtN@ d kDN@ m jzNB d jwN@ m jzND d jyN@ m j~ND +d j?N@ m j~NB d kAN@ m joMs m kTNw m kTMs m ksNw m ksMs m lRNw m lRMs +m lqNw m lqMs m mPNw m mPMs m mrN[ d m|N@ m msN[ d m|ND m muN[ d m}ND +m nENZ d m}ND d mxMy d muMu d mrMs d mnMs d mnMu d mnMy d mpMy d mpMu +d mnMu d mnMw m mnN[ d mzN[ m m?N[ d nIN[ m mpN[ d muNX m mxN[ d muNZ +m nBN[ d nENZ m nGN[ d nENZ m mnMs m iqMV d iqLq m isMV d isLs m itMZ +d itLq m itMZ d ipMT d ilMR m ikLq d i{Lq m iqLs d inLq m iqLu d ipLq +m itLu d ivLq m itLs d iwLq m ifLc m jNMR d jNMP d jOMP d jOMR d jNMR +m jNMT d jOMT d jQMR d jQMP d jOMN d jNMN d jLMP d jLMR d jNMV d jOMX +d jTMZ d j[MZ d j_MX d jaMV d jbMR d jbMN d jaMJ d j\MF d jTMC d jQMA +d jNL} d jLLw d jLLq m j_MV d jaMR d jaMN d j_MJ m j[MZ d j^MX d j_MR +d j_MN d j^MJ d j[MF d jTMC m jLLu d jNLw d jQLw d jYLu d j_Lu d jbLw +m jQLw d jYLs d j_Ls d jaLu m jQLw d jYLq d j_Lq d jaLs d jbLw d jbL{ +m jKLc m jrMR d jrMP d jtMP d jtMR d jrMR m jrMT d jtMT d jvMR d jvMP +d jtMN d jrMN d jqMP d jqMR d jrMV d jtMX d jyMZ d j?MZ d kDMX d kFMV +d kGMR d kGMN d kFMJ d kAMF d jyMC d jvMA d jrL} d jqLw d jqLq m kDMV +d kFMR d kFMN d kDMJ m j?MZ d kBMX d kDMR d kDMN d kBMJ d j?MF d jyMC +m jqLu d jrLw d jvLw d j~Lu d kDLu d kGLw m jvLw d j~Ls d kDLs d kFLu +m jvLw d j~Lq d kDLq d kFLs d kGLw d kGL{ m joLc m kTMg m kTLc m ksMg +m ksLc m lRMg m lRLc m lqMg m lqLc m mPMg m mPLc m nAML d mpLq m nCML +d mrLq m nEML d mtLq m nEML d mpML d mpMD m mpLq d nELq d nELy m mrML +d mpMD m mtML d mpMF m muML d mpMH m myML d mpMJ m m|Lq d nELs m n@Lq +d nELu m nALq d nELw m nCLq d nELy m mnLc m iqLG d iqKb m isLG d isKd +m itLK d itKb m itLK d ipLE d ilLC m ikKb d i{Kb m iqKd d inKb m iqKf +d ipKb m itKf d ivKb m itKd d iwKb m ifKT m jNLC d jNLA d jOLA d jOLC +d jNLC m jNLE d jOLE d jQLC d jQLA d jOK? d jNK? d jLLA d jLLC d jNLG +d jOLI d jTLK d j[LK d j_LI d jaLG d jbLC d jbK? d jaK{ d j\Kw d jTKs +d jQKq d jNKm d jLKg d jLKb m j_LG d jaLC d jaK? d j_K{ m j[LK d j^LI +d j_LC d j_K? d j^K{ d j[Kw d jTKs m jLKf d jNKg d jQKg d jYKf d j_Kf +d jbKg m jQKg d jYKd d j_Kd d jaKf m jQKg d jYKb d j_Kb d jaKd +stroke +m jaKd d jbKg d jbKk m jKKT m jrLC d jrLA d jtLA d jtLC d jrLC m jrLE +d jtLE d jvLC d jvLA d jtK? d jrK? d jqLA d jqLC d jrLG d jtLI d jyLK +d j?LK d kDLI d kFLE d kFK? d kDK{ d j?Ky m kBLI d kDLE d kDK? d kBK{ +m j~LK d kALI d kBLE d kBK? d kAK{ d j~Ky m jzKy d j?Ky d kBKw d kFKs +d kGKo d kGKi d kFKf d kDKd d j?Kb d jyKb d jtKd d jrKf d jqKi d jqKk +d jrKm d jtKm d jvKk d jvKi d jtKg d jrKg m kDKs d kFKo d kFKi d kDKf +m j~Ky d kAKw d kBKu d kDKo d kDKi d kBKd d j?Kb m jrKk d jrKi d jtKi +d jtKk d jrKk m joKT m kTLX m kTKT m ksLX m ksKT m lRLX m lRKT m lqLX +m lqKT m mPLX m mPKT m m}LR d myLP d mwLN d muLK d muLG d mwLC d myLA +d m{K} d m{Ky d mwKu m myLP d mwLL d mwLI d myLE d m{LC d m}K? d m}K{ +d m{Kw d msKs d m{Ko d m}Kk d m}Kg d m{Kd d myKb d mwK^ d mwKZ d myKV +m mwKq d m{Km d m{Ki d myKf d mwKd d muK` d muK\ d mwKX d myKV d m}KT +m mnKT m iqJw d iqJR m isJw d isJT m itJ{ d itJR m itJ{ d ipJu d ilJs +m ikJR d i{JR m iqJT d inJR m iqJV d ipJR m itJV d ivJR m itJT d iwJR +m ifJE m jNJs d jNJq d jOJq d jOJs d jNJs m jNJu d jOJu d jQJs d jQJq +d jOJo d jNJo d jLJq d jLJs d jNJw d jOJy d jTJ{ d j[J{ d j_Jy d jaJw +d jbJs d jbJo d jaJl d j\Jh d jTJd d jQJb d jNJ^ d jLJX d jLJR m j_Jw +d jaJs d jaJo d j_Jl m j[J{ d j^Jy d j_Js d j_Jo d j^Jl d j[Jh d jTJd +m jLJV d jNJX d jQJX d jYJV d j_JV d jbJX m jQJX d jYJT d j_JT d jaJV +m jQJX d jYJR d j_JR d jaJT d jbJX d jbJ\ m jKJE m j~Ju d j~JR m j?Jw +d j?JT m kAJ{ d kAJR m kAJ{ d joJ^ d kIJ^ m jyJR d kFJR m j~JT d jzJR +m j~JV d j|JR m kAJV d kBJR m kAJT d kDJR m joJE m kTKI m kTJE m ksKI +m ksJE m lRKI m lRJE m lqKI m lqJE m mPKI m mPJE m mtKC d mtJE m mnJE +m iqIh d iqIC m isIh d isIE m itIl d itIC m itIl d ipIf d ilId m ikIC +d i{IC m iqIE d inIC m iqIG d ipIC m itIG d ivIC m itIE d iwIC m ifHu +m jNId d jNIb d jOIb d jOId d jNId m jNIf d jOIf d jQId d jQIb d jOI` +d jNI` d jLIb d jLId d jNIh d jOIj d jTIl d j[Il d j_Ij d jaIh d jbId +d jbI` d jaI\ d j\IX d jTIT d jQIS d jNIO d jLII d jLIC m j_Ih d jaId +d jaI` d j_I\ m j[Il d j^Ij d j_Id d j_I` d j^I\ d j[IX d jTIT m jLIG +d jNII d jQII d jYIG d j_IG d jbII m jQII d jYIE d j_IE d jaIG m jQII +d jYIC d j_IC d jaIE d jbII d jbIM m jKHu m jtIl d jqIX d jtI\ d jyI^ +d j~I^ d kBI\ d kFIX d kGIS d kGIO d kFII d kBIE d j~IC d jyIC d jtIE +d jrIG d jqIK d jqIM d jrIO d jtIO d jvIM d jvIK d jtII d jrII m kDIX +d kFIT d kFIM d kDII m j~I^ d kAI\ d kBIZ d kDIT d kDIM d kBIG d kAIE +d j~IC m jrIM d jrIK d jtIK d jtIM d jrIM m jtIl d kDIl m jtIj d kAIj +m jtIh d jzIh d kAIj d kDIl m joHu m kTIy m kTHu m ksIy m ksHu m lRIy +m lRHu m lqIy m lqHu m mPIy m mPHu m muIt d myIr d m{Ip d m}Il d m}Ih +d m{Id d myIb d mwI^ d mwIZ d m{IV m myIr d m{In d m{Ij d myIf d mwId +d muI` d muI\ d mwIX d m?IT d mwIQ d muIM d muII d mwIE d myIC d m{H? +d m{H{ d myHw m m{IS d mwIO d mwIK d myIG d m{IE d m}IA d m}H} d m{Hy +d myHw d muHu m mnHu m iqHY d iqGt m isHY d isGv m itH\ d itGt m itH\ +d ipHW d ilHU m ikGt d i{Gt m iqGv d inGt m iqGx d ipGt m itGx d ivGt +m itGv d iwGt m ifGf m jNHU d jNHS d jOHS d jOHU d jNHU m jNHW d jOHW +d jQHU d jQHS d jOHQ d jNHQ d jLHS d jLHU d jNHY d jOH[ d jTH\ d j[H\ +d j_H[ d jaHY d jbHU d jbHQ d jaHM d j\HI d jTHE d jQHC d jNG? d jLGy +d jLGt m j_HY d jaHU d jaHQ d j_HM m j[H\ d j^H[ d j_HU d j_HQ d j^HM +d j[HI d jTHE m jLGx d jNGy d jQGy d jYGx d j_Gx d jbGy m jQGy d jYGv +d j_Gv d jaGx m jQGy d jYGt d j_Gt d jaGv d jbGy d jbG} m jKGf m kBHW +d kBHU d kDHU d kDHW d kBHW m kDHY d kBHY d kAHW d kAHU d kBHS d kDHS +d kFHU d kFHW d kDH[ d kAH\ d j|H\ d jwH[ d jtHW d jrHS d jqHK d jqG? +d jrGy d jvGv d jzGt d j~Gt d kBGv d kFGy d kGG? d kGHA d kFHG d kBHK +d j~HM d jzHM d jwHK d jvHI d jtHE m jvHW d jtHS d jrHK d jrG? d jtGy +d jvGx m kDGy d kFG} d kFHC d kDHG m j|H\ d jyH[ d jwHY d jvHU d jtHM +d jtG? d jvGy d jwGv d jzGt m j~Gt d kAGv d kBGx d kDG} d kDHC d kBHI +d kAHK d j~HM m joGf m kTHj m kTGf m ksHj m ksGf m lRHj m lRGf m lqHj +m lqGf m mPHj m mPGf m mpG? d mpHC d mqHI d mtHK d mwHK d myHI d m?HC +d nAHA d nDHA d nGHC d nHHG m mpHC d mqHG d mtHI d mwHI d myHG d m?HA +d nAG? d nDG? d nGHA d nHHG d nHHK m mnGf m iqGI d iqFd m isGI d isFf +m itGM d itFd m itGM d ipGG d ilGE m ikFd d i{Fd m iqFf d inFd m iqFh +d ipFd m itFh d ivFd m itFf d iwFd m ifFW m jNGE d jNGC d jOGC d jOGE +d jNGE m jNGG d jOGG d jQGE d jQGC d jOGA d jNGA d jLGC d jLGE d jNGI +d jOGK d jTGM d j[GM d j_GK d jaGI d jbGE d jbGA d jaF~ d j\Fz d jTFv +d jQFt d jNFp d jLFj d jLFd m j_GI d jaGE d jaGA d j_F~ m j[GM d j^GK +d j_GE d j_GA d j^F~ d j[Fz d jTFv m jLFh d jNFj d jQFj d jYFh d j_Fh +d jbFj m jQFj d jYFf d j_Ff d jaFh m jQFj d jYFd d j_Fd d jaFf d jbFj +d jbFn m jKFW m jqGM d jqGA m kGGM d kGGG d kFGA d j?Fx d j~Ft d j|Fl +d j|Fd m j~Fv d j|Fr d jzFl d jzFd m kFGA d j~Fx d jzFr d jyFl d jyFd +d j|Fd m jqGE d jrGI d jvGM d jyGM d kAGG d kDGG d kFGI d kGGM +stroke +m kGGM m jtGI d jvGK d jyGK d j|GI m jqGE d jrGG d jvGI d jyGI d kAGG +m joFW m kTG[ m kTFW m ksG[ m ksFW +stroke +/Times-Roman findfont 24 scalefont setfont +initmatrix +-1 72 mul 300 div 1 72 mul 300 div scale +-2409 88 translate +1600 3150 moveto +[1 0 0 -1 0 0] concat +(NOAO/IRAF fitz@pisces Mon Jun 30 10:37:53 1997 +) show +showpage diff --git a/vendor/x11iraf/cdl/doc/vximtool.man b/vendor/x11iraf/cdl/doc/vximtool.man new file mode 100644 index 00000000..66f2afb7 --- /dev/null +++ b/vendor/x11iraf/cdl/doc/vximtool.man @@ -0,0 +1,276 @@ +.\" @(#)vximtool.1 1.1 18-Jun-97 MJF +.TH VXIMTOOL 1 "18 Jun 1997" "IRAF Project" +.SH NAME +vximtool \-- A virtual and/or proxy display server for IRAF IIS protocol clients +.SH SYNOPSIS +\fBvximtool\fP [ \fIoptions\fP ...] +.br +\fBvximtool\fP -proxy [ \fIoptions ...] server [ server\fP ... ] + +.SH "DESCRIPTION" +.LP +\fIVXIMTOOL\fR is a image display server process much like \fIXIMTOOL\fR, +except that all it normally does is respond to datastream requests +to read and write to internal frame buffers maintained as arrays in memory. +Multiple frame buffers and frame buffer configurations are supported. It +can be used to debug IIS protocol client programs by printing out the +protocol packets recieved, or can simply be used as a dummy server in cases +where no image display is really needed. By enabling the \fI-proxy\fR +flag the server can also be used to repeat the datastream requests to a +list of other servers, effectively splitting the image display to a number +of other servers. See below for details on using the program in this +manner. + +The \fI-verbose\fR flag will log all datastream requests to the stderr, +otherwise the task runs silently except for error messages. The process is +terminated with an EOF on the stdin, if the task is intended to be run +as a background job the \fI-background\fR flag should be enabled to shut +off the check of the stdin and avoid a "waiting for tty input" message that +would suspend the background job. Frame buffers are maintained as rasters +in memory, up to four frames may currently be defined. If it not necessary +to keep the displayed images in memory (i.e. the client will not need to +read back any subrasters such as when doing overlay graphics), the +\fI-noraster\fR flag can be used to disable the memory rasters. In this +case any image readback will return an array of zero values. + +The default frame buffer size is 512x512, with 2 frames defined initially. +The \fI-config\fR and \fI-nframes\fR flags can be used to change the +startup frame buffers used. The frame buffer configuration table is normally +taken to be /usr/local/lib/imtoolrc but can be overridden by using an +IMTOOLRC environment variable, a \fI$HOME/.imtoolrc\fR file, or +the \fI-imtoolrc\fR command-line flag respectively. The format of the +frame buffer configuration file is + + \fIconfigno nframes width height [extra fields]\fP + e.g. + 1 2 512 512 + 2 2 800 800 + 3 1 1024 1024 # comment + +and so on. At most 128 frame buffer sizes may be defined, each configuration +may define up to 4 frames, configuration numbers need not be sequential. + +.SH OPTIONS +.TP 5 +.B "-background" +The task will be run in the background so don't listen to STDIN for an +EOF to quit gracefully. +.TP 5 +.B "-config \fInum\fP" +Initial frame buffer configuration number. The default value is 1, indicating +a 512x512 frame buffer with 2 frames. See below for information on the frame +buffers. +.TP 5 +.B "-fifo \fIpipe\fP" +Specifies the name of the fifo pipe to be used, the \fIi\fP +and \fIo\fP suffixes will be added automatically. The default pipe names +will be /dev/imt1i (input pipe) and /dev/imt1o (output pipe). +.TP 5 +.B "-fifo_only" +If set, only fifo pipes will be used for communication with a client program, +sockets will be disabled. +.TP 5 +.B "-help" +Print a summary of command line options to the screen. +.TP 5 +.B "-interactive" +Allow cursor value strings to be typed into the STDIN in response to cursor +read requests from the client. +.TP 5 +.B "-imtoolrc \fIfile\fP" +Specifies the frame buffer configuration file to be used. See below for +information on frame buffers. +.TP 5 +.B "-inet_only" +If set, only inet sockets will be used for communication with a client program, +fifo pipes and unix sockets will be disabled. +.TP 5 +.B "-noraster" +If set no client data will be stored in memory, and image readback will +return an array of zeroes unless used as a proxy server. +.TP 5 +.B "-nframes \fInum\fP" +Specifies the number of frame buffers to configure at startup. By default +there will be 2 frames available, a maximum of 4 frames are allowed. +.TP 5 +.B "-port_only" +Same as \fI-inet_only\fP option. If set, only inet sockets will be used for +communication with a client program. +.TP 5 +.B "-port \fInum\fP" +Set the primary port to listen on for client connections. The default +is 5137 except when used as a proxy server in which case the default is +5136. +.TP 5 +.B "-proxy" +Run as a proxy server by repeating client requests to each of the +\fIserver\fR remote server arguments. See the section on proxy usage +below for details. +.TP 5 +.B "-verbose" +If set, print information about all IIS packets headers recieved to the +STDERR stream. +.TP 5 +.B "-unix \fIname\fP" +Specifies the unix domain socket name to use. A "%d" in the filename will +be replaced with the user id. +.TP 5 +.B "-unix_only" +If set, only unix domain sockets will be used for communication with a client +program, inet sockets and fifos will be disabled. + +.SH "CLIENT CONNECTIONS" + +\fIVXImtool\fR allows clients to connect in any of the following ways: +.TP 5 +.B "fifo pipes" +The traditional approach. The default global /dev/imt1[io] +pipes may be used, or a private set of fifos can be specified using the +\fI-fifo\fP command line argument. Values should be specified as the root +pathname to a pair of fifo pipes whose last character is 'i' or 'o', +these characters will be added automatically when opening the pipes. +For example, to use the default pipes the path would be specified as simply +"/dev/imt1". A value of "none" disables this connection. +.TP 5 +.B "tcp/ip sockets" +Clients connect via a tcp/ip socket. The default port is \fI5137\fP, or a +custom port may be specified using the \fI-port\fP command line switch. +This permits connecting to the server over a remote network connection +anywhere on the Internet. When used as a proxy server the default port +number is 5136 so as to avoid a conflict with an XImtool running on the +same machine, other connections are disabled unless otherwise overridden +by a command line option following the \fI-proxy\fR flag to reset the +connection. A port number of 0 (zero) disables this connection. +.TP 5 +.B "unix domain sockets" +Like a tcp/ip socket, but limited to a single host system. Usually faster +than a tcp/ip socket, and comparable to a fifo. By default each user gets +their own unix domain socket, so this option allows multiple users to run +ximtools on the same host without having to customize things. The default +value is "/tmp/.IMT%d", other sockets may be defined using the \fI-unix\fP +command line switch. Legal values should be specified as a filename to be +used for the socket, up to two "%d" fields are allowed and will be replaced +by the userid. An empty string value disables this connection. +.LP +By default \fIvximtool\fR listens simultaneously for client connections on all +three types of ports. Clients may connect simultaneously by different +means allowing up to three different displays to be loading at the same +time into different frames. + +.SH "COMMUNICATIONS PROTOCOL" + +Clients communicate with \fIvximtool\fR using a protocol developed originally +for IIS (International Imaging Systems) Frame Buffer hardware, the so-called +"IIS protocol"; other more modern protocols will likely be supported in the +future. The IIS protocol is basically a command packet stream with a header +describing the operation to be performed (select frame, load display, read +cursor, etc), and an optional data packet containing e.g. pixels. It is +beyond the scope of this document to describe fully the details of the +protocol; interested users should contact \fIiraf@noao.edu\fP for further +information or see the \fIA Reference Guide for the IRAF Client Display +Library\fR for details. + +.SH "PROXY USAGE" + +The \fIvximtool\fR may also be used as a proxy server by enabling the +\fI-proxy\fR command line flag. In this mode the program acts as +a relay for the IIS datastream packets, sending image data, frame requests, +etc. to a list of other servers specified on the command line. The effect +of this is to allow a client to display to this program which then +re-displays to each of the other named servers. A maximum of 8 servers +may be named, they may be either on the local host or a remote machine +and connections can be established using either fifos or sockets. See +below for details on how to specify the server connection. + +The current implementation has a few restrictions users should keep in mind: +.IP +Cursor and image readback are done by sending the request \fIonly\fR to +the first server named on the command line. This is done to avoid forcing +a cursor mode on all servers which cannot be terminated when a response is +received from only one server, and means that the first server named should +be the one used to control interactive sessions. The remaining servers +however can still respond to cursor requests from other applications connected +to that server on another channel. +.IP +All named servers must be running prior to starting the proxy server. The +connection to the remote servers is established when this task is first run +and if no server is running that connection will be ignored. The task will +exit if no remote servers can be found for display. +.IP +Any connected server that shuts down while the proxy server is running is +likely to cause the program to crash on the next display. + +.SH "SPECIFYING THE REMOTE SERVER CONNECTION" + +The syntax for the server argument used in proxy mode is as follows: + + \fI<domain> : <address>\fR + +where <domain> is one of \fBinet\fR (internet tcp/ip socket), \fBunix\fR +(unix domain socket) or \fBfifo\fR (named pipe). The form of the address +depends upon the domain, as illustrated in the examples below. + +.TP 30 +inet:5137 +Connect to port 5137 on the local host. +.TP 30 +inet:5137:foo.bar.edu +Client connection to port 5137 on internet host \fIfoo.bar.edu\fR. +The dotted (numeric) form of address may also be used. +.TP 30 +unix:/tmp/.IMT212 +Unix domain socket with the given pathname. IPC method, local host only. +.TP 30 +fifo:/dev/imt1i:/dev/imt1o +FIFO or named pipe with the given pathname. IPC method, local host only. +Two pathnames are required, one for input and one for output, since FIFOs +are not bidirectional. +.LP +The address field may contain up to two "%d" fields. If present, the +user's UID will be substituted (e.g. "unix:/tmp/.IMT%d"). + +.SH "EXAMPLES" + +.TP 5 +1) Run the vximtool, logging output to the file named "spool": + + \f(CW% vximtool -verbose >& spool\fR +.TP 5 +2) Run the vximtool in the background, connect only on unix sockets, no output: + + \f(CW% vximtool -b -unix_only &\fR +.TP 5 +3) Don't store images in memory, start with initial 1024x1024 frame buffer: + + \f(CW% vximtool -noraster -config 3\fR +.TP 5 +4) Run the vximtool in the background, taking cursor input from a file: + + \f(CW% vximtool -i < cursor_file &\fR +.TP 5 +5) Run as a proxy server, displaying to both a local and a remote XImtool, log output to stderr: + + \fI...start all XImtool servers to be used\fP + \f(CW% vximtool -v -proxy unix:/tmp/.IMT%d inet:5137:pisces + Connected to server on unix:/tmp/.IMT359 + Connected to server on inet:5137:pisces + Open to accept input on inet: port 5136\fR + +.LP +To display to the proxy server the client should connect to the vximtool on +\fIinet:5136\fP, the proxy in turn will relay data to the servers listed on +the command line. Note that in this last example any cursor requests from +the client connected to the vximtool will be handled by the +ximtool connected on a unix socket on the local machine (i.e. the first +server argument). The remote ximtool +on the machine pisces could simultaneously be used by another client on +that machine connected by some other means. In this case it will only +display images coming from the \fIvximtool\fR proxy, but could be used in +an interactive IRAF session running on pisces to examine the images. + +.SH SEE ALSO +ximtool(1) +.br +\fIA Reference Guide for the IRAF Client Display Library (CDL)\fR +.SH COPYRIGHT +Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. diff --git a/vendor/x11iraf/cdl/doc/vximtool.ps b/vendor/x11iraf/cdl/doc/vximtool.ps new file mode 100644 index 00000000..70cae4f5 --- /dev/null +++ b/vendor/x11iraf/cdl/doc/vximtool.ps @@ -0,0 +1,2472 @@ +%!PS-Adobe-1.0 +%%Creator: devps (Pipeline Associates, Inc.) +%%CreationDate: Tue Mar 3 16:57:09 1998 +%%Pages: (atend) +%%DocumentFonts: (atend) + +/X{exch}def +/r{rmoveto}def +/m{moveto}def +/l{lineto}def +/rl{rlineto}def +/lc{yc X xc X l st}def +/mc{yc X xc X m}def +/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}def +/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}def +/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}def +/st{stroke}def +/gs{gsave}def +/gr{grestore}def +/cp{currentpoint}def +/np{newpath}def +/ct{curveto}def +/m0{0 0 moveto}def +/BP{/devps-save save def m0}def +/EP{ +clear devps-save restore +showpage}def +/res 10.000000 def +/V{res neg div 792 add +currentpoint pop X +m}def +/H{res div +currentpoint X pop +moveto}def +/h{res div 0 r}def +/v{res neg div 0 X r}def +/xc{res div}def +/yc{res neg div 792 add}def +/S{X H show}def +/psize 10 def +/height 1 def +/slant 0 def +/FF{findfont X dup 12 div setlinewidth /psize X def + [psize 0 psize height mul slant sin slant cos div mul psize height mul 0 0] + makefont setfont}def +/shade{gs + /dy X def + /dx X def + np m + setgray + 0 dy rl + dx 0 rl + 0 dy neg rl + dx neg 0 rl + closepath + fill +gr}def +1 setlinecap +/R{/Times-Roman FF}def +/B{/Times-Bold FF}def +/I{/Times-Italic FF}def +/C{/Courier FF}def +%%EndProlog +%%Page: 1 1 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +480 V +900(VXIMTOOL)S +1448(\()S +1497(1)S +1563(\))S +2787(USER COMMANDS )S +4884(VXIMTOOL)S +5432(\()S +5481(1)S +5547(\))S +960 V +9 B +900(NAME)S +1080 V +10 R +1260(vximtool)S +1652(\261-)S +1765(A)S +1867(virtual)S +2158(and/or)S +2443(proxy)S +2706(display)S +3025(server)S +3298(for)S +3444(IRAF)S +3702(IIS)S +3854(protocol)S +4217(clients)S +1248 V +9 B +900(SYNOPSIS)S +1368 V +10 B +1260(vximtool)S +10 R +1662([)S +10 I +1725(options)S +10 R +2050(...])S +1488 V +10 B +1260(vximtool)S +10 R +1662(-proxy)S +1958([)S +10 I +2021(options)S +2346(...])S +2490(server)S +2769([)S +2838(server)S +10 R +3117(...)S +3222(])S +1776 V +9 B +900(DESCRIPTION)S +1896 V +10 I +1260(VXIMTOOL)S +10 R +1793(is)S +1899(a)S +1982(image)S +2265(display)S +2593(server)S +2875(process)S +3213(much)S +3475(like)S +10 I +3665(XIMTOOL)S +10 R +4098(,)S +4163(except)S +4463(that)S +4653(all)S +4793(it)S +4889(normally)S +5290(does)S +5513(is)S +2016 V +1260(respond)S +1632(to)S +1766(datastream)S +2254(requests)S +2637(to)S +2770(read)S +2996(and)S +3195(write)S +3455(to)S +3588(internal)S +3948(frame)S +4235(bu)S +4335 H + (f)show 10 -.5 mul h (f)show +10 R +4396(ers)S +4567(maintained)S +5066(as)S +5204(arrays)S +5502(in)S +2136 V +1260(memory.)S +1682(Multiple)S +2062(frame)S +2329(bu)S +2429 H + (f)show 10 -.5 mul h (f)show +10 R +2490(ers)S +2641(and)S +2820(frame)S +3087(bu)S +3187 H + (f)show 10 -.5 mul h (f)show +10 R +3248(er)S +3360(con\256gurations)S +3967(are)S +4123(supported.)S +4607(It)S +4703(can)S +4876(be)S +5005(used)S +5223(to)S +5336(debug)S +2256 V +1260(IIS)S +1424(protocol)S +1799(client)S +2063(programs)S +2482(by)S +2624(printing)S +2983(out)S +3153(the)S +3317(protocol)S +3692(packets)S +4033(recieved,)S +4436(or)S +4560(can)S +4739(simply)S +5053(be)S +5188(used)S +5412(as)S +5536(a)S +2376 V +1260(dummy)S +1602(server)S +1881(in)S +1995(cases)S +2241(where)S +2520(no)S +2656(image)S +2936(display)S +3261(is)S +3364(really)S +3627(needed.)S +4000(By)S +4154(enabling)S +4535(the)S +10 I +4694(-proxy)S +10 R +4991(\257ag)S +5178(the)S +5337(server)S +2496 V +1260(can)S +1431(also)S +1625(be)S +1752(used)S +1968(to)S +2079(repeat)S +2355(the)S +2510(datastream)S +2975(requests)S +3335(to)S +3446(a)S +3522(list)S +3677(of)S +3792(other)S +4029(servers,)S +4368(e)S +4412 H + (f)show 10 -.5 mul h (f)show +10 R +4473(ectively)S +4821(splitting)S +5182(the)S +5336(image)S +2616 V +1260(display)S +1579(to)S +1687(a)S +1761(number)S +2096(of)S +2209(other)S +2444(servers.)S +2811(See)S +2985(below)S +3259(for)S +3405(details)S +3696(on)S +3826(using)S +4073(the)S +4225(program)S +4593(in)S +4701(this)S +4876(manner.)S +2856 V +1260(The)S +10 I +1448(-verbose)S +10 R +1824(\257ag)S +2007(will)S +2196(log)S +2357(all)S +2490(datastream)S +2955(requests)S +3315(to)S +3426(the)S +3581(stderr,)S +3866(otherwise)S +4287(the)S +4442(task)S +4636(runs)S +4841(silently)S +5170(except)S +5464(for)S +2976 V +1260(error)S +1485(messages.)S +1949(The)S +2136(process)S +2467(is)S +2566(terminated)S +3025(with)S +3234(an)S +3359(EOF)S +3579(on)S +3710(the)S +3863(stdin,)S +4114(if)S +4206(the)S +4359(task)S +4551(is)S +4649(intended)S +5024(to)S +5133(be)S +5258(run)S +5422(as)S +5536(a)S +3096 V +1260(background)S +1772(job)S +1941(the)S +10 I +2104(-background)S +10 R +2655(\257ag)S +2846(should)S +3154(be)S +3289(enabled)S +3640(to)S +3760(shut)S +3969(o)S +4019 H + (f)show 10 -.5 mul h (f)show +10 R +4122(the)S +4286(check)S +4560(of)S +4685(the)S +4849(stdin)S +5086(and)S +5272(avoid)S +5536(a)S +3216 V +1260("waiting)S +1634(for)S +1783(tty)S +1922(input")S +2202(message)S +2573(that)S +2756(would)S +3039(suspend)S +3394(the)S +3549(background)S +4053(job.)S +4269(Frame)S +4557(bu)S +4657 H + (f)show 10 -.5 mul h (f)show +10 R +4718(ers)S +4867(are)S +5021(maintained)S +5497(as)S +3336 V +1260(rasters)S +1554(in)S +1666(memory,)S +2058(up)S +2192(to)S +2305(four)S +2506(frames)S +2812(may)S +3019(currently)S +3414(be)S +3543(de\256ned.)S +3927(If)S +4028(it)S +4119(not)S +4282(necessary)S +4704(to)S +4817(keep)S +5040(the)S +5197(displayed)S +3456 V +1260(images)S +1580(in)S +1695(memory)S +2065(\(i.e.)S +2257(the)S +2416(client)S +2675(will)S +2868(not)S +3033(need)S +3258(to)S +3373(read)S +3581(back)S +3806(any)S +3987(subrasters)S +4423(such)S +4643(as)S +4763(when)S +5016(doing)S +5281(overlay)S +3576 V +1260(graphics\),)S +1690(the)S +10 I +1846(-noraster)S +10 R +2252(\257ag)S +2436(can)S +2608(be)S +2736(used)S +2953(to)S +3066(disable)S +3384(the)S +3541(memory)S +3909(rasters.)S +4259(In)S +4377(this)S +4557(case)S +4763(any)S +4942(image)S +5221(readback)S +3696 V +1260(will)S +1446(return)S +1714(an)S +1838(array)S +2072(of)S +2185(zero)S +2386(values.)S +3936 V +1260(The)S +1448(default)S +1758(frame)S +2023(bu)S +2123 H + (f)show 10 -.5 mul h (f)show +10 R +2184(er)S +2295(size)S +2484(is)S +2585(512x512,)S +2994(with)S +3206(2)S +3290(frames)S +3595(de\256ned)S +3923(initially.)S +4324(The)S +10 I +4513(-con\256g)S +10 R +4824(and)S +10 I +5002(-nframes)S +10 R +5391(\257ags)S +4056 V +1260(can)S +1437(be)S +1570(used)S +1792(to)S +1909(change)S +2230(the)S +2391(startup)S +2702(frame)S +2973(bu)S +3073 H + (f)show 10 -.5 mul h (f)show +10 R +3134(ers)S +3289(used.)S +3566(The)S +3760(frame)S +4031(bu)S +4131 H + (f)show 10 -.5 mul h (f)show +10 R +4192(er)S +4308(con\256guration)S +4880(table)S +5113(is)S +5219(normally)S +4176 V +1260(taken)S +1507(to)S +1616(be)S +1741(/usr/local/lib/imtoolrc)S +2645(but)S +2804(can)S +2973(be)S +3098(overridden)S +3561(by)S +3692(using)S +3941(an)S +4067(IMTOOLRC)S +4621(environment)S +5158(variable,)S +5536(a)S +4296 V +10 I +1260($HOME/.imtoolrc)S +10 R +2029(\256le,)S +2221(or)S +2343(the)S +10 I +2504(-imtoolrc)S +10 R +2915(command-line)S +3531(\257ag)S +3719(respectively.)S +4294(The)S +4487(format)S +4791(of)S +4912(the)S +5072(frame)S +5342(bu)S +5442 H + (f)show 10 -.5 mul h (f)show +10 R +5503(er)S +4416 V +1260(con\256guration)S +1823(\256le)S +1981(is)S +4656 V +10 I +1410(con\256gno)S +1784(nframes)S +2136(width)S +2389(height)S +2669([extra)S +2943(\256elds])S +4776 V +10 R +1290(e.g.)S +4896 V +1560(1)S +1670(2)S +1780(512)S +1990(512)S +5016 V +1560(2)S +1670(2)S +1780(800)S +1990(800)S +5136 V +1560(3)S +1670(1)S +1750(1024)S +1980(1024)S +2480(#)S +2560(comment)S +5376 V +1260(and)S +1434(so)S +1553(on.)S +1738(At)S +1868(most)S +2093(128)S +2273(frame)S +2536(bu)S +2636 H + (f)show 10 -.5 mul h (f)show +10 R +2697(er)S +2805(sizes)S +3030(may)S +3233(be)S +3358(de\256ned,)S +3708(each)S +3921(con\256guration)S +4485(may)S +4688(de\256ne)S +4963(up)S +5094(to)S +5203(4)S +5284(frames,)S +5496 V +1260(con\256guration)S +1823(numbers)S +2197(need)S +2415(not)S +2573(be)S +2697(sequential.)S +5784 V +9 B +900(OPTIONS)S +5904 V +10 B +1260(-background)S +6024 V +10 R +1510(The)S +1695(task)S +1886(will)S +2072(be)S +2196(run)S +2359(in)S +2467(the)S +2619(background)S +3120(so)S +3239(don't)S +3480(listen)S +3727(to)S +3835(STDIN)S +4159(for)S +4305(an)S +4429(EOF)S +4648(to)S +4756(quit)S +4942(gracefully.)S +6192 V +10 B +1260(-con\256g)S +10 I +1579(num)S +6312 V +10 R +1510(Initial)S +1799(frame)S +2081(bu)S +2181 H + (f)show 10 -.5 mul h (f)show +10 R +2242(er)S +2369(con\256guration)S +2952(number.)S +3362(The)S +3567(default)S +3894(value)S +4160(is)S +4277(1,)S +4402(indicating)S +4852(a)S +4947(512x512)S +5348(frame)S +6432 V +1510(bu)S +1610 H + (f)show 10 -.5 mul h (f)show +10 R +1671(er)S +1778(with)S +1986(2)S +2066(frames.)S +2422(See)S +2596(below)S +2870(for)S +3016(information)S +3518(on)S +3648(the)S +3800(frame)S +4062(bu)S +4162 H + (f)show 10 -.5 mul h (f)show +10 R +4223(ers.)S +6600 V +10 B +1260(-\256fo)S +10 I +1462(pipe)S +6720 V +10 R +1510(Speci\256es)S +1901(the)S +2053(name)S +2299(of)S +2412(the)S +2564(\256fo)S +2733(pipe)S +2936(to)S +3045(be)S +3170(used,)S +3409(the)S +10 I +3562(i)S +10 R +3621(and)S +10 I +3796(o)S +10 R +3877(su)S +3966 H + (f)show 10 -.5 mul h (\256)show +10 R +4050(xes)S +4214(will)S +4401(be)S +4526(added)S +4795(automatically.)S +5425(The)S +6840 V +1510(default)S +1817(pipe)S +2019(names)S +2304(will)S +2490(be)S +2614(/dev/imt1i)S +3056(\(input)S +3325(pipe\))S +3560(and)S +3734(/dev/imt1o)S +4198(\(output)S +4517(pipe\).)S +7008 V +10 B +1260(-\256fo_only)S +7128 V +10 R +1510(If)S +1615(set,)S +1790(only)S +2007(\256fo)S +2185(pipes)S +2435(will)S +2630(be)S +2763(used)S +2985(for)S +3140(communication)S +3801(with)S +4018(a)S +4101(client)S +4363(program,)S +4766(sockets)S +5100(will)S +5296(be)S +5430(dis-)S +7248 V +1510(abled.)S +7728 V +900(IRAF Project)S +2719(Last change: 18 Jun 1997)S +5530(1)S +7920 V +EP +%%Page: 2 2 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +480 V +900(VXIMTOOL)S +1448(\()S +1497(1)S +1563(\))S +2787(USER COMMANDS )S +4884(VXIMTOOL)S +5432(\()S +5481(1)S +5547(\))S +960 V +10 B +1260(-help)S +10 R +1510(Print)S +1735(a)S +1809(summary)S +2211(of)S +2324(command)S +2748(line)S +2928(options)S +3253(to)S +3361(the)S +3513(screen.)S +1128 V +10 B +1260(-interactive)S +1248 V +10 R +1510(Allow)S +1792(cursor)S +2073(value)S +2321(strings)S +2620(to)S +2730(be)S +2856(typed)S +3110(into)S +3299(the)S +3454(STDIN)S +3781(in)S +3892(response)S +4274(to)S +4385(cursor)S +4667(read)S +4871(requests)S +5231(from)S +5458(the)S +1368 V +1510(client.)S +1536 V +10 B +1260(-imtoolrc)S +10 I +1683(\256le)S +1656 V +10 R +1510(Speci\256es)S +1923(the)S +2097(frame)S +2381(bu)S +2481 H + (f)show 10 -.5 mul h (f)show +10 R +2542(er)S +2671(con\256guration)S +3257(\256le)S +3438(to)S +3569(be)S +3716(used.)S +4007(See)S +4204(below)S +4501(for)S +4670(information)S +5195(on)S +5348(frame)S +1776 V +1510(bu)S +1610 H + (f)show 10 -.5 mul h (f)show +10 R +1671(ers.)S +1944 V +10 B +1260(-inet_only)S +2064 V +10 R +1510(If)S +1611(set,)S +1782(only)S +1995(inet)S +2180(sockets)S +2509(will)S +2700(be)S +2829(used)S +3047(for)S +3198(communication)S +3855(with)S +4068(a)S +4147(client)S +4404(program,)S +4802(\256fo)S +4976(pipes)S +5222(and)S +5402(unix)S +2184 V +1510(sockets)S +1834(will)S +2020(be)S +2144(disabled.)S +2352 V +10 B +1260(-noraster)S +2472 V +10 R +1510(If)S +1614(set)S +1763(no)S +1901(client)S +2162(data)S +2367(will)S +2562(be)S +2695(stored)S +2978(in)S +3095(memory,)S +3492(and)S +3675(image)S +3958(readback)S +4356(will)S +4551(return)S +4828(an)S +4961(array)S +5204(of)S +5326(zeroes)S +2592 V +1510(unless)S +1790(used)S +2003(as)S +2116(a)S +2190(proxy)S +2453(server.)S +2760 V +10 B +1260(-nframes)S +10 I +1672(num)S +2880 V +10 R +1510(Speci\256es)S +1913(the)S +2077(number)S +2424(of)S +2549(frame)S +2823(bu)S +2923 H + (f)show 10 -.5 mul h (f)show +10 R +2984(ers)S +3142(to)S +3262(con\256gure)S +3681(at)S +3795(startup.)S +4164(By)S +4323(default)S +4642(there)S +4883(will)S +5081(be)S +5217(2)S +5309(frames)S +3000 V +1510(available,)S +1925(a)S +1999(maximum)S +2435(of)S +2548(4)S +2628(frames)S +2929(are)S +3080(allowed.)S +3168 V +10 B +1260(-port_only)S +3288 V +10 R +1510(Same)S +1770(as)S +10 I +1891(-inet_only)S +10 R +2334(option.)S +2683(If)S +2787(set,)S +2961(only)S +3177(inet)S +3365(sockets)S +3697(will)S +3891(be)S +4023(used)S +4244(for)S +4398(communication)S +5058(with)S +5275(a)S +5358(client)S +3408 V +1510(program.)S +3576 V +10 B +1260(-port)S +10 I +1506(num)S +3696 V +10 R +1510(Set)S +1670(the)S +1825(primary)S +2174(port)S +2368(to)S +2479(listen)S +2729(on)S +2862(for)S +3011(client)S +3266(connections.)S +3831(The)S +4019(default)S +4329(is)S +4429(5137)S +4662(except)S +4955(when)S +5204(used)S +5420(as)S +5536(a)S +3816 V +1510(proxy)S +1773(server)S +2046(in)S +2154(which)S +2428(case)S +2629(the)S +2781(default)S +3088(is)S +3185(5136.)S +3984 V +10 B +1260(-proxy)S +4104 V +10 R +1510(Run)S +1714(as)S +1834(a)S +1915(proxy)S +2186(server)S +2467(by)S +2605(repeating)S +3014(client)S +3274(requests)S +3639(to)S +3755(each)S +3975(of)S +4096(the)S +10 I +4256(server)S +10 R +4543(remote)S +4858(server)S +5139(arguments.)S +4224 V +1510(See)S +1684(the)S +1836(section)S +2149(on)S +2279(proxy)S +2542(usage)S +2799(below)S +3073(for)S +3219(details.)S +4392 V +10 B +1260(-verbose)S +4512 V +10 R +1510(If)S +1606(set,)S +1772(print)S +1991(information)S +2493(about)S +2745(all)S +2875(IIS)S +3027(packets)S +3356(headers)S +3690(recieved)S +4057(to)S +4165(the)S +4317(STDERR)S +4731(stream.)S +4680 V +10 B +1260(-unix)S +10 I +1513(name)S +4800 V +10 R +1510(Speci\256es)S +1909(the)S +2069(unix)S +2285(domain)S +2623(socket)S +2916(name)S +3170(to)S +3286(use.)S +3512(A)S +3622("%d")S +3876(in)S +3993(the)S +4154(\256lename)S +4537(will)S +4732(be)S +4865(replaced)S +5241(with)S +5458(the)S +4920 V +1510(user)S +1706(id.)S +5088 V +10 B +1260(-unix_only)S +5208 V +10 R +1510(If)S +1607(set,)S +1774(only)S +1983(unix)S +2192(domain)S +2523(sockets)S +2848(will)S +3035(be)S +3160(used)S +3374(for)S +3521(communication)S +4174(with)S +4383(a)S +4458(client)S +4711(program,)S +5105(inet)S +5286(sockets)S +5328 V +1510(and)S +1684(\256fos)S +1892(will)S +2078(be)S +2202(disabled.)S +5616 V +9 B +900(CLIENT)S +1272(CONNECTIONS)S +5736 V +10 I +1260(VXImtool)S +10 R +1673(allows)S +1964(clients)S +2255(to)S +2363(connect)S +2703(in)S +2811(any)S +2985(of)S +3098(the)S +3250(following)S +3669(ways:)S +5904 V +10 B +1260(\256fo)S +1429(pipes)S +6024 V +10 R +1510(The)S +1706(traditional)S +2158(approach.)S +2589(The)S +2785(default)S +3103(global)S +3394(/dev/imt1[io])S +3963(pipes)S +4215(may)S +4428(be)S +4564(used,)S +4814(or)S +4939(a)S +5025(private)S +5344(set)S +5497(of)S +6144 V +1510(\256fos)S +1731(can)S +1911(be)S +2047(speci\256ed)S +2444(using)S +2703(the)S +10 I +2867(-\256fo)S +10 R +3070(command)S +3506(line)S +3698(argument.)S +4172(Values)S +4491(should)S +4800(be)S +4936(speci\256ed)S +5333(as)S +5458(the)S +6264 V +1510(root)S +1701(pathname)S +2119(to)S +2227(a)S +2301(pair)S +2486(of)S +2599(\256fo)S +2768(pipes)S +3009(whose)S +3294(last)S +3463(character)S +3857(is)S +3954('i')S +4078(or)S +4191('o',)S +4362(these)S +4597(characters)S +5030(will)S +5217(be)S +5342(added)S +6384 V +1510(automatically)S +2099(when)S +2360(opening)S +2727(the)S +2894(pipes.)S +3175(For)S +3359(example,)S +3767(to)S +3890(use)S +4068(the)S +4234(default)S +4555(pipes)S +4810(the)S +4976(path)S +5192(would)S +5486(be)S +6504 V +1510(speci\256ed)S +1895(as)S +2008(simply)S +2311("/dev/imt1".)S +2832(A)S +2934(value)S +3180(of)S +3293("none")S +3599(disables)S +3951(this)S +4126(connection.)S +6672 V +10 B +1260(tcp/ip)S +1535(sockets)S +6792 V +10 R +1510(Clients)S +1836(connect)S +2188(via)S +2352(a)S +2438(tcp/ip)S +2708(socket.)S +3030(The)S +3227(default)S +3546(port)S +3749(is)S +10 I +3858(5137)S +10 R +4058(,)S +4125(or)S +4250(a)S +4337(custom)S +4669(port)S +4873(may)S +5088(be)S +5225(speci\256ed)S +6912 V +1510(using)S +1760(the)S +10 I +1915(-port)S +10 R +2148(command)S +2575(line)S +2758(switch.)S +3107(This)S +3318(permits)S +3650(connecting)S +4120(to)S +4230(the)S +4384(server)S +4659(over)S +4868(a)S +4944(remote)S +5253(network)S +7032 V +1510(connection)S +1992(anywhere)S +2423(on)S +2567(the)S +2734(Internet.)S +3174(When)S +3457(used)S +3685(as)S +3813(a)S +3902(proxy)S +4180(server)S +4468(the)S +4635(default)S +4957(port)S +5163(number)S +5513(is)S +7152 V +1510(5136)S +1742(so)S +1863(as)S +1978(to)S +2088(avoid)S +2342(a)S +2418(con\257ict)S +2750(with)S +2960(an)S +3086(XImtool)S +3457(running)S +3800(on)S +3932(the)S +4085(same)S +4321(machine,)S +4715(other)S +4951(connections)S +5459(are)S +7272 V +1510(disabled)S +1881(unless)S +2169(otherwise)S +2595(overridden)S +3065(by)S +3203(a)S +3285(command)S +3717(line)S +3905(option)S +4199(following)S +4626(the)S +10 I +4787(-proxy)S +10 R +5086(\257ag)S +5275(to)S +5392(reset)S +7752 V +900(IRAF Project)S +2719(Last change: 18 Jun 1997)S +5530(2)S +7920 V +EP +%%Page: 3 3 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +480 V +900(VXIMTOOL)S +1448(\()S +1497(1)S +1563(\))S +2787(USER COMMANDS )S +4884(VXIMTOOL)S +5432(\()S +5481(1)S +5547(\))S +960 V +1510(the)S +1662(connection.)S +2185(A)S +2287(port)S +2478(number)S +2813(of)S +2926(0)S +3006(\(zero\))S +3273(disables)S +3625(this)S +3800(connection.)S +1128 V +10 B +1260(unix)S +1480(domain)S +1833(sockets)S +1248 V +10 R +1510(Like)S +1733(a)S +1817(tcp/ip)S +2085(socket,)S +2405(but)S +2573(limited)S +2898(to)S +3017(a)S +3102(single)S +3382(host)S +3590(system.)S +3934(Usually)S +4286(faster)S +4548(than)S +4761(a)S +4846(tcp/ip)S +5115(socket,)S +5436(and)S +1368 V +1510(comparable)S +2008(to)S +2119(a)S +2196(\256fo.)S +2393(By)S +2543(default)S +2853(each)S +3068(user)S +3267(gets)S +3460(their)S +3675(own)S +3879(unix)S +4089(domain)S +4421(socket,)S +4733(so)S +4854(this)S +5031(option)S +5319(allows)S +1488 V +1510(multiple)S +1882(users)S +2125(to)S +2241(run)S +2413(ximtools)S +2803(on)S +2942(the)S +3103(same)S +3347(host)S +3553(without)S +3898(having)S +4209(to)S +4326(customize)S +4770(things.)S +5109(The)S +5303(default)S +1608 V +1510(value)S +1758(is)S +1857("/tmp/.IMT%d",)S +2549(other)S +2785(sockets)S +3110(may)S +3313(be)S +3438(de\256ned)S +3763(using)S +4011(the)S +10 I +4164(-unix)S +10 R +4400(command)S +4825(line)S +5006(switch.)S +5353(Legal)S +1728 V +1510(values)S +1813(should)S +2128(be)S +2270(speci\256ed)S +2673(as)S +2804(a)S +2896(\256lename)S +3288(to)S +3414(be)S +3557(used)S +3789(for)S +3954(the)S +4125(socket,)S +4454(up)S +4603(to)S +4730(two)S +4929("%d")S +5193(\256elds)S +5459(are)S +1848 V +1510(allowed)S +1856(and)S +2030(will)S +2216(be)S +2340(replaced)S +2707(by)S +2837(the)S +2989(userid.)S +3288(An)S +3440(empty)S +3720(string)S +3978(value)S +4224(disables)S +4576(this)S +4751(connection.)S +2016 V +1260(By)S +1408(default)S +10 I +1716(vximtool)S +10 R +2091(listens)S +2378(simultaneously)S +3015(for)S +3162(client)S +3415(connections)S +3923(on)S +4054(all)S +4186(three)S +4417(types)S +4660(of)S +4775(ports.)S +5092(Clients)S +5408(may)S +2136 V +1260(connect)S +1614(simultaneously)S +2264(by)S +2408(di)S +2486 H + (f)show 10 -.5 mul h (f)show +10 R +2547(erent)S +2790(means)S +3089(allowing)S +3483(up)S +3627(to)S +3748(three)S +3990(di)S +4068 H + (f)show 10 -.5 mul h (f)show +10 R +4129(erent)S +4371(displays)S +4742(to)S +4863(be)S +5000(loading)S +5343(at)S +5458(the)S +2256 V +1260(same)S +1495(time)S +1703(into)S +1889(di)S +1967 H + (f)show 10 -.5 mul h (f)show +10 R +2028(erent)S +2257(frames.)S +2544 V +9 B +900(COMMUNICATIONS)S +1807(PROTOCOL)S +2664 V +10 R +1260(Clients)S +1583(communicate)S +2160(with)S +10 I +2377(vximtool)S +10 R +2760(using)S +3016(a)S +3099(protocol)S +3471(developed)S +3920(originally)S +4348(for)S +4503(IIS)S +4664(\(International)S +5247(Imaging)S +2784 V +1260(Systems\))S +1659(Frame)S +1946(Bu)S +2063 H + (f)show 10 -.5 mul h (f)show +10 R +2124(er)S +2232(hardware,)S +2658(the)S +2811(so-called)S +3202("IIS)S +3396(protocol";)S +3829(other)S +4065(more)S +4301(modern)S +4637(protocols)S +5040(will)S +5227(likely)S +5486(be)S +2904 V +1260(supported)S +1687(in)S +1798(the)S +1953(future.)S +2279(The)S +2467(IIS)S +2622(protocol)S +2988(is)S +3088(basically)S +3476(a)S +3553(command)S +3981(packet)S +4275(stream)S +4575(with)S +4787(a)S +4865(header)S +5164(describing)S +3024 V +1260(the)S +1421(operation)S +1837(to)S +1954(be)S +2087(performed)S +2541(\(select)S +2840(frame,)S +3136(load)S +3347(display,)S +3700(read)S +3910(cursor,)S +4223(etc\),)S +4436(and)S +4618(an)S +4750(optional)S +5116(data)S +5320(packet)S +3144 V +1260(containing)S +1712(e.g.)S +1886(pixels.)S +2180(It)S +2271(is)S +2368(beyond)S +2692(the)S +2844(scope)S +3101(of)S +3214(this)S +3390(document)S +3815(to)S +3924(describe)S +4287(fully)S +4507(the)S +4660(details)S +4952(of)S +5066(the)S +5219(protocol;)S +3264 V +1260(interested)S +1688(users)S +1933(should)S +2240(contact)S +10 I +2568(iraf@noao.edu)S +10 R +3214(for)S +3370(further)S +3681(information)S +4193(or)S +4316(see)S +4482(the)S +10 I +4643(A)S +4743(Reference)S +5180(Guide)S +5463(for)S +3384 V +1260(the)S +1412(IRAF)S +1658(Client)S +1933(Display)S +2274(Library)S +10 R +2610(for)S +2756(details.)S +3672 V +9 B +900(PROXY)S +1247(USAGE)S +3792 V +10 R +1260(The)S +10 I +1445(vximtool)S +10 R +1819(may)S +2021(also)S +2212(be)S +2336(used)S +2549(as)S +2663(a)S +2738(proxy)S +3002(server)S +3276(by)S +3407(enabling)S +3782(the)S +10 I +3935(-proxy)S +10 R +4226(command)S +4651(line)S +4832(\257ag.)S +5068(In)S +5182(this)S +5358(mode)S +3912 V +1260(the)S +1420(program)S +1796(acts)S +1989(as)S +2110(a)S +2191(relay)S +2427(for)S +2580(the)S +2739(IIS)S +2898(datastream)S +3367(packets,)S +3728(sending)S +4076(image)S +4357(data,)S +4585(frame)S +4854(requests,)S +5243(etc.)S +5421(to)S +5536(a)S +4032 V +1260(list)S +1421(of)S +1542(other)S +1785(servers)S +2105(speci\256ed)S +2498(on)S +2636(the)S +2796(command)S +3228(line.)S +3471(The)S +3664(e)S +3708 H + (f)show 10 -.5 mul h (f)show +10 R +3769(ect)S +3923(of)S +4045(this)S +4229(is)S +4335(to)S +4452(allow)S +4713(a)S +4796(client)S +5057(to)S +5174(display)S +5502(to)S +4152 V +1260(this)S +1436(program)S +1805(which)S +2080(then)S +2283(re-displays)S +2752(to)S +2861(each)S +3074(of)S +3188(the)S +3341(other)S +3577(named)S +3874(servers.)S +4241(A)S +4343(maximum)S +4779(of)S +4892(8)S +4972(servers)S +5284(may)S +5486(be)S +4272 V +1260(named,)S +1594(they)S +1809(may)S +2024(be)S +2161(either)S +2431(on)S +2574(the)S +2740(local)S +2978(host)S +3189(or)S +3316(a)S +3404(remote)S +3725(machine)S +4107(and)S +4295(connections)S +4816(can)S +4998(be)S +5136(established)S +4392 V +1260(using)S +1507(either)S +1764(\256fos)S +1972(or)S +2085(sockets.)S +2464(See)S +2638(below)S +2912(for)S +3058(details)S +3349(on)S +3479(how)S +3681(to)S +3789(specify)S +4107(the)S +4259(server)S +4532(connection.)S +4632 V +1260(The)S +1445(current)S +1757(implementation)S +2415(has)S +2578(a)S +2652(few)S +2831(restrictions)S +3305(users)S +3540(should)S +3837(keep)S +4055(in)S +4163(mind:)S +4800 V +1620(Cursor)S +1924(and)S +2100(image)S +2376(readback)S +2767(are)S +2920(done)S +3146(by)S +3278(sending)S +3621(the)S +3775(request)S +10 I +4095(only)S +10 R +4299(to)S +4409(the)S +4563(\256rst)S +4751(server)S +5026(named)S +5325(on)S +5458(the)S +4920 V +1620(command)S +2049(line.)S +2289(This)S +2502(is)S +2604(done)S +2833(to)S +2946(avoid)S +3203(forcing)S +3526(a)S +3605(cursor)S +3889(mode)S +4146(on)S +4281(all)S +4416(servers)S +4733(which)S +5012(cannot)S +5313(be)S +5442(ter-)S +5040 V +1620(minated)S +1973(when)S +2220(a)S +2295(response)S +2675(is)S +2773(received)S +3141(from)S +3366(only)S +3576(one)S +3752(server,)S +4052(and)S +4228(means)S +4515(that)S +4697(the)S +4851(\256rst)S +5039(server)S +5314(named)S +5160 V +1620(should)S +1924(be)S +2055(the)S +2214(one)S +2395(used)S +2615(to)S +2730(control)S +3050(interactive)S +3507(sessions.)S +3926(The)S +4117(remaining)S +4558(servers)S +4876(however)S +5255(can)S +5429(still)S +5280 V +1620(respond)S +1966(to)S +2074(cursor)S +2353(requests)S +2710(from)S +2934(other)S +3169(applications)S +3682(connected)S +4116(to)S +4224(that)S +4404(server)S +4677(on)S +4807(another)S +5136(channel.)S +5448 V +1620(All)S +1792(named)S +2102(servers)S +2428(must)S +2667(be)S +2805(running)S +3160(prior)S +3398(to)S +3520(starting)S +3864(the)S +4031(proxy)S +4309(server.)S +4652(The)S +4852(connection)S +5335(to)S +5458(the)S +5568 V +1620(remote)S +1934(servers)S +2253(is)S +2357(established)S +2838(when)S +3091(this)S +3273(task)S +3471(is)S +3575(\256rst)S +3768(run)S +3937(and)S +4117(if)S +4214(no)S +4350(server)S +4629(is)S +4732(running)S +5079(that)S +5265(connec-)S +5688 V +1620(tion)S +1806(will)S +1992(be)S +2116(ignored.)S +2506(The)S +2691(task)S +2882(will)S +3068(exit)S +3248(if)S +3339(no)S +3469(remote)S +3776(servers)S +4088(can)S +4256(be)S +4380(found)S +4643(for)S +4789(display.)S +5856 V +1620(Any)S +1832(connected)S +2276(server)S +2559(that)S +2749(shuts)S +2995(down)S +3257(while)S +3519(the)S +3682(proxy)S +3956(server)S +4240(is)S +4348(running)S +4700(is)S +4808(likely)S +5077(to)S +5196(cause)S +5458(the)S +5976 V +1620(program)S +1988(to)S +2096(crash)S +2336(on)S +2466(the)S +2618(next)S +2820(display.)S +6264 V +9 B +900(SPECIFYING)S +1482(THE)S +1699(REMOTE)S +2126(SERVER)S +2518(CONNECTION)S +6384 V +10 R +1260(The)S +1445(syntax)S +1736(for)S +1882(the)S +2034(server)S +2307(argument)S +2714(used)S +2927(in)S +3035(proxy)S +3298(mode)S +3550(is)S +3647(as)S +3760(follows:)S +6624 V +10 I +1620(<domain>)S +2086(:)S +2149(<address>)S +6864 V +10 R +1260(where)S +1539(<domain>)S +1988(is)S +2092(one)S +2273(of)S +10 B +2393(inet)S +10 R +2591(\(internet)S +2966(tcp/ip)S +3231(socket\),)S +10 B +3581(unix)S +10 R +3808(\(unix)S +4056(domain)S +4393(socket\))S +4718(or)S +10 B +4838(\256fo)S +10 R +5014(\(named)S +5350(pipe\).)S +6984 V +1260(The)S +1445(form)S +1669(of)S +1782(the)S +1934(address)S +2263(depends)S +2620(upon)S +2850(the)S +3002(domain,)S +3357(as)S +3470(illustrated)S +3900(in)S +4008(the)S +4160(examples)S +4567(below.)S +7272 V +1260(inet:5137)S +2760(Connect)S +3123(to)S +3231(port)S +3422(5137)S +3652(on)S +3782(the)S +3934(local)S +4158(host.)S +7752 V +900(IRAF Project)S +2719(Last change: 18 Jun 1997)S +5530(3)S +7920 V +EP +%%Page: 4 4 +BP +/slant 0 def +/height 1.000000 def +10 R +10 R +480 V +900(VXIMTOOL)S +1448(\()S +1497(1)S +1563(\))S +2787(USER COMMANDS )S +4884(VXIMTOOL)S +5432(\()S +5481(1)S +5547(\))S +960 V +1260(inet:5137:foo.bar.edu)S +2760(Client)S +3055(connection)S +3543(to)S +3671(port)S +3882(5137)S +4133(on)S +4284(internet)S +4640(host)S +10 I +4858(foo.bar.edu)S +10 R +5319(.)S +5425(The)S +1080 V +2760(dotted)S +3040(\(numeric\))S +3463(form)S +3687(of)S +3800(address)S +4129(may)S +4331(also)S +4522(be)S +4646(used.)S +1248 V +1260(unix:/tmp/.IMT212)S +2760(Unix)S +3010(domain)S +3360(socket)S +3665(with)S +3893(the)S +4066(given)S +4339(pathname.)S +4803(IPC)S +5010(method,)S +5386(local)S +1368 V +2760(host)S +2957(only.)S +1536 V +1260(\256fo:/dev/imt1i:/dev/imt1o)S +2760(FIFO)S +3021(or)S +3148(named)S +3458(pipe)S +3674(with)S +3896(the)S +4062(given)S +4328(pathname.)S +4815(IPC)S +5016(method,)S +5386(local)S +1656 V +2760(host)S +2969(only.)S +3244(Two)S +3469(pathnames)S +3938(are)S +4101(required,)S +4500(one)S +4686(for)S +4844(input)S +5092(and)S +5278(one)S +5464(for)S +1776 V +2760(output,)S +3071(since)S +3306(FIFOs)S +3592(are)S +3743(not)S +3901(bidirectional.)S +1944 V +1260(The)S +1450(address)S +1784(\256eld)S +1997(may)S +2204(contain)S +2533(up)S +2668(to)S +2781(two)S +2966("%d")S +3216(\256elds.)S +3523(If)S +3624(present,)S +3972(the)S +4129(user's)S +4402(UID)S +4614(will)S +4805(be)S +4934(substituted)S +5403(\(e.g.)S +2064 V +1260("unix:/tmp/.IMT%d"\).)S +2352 V +9 B +900(EXAMPLES)S +2472 V +10 R +1260(1\))S +1373(Run)S +1570(the)S +1722(vximtool,)S +2139(logging)S +2475(output)S +2761(to)S +2869(the)S +3021(\256le)S +3179(named)S +3475("spool":)S +2712 V +10 C +1750(%)S +1870(vximtool)S +2410(-verbose)S +2950(>&)S +3130(spool)S +2880 V +10 R +1260(2\))S +1373(Run)S +1570(the)S +1722(vximtool)S +2114(in)S +2222(the)S +2374(background,)S +2900(connect)S +3240(only)S +3448(on)S +3578(unix)S +3786(sockets,)S +4135(no)S +4265(output:)S +3120 V +10 C +1750(%)S +1870(vximtool)S +2410(-b)S +2590(-unix_only)S +3250(&)S +3288 V +10 R +1260(3\))S +1373(Don't)S +1636(store)S +1860(images)S +2173(in)S +2281(memory,)S +2669(start)S +2871(with)S +3079(initial)S +3343(1024x1024)S +3823(frame)S +4085(bu)S +4185 H + (f)show 10 -.5 mul h (f)show +10 R +4246(er:)S +3528 V +10 C +1750(%)S +1870(vximtool)S +2410(-noraster)S +3010(-config)S +3490(3)S +3696 V +10 R +1260(4\))S +1373(Run)S +1570(the)S +1722(vximtool)S +2114(in)S +2222(the)S +2374(background,)S +2900(taking)S +3180(cursor)S +3459(input)S +3695(from)S +3919(a)S +3993(\256le:)S +3936 V +10 C +1750(%)S +1870(vximtool)S +2410(-i)S +2590(<)S +2710(cursor_file)S +3430(&)S +4104 V +10 R +1260(5\))S +1373(Run)S +1570(as)S +1683(a)S +1757(proxy)S +2020(server,)S +2318(displaying)S +2765(to)S +2873(both)S +3081(a)S +3155(local)S +3379(and)S +3553(a)S +3627(remote)S +3934(XImtool,)S +4328(log)S +4486(output)S +4772(to)S +4880(stderr:)S +4344 V +10 I +1750(...start)S +2039(all)S +2175(XImtool)S +2527(servers)S +2845(to)S +2953(be)S +3077(used)S +4464 V +10 C +1750(%)S +1870(vximtool)S +2410(-v)S +2590(-proxy)S +3010(unix:/tmp/.IMT%d)S +4030(inet:5137:pisces)S +4584 V +1750(Connected)S +2350(to)S +2530(server)S +2950(on)S +3130(unix:/tmp/.IMT359)S +4704 V +1750(Connected)S +2350(to)S +2530(server)S +2950(on)S +3130(inet:5137:pisces)S +4824 V +1750(Open)S +2050(to)S +2230(accept)S +2650(input)S +3010(on)S +3190(inet:)S +3550(port)S +3850(5136)S +5112 V +10 R +1260(To)S +1407(display)S +1732(to)S +1846(the)S +2004(proxy)S +2273(server)S +2552(the)S +2710(client)S +2969(should)S +3273(connect)S +3620(to)S +3735(the)S +3894(vximtool)S +4293(on)S +10 I +4430(inet:5136)S +10 R +4813(,)S +4875(the)S +5034(proxy)S +5304(in)S +5419(turn)S +5232 V +1260(will)S +1463(relay)S +1709(data)S +1922(to)S +2047(the)S +2216(servers)S +2545(listed)S +2809(on)S +2956(the)S +3125(command)S +3566(line.)S +3818(Note)S +4059(that)S +4256(in)S +4381(this)S +4572(last)S +4757(example)S +5141(any)S +5331(cursor)S +5352 V +1260(requests)S +1626(from)S +1859(the)S +2020(client)S +2281(connected)S +2724(to)S +2841(the)S +3002(vximtool)S +3403(will)S +3598(be)S +3731(handled)S +4086(by)S +4225(the)S +4386(ximtool)S +4737(connected)S +5180(on)S +5319(a)S +5402(unix)S +5472 V +1260(socket)S +1554(on)S +1693(the)S +1854(local)S +2087(machine)S +2464(\(i.e.)S +2658(the)S +2819(\256rst)S +3014(server)S +3296(argument\).)S +3800(The)S +3994(remote)S +4310(ximtool)S +4661(on)S +4800(the)S +4960(machine)S +5336(pisces)S +5592 V +1260(could)S +1516(simultaneously)S +2156(be)S +2284(used)S +2501(by)S +2635(another)S +2968(client)S +3224(on)S +3358(that)S +3542(machine)S +3914(connected)S +4352(by)S +4486(some)S +4732(other)S +4972(means.)S +5317(In)S +5435(this)S +5712 V +1260(case)S +1476(it)S +1576(will)S +1776(only)S +1998(display)S +2331(images)S +2658(coming)S +3002(from)S +3240(the)S +10 I +3406(vximtool)S +10 R +3794(proxy,)S +4096(but)S +4268(could)S +4534(be)S +4672(used)S +4899(in)S +5021(an)S +5159(interactive)S +5832 V +1260(IRAF)S +1518(session)S +1837(running)S +2178(on)S +2308(pisces)S +2582(to)S +2690(examine)S +3058(the)S +3210(images.)S +6120 V +9 B +900(SEE)S +1112(ALSO)S +6240 V +10 R +1260(ximtool\(1\))S +6360 V +10 I +1260(A)S +1351(Reference)S +1779(Guide)S +2053(for)S +2200(the)S +2352(IRAF)S +2598(Client)S +2873(Display)S +3214(Library)S +3550(\(CDL\))S +6528 V +9 B +900(COPYRIGHT)S +6648 V +10 R +1260(Copyright\(c\))S +1806(1986)S +2036(Association)S +2538(of)S +2651(Universities)S +3164(for)S +3310(Research)S +3705(in)S +3813(Astronomy)S +4293(Inc.)S +7680 V +900(IRAF Project)S +2719(Last change: 18 Jun 1997)S +5530(4)S +7920 V +EP +%%Trailer +%%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier +%%Pages: 4 +
\ No newline at end of file diff --git a/vendor/x11iraf/cdl/eps.c b/vendor/x11iraf/cdl/eps.c new file mode 100644 index 00000000..19c79230 --- /dev/null +++ b/vendor/x11iraf/cdl/eps.c @@ -0,0 +1,2187 @@ +#include <stdio.h> +#include <math.h> +#include <time.h> +#include <pwd.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + +#ifdef __STDC__ +#include <stdlib.h> +#include <string.h> +#endif + +#ifdef SOLARIS +#include <sys/systeminfo.h> +#endif + +#ifdef SVR4 +#include <sys/types.h> +#include <unistd.h> +#endif + + +/* + * EPS.C -- EPS hardcopy routines. This code takes an input structure + * containing the pixels, colormap, and output specifications and creates + * and Encapsulated PostScript file. + * + * #include "eps.h" # flags, macro defs, etc. + * + * psim = eps_init () + * eps_print (psim, fp, &data, xdim, ydim, depth, pad) + * eps_close (psim) + * + * eps_setPage (psim, orient, paper_size, scale, flags) + * eps_setCmap (psim, &r, &g, &b, ncolors) + * eps_setCompress (psim, ctype) + * eps_setColorType (psim, otype) + * eps_setLabel (psim, &label) + * eps_setTransform (psim, z1, z2, ztype, offset, slope, cmap_name) + * eps_setCorners (psim, llx, lly, urx, ury) + * + * eps_getImageSize (psim, xdim, ydim, &width, &height) + * eps_getImagePos (psim, xdim, ydim, &llx, &llx) + * + * # Read-only Macro functions: Result type + * ---------------------------- ----------- + * Orientation (psim) EPS_PORTRAIT | EPS_LANDSCAPE + * Scale (psim) float scale value + * MaxScale (psim) float maxaspect scale value + * DoAutoScale (psim) bool + * DoAutoRotate (psim) bool + * DoMaxAspect (psim) bool + * PageType (psim) EPS_LETTER | EPS_LEGAL | ... + * PageXdim (psim) page pixel width + * PageYdim (psim) page pixel height + * PageWidth (psim) page size in inches + * PageHeight (psim) page size in inches + * + * The first three routines are all that's required to output an array of + * pixels to an open file descriptor. The default output produced is a + * grayscale EPS file, centered in a portrait orientation (unless a rotation + * is required to make it fit on the page) and auto scaled to fit on a normal + * 8.5"x11" page. + * + * The remaining routines can be used to set various options, new colormaps + * labels, etc. They are not required unless you need to override one or + * more of the output defaults. + */ + +#define MAX_LENLABEL 256 +#define SZ_EPSBUF 8193 + +#undef min +#undef max + +static char *hextab = "0123456789abcdef"; +static int pixnum = 0, lpix = 0; +static uchar *pixbuf; + + +#define PageXdim(ps) ( PageInfo[ps->page.page_type].npixx ) +#define PageYdim(ps) ( PageInfo[ps->page.page_type].npixy ) +#define PageWidth(ps) ( PageInfo[ps->page.page_type].sizex ) +#define PageHeight(ps) ( PageInfo[ps->page.page_type].sizey ) + +typedef struct { + float sizex, sizey; /* page size in inches */ + int npixx, npixy; /* pix resolution at 72 dpi */ +} PSPageInfo; + +static PSPageInfo PageInfo[] = { /* assumes 300 dpi */ + { 8.500, 11.000, /* US NORMAL, aka LETTER */ + 612, 762 + }, + { 8.500, 14.000, /* US LEGAL */ + 612, 1008 + }, + { 8.267, 11.811, /* A4 */ + 595, 850 + }, + { 7.283, 10.630, /* B5 */ + 524, 765 + }, + {11.000, 17.000, /* B-size */ + 762, 1224 + }, + { 3.875, 4.875, /* 4 by 5 */ + 279, 351 + }, + { 0.945, 1.417, /* 35mm (24x36) */ + 68, 102 + } +}; + + + +#ifdef ANSI_FUNC + +static void eps_pageParams(PSImagePtr psim, float *llx, float *lly, int *icols, int *irows, int *scols, int *srows, int *turnflag); +static void eps_writePix(FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int pad); +static void eps_writeMono(FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int pad); +static void eps_writeMonoRGB(FILE *fp, uchar *pix, int npix, int xdim, int depth, int pad); +static void eps_writeRGB(FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int depth, int pad); +static void eps_writeCmap(PSCmap *cmap, FILE *fp); +static void eps_simpleHeader(PSImagePtr psim, FILE *fp); +static void eps_annotate(PSImagePtr psim, FILE *fp); +static void eps_portLabels(FILE *fp, PSImagePtr psim, int scols, int srows, int icols, int irows, float llx, float lly); +static void eps_landLabels(FILE *fp, PSImagePtr psim, int scols, int srows, int icols, int irows, float llx, float lly); +static void eps_doColorbar(FILE *fp, PSImagePtr psim, int scols, int srows, float llx, float lly, int turnflag); +static void eps_colorHeader(PSImagePtr psim, FILE *fp); +static void eps_writeTrailer(FILE *fp); +static void eps_simpleTrailer(FILE *fp); +static void eps_flushPix(FILE *fp); +static float ticstep(float range, int nsteps); +static char *make_label(void); + +#else + +static void eps_simpleHeader(), eps_colorHeader(); +static void eps_pageParams(), eps_simpleTrailer(); +static void eps_writeCmap(), eps_writeTrailer(); +static void eps_writeMono(), eps_writePix(); +static void eps_writeMonoRGB(), eps_writeRGB(); +static void eps_putPix(), eps_flushPix(); +static void eps_annotate(), eps_portLabels(), eps_landLabels(); +static void eps_doColorbar(); +static float ticstep(); +static char *make_label(); + +#endif + + +static int debug = 0; + + +/* EPS_INIT -- Allocate and return an initialized pointer to a structure + * containing the default output setup. + */ +#ifdef ANSI_FUNC + +PSImage * +eps_init (void) +#else + +PSImage * +eps_init() +#endif +{ + register int i; + register PSImage *ps; + + /* Allocate the structure. */ + ps = (PSImage *) calloc ((unsigned)1, sizeof (PSImage)); + + /* Initialize the structure. */ + ps->cols = 0; + ps->rows = 0; + ps->colorClass = EPS_GRAYSCALE; + ps->compression = NoCompression; + ps->annotate = 1; + ps->label = (char *) calloc (MAX_LENLABEL, sizeof (uchar)); + ps->z1 = 0.0; + ps->z2 = 255.0; + ps->ztype = 0; + + /* Set up a default grayscale colormap. */ + ps->cmap.ncolors = 256; + for (i=0; i<ps->cmap.ncolors; i++) + ps->cmap.r[i] = ps->cmap.g[i] = ps->cmap.b[i] = i; + ps->cmap.IsDefault = 1; + + /* Load the page information defaults. */ + eps_setPage (ps, EPS_PORTRAIT, EPS_LETTER, 100, EPS_AUTOSCALE); + + /* Initialize the pixel buffer array */ + pixbuf = (uchar *) calloc (SZ_EPSBUF, sizeof (uchar)); + + return (ps); +} + + +/* EPS_PRINT -- Dump the given array of pixels to the output file as an EPS + * format file. The data array may contain 8-bit, 24-bit RGB triplets, or + * 32-bit RGBA pixels. + */ +#ifdef ANSI_FUNC + +void +eps_print ( + PSImage *psim, /* EPS image structure */ + FILE *fp, /* output file descriptor */ + uchar *data, /* array of image pixels */ + int xdim, + int ydim, /* image dimensions */ + int depth, /* bits / pixel, must be 8,24, or 32 */ + int pad /* bytes per line of padding */ +) +#else + +void +eps_print (psim, fp, data, xdim, ydim, depth, pad) +PSImage *psim; /* EPS image structure */ +FILE *fp; /* output file descriptor */ +uchar *data; /* array of image pixels */ +int xdim, ydim; /* image dimensions */ +int depth; /* bits / pixel, must be 8,24, or 32 */ +int pad; /* bytes per line of padding */ +#endif +{ + int npix = xdim * ydim; + uchar *pix = data; + + psim->cols = xdim; /* save it for the headers */ + psim->rows = ydim; + + if (debug) + fprintf (stderr, "eps_print: w=%d h=%d d=%d pad=%d\n", + xdim, ydim, depth, pad); + + switch (psim->colorClass) { + case EPS_GRAYSCALE: + /* Regardless of the color type desired we'll either write the + * pixels directly or convert from pseudocolor or RGB. For a + * start dump the header. + */ + eps_simpleHeader (psim, fp); + + if (psim->cmap.IsDefault && depth == 8) { + /* We're using the default grayscale colormap with an + * 8-bit image, so just dump the pixels. + */ + if (debug) + fprintf (stderr,"eps_print: straight grayscale.\n"); + eps_writePix (fp, pix, &psim->cmap, npix, xdim, pad); + + } else if (!psim->cmap.IsDefault && depth == 8) { + /* We're using an arbitrary colormap with an 8-bit image, + * so convert to grayscale and write the pixels. + */ + if (debug) + fprintf (stderr,"eps_print: pseudo cnv to grayscale.\n"); + eps_writeMono (fp, pix, &psim->cmap, npix, xdim, pad); + + } else { + /* Convert RGBA to grayscale. */ + if (debug) + fprintf (stderr,"eps_print: RGB cnv to grayscale.\n"); + eps_writeMonoRGB (fp, pix, npix, xdim, depth, pad); + + } + + /* Now that the image is out we restore the graphics context. */ + fprintf (fp, "grestore\n" ); + + /* Write the colorbar. */ + if (psim->annotate) + eps_annotate (psim, fp); + + /* Write the trailer. */ + eps_simpleTrailer (fp); + break; + + case EPS_PSEUDOCOLOR: + /* Write the color prolog header. */ + eps_colorHeader (psim, fp); + + /* Dump the colormap. */ + eps_writeCmap (&psim->cmap, fp); + + /* Write color indices. */ + eps_writePix (fp, pix, &psim->cmap, npix, xdim, pad); + + /* Write the colorbar. */ + if (psim->annotate) + eps_annotate (psim, fp); + + /* Write the trailer to finish it off. */ + eps_writeTrailer (fp); + break; + + case EPS_TRUECOLOR: + /* Write the seudocolor prolog header. */ + eps_colorHeader (psim, fp); + + eps_writeRGB (fp, pix, &psim->cmap, npix, xdim, depth, pad); + + /* Write the colorbar. */ + if (psim->annotate) + eps_annotate (psim, fp); + + /* Write the trailer to finish it off. */ + eps_writeTrailer (fp); + break; + + default: + perror ("Bad colorClass specification.\n"); + break; + } + + fflush (fp); +} + + +/* EPS_CLOSE -- Close down the EPS output structure. + */ +#ifdef ANSI_FUNC + +void +eps_close ( + PSImage *psim /* EPS image structure */ +) +#else + +void +eps_close (psim) +PSImage *psim; /* EPS image structure */ +#endif +{ + if (psim->label) + (void) free ((char *) psim->label); + (void) free ((char *) pixbuf); + (void) free (psim); +} + + +/* EPS_SETPAGE -- Inialize the page setup with a different size, orientation, + * or scale options. + */ +#ifdef ANSI_FUNC + +void +eps_setPage ( + PSImage *psim, /* EPS image structure */ + int orientation, /* page orientation flag */ + int paper_size, /* paper size flag */ + int scale, /* image scale percentage */ + int flags /* option flags */ +) +#else + +void +eps_setPage (psim, orientation, paper_size, scale, flags) +PSImage *psim; /* EPS image structure */ +int orientation; /* page orientation flag */ +int paper_size; /* paper size flag */ +int scale; /* image scale percentage */ +int flags; /* option flags */ +#endif +{ + int NPageTypes = sizeof (PageInfo) / sizeof (PSPageInfo); + + /* Set the orientation of the output */ + if (orientation == EPS_PORTRAIT) + psim->page.orientation = EPS_PORTRAIT; + else if (orientation == EPS_LANDSCAPE) + psim->page.orientation = EPS_LANDSCAPE; + else + perror ("eps_setPage: Invalid orientation."); + + /* Set the output paper size */ + if (paper_size >= 0 && paper_size <= NPageTypes) + psim->page.page_type = paper_size; + else + perror ("eps_setPage: Invalid paper size."); + + /* Set scale and recompute dpi resolution. */ + psim->page.scale = (float) scale / 100.0; + psim->page.maxscale = (float) scale / 100.0; + psim->page.dpi = 72; /* need to recalculate */ + + /* Set the option flags */ + psim->page.flags = flags; + + if (debug) { + fprintf (stderr, + "eps_setPage: orientation:%d size:%d scale:%g\n", + Orientation(psim), PageType(psim), Scale(psim)); + fprintf (stderr,"\tautoscale:%d autorotate:%d maxaspect:%d\n", + DoAutoScale(psim), DoAutoRotate(psim), DoMaxAspect(psim)); + } +} + + +/* EPS_SETCMAP -- Define a given colormap to be used on output. + */ +#ifdef ANSI_FUNC + +void +eps_setCmap ( + PSImage *psim, /* EPS image structure */ + uchar *r, + uchar *g, + uchar *b, /* color components */ + int ncolors /* number of colors in colormap */ +) +#else + +void +eps_setCmap (psim, r, g, b, ncolors) +PSImage *psim; /* EPS image structure */ +uchar *r, *g, *b; /* color components */ +int ncolors; /* number of colors in colormap */ +#endif +{ + register int i = 0; + + /* Load the colormap. */ + psim->cmap.ncolors = ncolors; + /* for (i=0; i < ncolors; i++) { */ + for (i=0; i < 256; i++) { + psim->cmap.r[i] = r[i]; + psim->cmap.g[i] = g[i]; + psim->cmap.b[i] = b[i]; + } + + psim->cmap.IsDefault = 0; +} + + +/* EPS_SETCOMPRESS -- Define the type of output compression to use. + */ +#ifdef ANSI_FUNC + +void +eps_setCompress ( + PSImage *psim, /* EPS image structure */ + int compress /* compression type flag */ +) +#else + +void +eps_setCompress (psim, compress) +PSImage *psim; /* EPS image structure */ +int compress; /* compression type flag */ +#endif +{ + /* Set the compression type to use. */ + switch (compress) { + case NoCompression: + case RLECompression: + psim->compression = compress; + break; + case LZWCompression: + case JPEGCompression: + default: + perror ("eps_setCompress: Invalid compression type."); + } +} + + +/* EPS_SETCOLORTYPE -- Set the type of output image to be written, e.g. even + * though we have an RGB or pseudocolor image we may wish to coerce it to + * a grayscale on output. + */ +#ifdef ANSI_FUNC + +void +eps_setColorType ( + PSImage *psim, /* EPS image structure */ + int color_class /* output color class */ +) +#else + +void +eps_setColorType (psim, color_class) +PSImage *psim; /* EPS image structure */ +int color_class; /* output color class */ +#endif +{ + /* Set the compression type to use. */ + switch (color_class) { + case EPS_GRAYSCALE: + case EPS_PSEUDOCOLOR: + case EPS_TRUECOLOR: + psim->colorClass = color_class; + break; + default: + perror ("eps_setColorType: Invalid output color type."); + } +} + + +/* EPS_SETLABEL -- Set the output label to be used in annotation. + */ +#ifdef ANSI_FUNC + +void +eps_setLabel ( + register PSImage *psim, /* EPS image structure */ + char *label /* Label string */ +) +#else + +void +eps_setLabel (psim, label) +register PSImage *psim; /* EPS image structure */ +char *label; /* Label string */ +#endif +{ + register int maxlen = MAX_LENLABEL; + + if (!psim->label) + psim->label = (char *) malloc (maxlen); + + (void) strncpy (psim->label, label, maxlen-1); + psim->label[maxlen-1] = '\0'; +} + + +/* EPS_SETTRANSFORM -- Set the color transformation parameters, i.e. the + * z1/z2 values that map the image pixel values being displayed to the number + * of colors we have available. This is used in the annotation when labeling + * the colorbar. + */ +#ifdef ANSI_FUNC + +void +eps_setTransform ( + PSImage *psim, /* EPS image structure */ + float z1, + float z2, /* zscale values */ + int ztype, /* Transformation type */ + float offset, + float scale, /* brightness/contrast values */ + char *cmap_name /* colormap name */ +) +#else + +void +eps_setTransform (psim, z1, z2, ztype, offset, scale, cmap_name) +PSImage *psim; /* EPS image structure */ +float z1, z2; /* zscale values */ +int ztype; /* Transformation type */ +float offset, scale; /* brightness/contrast values */ +char *cmap_name; /* colormap name */ +#endif +{ + psim->z1 = z1; + psim->z2 = z2; + psim->ztype = ztype; + psim->offset = offset; + psim->scale = scale; + if (!psim->cmap.cmap_name) + psim->cmap.cmap_name = (char *) malloc (16); + strcpy (psim->cmap.cmap_name, cmap_name); + + if (debug) { + fprintf (stderr, + "setTransform: z1=%g z2=%g zt=%d offset=%g scale=%g name='%s'\n", + psim->z1, psim->z2, psim->ztype, + psim->offset, psim->scale, + psim->cmap.cmap_name); + } +} + + +/* EPS_SETCORNERS -- Set the image corner values. + */ +#ifdef ANSI_FUNC + +void +eps_setCorners ( + PSImage *psim, /* EPS image structure */ + int llx, + int lly, + int urx, + int ury /* image corners */ +) +#else + +void +eps_setCorners (psim, llx, lly, urx, ury) +PSImage *psim; /* EPS image structure */ +int llx, lly, urx, ury; /* image corners */ +#endif +{ + psim->llx = llx; + psim->lly = lly; + psim->urx = urx; + psim->ury = ury; +} + + +/* EPS_GETIMAGESIZE -- Given the current page parameters and image dimensions, + * compute the size of the image (in inches) on the page. + */ +#ifdef ANSI_FUNC + +void +eps_getImageSize ( + PSImagePtr psim, /* EPS image struct */ + int xdim, + int ydim, /* image dimensions */ + float *width, + float *height /* width x height of image on page */ +) +#else + +void +eps_getImageSize (psim, xdim, ydim, width, height) +PSImagePtr psim; /* EPS image struct */ +int xdim, ydim; /* image dimensions */ +float *width, *height; /* width x height of image on page */ +#endif +{ + int icols, irows, scols, srows, turnflag; + float llx, lly; + + /* Get the common page parameters. */ + eps_pageParams (psim, &llx, &lly, &icols, &irows, &scols, &srows, + &turnflag); + + *width = (scols / (float) psim->page.dpi); + *height = (srows / (float) psim->page.dpi); +} + + +/* EPS_GETIMAGEPOS -- Given the current page parameters and image dimensions, + * compute the position of the image (in pixels) on the page. + */ +#ifdef ANSI_FUNC + +void +eps_getImagePos ( + PSImagePtr psim, /* EPS image struct */ + int xdim, + int ydim, /* image dimensions */ + int *llx, + int *lly /* LL coords for centered image */ +) +#else + +void +eps_getImagePos (psim, xdim, ydim, llx, lly) +PSImagePtr psim; /* EPS image struct */ +int xdim, ydim; /* image dimensions */ +int *llx, *lly; /* LL coords for centered image */ +#endif +{ + int icols, irows, scols, srows, turnflag; + float lx, ly; + + /* Get the common page parameters. */ + eps_pageParams (psim, &lx, &ly, &icols, &irows, &scols, &srows, + &turnflag); + + *llx = (int) lx; + *lly = (int) ly; +} + + +/************************ + * Private Procedures * + ************************/ + + +/* EPS_PAGEPARAMS -- Compute the EPS page parameters. + */ +#ifdef ANSI_FUNC + +static void +eps_pageParams ( + PSImagePtr psim, /* EPS image struct */ + float *llx, + float *lly, /* LL coords for centered image */ + int *icols, + int *irows, /* final image rows/cols */ + int *scols, + int *srows, /* scaled rows/cols */ + int *turnflag /* turn the image? */ +) +#else + +static void +eps_pageParams (psim, llx, lly, icols, irows, scols, srows, turnflag) +PSImagePtr psim; /* EPS image struct */ +float *llx, *lly; /* LL coords for centered image */ +int *icols, *irows; /* final image rows/cols */ +int *scols, *srows; /* scaled rows/cols */ +int *turnflag; /* turn the image? */ +#endif +{ + int devpix, pwidth, pheight, cols=0, rows=0; + float pixfac, scale = Scale(psim), margin; + + /* See if we need to rotate the image to fit on the page. */ + margin = (psim->annotate ? 0.9 : 0.95); + pwidth = (int) PageXdim(psim) * margin; + pheight = (int) PageYdim(psim) * margin; + *icols = cols = psim->cols; + *irows = rows = psim->rows; + *turnflag = 0; + if (DoAutoRotate(psim)) { + if (psim->cols > psim->rows && (scale * psim->cols) > pwidth) { + if (debug) fprintf (stderr, "Rotating image....\n"); + *turnflag = 1; + cols = *irows; + rows = *icols; + } + } else if (psim->page.orientation == EPS_LANDSCAPE) { + if (debug) fprintf (stderr, "Rotating image....\n"); + *turnflag = 1; + cols = *irows; + rows = *icols; + } + + if (turnflag) { + margin = (turnflag ? 0.825 : margin); + pwidth = (int) PageXdim(psim) * margin; + pheight = (int) PageYdim(psim) * margin; + } + + /* Figure out the image size. */ + devpix = psim->page.dpi / 72.0 + 0.5; /* device pixels per unit */ + pixfac = 72.0 / psim->page.dpi * devpix; + *scols = psim->page.scale * cols * pixfac; + *srows = psim->page.scale * rows * pixfac; + + /* See if we need to fiddle with the size to get it on the page + * the way we want. + */ + if (debug) { + fprintf (stderr, "before: scale=%g scols=%d srows=%d pixfac=%g\n", + scale, *scols, *srows, pixfac); + fprintf (stderr, "\tpwidth=%d pheight=%d\n", pwidth, pheight); + fprintf (stderr,"\tautoscale:%d autorotate:%d maxaspect:%d\n", + DoAutoScale(psim), DoAutoRotate(psim), DoMaxAspect(psim)); + } + if ( *scols > pwidth || *srows > pheight ) { + + /* Image is larger than we think will fit on the page. If we're + * autoscaling reset the scale. + */ + if (DoAutoScale(psim)) { + if (debug) + fprintf (stderr, "Image too big, autoscaling...\n"); + if ( *scols >= pwidth ) { + if (*scols >= *srows) { + scale *= (float)PageXdim(psim) / (float)*scols * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } else { + scale *= (float)PageYdim(psim) / (float)*srows * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } + } + if (debug) + fprintf (stderr, ": scale=%f scols=%d srows=%d pixfac=%g\n", + scale, *scols, *srows, pixfac); + if ( *srows >= pheight ) { + if (*scols >= *srows) { + scale *= (float)PageXdim(psim) / (float)*scols * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } else { + scale *= (float)PageYdim(psim) / (float)*srows * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } + } + if (debug) + fprintf (stderr, ": scale=%f scols=%d srows=%d pixfac=%g\n", + scale, *scols, *srows, pixfac); + psim->page.maxscale = scale; /* update new scale factor */ + + } else { + /* Notify user that the image won't fit and suggest a scale. */ + if ( *scols > pwidth ) + scale *= (float) PageXdim(psim) / (float) *scols * margin; + if ( *srows > pheight ) + scale *= (float) PageYdim(psim) / (float) *srows * margin; + psim->page.maxscale = scale; /* update new scale factor */ + + fprintf (stderr, + "Image too big for the page, no autoscaling set...\n"); + fprintf (stderr, "Reset autoscale flag or use scale < %g\n", + scale); + } + + } + + if (DoMaxAspect(psim)) { + /* Image will fit on page, but blow it up to a maximum size for + * the page orientation but retain the image aspect. + */ + if (debug) + fprintf (stderr, "Doing max aspect..."); + if ( *scols >= *srows ) { + scale *= (float) PageXdim(psim) / (float) *scols * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } else if ( *srows > *scols ) { + scale *= (float) PageYdim(psim) / (float) *srows * margin; + *scols = scale * cols * pixfac; + *srows = scale * rows * pixfac; + } + psim->page.maxscale = scale; /* update new scale factor */ + } + + /* Center it on the page. */ + *llx = (PageXdim(psim) - *scols) / 2 - (*turnflag ? 10 : 0); + *lly = (PageYdim(psim) - *srows) / 2 + (*turnflag ? 0 : 10); + + if (debug) { + fprintf(stderr,"after: scale=%g scols=%d srows=%d ", + scale, *scols, *srows); + fprintf(stderr,"icols=%d irows=%d llx=%g lly=%g\n", + *icols, *irows, *llx, *lly); + } +} + + +/* EPS_WRITEPIX -- Write the pixels or color indices directly. + */ +#ifdef ANSI_FUNC + +static void +eps_writePix (FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int pad) +#else + +static void +eps_writePix (fp, pix, cmap, npix, xdim, pad) +FILE *fp; +uchar *pix; +PSCmap *cmap; +int npix; +int xdim; +int pad; +#endif +{ + register int i, min, max; + + min = *pix; + max = *pix; + while (npix > 0) { + min = (min > *pix ? *pix : min); + max = (max < *pix ? *pix : max); + + /* Write the pixels. */ + for (i=0; i < PIX_PER_LINE && npix--; i+=2) { + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix++ & 0x0F)]; + } + pixbuf[pixnum++] = '\n'; + + if (pixnum >= (SZ_EPSBUF - PIX_PER_LINE - 1)) { + pixbuf[pixnum] = '\0'; + fwrite ((char *)pixbuf, sizeof(char), pixnum, fp); + pixnum = 0; + } + + /* Skip the pad chars. */ + for (i=0; i<pad && npix; i++, npix--) + pix++; + } + cmap->min = min; + cmap->max = max; + eps_flushPix (fp); +} + + +/* EPS_WRITEMONO -- Write a pseudocolor image and convert to grayscale. + */ +#ifdef ANSI_FUNC + +static void +eps_writeMono (FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int pad) +#else + +static void +eps_writeMono (fp, pix, cmap, npix, xdim, pad) +FILE *fp; +uchar *pix; +PSCmap *cmap; +int npix; +int xdim; +int pad; +#endif +{ + register int i, min, max; + register uchar pval; + + min = *pix; + max = *pix; + while (npix > 0) { + min = (min > *pix ? *pix : min); + max = (max < *pix ? *pix : max); + + /* Write the pixels. */ + for (i=0; i < PIX_PER_LINE && npix; i+=2, npix-- ) { + pval = (uchar) MONO (cmap->r[*pix], + cmap->g[*pix], + cmap->b[*pix++]); + pixbuf[pixnum++] = (uchar) hextab[(pval >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[(pval & 0x0F)]; + } + pixbuf[pixnum++] = '\n'; + + if (pixnum >= (SZ_EPSBUF - PIX_PER_LINE - 1) || !npix) { + pixbuf[pixnum] = '\0'; + fwrite ((char *)pixbuf, sizeof(char), pixnum, fp); + pixnum = 0; + } + + /* skip the pad chars */ + for (i=0; i<pad && npix; i++, npix--) + pix++; + } + cmap->min = min; + cmap->max = max; + eps_flushPix (fp); +} + + +/* EPS_WRITEMONORGB -- Write RGB data converted to grayscale. + */ +#ifdef ANSI_FUNC + +static void +eps_writeMonoRGB (FILE *fp, uchar *pix, int npix, int xdim, int depth, int pad) +#else + +static void +eps_writeMonoRGB (fp, pix, npix, xdim, depth, pad) +FILE *fp; +uchar *pix; +int npix; +int xdim; +int depth; +int pad; +#endif +{ + register int i; + register uchar pval; + + while (npix > 0) { + /* Write the pixels. */ + if (depth < 24) { + for (i=0; i < PIX_PER_LINE && npix; i+=2, npix-=3 ) { + pval = (uchar) MONO (*pix++, *pix++, *pix++); + pixbuf[pixnum++] = (uchar) hextab[(pval >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[(pval & 0x0F)]; + } + } else { + /* Skip alpha channel in the loop */ + for (i=0; i < PIX_PER_LINE && npix; i+=2, npix-=3, pix++ ) { + pval = (uchar) MONO (*pix++, *pix++, *pix++); + pixbuf[pixnum++] = (uchar) hextab[(pval >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[(pval & 0x0F)]; + } + } + pixbuf[pixnum++] = '\n'; + + if (pixnum >= (SZ_EPSBUF - PIX_PER_LINE - 1)) { + pixbuf[pixnum] = '\0'; + fwrite ((char *)pixbuf, sizeof(char), pixnum, fp); + pixnum = 0; + } + + /* skip the pad chars */ + for (i=0; i<pad && npix; i++, npix--) + pix++; + } + eps_flushPix (fp); +} + + +/* EPS_WRITERGB -- Write the pixels in RGB format, skipping a possible alpha + * channel. + */ +#ifdef ANSI_FUNC + +static void +eps_writeRGB (FILE *fp, uchar *pix, PSCmap *cmap, int npix, int xdim, int depth, int pad) +#else + +static void +eps_writeRGB (fp, pix, cmap, npix, xdim, depth, pad) +FILE *fp; +uchar *pix; +PSCmap *cmap; +int npix; +int xdim; +int depth; +int pad; +#endif +{ + register int i, min, max; + register uchar val; + + min = *pix; + max = *pix; + while (npix > 0) { + min = (min > *pix ? *pix : min); + max = (max < *pix ? *pix : max); + + /* Write the pixels. */ + if (depth < 24) { + for (i=0; i < PIX_PER_LINE && npix; i+=6, npix--, pix++ ) { + val = (uchar) cmap->r[*pix]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val & 0x0F)]; + val = (uchar) cmap->g[*pix]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val & 0x0F)]; + val = (uchar) cmap->b[*pix]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)val & 0x0F)]; + } + } else { + /* Skip alpha channel in the loop */ + for (i=0; i < PIX_PER_LINE && npix; i+=6, npix-=3, pix++ ) { + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix++ & 0x0F)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix++ & 0x0F)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix >> 4)]; + pixbuf[pixnum++] = (uchar) hextab[((uchar)*pix++ & 0x0F)]; + } + } + pixbuf[pixnum++] = '\n'; + + if (pixnum >= (SZ_EPSBUF - PIX_PER_LINE - 1)) { + pixbuf[pixnum] = '\0'; + fwrite ((char *)pixbuf, sizeof(char), pixnum, fp); + pixnum = 0; + } + + + /* skip the pad chars */ + for (i=0; i<pad && npix; i++, npix--) + pix++; + } + cmap->min = min; + cmap->max = max; + eps_flushPix (fp); +} + + +/* EPS_WRITECMAP -- Output Postscript colormap. + */ +#ifdef ANSI_FUNC + +static void +eps_writeCmap (PSCmap *cmap, FILE *fp) +#else + +static void +eps_writeCmap (cmap, fp) +PSCmap *cmap; +FILE *fp; +#endif +{ + register int i, j; + + /* Dump number of colors and colormap used. */ + fprintf (fp, "256\n"); + for (i=0; i < 256; ) { + for (j=0; j < 10 && i < 256; i++, j++) { + fprintf (fp, "%02x%02x%02x", + cmap->r[i], cmap->g[i], cmap->b[i]); + } + fprintf (fp, "\n"); + } +} + + +/* EPS_SIMPLEHEADER -- Output simple Postscript header. + */ +static char *EPSSimpleRLEProlog[]= { + "/rlestr1 1 string def\n", + "/readrlestring { /* s -- nr */\n", + " /rlestr exch def /* - */\n", + " currentfile rlestr1 readhexstring pop /* s1 */\n", + " 0 get /* c */\n", + " dup 127 le { /* c */\n", + " currentfile rlestr 0 /* c f s 0 */\n", + " 4 3 roll /* f s 0 c */\n", + " 1 add getinterval /* f s */\n", + " readhexstring pop /* s */\n", + " length /* nr */\n", + " } { /* c */\n", + " 256 exch sub dup /* n n */\n", + " currentfile rlestr1 readhexstring pop /* n n s1 */\n", + " 0 get /* n n c */\n", + " exch 0 exch 1 exch 1 sub { /* n c 0 1 n-1*/\n", + " rlestr exch 2 index put\n", + " } for /* n c */\n", + " pop /* nr */\n", + " } ifelse /* nr */\n", + "} bind def\n", + "/readstring { /* s -- s */\n", + " dup length 0 { /* s l 0 */\n", + " 3 copy exch /* s l n s n l*/\n", + " 1 index sub /* s l n s n r*/\n", + " getinterval /* s l n ss */\n", + " readrlestring /* s l n nr */\n", + " add /* s l n */\n", + " 2 copy le { exit } if /* s l n */\n", + " } loop /* s l l */\n", + " pop pop /* s */\n", + "} bind def\n", + NULL +}; + +#ifdef ANSI_FUNC + +static void +eps_simpleHeader (PSImagePtr psim, FILE *fp) +#else + +static void +eps_simpleHeader (psim, fp) +PSImagePtr psim; +FILE *fp; +#endif +{ + register char **line; + int icols=0, irows=0, scols=0, srows=0, turnflag=0; + float llx = 0.0, lly = 0.0; + time_t timer; + + /* Get the common page parameters. */ + eps_pageParams (psim, &llx, &lly, &icols, &irows, &scols, &srows, + &turnflag); + + /* Now write header and prolog stuff */ + fprintf (fp, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); + fprintf (fp, "%%%%Title: XImtool Screen Hardcopy\n"); + fprintf (fp, "%%%%Creator: XImtool\n"); + timer = time ((time_t *) NULL); + (void) localtime (&timer); + fprintf (fp, "%%%%CreationDate: %s", ctime(&timer)); + if (psim->annotate) + fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", + (int) (MAX (0, llx - X_ANNOT_MARGIN)), + (int) (MAX (0, lly - Y_ANNOT_MARGIN)), + (int) ( llx + scols + 0.5 + X_ANNOT_MARGIN), + (int) ( lly + srows + 0.5 + Y_ANNOT_MARGIN) ); + else + fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", + (int) (MAX (0, llx - 10)), + (int) (MAX (0, lly - 10)), + (int) ( llx + scols + 0.5 + 10), + (int) ( lly + srows + 0.5 + 10) ); + fprintf (fp, "%%%%Pages: 1\n"); + fprintf (fp, "%%%%EndComments\n" ); + + if ( psim->compression == RLECompression ) { + for (line = EPSSimpleRLEProlog; *line; line++) + fprintf (fp, "%s\n",*line); + } else { + fprintf (fp, "/readstring {\n" ); /* s -- s */ + fprintf (fp, " currentfile exch readhexstring pop\n" ); + fprintf (fp, "} bind def\n" ); + } + + if (psim->colorClass == EPS_TRUECOLOR) { + fprintf (fp, "/rpicstr %d string def\n", icols ); + fprintf (fp, "/gpicstr %d string def\n", icols ); + fprintf (fp, "/bpicstr %d string def\n", icols ); + } else + fprintf (fp, "/picstr %d string def\n", icols ); + fprintf (fp, "%%%%EndProlog\n" ); + fprintf (fp, "%%%%Page: 1 1\n" ); + fprintf (fp, "gsave\n" ); + + fprintf (fp, "%g %g translate\n", llx, lly ); + fprintf (fp, "%d %d scale\n", scols, srows ); + if ( turnflag ) { + if (debug) fprintf (stderr, "turnflag enabled....\n"); + fprintf (fp, "0.5 0.5 translate 90 rotate -0.5 -0.5 translate\n"); + } + fprintf (fp, "%d %d 8\n", icols, irows); + fprintf (fp, "[ %d 0 0 -%d 0 %d ]\n", icols, irows, irows ); + + if (psim->colorClass == EPS_TRUECOLOR) { + fprintf (fp, "{ rpicstr readstring }\n" ); + fprintf (fp, "{ gpicstr readstring }\n" ); + fprintf (fp, "{ bpicstr readstring }\n" ); + fprintf (fp, "true 3\n" ); + fprintf (fp, "colorimage\n" ); + } else { + fprintf (fp, "{ picstr readstring }\n" ); + fprintf (fp, "image\n" ); + } +} + + +/* EPS_ANNOTATE -- Annotate the main image window with axis labels, + * colorbars, and the title string. + */ + +#ifdef ANSI_FUNC + +static void +eps_annotate (PSImagePtr psim, FILE *fp) +#else + +static void +eps_annotate (psim, fp) +PSImagePtr psim; +FILE *fp; +#endif +{ + int icols=0, irows=0, scols=0, srows=0, turnflag=0; + int cbar_size; + float llx = 0.0, lly = 0.0; + + + /* Get the common page parameters. */ + eps_pageParams (psim, &llx, &lly, &icols, &irows, &scols, &srows, + &turnflag); + + /* Write the annotation prolog stufd. */ + fprintf (fp, "gsave\n" ); + + /* Main image title. */ + if (psim->label != NULL) { + fprintf (fp, + "/labelfont /NewCenturySchlbk-Roman findfont 16 scalefont def\n"); + if (turnflag) { + fprintf (fp, "/label { moveto labelfont setfont\n"); + fprintf (fp, " 90 rotate show -90 rotate\n} def\n" ); + fprintf (fp, "(%s) %g %g label\n", psim->label, + llx - TITLE_OFFSET, + lly + (srows/2) - 8.25*(strlen(psim->label)/2) ); + } else { + fprintf (fp, "/label { moveto labelfont setfont show } def\n" ); + fprintf (fp, "(%s) %g %g label\n", psim->label, + llx + (scols/2) - 8.25*(strlen(psim->label)/2), + lly + srows + TITLE_OFFSET); + } + } + + /* A border for the image axes. */ + fprintf (fp, "/imBorder {\n"); + fprintf (fp, " %-4d %-4d moveto %% Outer axis\n", + (int)(llx - AXIS_OOFFSET), + (int)(lly - AXIS_OOFFSET)); + fprintf (fp, " 0 %-4d rlineto\n", srows + (2 * AXIS_OOFFSET)); + fprintf (fp, " %-4d 0 rlineto\n", scols + (2 * AXIS_OOFFSET)); + fprintf (fp, " 0 -%-4d rlineto\n", srows + (2 * AXIS_OOFFSET)); + fprintf (fp, " closepath\n"); + fprintf (fp, " %g setlinewidth\n", AXIS_OWIDTH); + fprintf (fp, " stroke\n"); + + fprintf (fp, " %-4d %-4d moveto %% Inner axis\n", + (int)(llx - AXIS_IOFFSET), + (int)(lly - AXIS_IOFFSET)); + fprintf (fp, " 0 %-4d rlineto\n", srows + (2 * AXIS_IOFFSET)); + fprintf (fp, " %-4d 0 rlineto\n", scols + (2 * AXIS_IOFFSET)); + fprintf (fp, " 0 -%-4d rlineto\n", srows + (2 * AXIS_IOFFSET)); + fprintf (fp, " closepath\n"); + fprintf (fp, " %g setlinewidth\n", AXIS_IWIDTH); + fprintf (fp, " stroke\n"); + + fprintf (fp, "} def\n"); + fprintf (fp, "imBorder\n"); + + /* Axis label font definitions. */ + fprintf (fp, "/axlabelfont /Times-Roman findfont 8 scalefont def\n"); + fprintf (fp, "/axlabel { moveto axlabelfont setfont %s show %s } def\n", + (turnflag ? "90 rotate" : " "), + (turnflag ? "-90 rotate" : " ")); + + /* Axis ticmark procedures. */ + fprintf (fp, "/xMajorTicmark {\n"); + fprintf (fp, " moveto\n"); + fprintf (fp, " 0 %d rlineto ", MAJOR_TICK_SIZE); + fprintf (fp, " 0 %d rmoveto ", + srows + MAJOR_TICK_SIZE + (2 * AXIS_IOFFSET) ); + fprintf (fp, " 0 -%d rlineto\n", MAJOR_TICK_SIZE); + fprintf (fp, " %g setlinewidth\n stroke\n", MAJOR_TICK_WIDTH); + fprintf (fp, "} def\n"); + fprintf (fp, "/yMajorTicmark {\n"); + fprintf (fp, " moveto\n"); + fprintf (fp, " %d 0 rlineto ", MAJOR_TICK_SIZE); + fprintf (fp, " %d 0 rmoveto ", + scols + MAJOR_TICK_SIZE + (2 * AXIS_IOFFSET) ); + fprintf (fp, " -%d 0 rlineto\n", MAJOR_TICK_SIZE); + fprintf (fp, " %g setlinewidth\n stroke\n", MAJOR_TICK_WIDTH); + fprintf (fp, "} def\n"); + fprintf (fp, "/xMinorTicmark {\n"); + fprintf (fp, " moveto\n"); + fprintf (fp, " 0 %d rlineto ", MINOR_TICK_SIZE); + fprintf (fp, " 0 %d rmoveto ", + srows + MAJOR_TICK_SIZE + (2*AXIS_IOFFSET) + + (MAJOR_TICK_SIZE - MINOR_TICK_SIZE) ); + fprintf (fp, " 0 -%d rlineto\n", MINOR_TICK_SIZE); + fprintf (fp, " %g setlinewidth\n stroke\n", MINOR_TICK_WIDTH); + fprintf (fp, "} def\n"); + fprintf (fp, "/yMinorTicmark {\n"); + fprintf (fp, " moveto\n"); + fprintf (fp, " %d 0 rlineto ", MINOR_TICK_SIZE); + fprintf (fp, " %d 0 rmoveto ", + scols + MAJOR_TICK_SIZE + (2*AXIS_IOFFSET) + + (MAJOR_TICK_SIZE - MINOR_TICK_SIZE) ); + fprintf (fp, " -%d 0 rlineto\n", MINOR_TICK_SIZE); + fprintf (fp, " %g setlinewidth\n stroke\n", MINOR_TICK_WIDTH); + fprintf (fp, "} def\n"); + + /* The axis labeling. */ + if (turnflag) + eps_landLabels (fp, psim, scols, srows, icols, irows, llx, lly); + else + eps_portLabels (fp, psim, scols, srows, icols, irows, llx, lly); + fprintf (fp, "grestore\n"); + + /* The colorbar. */ + eps_doColorbar (fp, psim, scols, srows, llx, lly, turnflag); + + /* Print the transform information. */ + fprintf (fp, "gsave\n"); + fprintf (fp, "/Times-Roman findfont 8 scalefont setfont\n"); + if (turnflag) { + cbar_size = MIN (512, MAX (256, srows + 2)); + fprintf (fp, "%d %d moveto\n", + (int)llx + scols + 26, + (int)lly + (srows/2) - (cbar_size/2) - (cbar_size==256?5:1)); + } else { + cbar_size = MIN (512, MAX (256, scols + 2)); + fprintf (fp, "%d %d moveto\n", + (int)llx + (scols/2) - (cbar_size/2) - (cbar_size==256?5:1), + (int)(lly-29)); + } + fprintf (fp, "(z1=%.2f z2=%.2f ztrans=%s Con=%.2f Brt=%.2f cmap=%s ncolors=%d) %s show %s\n", + psim->z1, psim->z2, + (psim->ztype==EPS_UNITARY ? "unitary": + (psim->ztype==EPS_LINEAR ? "linear" : "log")), + psim->scale, psim->offset, + psim->cmap.cmap_name, + psim->cmap.max - psim->cmap.min + 1, + (turnflag ? "90 rotate" : " "), + (turnflag ? "-90 rotate" : " ")); + fprintf (fp, "grestore\n"); + + /* Print the timestamp. */ + fprintf (fp, "gsave\n"); + fprintf (fp, "/Times-Roman findfont 6 scalefont setfont\n"); + fprintf (fp, "20 15 moveto\n(%s) show\n", make_label()); + fprintf (fp, "grestore\n"); + + if (debug) { + fprintf (stderr, "colormap: min/max = %d/%d\n", + psim->cmap.min, psim->cmap.max); + fprintf (stderr, "label: '%s'", make_label()); + } +} + + +/* EPS_PORTRAITLABELS -- Write out the labeling procedures for a portrait + * mode image. + */ +#ifdef ANSI_FUNC + +static void +eps_portLabels (FILE *fp, PSImagePtr psim, int scols, int srows, int icols, int irows, float llx, float lly) +#else + +static void +eps_portLabels (fp, psim, scols, srows, icols, irows, llx, lly) +FILE *fp; +PSImagePtr psim; +int scols, srows; +int icols, irows; +float llx, lly; +#endif +{ + int start, end, range, nlabels; + float xpos, xstep, ypos, ystep; + float Mval, xval=0.0, yval=0.0, tic, mtic, Mtic; + + /* X Axis labeling and ticmarks. */ + nlabels = (scols > 256 ? 5 : 3); + fprintf (fp, "/axLabelX {\n"); + if (psim->urx > psim->llx) { + start = psim->llx; + end = psim->urx; + } else { + start = psim->urx; + end = psim->llx; + } + range = end - start + 1; + Mtic = tic = ticstep ((float)range, (range>=256 ? NTICMARKS : 3)); + mtic = (float) tic / (tic < 100 ? 5. : 10.); + Mval = ( (int)(start + Mtic) / (int) Mtic) * Mtic; + xval = ( (int)(start + mtic) / (int) mtic) * mtic; + xstep = mtic * ((float)scols/(float)(range)); + if (psim->urx > psim->llx) + xpos = llx + ( (float)(xval - start) / (float)range * scols); + else { + xpos = (llx + scols) - ((float)(xval-start) / (float)range * scols); + xstep = -xstep; + } + while (xval <= end) { + if ( xval == Mval ) { + fprintf (fp, " %4d %4d xMajorTicmark\t", + (int)xpos, (int)(lly-AXIS_OOFFSET)); + fprintf (fp, " (%g) %d %d axlabel\n", + xval, + (int)xpos-(xval>=1000?8:(xval>=100?5:2)), + (int)(lly-14)); + Mval += Mtic; + } else + fprintf (fp, "\t%4d %4d xMinorTicmark\n", + (int)xpos, (int)(lly-AXIS_OOFFSET)); + xval += mtic; + xpos += xstep; + } + fprintf (fp, "} def\n"); + fprintf (fp, "axLabelX\n"); + + /* Y Axis labeling and ticmarks. */ + nlabels = (srows > 256 ? 5 : 3); + fprintf (fp, "/axLabelY {\n"); + if (psim->ury > psim->lly) { + start = psim->lly; + end = psim->ury; + } else { + start = psim->ury; + end = psim->lly; + } + range = end - start + 1; + Mtic = tic = ticstep ((float)range, (range>=256 ? NTICMARKS : 3)); + mtic = (float) tic / (tic < 100 ? 5. : 10.); + Mval = ( (int)(start + Mtic) / (int) Mtic) * Mtic; + yval = ( (int)(start + mtic) / (int) mtic) * mtic; + ystep = mtic * ((float)srows/(float)(range)); + if (psim->ury > psim->lly) + ypos = lly + ( (float)(yval - start) / (float)range * srows); + else { + ypos = (lly + srows) - ((float)(yval-start) / (float)range * srows); + ystep = -ystep; + } + while (yval <= end) { + if ( yval == Mval ) { + fprintf (fp, " %4d %4d yMajorTicmark\t", + (int)(llx-AXIS_OOFFSET), (int)ypos); + fprintf (fp, " (%g) %d %d axlabel\n", + yval, + (int)(llx-(yval>=1000?27:(yval>=100?20:16))), + (int)ypos-2); + Mval += Mtic; + } else + fprintf (fp, "\t%4d %4d yMinorTicmark\n", + (int)(llx-AXIS_OOFFSET), (int)ypos); + yval += mtic; + ypos += ystep; + } + fprintf (fp, "} def\n"); + fprintf (fp, "axLabelY\n"); +} + + +/* EPS_LANDSCAPELABELS -- Write out the labeling procedures for a landscape + * mode image. + */ +#ifdef ANSI_FUNC + +static void +eps_landLabels (FILE *fp, PSImagePtr psim, int scols, int srows, int icols, int irows, float llx, float lly) +#else + +static void +eps_landLabels (fp, psim, scols, srows, icols, irows, llx, lly) +FILE *fp; +PSImagePtr psim; +int scols, srows; +int icols, irows; +float llx, lly; +#endif +{ + float xpos, xstep, ypos, ystep; + int start, end, range, nlabels; + float Mval, xval=0.0, yval=0.0, tic, mtic, Mtic; + + /* X Axis labeling and ticmarks. */ + nlabels = (srows > 256 ? 5 : 3); + fprintf (fp, "/axLabelX {\n"); + if (psim->ury > psim->lly) { + start = psim->lly; + end = psim->ury; + } else { + start = psim->ury; + end = psim->lly; + } + range = end - start + 1; + Mtic = tic = ticstep ((float)range, (range>=256 ? NTICMARKS : 3)); + mtic = (float) tic / (tic < 100 ? 5. : 10.); + Mval = ( (int)(start + Mtic) / (int) Mtic) * Mtic; + xval = ( (int)(start + mtic) / (int) mtic) * mtic; + xstep = mtic * ((float)scols/(float)(range)); + if (psim->ury > psim->lly) + xpos = (llx + scols) - ((float)(xval-start) / (float)range * scols); + else { + xpos = llx + ((float)(xval-start) / (float)range * scols); + xstep = -xstep; + } + while (xval <= end ) { + if ( xval == Mval ) { + fprintf (fp, " %4d %4d xMajorTicmark\t", + (int)xpos, (int)(lly-AXIS_OOFFSET)); + fprintf (fp, " (%g) %d %d axlabel\n", + xval, + (int)xpos+2, + (int)(lly-(yval>=1000?30:(yval>=100?25:20))) ); + Mval += Mtic; + } else + fprintf (fp, "\t%4d %4d xMinorTicmark\n", + (int)xpos, (int)(lly-AXIS_OOFFSET)); + xval += mtic; + xpos -= xstep; + } + fprintf (fp, "} def\n"); + fprintf (fp, "axLabelX\n"); + + /* Y Axis labeling and ticmarks. */ + nlabels = (srows > 256 ? 5 : 3); + fprintf (fp, "/axLabelY {\n"); + if (psim->urx > psim->llx) { + start = psim->llx; + end = psim->urx; + } else { + start = psim->urx; + end = psim->llx; + } + Mtic = tic = ticstep ((float)range, (range>=256 ? NTICMARKS : 3)); + mtic = (float) tic / (tic < 100 ? 5. : 10.); + Mval = ( (int)(start + Mtic) / (int) Mtic) * Mtic; + yval = ( (int)(start + mtic) / (int) mtic) * mtic; + ystep = mtic * ((float)scols/(float)(range)); + if (psim->urx > psim->llx) + ypos = lly + ( (float)(yval - start) / (float)range * scols); + else { + ypos = (lly + srows) - ((float)(yval-start) / (float)range * scols); + ystep = -ystep; + } + while (yval <= end) { + if ( yval == Mval ) { + fprintf (fp, " %4d %4d yMajorTicmark\t", + (int)(llx-AXIS_OOFFSET), (int)ypos); + fprintf (fp, " (%g) %d %d axlabel\n", + yval, + (int)(llx+scols+(2*AXIS_OOFFSET)+2), + (int)ypos-(yval>=1000?9:(yval>=100?6:2)) ); + Mval += Mtic; + } else + fprintf (fp, "\t%4d %4d yMinorTicmark\n", + (int)(llx-AXIS_OOFFSET), (int)ypos); + yval += mtic; + ypos += ystep; + } + fprintf (fp, "} def\n"); + fprintf (fp, "axLabelY\n"); +} + + +/* EPS_DOCOLORBAR -- Annotate the image with a colorbar. + */ + +#ifdef ANSI_FUNC + +static void +eps_doColorbar (FILE *fp, PSImagePtr psim, int scols, int srows, float llx, float lly, int turnflag) +#else + +static void +eps_doColorbar (fp, psim, scols, srows, llx, lly, turnflag) +FILE *fp; +PSImagePtr psim; +int scols, srows; +float llx, lly; +int turnflag; +#endif +{ + register int i, j, cbar_size; + int ncolors, nlabels, pos, step, cmel, cmstep, val; + + /* Colorbar label font definitions. */ + fprintf (fp, "/cblabelfont /Times-Roman findfont 10 scalefont def\n"); + fprintf (fp, "/cblabel { moveto cblabelfont setfont %s show %s } def\n", + (turnflag ? "90 rotate" : " "), + (turnflag ? "-90 rotate" : " ")); + + /* A border for the colorbar. */ + fprintf (fp, "/cbarBorder {\n"); + if (turnflag) { + cbar_size = MIN (512, MAX (256, srows + 2)) - 1; + fprintf (fp, " %4d %4d moveto\n", + (int)llx + scols + 31, + (int)lly + (srows/2) - (cbar_size/2) - 1); + fprintf (fp, " 17 0 rlineto\n"); + fprintf (fp, " 0 %4d rlineto\n", cbar_size + 3); + fprintf (fp, " -17 0 rlineto\n"); + } else { + cbar_size = MIN (512, MAX (256, scols + 2)); + fprintf (fp, " %-4d %4d moveto\n", + (int)llx + (scols/2) - (cbar_size/2) - 1, + (int)(lly - 46)); + fprintf (fp, " 0 14 rlineto\n"); + fprintf (fp, " %-4d 0 rlineto\n", cbar_size + 3); + fprintf (fp, " 0 -14 rlineto\n"); + } + fprintf (fp, " closepath\n"); + fprintf (fp, " 1 setlinewidth\n"); + fprintf (fp, " stroke\n"); + fprintf (fp, "} def\n"); + fprintf (fp, "cbarBorder\n"); + + /* Draw the colorbar labels, but only for grayscale images. */ + ncolors = psim->cmap.max - psim->cmap.min + 1; + nlabels = 5; + if (turnflag) + pos = (int)lly + (srows/2) - (cbar_size/2); + else + pos = (int)llx + (scols/2) - (cbar_size/2); + step = cbar_size / nlabels; + cmel = psim->cmap.min; + cmstep = ncolors / nlabels; + for (i=0; i <= nlabels; i++) { + val = MONO(psim->cmap.r[cmel], /* get grayscale value */ + psim->cmap.g[cmel], + psim->cmap.b[cmel]); + if (psim->z1 != 0.0 && psim->z2 != 0.0) { + /* We have a transformation defined, convert the grayscale + * value to original image values. Assumes a linear + * transformation, for a log transformation the wcsbox + * reports only screen units so we'll do that here as well. + */ + if (psim->ztype == EPS_LINEAR) + val = ((psim->z2-psim->z1)/(float)ncolors)*cmel + psim->z1; + } + + if (turnflag) + fprintf (fp, "(%d) %d %d cblabel\n", + val, + (int)llx + scols + 57, + pos-(val<100?3:6)); + else + fprintf (fp, "(%d) %d %d cblabel\n", + val, + pos-(val<100?3:6), + (int)(lly-55)); + cmel += cmstep; + cmel = (cmel < psim->cmap.max ? cmel : psim->cmap.max); + pos += step; + } + + /* Draw the colorbar. */ + if (psim->colorClass == EPS_GRAYSCALE) { + fprintf (fp, "/cbarstr %d string def\n", ncolors); + fprintf (fp, "gsave\n" ); + if (turnflag) { + fprintf (fp, "%d %d translate\n", + (int)(llx + scols + 45), + (int)(lly + (srows/2) - (cbar_size/2)) + 1); + fprintf (fp, + "0.5 0.5 translate 90 rotate -0.5 -0.5 translate\n"); + } else { + fprintf (fp, "%g %g translate\n", + llx + (scols/2) - (cbar_size/2) + 1, + lly - 45 ); + } + fprintf (fp, "%d 12 scale\n", cbar_size); + fprintf (fp, "%d 1 8 [ %d 0 0 1 0 0 ]\n", ncolors, ncolors); + + fprintf (fp, "{ cbarstr readstring }\n" ); + fprintf (fp, "image\n" ); + + } else { + fprintf (fp, "DisplayImage\n" ); + if (turnflag) { + fprintf (fp, "%d %d\n", + (int)(llx + scols + 34), + (int)(lly + (srows/2) - (cbar_size/2))); + fprintf (fp, "12 %d\n", cbar_size); + } else { + fprintf (fp, "%d %d\n", + (int)llx + (scols/2) - (cbar_size/2), + (int)lly - 45 ); + fprintf (fp, "%d 12\n", cbar_size); + } + fprintf (fp, "%d 1\n", ncolors); + fprintf (fp, "%d\n", turnflag); + fprintf (fp, "0\n"); + fprintf (fp, "1\n"); + } + + /* Write out the colormap used. */ + if (psim->colorClass == EPS_GRAYSCALE) { + for (i=psim->cmap.min; i <= psim->cmap.max; i++ ) { + fprintf (fp, "%02x", + MONO(psim->cmap.r[i],psim->cmap.g[i], psim->cmap.b[i])); + if ((i+1) % 32 == 0) + fprintf (fp, "\n"); + } + fprintf (fp, "\n"); + fprintf (fp, "grestore\n"); + } else { + for (j=1, i=psim->cmap.min; i <= psim->cmap.max; i++, j++ ) + fprintf (fp, "%02x%02x%02x\n", + psim->cmap.r[i],psim->cmap.g[i], psim->cmap.b[i]); + if (j % 12 ==0) + fprintf (fp, "\n"); + } +} + + +/* EPS_COLORHEADER - Write the pseudocolor header prolog and compute EPS page + * parameters. + */ +static char *EPSColorProlog[]= + { + "%%BeginProlog", + "%", + "% Display a color image. The image is displayed in color on", + "% Postscript viewers or printers that support color, otherwise", + "% it is displayed as grayscale.", + "%", + "/buffer 512 string def", + "/byte 1 string def", + "/color_packet 3 string def", + "/pixels 768 string def", + "", + "/DirectClassPacket", + "{", + " %", + " % Get a DirectClass packet.", + " %", + " % Parameters: ", + " % red.", + " % green.", + " % blue.", + " % length: number of pixels minus one of this color (optional).", + " %", + " currentfile color_packet readhexstring pop pop", + " compression 0 gt", + " {", + " /number_pixels 3 def", + " }", + " {", + " currentfile byte readhexstring pop 0 get", + " /number_pixels exch 1 add 3 mul def", + " } ifelse", + " 0 3 number_pixels 1 sub", + " {", + " pixels exch color_packet putinterval", + " } for", + " pixels 0 number_pixels getinterval", + "} bind def", + "", + "/DirectClassImage", + "{", + " %", + " % Display a DirectClass image.", + " %", + " systemdict /colorimage known", + " {", + " columns rows 8", + " [", + " columns 0 0", + " rows neg 0 rows", + " ]", + " { DirectClassPacket } false 3 colorimage", + " }", + " {", + " %", + " % No colorimage operator; convert to grayscale.", + " %", + " columns rows 8", + " [", + " columns 0 0", + " rows neg 0 rows", + " ]", + " { GrayDirectClassPacket } image", + " } ifelse", + "} bind def", + "", + "/GrayDirectClassPacket", + "{", + " %", + " % Get a DirectClass packet; convert to grayscale.", + " %", + " % Parameters: ", + " % red", + " % green", + " % blue", + " % length: number of pixels minus one of this color (optional).", + " %", + " currentfile color_packet readhexstring pop pop", + " color_packet 0 get 0.299 mul", + " color_packet 1 get 0.587 mul add", + " color_packet 2 get 0.114 mul add", + " cvi", + " /gray_packet exch def", + " compression 0 gt", + " {", + " /number_pixels 1 def", + " }", + " {", + " currentfile byte readhexstring pop 0 get", + " /number_pixels exch 1 add def", + " } ifelse", + " 0 1 number_pixels 1 sub", + " {", + " pixels exch gray_packet put", + " } for", + " pixels 0 number_pixels getinterval", + "} bind def", + "", + "/GrayPseudoClassPacket", + "{", + " %", + " % Get a PseudoClass packet; convert to grayscale.", + " %", + " % Parameters: ", + " % index: index into the colormap.", + " % length: number of pixels minus one of this color (optional).", + " %", + " currentfile byte readhexstring pop 0 get", + " /offset exch 3 mul def", + " /color_packet colormap offset 3 getinterval def", + " color_packet 0 get 0.299 mul", + " color_packet 1 get 0.587 mul add", + " color_packet 2 get 0.114 mul add", + " cvi", + " /gray_packet exch def", + " compression 0 gt", + " {", + " /number_pixels 1 def", + " }", + " {", + " currentfile byte readhexstring pop 0 get", + " /number_pixels exch 1 add def", + " } ifelse", + " 0 1 number_pixels 1 sub", + " {", + " pixels exch gray_packet put", + " } for", + " pixels 0 number_pixels getinterval", + "} bind def", + "", + "/PseudoClassPacket", + "{", + " %", + " % Get a PseudoClass packet.", + " %", + " % Parameters: ", + " % index: index into the colormap.", + " % length: number of pixels minus one of this color (optional).", + " %", + " currentfile byte readhexstring pop 0 get", + " /offset exch 3 mul def", + " /color_packet colormap offset 3 getinterval def", + " compression 0 gt", + " {", + " /number_pixels 3 def", + " }", + " {", + " currentfile byte readhexstring pop 0 get", + " /number_pixels exch 1 add 3 mul def", + " } ifelse", + " 0 3 number_pixels 1 sub", + " {", + " pixels exch color_packet putinterval", + " } for", + " pixels 0 number_pixels getinterval", + "} bind def", + "", + "/PseudoClassImage", + "{", + " %", + " % Display a PseudoClass image.", + " %", + " % Parameters: ", + " % colors: number of colors in the colormap.", + " % colormap: red, green, blue color packets.", + " %", + " currentfile buffer readline pop", + " token pop /colors exch def pop", + " /colors colors 3 mul def", + " /colormap colors string def", + " currentfile colormap readhexstring pop pop", + " systemdict /colorimage known", + " {", + " columns rows 8", + " [", + " columns 0 0", + " rows neg 0 rows", + " ]", + " { PseudoClassPacket } false 3 colorimage", + " }", + " {", + " %", + " % No colorimage operator; convert to grayscale.", + " %", + " columns rows 8", + " [", + " columns 0 0", + " rows neg 0 rows", + " ]", + " { GrayPseudoClassPacket } image", + " } ifelse", + "} bind def", + "", + "/DisplayImage", + "{", + " %", + " % Display a DirectClass or PseudoClass image.", + " %", + " % Parameters: ", + " % x & y translation.", + " % x & y scale.", + " % image columns & rows.", + " % orientation: 0-Portrait or 1-Landscape", + " % class: 0-DirectClass or 1-PseudoClass.", + " % compression: 0-RunlengthEncodedCompression or 1-NoCompression.", + " % hex color packets.", + " %", + " gsave", + " currentfile buffer readline pop", + " token pop /x exch def", + " token pop /y exch def pop", + " x y translate", + " currentfile buffer readline pop", + " token pop /x exch def", + " token pop /y exch def pop", + " x y scale", + " currentfile buffer readline pop", + " token pop /columns exch def", + " token pop /rows exch def pop", + " currentfile buffer readline pop", + " token pop /orient exch def pop", + " orient 0 gt { 0.5 0.5 translate 90 rotate -0.5 -0.5 translate } if", + " currentfile buffer readline pop", + " token pop /class exch def pop", + " currentfile buffer readline pop", + " token pop /compression exch def pop", + " class 0 gt { PseudoClassImage } { DirectClassImage } ifelse", + " grestore", + "} bind def", + "%%EndProlog", + "%%Page: 1 1", + NULL +}; + + +#ifdef ANSI_FUNC + +static void +eps_colorHeader (PSImagePtr psim, FILE *fp) +#else + +static void +eps_colorHeader (psim, fp) +PSImagePtr psim; +FILE *fp; +#endif +{ + register char **line; + int icols=0, irows=0, scols=0, srows=0, turnflag=0; + float llx = 0.0, lly = 0.0; + time_t timer; + + /* Get the common page parameters. */ + eps_pageParams (psim, &llx, &lly, &icols, &irows, &scols, &srows, + &turnflag); + + /* Now write header and prolog stuff */ + fprintf (fp, "%%!PS-Adobe-3.0 EPSF-3.0\n"); + fprintf (fp, "%%%%Title: XImtool Screen Hardcopy\n"); + fprintf (fp, "%%%%Creator: XImtool\n"); + timer = time ((time_t *) NULL); + (void) localtime (&timer); + fprintf (fp, "%%%%CreationDate: %s", ctime(&timer)); + if (psim->annotate) + fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", + (int) (MAX (0, llx - X_ANNOT_MARGIN)), + (int) (MAX (0, lly - Y_ANNOT_MARGIN)), + (int) ( llx + scols + 0.5 + X_ANNOT_MARGIN), + (int) ( lly + srows + 0.5 + Y_ANNOT_MARGIN) ); + else + fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", + (int) (MAX (0, llx - 10)), + (int) (MAX (0, lly - 10)), + (int) ( llx + scols + 0.5 + 10), + (int) ( lly + srows + 0.5 + 10) ); + fprintf (fp, "%%%%Pages: 1\n"); + fprintf (fp, "%%%%EndComments\n"); + + /* Output remaining Postscript prolog commands. */ + for (line = EPSColorProlog; *line; line++) + fprintf (fp, "%s\n",*line); + fprintf (fp, "userdict begin\n"); + fprintf (fp, "%%%%BeginData:\n"); + + fprintf (fp, "DisplayImage\n"); + + /* Now write the image display parameters, specifically + * + * x & y translation. + * x & y scale. + * image columns & rows. + * orientation: 0-Portrait or 1-Landscape + * class: 0-DirectClass or 1-PseudoClass. + * compression: 0-RunlengthEncodedCompression or 1-NoCompression. + * hex color packets. + */ + + fprintf (fp, "%d %d\n%u %u\n%u %u\n%d\n%d\n%d\n", + (int) llx, (int) lly, + (int) scols, (int) srows, + psim->cols, psim->rows, + turnflag, + psim->colorClass == EPS_PSEUDOCOLOR, + psim->compression == NoCompression); +} + + +/* EPS_WRITETRAILER -- Output Postscript trailer blurb. + */ +#ifdef ANSI_FUNC + +static void +eps_writeTrailer (FILE *fp) +#else + +static void +eps_writeTrailer (fp) +FILE *fp; +#endif +{ + fprintf (fp, "\n"); + fprintf (fp, "showpage\n"); + fprintf (fp, "%%%%EndData\n"); + fprintf (fp, "end\n"); + fprintf (fp, "%%%%PageTrailer\n"); + fprintf (fp, "%%%%Trailer\n"); + fprintf (fp, "%%%%EOF\n"); +} + + +/* EPS_SIMPLETRAILER -- Output Postscript trailer blurb. + */ +#ifdef ANSI_FUNC + +static void +eps_simpleTrailer (FILE *fp) +#else + +static void +eps_simpleTrailer (fp) +FILE *fp; +#endif +{ + fprintf (fp, "showpage\n"); +} + + +#ifdef ANSI_FUNC + +static void +eps_flushPix (FILE *fp) +#else + +static void +eps_flushPix (fp) +FILE *fp; +#endif +{ + pixbuf[pixnum] = '\0'; + fprintf (fp, "%s", pixbuf); + pixnum = 0; + lpix = 0; +} + + +/* Utility Routines. + */ + +/* TICSTEP -- calculate nice intervals for the ticmarks. + */ +#ifdef ANSI_FUNC + +static float +ticstep (float range, int nsteps) +#else + +static float +ticstep (range,nsteps) +float range; +int nsteps; +#endif +{ + double df, t2, t5, p1, p2, p3; + float ticstep; + int logtic; + + df = range / (float)(nsteps + 1); + t2 = 0.301029996; + t5 = 0.698970004; + p1 = log10 ((double)(df > 0.0 ? df : -df)); + p2 = (int) p1; + p3 = p1 - p2; + if(p3 < 0.) { + p3 = p2 + 1.; + p2 = p2 - 1.; + } + + if (p3 < 1.0e-10) + ticstep = pow((double)10.0,(double)(p2)); + else if (p3 > 0. && p3 <= t2) + ticstep = pow((double)10.0,(double)(p2+t2)); + else if (p3 > t2 && p3 <= t5) + ticstep = pow((double)10.0,(double)(p2+t5)); + else if (p3 > t5 && p3 <= 1.) + ticstep = pow((double)10.0,(double)(p2+1.)); + else + ticstep = df; + + logtic = (int) log10(ticstep) - 1; + ticstep = (int)( (ticstep / pow((double)10.,(double)logtic)) * + pow((double)10.,(double)logtic) ); + + if (ticstep < 0.1) ticstep = 0.10; + + return (ticstep); +} + + +/* MAKE_LABEL -- Generate the label for the output printer page. + */ +#ifdef ANSI_FUNC + +static char * +make_label (void) +#else + +static char * +make_label() +#endif +{ + struct tm *lt; + static char label_buffer[256]; + char hostname[32], username[32]; + struct passwd *pw; + time_t clock; + +#ifdef SOLARIS + sysinfo (SI_HOSTNAME, hostname, 32); +#else + gethostname (hostname, 32); +#endif + + clock = time(0); + pw = getpwuid (getuid()); + strcpy (username, pw->pw_name); + endpwent(); + + lt = localtime (&clock); + sprintf (label_buffer, "NOAO/IRAF %s@%s %s", + username, hostname, (char *)asctime(lt)); + + return (label_buffer); +} diff --git a/vendor/x11iraf/cdl/eps.h b/vendor/x11iraf/cdl/eps.h new file mode 100644 index 00000000..c65ed4b4 --- /dev/null +++ b/vendor/x11iraf/cdl/eps.h @@ -0,0 +1,109 @@ +/* + * EPS.H -- Include definitions for EPS hardcopy routines. + */ + + +/* Handy macro definitions */ + +#define MONO(rd,gn,bl) ((int)(rd*11 + gn*16 + bl*5) >> 5) /*.33R+ .5G+ .17B*/ +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + +#define Orientation(ps) ( ps->page.orientation ) +#define Scale(ps) ( ps->page.scale ) +#define MaxScale(ps) ( ps->page.maxscale ) +#define PageType(ps) ( ps->page.page_type ) +#define DoAutoScale(ps) ( ps->page.flags & EPS_AUTOSCALE ) +#define DoAutoRotate(ps) ( ps->page.flags & EPS_AUTOROTATE ) +#define DoMaxAspect(ps) ( ps->page.flags & EPS_MAXASPECT ) + +#define PIX_PER_LINE 72 + +/* Compression options. */ +#define NoCompression 0 /* Don't compress image */ +#define RLECompression 1 /* RLE compression */ +#define LZWCompression 2 /* LZW compression (not implemted) */ +#define JPEGCompression 3 /* JPEG compression (not implemted) */ + +/* Output color classes. */ +#define EPS_GRAYSCALE 0 /* Write a grayscale image */ +#define EPS_PSEUDOCOLOR 1 /* Write a pseudocolor image */ +#define EPS_TRUECOLOR 2 /* Write a RGB image */ + +/* Page option flags. */ +#define EPS_PORTRAIT 0 /* Page orientations */ +#define EPS_LANDSCAPE 1 +#define EPS_AUTOSCALE 0x01 /* Auto scale to fit on page */ +#define EPS_AUTOROTATE 0x02 /* Auto rotate to fit on page */ +#define EPS_MAXASPECT 0x04 /* Increase scale to max aspect */ + +/* Transformation parameters. */ +#define EPS_UNITARY 0 +#define EPS_LINEAR 1 +#define EPS_LOG 2 + +/* Page layout structure. */ +typedef struct { + int orientation; /* page orioentation */ + float scale; /* image scale factor */ + float maxscale; /* maxaspect image scale factor */ + int dpi; /* dpi resolution */ + int page_type; /* type of paper being used */ + int flags; /* option flags */ +} PSPage, *PSPagePtr; + +/* Colormap structure. */ +typedef struct { + int IsDefault; /* Are we using the default colormap? */ + int ncolors; /* number of colormap colors */ + int min, max; /* image min/max */ + unsigned char r[256]; /* red colormap */ + unsigned char g[256]; /* green colormap */ + unsigned char b[256]; /* blue colormap */ + char *cmap_name; /* colormap name */ +} PSCmap, *PSCmapPtr; + +/* Main EPS structure. */ +typedef struct { + int cols; /* num output columns */ + int rows; /* num output rows */ + int colorClass; /* output color class */ + int compression; /* output compression type */ + int annotate; /* annotate the output image? */ + int llx, lly, urx, ury; /* image coordinate corners */ + float z1, z2; /* zscale transform values */ + int ztype; /* type of transformation */ + float offset, scale; /* brightness/contrast values */ + char *label; /* label string */ + + PSPage page; /* Page layout structure */ + PSCmap cmap; /* Colormap struct */ +} PSImage, *PSImagePtr; + + +/* Page sizes and resolution information. */ +#define EPS_LETTER 0 +#define EPS_LEGAL 1 +#define EPS_A4 2 +#define EPS_B5 3 +#define EPS_BSIZE 4 +#define EPS_4BY5 5 +#define EPS_35MM 6 + +/* Page layout definitions. */ +#define X_ANNOT_MARGIN 30 /* margin in pixels for annotation */ +#define Y_ANNOT_MARGIN 60 /* margin in pixels for annotation */ +#define TITLE_OFFSET 20 /* Offset for title string */ +#define AXIS_OOFFSET 7 /* Outer offset for axis */ +#define AXIS_IOFFSET 2 /* Inner offset for axis */ +#define AXIS_OWIDTH 1.5 /* Outer axis width */ +#define AXIS_IWIDTH 1.0 /* Inner axis width */ +#define MAJOR_TICK_SIZE 5 /* Size of major tic mark */ +#define MAJOR_TICK_WIDTH 1.5 /* Width of major tic mark */ +#define MINOR_TICK_SIZE 3 /* Size of major tic mark */ +#define MINOR_TICK_WIDTH 0.5 /* Width of major tic mark */ +#define NTICMARKS 5 /* Number of major tick marks */ + diff --git a/vendor/x11iraf/cdl/examples/Imakefile b/vendor/x11iraf/cdl/examples/Imakefile new file mode 100644 index 00000000..ef6c3d97 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/Imakefile @@ -0,0 +1,36 @@ +# +# IMakefile for CDL Example tasks. +# + +X11IRAFDIR = ../../ +#include <../../X11IRAF.tmpl> + + + CDEBUGFLAGS = -g + FCFLAGS = -g + CDLDIR = ../ + INCLUDES = -I. -I$(CDLDIR) + LOCAL_LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + +AllTarget(animate display mosaic tvmark fdisplay ftvmark) + +NormalFortranObjectRule() + +NormalProgramTarget(animate,animate.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(display,display.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(mosaic,mosaic.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(tvmark,tvmark.o,../libcdl.a,$(LIBS),-lm) + +fdisplay: fdisplay.o ../libcdl.a + f77 -o fdisplay fdisplay.o ../libcdl.a -lm $(LDLIBS) + +ftvmark: ftvmark.o ../libcdl.a + f77 -o ftvmark ftvmark.o ../libcdl.a -lm $(LDLIBS) + +clean:: + $(RM) fdisplay ftvmark + +DependTarget() +LintTarget() diff --git a/vendor/x11iraf/cdl/examples/Imakefile.standalone b/vendor/x11iraf/cdl/examples/Imakefile.standalone new file mode 100644 index 00000000..8886ae9e --- /dev/null +++ b/vendor/x11iraf/cdl/examples/Imakefile.standalone @@ -0,0 +1,54 @@ +# +# IMakefile for CDL Example tasks. +# + + CDEBUGFLAGS = -g + FCFLAGS = -g + CDLDIR = ../ + INCLUDES = -I. -I$(CDLDIR) + LOCAL_LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + +# Hack to compile under SunPRO V4 on Solaris +#if defined (SunArchitecture) && OSMajorVersion >= 5 && HasSunC +#if OSMinorVersion <= 5 +#if !defined (i386Architecture) + CCOPTIONS = -Xs +EXTRA_LDOPTIONS = -xildoff +#endif +#else + CCOPTIONS = +EXTRA_LDOPTIONS = -xildoff +#endif + +#else +#if defined (UltrixArchitecture) + CCOPTIONS = -DULTRIX +#endif +#if defined (OSF1Architecture) && OSMajorVersion >= 4 + CCOPTIONS = -DOSF1 +#endif +#endif + + +AllTarget(animate display mosaic tvmark fdisplay ftvmark) + +NormalFortranObjectRule() + +NormalProgramTarget(animate,animate.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(display,display.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(mosaic,mosaic.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(tvmark,tvmark.o,../libcdl.a,$(LIBS),-lm) + +fdisplay: fdisplay.o ../libcdl.a + f77 -o fdisplay fdisplay.o ../libcdl.a -lm $(LDLIBS) + +ftvmark: ftvmark.o ../libcdl.a + f77 -o ftvmark ftvmark.o ../libcdl.a -lm $(LDLIBS) + +clean:: + $(RM) fdisplay ftvmark + +DependTarget() +LintTarget() diff --git a/vendor/x11iraf/cdl/examples/Makefile.generic b/vendor/x11iraf/cdl/examples/Makefile.generic new file mode 100644 index 00000000..fae978aa --- /dev/null +++ b/vendor/x11iraf/cdl/examples/Makefile.generic @@ -0,0 +1,102 @@ +# +# Generic Makefile for CDL Example tasks. +# + + CDEBUGFLAGS = -g + FCFLAGS = -g + RM = rm + CDLDIR = ../ + INCLUDES = -I. -I$(CDLDIR) + LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + LDLIBS = + +all:: display mosaic tvmark fdisplay ftvmark + +.c.o: + $(RM) -f $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $*.c + +.f.o: + $(RM) -f $@ + $(FC) -c $(FCFLAGS) $*.f + +display: display.o ../libcdl.a + $(RM) -f $@ + $(CC) -o $@ display.o $(LDFLAGS) $(LDOPTIONS) $(LIBS) $(LDLIBS) -lm + +clean:: + $(RM) -f display + +mosaic: mosaic.o ../libcdl.a + $(RM) -f $@ + $(CC) -o $@ mosaic.o $(LDFLAGS) $(LDOPTIONS) $(LIBS) $(LDLIBS) -lm + +clean:: + $(RM) -f mosaic + +tvmark: tvmark.o ../libcdl.a + $(RM) -f $@ + $(CC) -o $@ tvmark.o $(LDFLAGS) $(LDOPTIONS) $(LIBS) $(LDLIBS) -lm + +clean:: + $(RM) -f tvmark + +fdisplay: fdisplay.o ../libcdl.a + f77 -o fdisplay fdisplay.o ../libcdl.a -lm $(LDLIBS) + +ftvmark: ftvmark.o ../libcdl.a + f77 -o ftvmark ftvmark.o ../libcdl.a -lm $(LDLIBS) + +clean:: + $(RM) -f fdisplay ftvmark + +depend:: + +lint: + $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) +lint1: + $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) + +clean:: + $(RM) -f *.o + +# ------------------------------------------------------------------------- +# common rules for all Makefiles - do not edit + +emptyrule:: + +Makefile:: + -@if [ -f Makefile ]; then set -x; \ + $(RM) -f Makefile.bak; $(MV) Makefile Makefile.bak; \ + else exit 0; fi + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + +tags:: + $(TAGS) -w *.[ch] + $(TAGS) -xw *.[ch] > TAGS + +saber: + # load $(ALLDEFINES) $(SRCS) + +osaber: + # load $(ALLDEFINES) $(OBJS) + +# ------------------------------------------------------------------------- +# empty rules for directories that do not have SUBDIRS - do not edit + +install:: + @echo "install in $(CURRENT_DIR) done" + +install.man:: + @echo "install.man in $(CURRENT_DIR) done" + +Makefiles:: + +includes:: + +# ------------------------------------------------------------------------- +# dependencies generated by makedepend + +# DO NOT DELETE diff --git a/vendor/x11iraf/cdl/examples/README b/vendor/x11iraf/cdl/examples/README new file mode 100644 index 00000000..fb0f58de --- /dev/null +++ b/vendor/x11iraf/cdl/examples/README @@ -0,0 +1,25 @@ +CDL PACKAGE EXAMPLES -- This directory contains several example programs +to demostrate usage of the Client Display library. Programs are available +in both C and Fortran. These are working examples but perhaps not the most +highly efficient code since they're meant to demonstrate how the package +might be used. Tasks available so far include + + DISPLAY.C - C program to display an image. Demonstrates how + to use the high level format display calls, the + midlevel raw pixel display, and the lowest level + raw raster display methods. + TVMARK.C - C program to display and image and overlay with + point marks, optional interactive marking available. + Demonstrates usage of cursor reads and call for + the various marking routines. + MOSAIC.C - C program to mosaic several images on the display. + Demonstrates the use of low-level raster I/O to + do more complex display operations. + + FDISPLAY.F - Fortran equivalent of the DISPLAY task above. + FTVMARK.F - Fortran equivalent of the TVMARK task above. + +Misc Files in This Directory: + + DPIX.FITS - 512x512 test image of M51 + COORDS - sample coordinate file for tvmark task diff --git a/vendor/x11iraf/cdl/examples/animate.c b/vendor/x11iraf/cdl/examples/animate.c new file mode 100644 index 00000000..66f487d9 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/animate.c @@ -0,0 +1,153 @@ +#include <stdio.h> +#include <sys/types.h> +#include <unistd.h> +#include "cdl.h" + +/* ANIMATE -- Example task to demonstrate rapid display of rasters such as + * would be done in an animation sequence, or in an acquisition system + * which needs to display guider images repeatedly (the actual inspiration + * for this demo. + * + * Examples: + * Display a scrolling test pattern: + * % animate + * + * Usage: + * animate [-nx N] [-ny N] [-fbconfig N] + * + * Note that your choice of frame buffer is important since if it's + * larger than the image size you're spending a lot of overhead in writing + * blank pixels around the actual image. When writing a true subraster of + * the image/frame buffer, the routine first reads back the pixels in the + * affected rows, edits the pixels in the subraster columns and then writes + * back the entire row. If the subraster width is the same size as the + * frame buffer width it does a straight write which will speed up the dis- + * play since you avoid the readback overhead. It may be worth defining a + * custom frame buffer the size of your image to speed things up. + */ + +#define DIAGONAL 0 /* test pattern flags */ +#define VERTICAL 1 +#define HORIZONTAL 2 + +#define max(a,b) (a > b ? a : b) /* Utility macros */ +#define min(a,b) (a < b ? a : b) + + +CDLPtr cdl; +uchar *pix = NULL; + +main (argc, argv) +int argc; +char *argv[]; +{ + register int i, frame=1; + int nx=256, ny=256, fbconfig=0; + int status=0, fb_w, fb_h, nf, lx, ly; + uchar *line; + + /* Handle command line args. */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strcmp (argv[i], "-nx") == 0) + nx = atoi (argv[++i]); + else if (strcmp (argv[i], "-ny") == 0) + ny = atoi (argv[++i]); + else if (strcmp (argv[i], "-fbconfig") == 0) + fbconfig = atoi (argv[++i]); + } + } + + /* Open the package and a connection to the server. */ + if (!(cdl = cdl_open ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* Make a test pattern. */ + pix = (uchar *) malloc (nx * ny); + makeTestPattern (pix, nx, ny, DIAGONAL); + + /* Now select a frame buffer large enough for the image. The + * fbconfig number is passed in the WCS packet, but the display + * calls below will compute the correct WCS for the image and + * transmit that prior to display, all we're doing here is + * setting up the FB to be used. + */ + if (fbconfig == 0) + cdl_selectFB (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 1); + else + cdl_lookupFBSize (cdl, fbconfig, &fb_w, &fb_h, &nf); + + + /* For the WCS we assume a simple linear transform where the image is + * Y-flipped, the (x,y) translation is computed so it is correct + * for an frame buffer >= than the image size. The Z-transform is + * fixed since we're using a test pattern with known values. + */ + cdl_setWCS (cdl, "test pattern", "", 1., 0., 0., -1., + (float) (nx / 2) - (fb_w / 2) + 1, /* X translation */ + (float) (fb_h / 2) + (ny / 2), /* Y translation */ + 0.0, 200.0, CDL_LINEAR); /* Z transform */ + + + /* Select and clear the initial frame prior to display. */ + cdl_setFrame (cdl, frame); + cdl_clearFrame (cdl); + + /* Now display the pixels. We'll compute the image placement + * ourselves and write the image as a raw subraster of the frame + * buffer in the center of the display. + */ + lx = (fb_w / 2) - (nx / 2); + ly = fb_h - ((fb_h / 2) + (ny / 2)); + status = cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix); + + /* Now animate the image. */ + line = (uchar *) malloc (nx); + while (1) { + /* Shift the image down one line, roll the botton line to the + * top and redisplay the subraster/ + */ + memcpy (pix, line, nx); + memmove (pix+nx, pix, (ny-1)*nx); + memcpy (line, pix+((ny-1)*nx), nx); + + status = cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix); + } + + + cdl_close (cdl); /* close the package */ + free ((unsigned char *) pix); /* free the raster */ + exit (status); +} + + +/* Make a test pattern. */ + +makeTestPattern (raster, nx, ny, pattern) +uchar *raster; +int nx, ny, pattern; +{ + register uchar pix; + register int i, j; + register float scale; + + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { + switch (pattern) { + case DIAGONAL: /* Diagonal ramp */ + scale = 200. / (float)(ny) / 2.; + pix = (uchar) max(2, (min(200,(scale*i + scale*j)))); + break; + case VERTICAL: /* Vertical ramp */ + scale = 200. / (float)(ny); + pix = (uchar) max(2, (min(200,(scale * i)))); + break; + case HORIZONTAL: /* Horizontal ramp */ + scale = 200. / (float)(nx); + pix = (uchar) max(2, (min(200,(scale * j)))); + break; + } + raster[i * nx + j] = pix; + } + } +} diff --git a/vendor/x11iraf/cdl/examples/coords b/vendor/x11iraf/cdl/examples/coords new file mode 100644 index 00000000..7f6fcdf5 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/coords @@ -0,0 +1,42 @@ + 49 343 + 59 226 + 68 459 + 87 481 + 92 319 + 97 106 +113 143 +126 117 +133 391 +134 109 +134 221 +144 345 +150 83 +179 355 +182 63 +211 328 +218 439 +219 314 +225 129 +241 403 +265 340 +269 355 +288 133 +292 104 +294 178 +320 327 +321 32 +329 409 +338 325 +348 231 +349 188 +364 325 +365 124 +377 368 +381 67 +405 274 +415 187 +442 409 +452 212 +466 62 +472 232 +508 445 diff --git a/vendor/x11iraf/cdl/examples/display.c b/vendor/x11iraf/cdl/examples/display.c new file mode 100644 index 00000000..67b52c97 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/display.c @@ -0,0 +1,257 @@ +#include <stdio.h> +#ifdef ULTRIX +#include <sys/types.h> +#endif +#include <sys/types.h> +#include <unistd.h> +#include "cdl.h" + +/* + * DISPLAY -- Example task to display an image as a command-line task. + * This task is meant to show three ways the CDL can be used to display + * and image, it is functional but perhaps not highly efficient for this + * reason. See the code comments for a description of each method. + * + * Examples: + * To display a simple IRAF or FITS file: + * % ./display -frame 2 image.imh + * % ./display image.fits + * + * To display a FITS file as a raw image: + * % ./display -nx 512 -ny 512 -depth 16 -hskip 5760 -raw dpix.fits + * + * Usage: + * display [-depth N] [-fits] [-frame N] [-fbconfig N] [-hskip N] + * [-iraf] [-nozscale] [-nx N] [-ny N] [-raw] [-zscale] + * [-ns N] [-nl N] [-log] file + */ + +#define NONE -1 +#define IRAF 0 +#define FITS 1 +#define RAW 2 + +#define ABS(x) (x > 0 ? x : -x) + +#ifdef SOLARIS +char *getcwd(); +#else +char *getwd(); +#endif + + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname; + int i, log = 0, status = 0, frame = 1, fbconfig = 0, zscale = 1; + int format = NONE, nx = 0, ny = 0, depth = 8, hskip = 0; + int ns = -1, nl = -1; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + char *path_prefix = (char *) calloc (1025, sizeof(char)); + char *path = (char *) calloc (512, sizeof(char)); + char *node = (char *) calloc (512, sizeof(char)); + + + /* Process the command line options. */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strcmp (argv[i], "-depth") == 0) + depth = atoi (argv[++i]); + else if (strcmp (argv[i], "-fits") == 0) + format = FITS; + else if (strcmp (argv[i], "-frame") == 0) + frame = atoi (argv[++i]); + else if (strcmp (argv[i], "-fbconfig") == 0) + fbconfig = atoi (argv[++i]); + else if (strcmp (argv[i], "-hskip") == 0) + hskip = atoi (argv[++i]); + else if (strcmp (argv[i], "-iraf") == 0) + format = IRAF; + else if (strcmp (argv[i], "-log") == 0) + log++; + else if (strcmp (argv[i], "-nozscale") == 0) + zscale = 0; + else if (strcmp (argv[i], "-ns") == 0) + ns = atoi (argv[++i]); + else if (strcmp (argv[i], "-nl") == 0) + nl = atoi (argv[++i]); + else if (strcmp (argv[i], "-nx") == 0) + nx = atoi (argv[++i]); + else if (strcmp (argv[i], "-ny") == 0) + ny = atoi (argv[++i]); + else if (strcmp (argv[i], "-raw") == 0) + format = RAW; + else if (strcmp (argv[i], "-zscale") == 0) + zscale = 1; + } + } + + /* Open the package and a connection to the server. */ + if (!(cdl = cdl_open ((char *)getenv("IMTDEV"))) ) + exit (-1); + + fname = argv[argc-1]; + + if (ns > 0) cdl_setSample (cdl, ns); + if (nl > 0) cdl_setSampleLines (cdl, nl); + if (log > 0) cdl_setZTrans (cdl, CDL_LOG); + + /* METHOD 1: Displays the image using the high-level format display + * call. Display as an IRAF image if the option was set indicating + * this is the format, otherwise test the file to see if it is anyway. + */ + if (format == IRAF || (format == NONE && cdl_isIRAF (fname))) { + status = cdl_displayIRAF (cdl, fname, 1, frame, + (fbconfig==0 ? FB_AUTO : fbconfig), zscale); + + + /* METHOD 2: Uses the CDL procedure for getting image pixels from + * a known format, minimal work required to display an image. The + * point here is that you can use this mthod to process the image + * yourself prior to display, e.g. subsample the pixels, apply a user + * LUT, etc but still use the CDL to get the raw image and do the + * display. + */ + } else if (format == FITS || (format == NONE && cdl_isFITS (fname))) { + float *bscale, *bzero; + char title[80]; + + /* Get the FITS image pixels, exit w/ an error status if something + * went wrong, the procedure will print what that was. + */ + if (cdl_readFITS (fname, &pix, &nx, &ny, &depth, title)) { + cdl_close (cdl); /* close the package */ + exit (1); /* exit w/ error code */ + } + + /* Now select a frame buffer large enough for the image. The + * fbconfig number is passed in the WCS packet, but the display + * call below will compute the correct WCS for the image and + * transmit that prior to display, all we're doing here is + * setting up the FB to be used. + */ + if (fbconfig == 0) + cdl_selectFB (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 0); + + /* Lastly, display the pixels to the requested frame, do any + * zscaling requested using the CDL procedure. + */ + (void) cdl_setTitle (cdl, title); + (void) cdl_setName (cdl, fname); + if (cdl_displayPix(cdl, pix, nx, ny, depth, frame, fbconfig,zscale)) + status = 1; + + /* Now just free the pixel pointer to clean up. + */ + free ((unsigned char *) pix); + + + /* METHOD 3: Displays an image of raw pixels. The client code is + * responsible for reading the image and calling all the procedures + * needed for image display, initialize the frame, zscaling pix, etc. + * While we assume a simple raster format in this program, the user + * code can read a compressed image format such as GIF, mosaic multiple + * images for display as a single image, or just about anything that + * produces a raster for display. The intent here is to show all the + * lowest level calls needed for displaying the image. + */ + } else if (format == RAW) { + FILE *fd; + int lx, ly; + + if (nx == 0 || ny == 0) { + fprintf (stderr, "No size given for raw data.\n"); + exit (1); + } + + /* Open the image file if we can. */ + if (fd = fopen (fname, "r")) { + + /* Seek to the offset specified. */ + lseek (fileno(fd), (off_t) hskip, SEEK_SET); + + /* Allocate the pixel pointer and read the data. */ + pix = (unsigned char *) malloc (nx * ny * (ABS(depth) / 8)); + fread (pix, ABS(depth)/8, nx * ny, fd); + + /* If we're zscaling and depth is more than 8-bits, do that. */ + if (zscale && ABS(depth) > 8) { + cdl_computeZscale (cdl, pix, nx, ny, depth, &z1, &z2); + cdl_zscaleImage (cdl, &pix, nx, ny, depth, z1, z2); + } + + /* Select and clear the requested frame prior to display. */ + cdl_setFrame (cdl, frame); + cdl_clearFrame (cdl); + + /* Now select a frame buffer large enough for the image. + * We'll ask that this be reset but the change won't go to + * the server until we send in the WCS below. + */ + cdl_selectFB (cdl, nx, ny, &fbconfig, &fb_w, &fb_h, &nf, 1); + + /* Compute the image placement so it's centered in the frame, + * but note the cdl_writeSubRaster() routine can place an + * arbitrary raster anywhere in the frame buffer. + lx = (fb_w / 2) - (nx / 2); + ly = fb_h - ((fb_h / 2) + (ny / 2)); + + /* Set the mapping we'll send with the WCS which must be + * called before the cdl_setWCS() call since the data is sent + * with the WCS and not as a separate call. + */ + + /* First we must compose a node!path prefix for the image */ + gethostname (node, 512); +#ifdef SOLARIS + (void) getcwd (path, 512); +#else + (void) getwd (path); +#endif + if (*fname == '/') + (void) sprintf (path_prefix, "%s!%s", node, fname); + else + (void) sprintf (path_prefix, "%s!%s/%s", node, path, fname); + + cdl_setMapping (cdl, "image", 0., 0., nx, ny, lx, ly, nx, ny, + path_prefix); + + /* For the WCS we assume a simple linear transform where the + * image is Y-flipped, the (x,y) translation is computed so + * it is correct for an frame buffer >= than the image size. + */ + cdl_setWCS (cdl, fname, "", 1., 0., 0., -1., + (float) (nx / 2) - (fb_w / 2) + 1, /* X trans. */ + (float) (fb_h / 2) + (ny / 2), /* Y trans. */ + z1, z2, CDL_LINEAR); /* Z transform */ + + + /* Now display the pixels. + */ + if (cdl_writeSubRaster (cdl, lx, ly, nx, ny, pix)) + status = 1; + + /* Now just free the pixel pointer to clean up. + */ + free ((unsigned char *) pix); + fclose (fd); + + } else + status = 1; + + } else { + if (access (fname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\n", fname); + else + fprintf (stderr, "'%s': image does not exist.\n", fname); + status = 1; + } + + cdl_close (cdl); /* close the package */ + exit (status); +} diff --git a/vendor/x11iraf/cdl/examples/dpix.fits b/vendor/x11iraf/cdl/examples/dpix.fits Binary files differnew file mode 100644 index 00000000..33c19cb3 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/dpix.fits diff --git a/vendor/x11iraf/cdl/examples/fdisplay.f b/vendor/x11iraf/cdl/examples/fdisplay.f new file mode 100644 index 00000000..d14633f6 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/fdisplay.f @@ -0,0 +1,65 @@ +C ======================================================================== +C = +C FDISPLAY -- Example fortran program showing the use of the Client = +C Display Library (CDL) Fortran interface for displaying images. In = +C this simple program all input is prompted for on the command line. = +C = +C ======================================================================== + + + program fdisplay + character*132 imname + character*132 imtdev + +C -------------------------- +C Initialize the CDL package +C -------------------------- + call getenv('IMTDEV',imtdev) + call cfopen(imtdev, ier) + if (ier .gt. 0) then + write (*,*) 'open: Error return from CDL' + goto 999 + endif + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C ---------------------------------------------------------- +C If we've got a FITS format image, go ahead and display it. +C ---------------------------------------------------------- + call cfisfits (imname, isfits) + if (isfits .gt. 0) then + call cfdisplayfits (imname, iframe, ifb, 1, ier) + if (ier .gt. 0) then + write (*,*) 'displayFITS: Error return from CDL' + goto 999 + endif + else +C -------------------------------------------------------- +C We've got an IRAF format image, go ahead and display it. +C -------------------------------------------------------- + call cfisiraf (imname, isiraf) + if (isiraf .gt. 0) then + call cfdisplayiraf (imname, 1, iframe, ifb, 1, ier) + if (ier .gt. 0) then + write (*,*) 'displayIRAF: Error return from CDL' + goto 999 + endif + else +C ---------------------------------- +C Unrecognized image, punt and exit. +C ---------------------------------- + write (*,*) 'Unrecognized image format' + endif + endif + +C ------------------ +C Clean up and exit. +C ------------------ +999 continue + call cfclose (ier) + end diff --git a/vendor/x11iraf/cdl/examples/ftvmark.f b/vendor/x11iraf/cdl/examples/ftvmark.f new file mode 100644 index 00000000..a530895d --- /dev/null +++ b/vendor/x11iraf/cdl/examples/ftvmark.f @@ -0,0 +1,301 @@ +C ========================================================================== +C = +C FTVMARK -- Example fortran program showing the use of the Client = +C Display Library (CDL) Fortran interface for doing graphics overlay. In = +C this simple program all input is prompted for on the command line. = +C = +C ========================================================================== + + + program ftvmark + include "../cdlftn.inc" + character*64 imname + character*132 imtdev + +C -------------------------- +C Initialize the CDL package +C -------------------------- + call getenv('IMTDEV',imtdev) + call cfopen(imtdev, ier) + if (ier .gt. 0) then + write (*,*) 'open: Error return from CDL' + goto 999 + endif + + write (*, "('Image Name: ', $)") + read (5, *) imname + write (*, "('Frame Number: ', $)") + read (5, *) iframe + write (*, "('Frame buffer configuration number: ', $)") + read (5, *) ifb + +C ---------------------------------------------------------- +C If we've got a FITS format image, go ahead and display it. +C ---------------------------------------------------------- + call cfisfits (imname, isfits) + if (isfits .gt. 0) then + call cfdisplayfits (imname, iframe, ifb, 1, ier) + if (ier .gt. 0) then + write (*,*) 'displayFITS: Error return from CDL' + goto 999 + endif + else + +C -------------------------------------------------------- +C We've got an IRAF format image, go ahead and display it. +C -------------------------------------------------------- + call cfisiraf (imname, isiraf) + if (isiraf .gt. 0) then + call cfdisplayiraf (imname, 1, iframe, ifb, 1, ier) + if (ier .gt. 0) then + write (*,*) 'displayIRAF: Error return from CDL' + goto 999 + endif + else +C ------------------------------------------------------------- +C No valid image given, so map the current display for marking. +C ------------------------------------------------------------- + call cfmapframe (iframe) + endif + endif + +C --------------------------------------------------------------- +C Now that we've got an image displayed or mapped, enter a cursor +C loop to mark the image. We do this in a subroutine so all the +C parameters needed are together. +C --------------------------------------------------------------- + call markInteractive () + +C ----------------- +C Clean up and exit +C ----------------- +999 continue + call cfclose (ier) + end + + +C ======================================================================= +C = +C MARKINTERACTIVE -- Subroutine for processing the cursor loop. = +C = +C ======================================================================= + + subroutine markInteractive () + include "../cdlftn.inc" + real angle, rx, ry, txsize + integer nx, ny, x, y, x2, y2, fill, size, color + integer number, radius, xrad, yrad, nannuli, sep + character key + character*64 cmd, str + +C ----------------------------------------------------------------- +C Allocate a 1024x1024 array for pixels. This is the largest frame +C buffer we support in this example task +C ----------------------------------------------------------------- + character pix(1048576) + +C -------------------------------- +C Initialize the parameters to use +C -------------------------------- + color = 205 + size = 10 + fill = 0 + angle = 0.0 + txsize = 1.0 + number = 1 + radius = 11 + xrad = 11 + yrad = 6 + nannuli = 3 + sep = 5 + +C ---------------------------------------------- +C Read a cursor keystroke telling us what to do. +C ---------------------------------------------- +10 call cfreadcursor (0, rx, ry, key, ier) + if (ier .gt. 0) then + write (*,*) 'cfreadCursor: Error return from CDL' + goto 998 + endif + +C ---------------------------------------------------------- +C Round the real cursor position to integer pixel positions. +C ---------------------------------------------------------- + x = nint (rx + 0.5) + y = nint (ry + 0.5) + +C -------------------------------------------------------------- +C Check the keystroke and take the appropriate action. Don't go +C looking for an error condition. +C -------------------------------------------------------------- + +C -------------- +C Colon Commands +C -------------- + if (key .eq. ':') then +C ---------------------------------------------- +C Read a three character command and value field +C ---------------------------------------------- + read (*,'(A3, i4)') cmd, ival + +C ------------------------- +C Process the colon command +C ------------------------- + if (cmd(1:3) .eq. 'ang') then + angle = real (ival) + else if (cmd(1:3) .eq. 'col') then + color = ival + else if (cmd(1:3) .eq. 'fil') then + fill = ival + else if (cmd(1:3) .eq. 'num') then + number = ival + else if (cmd(1:3) .eq. 'nan') then + nannuli = ival + else if (cmd(1:3) .eq. 'lab') then + label = ival + else if (cmd(1:3) .eq. 'sep') then + sep = ival + else if (cmd(1:3) .eq. 'siz') then + size = ival + else if (cmd(1:3) .eq. 'txs') then + txsize = ival + else if (cmd(1:3) .eq. 'xra') then + xrad = ival + else if (cmd(1:3) .eq. 'yra') then + yraf = ival + else if (cmd(1:3) .eq. 'pri') then + call cfreadframebuffer (pix, nx, ny, ier) + call cfprintpix ("lpr", pix, nx, ny, 1, ier) + else if (cmd(1:3) .eq. 'sta') then + print 201, angle, color + print 202, fill, number + print 203, nannuli, sep + print 204, size, txsize + print 205, xrad, yrad + print 206, label +201 format ('angle = ',F5.3, t25, 'color = ',I5) +202 format ('fill = ',I5, t25, 'number = ',I5) +203 format ('nannuli = ',I5, t25, 'sep = ',I5) +204 format ('size = ',I5, t25, 'txsize = ',F5.3) +205 format ('xrad = ',I5, t25, 'yrad = ',I5) +206 format ('fill = ',I5) + endif + +C ------------- +C Point Markers +C ------------- + else if (key .eq. 'p') then + call cfmarkpoint (x, y, 1, size, M_PLUS, color, ier) + else if (key .eq. 'x') then + call cfmarkpoint (x, y, 1, size, M_CROSS, color, ier) + else if (key .eq. '.') then + call cfmarkpoint (x, y, 1, size, M_POINT, color, ier) + else if (key .eq. '*') then + call cfmarkpoint (x, y, 1, size, M_STAR, color, ier) + else if (key .eq. '_') then + call cfmarkpoint (x, y, 1, size, M_HBLINE, color, ier) + else if (key .eq. '|') then + call cfmarkpoint (x, y, 1, size, M_VBLINE, color, ier) + else if (key .eq. 'o') then + call cfmarkpoint (x, y, 1, size, ior(M_CIRCLE,fill), + & color, ier) + else if (key .eq. 's') then + call cfmarkpoint (x, y, 1, size, ior(M_BOX,fill), color, + & ier) + else if (key .eq. 'v') then + call cfmarkpoint (x, y, 1, size, ior(M_DIAMOND,fill), + & color, ier) + +C ------------- +C Other Markers +C ------------- + + else if (key .eq. 'b') then + print '("Hit another key to define the box ....")' + call cfreadcursor (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + call cfmarkbox (x, y, x2, y2, fill, color, ier) + else if (key .eq. 'c') then + print '("Hit another key to set the radius ....")' + call cfreadcursor (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + radius = nint (sqrt (real((x2-x)**2 + (y2-y)**2))) + call cfmarkcircle (x, y, radius, fill, color, ier) + else if (key .eq. 'd') then + call cfdeletemark (x, y, ier) + else if (key .eq. 'e') then + call cfmarkellipse (x, y, xrad, yrad, angle, fill, color, ier) + else if (key .eq. 'l') then + print '("Hit another key to set line endpoint ....")' + call cfreadcursor (0, rx, ry, key, ier) + x2 = nint (rx + 0.5) + y2 = nint (ry + 0.5) + call cfmarkline (x, y, x2, y2, color, ier) + else if (key .eq. 't') then + print '("Test string: ", $)' + read (*,'(A64)') str + call cfmarktext (x, y, str, txsize, angle, color, ier) + else if (key .eq. 'C') then + call cfmarkcircannuli (x, y, radius, nannuli, sep, ier) + else if (key .eq. 'D') then + call cfclearoverlay (ier) + else if (key .eq. 'E') then + call cfmarkellipannuli (x, y, xrad, yrad, angle, nannuli, + & sep, ier) + +C ------------- +C Misc Commands +C ------------- + else if (key .eq. '?') then + call printHelp () + else if (key .eq. 'q') then + goto 998 + endif + +C Loop back until we want to quit + goto 10 + +998 continue + end + + +C ======================================================================= +C = +C PRINTHELP -- Utility subroutine to print a help summary for the task. = +C = +C ======================================================================= + + subroutine printHelp () + print '(" Command Summary")' + print '(" ")' + print '(" :angle <real> - set ellipse or text angle")' + print '(" :color <int> - set marker color")' + print '(" :fill <0|1> - set fill option (zero or one)")' + print '(" :number <int> - set point number")' + print '(" :nannuli <int> - set number of annuli")' + print '(" :label <0|1> - set point label option")' + print '(" :sep <int> - set annuli separation (pixels)")' + print '(" :size <int> - set point marker size")' + print '(" :txsize <real> - set relative text size")' + print '(" :xrad <int> - set ellipse x radius")' + print '(" :yrad <int> - set ellipse y radius")' + print '(" :status - print current settings")' + print '(" :snap <file> - snap frame buffer as EPS to file")' + print '(" :print - print FB to default printer")' + print '(" ")' + print '("Point Markers:")' + print '(" v - diamond mark p - plus mark x - cross mark")' + print '(" . - point mark * - star mark _ - horiz dash")' + print '(" | - vert dash o - circle mark s - square mark")' + print '(" ")' + print '("Misc. Commands")' + print '(" ? - Print Help q - Quit")' + print '(" b - Box c - Circle")' + print '(" d - Delete marker e - Ellipse marker")' + print '(" l - Line t - Text string")' + print '(" C - Circular annuli D - Delete all markers")' + print '(" E - Elliptical annuli")' + print '(" ")' + end diff --git a/vendor/x11iraf/cdl/examples/mosaic.c b/vendor/x11iraf/cdl/examples/mosaic.c new file mode 100644 index 00000000..e31ee264 --- /dev/null +++ b/vendor/x11iraf/cdl/examples/mosaic.c @@ -0,0 +1,219 @@ +#include <stdio.h> +#include <unistd.h> +#include "cdl.h" + +/* MOSAIC -- Example task to demostrate a possible mosaic display + * application. Image names may optionally be drawn on each tile of + * the mosaic by specifying the -label and -color flags. The -pad flag + * can be used to put a space between images, -sample is used to sub- + * sample an image before display. Assumes all images are the same size. + * + * Examples: + * To display four images with a gap in a 1600x1600 frame buffer + * % mosaic -nx 2 -ny 2 -fbconfig 4 -pad 20 foo[1234].imh + * To display a set of images, subsampling each by 4 pixels + * % mosaic -nx 2 -ny 2 -pad -10 -sample 4 foo[1234].imh + * + * Usage: + * mosaic [-fbconfig N] [-frame N] [-color N] [-label] [-nozscale] + * [-raw -xdim N -ydim N -bitpix N [-hskip N] ] + * [-nx N] [-ny N] [-pad N] [-sample N]image1 image2 ..... + */ + +#define ABS(x) (x > 0 ? x : -x) + + +main (argc, argv) +int argc; +char **argv; +{ + CDLPtr cdl; + char *fname = NULL, title[128]; + int i, j, k, status=0, label=0, frame=1, fb=FB_AUTO, zscale=1; + int sample=1, pad=0, col=204, imx=0, imy=0, nimages, nim; + int ii, xinit, rowx, rowy, nnx, nny, fb_w, fb_h, nf, mx, my; + int raw = 0, bitpix=0, hskip=0; + int nx = 1, ny = 1; + float z1, z2; + unsigned char *pix = NULL; + + + /* Process the command line options. */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp (argv[i], "-fbconfig",3) == 0) + fb = atoi (argv[++i]); + else if (strncmp (argv[i], "-frame",3) == 0) + frame = atoi (argv[++i]); + else if (strncmp (argv[i], "-color",3) == 0) + col = atoi (argv[++i]); + else if (strncmp (argv[i], "-label",4) == 0) + label = 1; + else if (strncmp (argv[i], "-nozscale",4) == 0) + zscale = 0; + else if (strncmp (argv[i], "-nx",3) == 0) + nx = atoi (argv[++i]); + else if (strncmp (argv[i], "-ny",3) == 0) + ny = atoi (argv[++i]); + else if (strncmp (argv[i], "-pad",4) == 0) + pad = atoi (argv[++i]); + else if (strncmp (argv[i], "-raw",4) == 0) + raw++; + else if (strncmp (argv[i], "-xdim",4) == 0) + imx = atoi (argv[++i]); + else if (strncmp (argv[i], "-ydim",4) == 0) + imy = atoi (argv[++i]); + else if (strncmp (argv[i], "-bitpix",4) == 0) + bitpix = atoi (argv[++i]); + else if (strncmp (argv[i], "-hskip",4) == 0) + hskip = atoi (argv[++i]); + else if (strncmp (argv[i], "-sample",4) == 0) { + sample = atoi (argv[++i]); + if (sample % 2) { + fprintf (stderr, "ERROR: Sample size must be even\n"); + exit (-1); + } + } else + break; + } + } else { + printf("Usage:\n\tmosaic "); + printf("[-fbconfig N] [-frame N] [-color N] [-label] [-nozscale]"); + printf("\n\t[-raw -xdim N -ydim N -bitpix N [-hskip N] ]"); + printf("\n\t[-nx N] [-ny N] [-pad N] [-sample N] image1 ....\n"); + exit (1); + } + nimages = argc - i; + + + /* Open the package and a connection to the server. */ + if (!(cdl = cdl_open ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* Clear the frame to begin. */ + (void) cdl_clearFrame (cdl); + + /* Loop over each of the images in the list. */ + nim = 0; + rowx = rowy = 0; + nnx = nny = 0; + for (k=0; k < ny && nim < nimages; k++) { + rowy += nny + pad; + for (rowx = xinit, j=0; j < nx && nim < nimages; j++) { + + /* Get the image name for display. */ + fname = argv[i++]; + + /* Figure out what kind of image it is and get the pixels. */ + if (!raw && cdl_isIRAF (fname)) + status = cdl_readIRAF (fname, 1, &pix, &imx, &imy, &bitpix, + title); + else if (!raw && cdl_isFITS (fname)) + status = cdl_readFITS (fname, &pix, &imx, &imy, &bitpix, + title); + else { + if (raw) { + /* It's a raw data array, be sure we have everyting + * we need in order to read it. + */ + if (imx == 0 || imy == 0 || bitpix == 0) { + fprintf(stderr, "ERROR: Use of '-raw' requires "); + fprintf(stderr, "'-xdim', '-ydim' and '-bitpix'\n"); + status = 1; + } else { + FILE *fd; + + /* Open the image file if we can. */ + if (fd = fopen (fname, "r")) { + + /* Seek to the offset specified. */ + lseek (fileno(fd), (off_t) hskip, SEEK_SET); + + /* Allocate the pixel pointer and read data. */ + pix = (pix ? pix : (uchar *) malloc ( + imx*imy*(ABS(bitpix) / 8)) ); + fread (pix, ABS(bitpix)/8, imx*imy, fd); + fclose (fd); + } else + status = 1; + } + } else { + /* Didn't set the raw flag, and we don't know what + * it is....punt. + */ + if (access (fname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\n", + fname); + else + fprintf (stderr, "'%s': image doesn't exist.\n", fname); + status = 1; + } + } + if (status) goto err_; + + /* Compute subsampled image size. */ + if (sample > 1) + nnx = imx / sample, nny = imy / sample; + else + nnx = imx, nny = imy; + + /* Unless we asked for a specific FB size find one large enough + * to handle the mosaic. We don't check to be sure what's + * returned is really large enough. + */ + if (nim == 0 && fb == FB_AUTO) { + cdl_selectFB (cdl, nx*nnx+(pad*(nx-1)), ny*nny+(pad*(ny-1)), + &fb, &fb_w, &fb_h, &nf, 1); + } else { + cdl_setFBConfig (cdl, fb); + cdl_lookupFBSize (cdl, fb, &fb_w, &fb_h, &nf); + } + + /* Define a WCS for the frame. */ + cdl_setWCS (cdl, "image mosaic", "", 1., 0., 0., -1., 0., + (float) ny*imy+(pad*(ny+1)), 1., 255., 1); + + /* The first time through figure out the placement so the + * entire mosaic is centered in the frame. + */ + if (nim == 0) { + mx = (nx * nnx) + pad * (nx-1); + my = (ny * nny) + pad * (ny-1); + rowy = (fb_h - my) / 2; + xinit = rowx = (fb_w - mx) / 2; + } + + /* Compute the zscaled imaged pixels. */ + if (zscale) { + cdl_computeZscale (cdl, pix, imx ,imy, bitpix, &z1, &z2); + printf ("%s: z1=%g z2=%g\n", fname, z1, z2); + cdl_zscaleImage (cdl, &pix, imx ,imy, bitpix, z1, z2); + } + + /* Subsample the image if requested. */ + if (sample > 1) { + int l, m, n; + + for (l=0, n=0; l < imy; l+=sample) + for (m=0; m < imx; m+=sample) + pix[n++] = pix[(l*imx)+m]; + } + + /* Write the image to the frame buffer. */ + if (cdl_writeSubRaster (cdl, rowx, rowy, nnx, nny, pix)) + goto err_; + + /* Draw the image name as a label. */ + if (label) + cdl_markText (cdl, rowx+10, rowy+10, fname, 1., 0., col); + + nim++; + rowx += nnx + pad; + } + } + + /* Close the package and clean up. */ +err_: cdl_close (cdl); + free ( (char *) pix); + exit (status); +} diff --git a/vendor/x11iraf/cdl/examples/tvmark.c b/vendor/x11iraf/cdl/examples/tvmark.c new file mode 100644 index 00000000..db4413ce --- /dev/null +++ b/vendor/x11iraf/cdl/examples/tvmark.c @@ -0,0 +1,397 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <math.h> +#include "cdl.h" + +/* + * TVMARK -- Example task for displaying an marking images. This program + * can be used to either display an image and overlay points defined in + * a coordinate file, map an existing display frame for marking, or option- + * ally enter a cursor command loop after either of these providing other + * marking capability. All options support minimum match. + * + * Examples: + * % tvmark dpix.fits + * % tvmark -coords coords -color 205 dpix.fits + * % tvmark -frame 2 + * % tvmark -coords coords -interactive dpix.fits + * + * Usage: + * tvmark [-frame N] [-fbconfig N] [-coords <file>] [-size N] [-color N] + * [-nolabel] [-fill] [-interactive] [image] + */ + + +static void tvmInteractive(), tvmPrintHelp(); + +#define SZ_NAME 128 + + +/* typedef unsigned char uchar; */ /* Defined in 'cdl.h' */ + + +main (argc, argv) +int argc; +char *argv[]; +{ + CDLPtr cdl; + char *fname = NULL, *cfname = NULL; + int i, status = 0, fill = 0, frame = 1, fb = FB_AUTO, zscale = 1; + int color = 201, label = 1, size = 9, interactive = 0; + float z1, z2; + int fb_w, fb_h, nf; + unsigned char *pix = NULL; + + /* Process the command line options. */ + if (argc > 1) { + for (i=1; i < argc; i++) { + if (strncmp (argv[i], "-color",4) == 0) + color = atoi (argv[++i]); + else if (strncmp (argv[i], "-coords",4) == 0) + cfname = argv[++i]; + else if (strncmp (argv[i], "-fbconfig",3) == 0) + fb = atoi (argv[++i]); + else if (strncmp (argv[i], "-fill",4) == 0) + fill = 1; + else if (strncmp (argv[i], "-frame",3) == 0) + frame = atoi (argv[++i]); + else if (strncmp (argv[i], "-interactive",2) == 0) + interactive = 1; + else if (strncmp (argv[i], "-nolabel",4) == 0) + label = 0; + else if (strncmp (argv[i], "-nozscale",4) == 0) + zscale = 0; + else if (strncmp (argv[i], "-size",2) == 0) + size = atoi (argv[++i]); + else + fname = argv[i]; + } + } + + /* Open the package and a connection to the server. */ + if (!(cdl = cdl_open ((char *)getenv("IMTDEV"))) ) + exit (-1); + + /* If an image was specified display it first, otherwise assume the + * image has already been loaded in the frame and mark that. + */ + if (fname) { + if (cdl_isIRAF (fname)) + status = cdl_displayIRAF (cdl, fname, 1, frame, fb, zscale); + else if (cdl_isFITS (fname)) + status = cdl_displayFITS (cdl, fname, frame, fb, zscale); + else { + if (access (cfname, F_OK) == 0) + fprintf (stderr, "'%s': unknown image format.\n", fname); + else + fprintf (stderr, "'%s': image doesn't exist.\n", fname); + status = 1; + } + if (status) goto err_; + } else { + + /* If we've requested a special frame buffer, set it now. */ + if (fb > 0) + cdl_setFBConfig (cdl, fb); + + /* Map the current display frame for use as an image. */ + cdl_mapFrame (cdl, frame); + } + + /* If a coordinate file was specified read the file and mark those + * coords with points. + */ + if (cfname) + (void) cdl_markCoordsFile (cdl, cfname, M_STAR, size, color, label); + + /* Lastly, start up an interactive cursor loop if needed. */ + if (interactive) + tvmInteractive (cdl, label, fill, color, size); + + /* Close the package and clean up. */ +err_: cdl_close (cdl); + exit (status); +} + + +/* TVMINTERACTIVE -- Process commands interactively. */ + +static void +tvmInteractive (cdl, label, fill, color, size) +CDLPtr cdl; +int label, fill, color, size; +{ + float angle = 0.0, rx, ry, txsize = 1.5, off = 0.5; + int nx, ny, i, x, y, x2, y2, font = F_ROMAN, mag = 3; + int number=1, radius=11, xrad=11, yrad=6, nannuli=3, sep=5; + int linewidth = 1, textwidth = 1, linestyle = 0, wcs = 0; + char key, *cp, cmd[SZ_NAME], str[SZ_NAME]; + unsigned char *pix; + + + /* Process commands until a 'q' keystrke is hit. + */ + while (cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key) != 'q') { + x = (int) (rx + off); /* convert to int pixels */ + y = (int) (ry + off); + + switch (key) { + case ':': /* process a colon command */ + putchar (':'); + fgets (str, 64, stdin); + for (i=0; str[i] != ' ' && str[i]; i++) + cmd[i] = str[i]; + cmd[i++] = '\0'; + + if (strcmp (cmd, "angle") == 0) + angle = atof (&str[i]); + else if (strcmp (cmd, "color") == 0) + color = atoi (&str[i]); + else if (strcmp (cmd, "fill") == 0) + fill = atoi (&str[i]); + else if (strcmp (cmd, "font") == 0) { + switch (str[i]) { + case 'r': font = F_ROMAN; break; + case 'g': font = F_GREEK; break; + case 't': font = F_TIMES; break; + case 'f': font = F_FUTURA; break; + } + cdl_setFont (cdl, font); + } else if (strcmp (cmd, "number") == 0) + number = atoi (&str[i]); + else if (strcmp (cmd, "nannuli") == 0) + nannuli = atoi (&str[i]); + else if (strcmp (cmd, "label") == 0) + label = atoi (&str[i]); + else if (strcmp (cmd, "mag") == 0) + mag = atoi (&str[i]); + else if (strcmp (cmd, "sep") == 0) + sep = atoi (&str[i]); + else if (strcmp (cmd, "size") == 0) + size = atoi (&str[i]); + else if (strcmp (cmd, "txsize") == 0) + txsize = atof (&str[i]); + else if (strcmp (cmd, "radius") == 0) + radius = atoi (&str[i]); + else if (strcmp (cmd, "xrad") == 0) + xrad = atoi (&str[i]); + else if (strcmp (cmd, "yrad") == 0) + yrad = atoi (&str[i]); + else if (strcmp (cmd, "linewidth") == 0 || + strcmp (cmd, "width") == 0) { + linewidth = atoi (&str[i]); + cdl_setLineWidth (cdl, linewidth); + } else if (strcmp (cmd, "linestyle") == 0 || + strcmp (cmd, "style") == 0) { + linestyle = atoi (&str[i]); + cdl_setLineStyle (cdl, linestyle); + } else if (strcmp (cmd, "textwidth") == 0) { + textwidth = atoi (&str[i]); + cdl_setTextWidth (cdl, textwidth); + } else if (strcmp (cmd, "print") == 0) { + cdl_readFrameBuffer (cdl, &pix, &nx, &ny); + cdl_printPix (cdl, NULL, pix, nx, ny, 1); + } else if (strcmp (cmd, "snap") == 0) { + cdl_readFrameBuffer (cdl, &pix, &nx, &ny); + cdl_printPixToFile (cdl, &str[i], pix, nx, ny, 1); + } else if (strcmp (cmd, "status") == 0) { + printf ("angle = %-5.3g\tcolor = %d\t",angle, color); + printf ("fill = %-5d\tnumber = %d\n",fill, number); + printf ("nannuli = %-5d\tsep = %d\t",nannuli, sep); + printf ("size = %-5d\ttxsize = %g\n",size, txsize); + printf ("xrad = %-5d\tyrad = %d\t",xrad, yrad); + printf ("label = %-5d\tfont = %d\n",label, font); + printf ("linewidth = %-5d\tmag = %d\n",linewidth, mag); + printf ("textwidth = %-5d\tstyle = %d\n", + textwidth, linestyle); + } + break; + + case '?': + tvmPrintHelp (); + break; + + case 'p': /* plus mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_PLUS, color); + break; + case 'x': /* cross mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_CROSS, color); + break; + case '.': /* point mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_POINT, color); + break; + case '*': /* star mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_STAR, color); + break; + case '_': /* horiz dash mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_HBLINE, color); + break; + case '|': /* vert dash mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_VBLINE, color); + break; + case 'o': /* circle mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_CIRCLE|fill, color); + break; + case 's': /* square mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_BOX|fill, color); + break; + case 'v': /* diamond mark */ + cdl_markPoint (cdl, x, y, (label ? number++ : 0), size, + M_DIAMOND|fill, color); + break; + + case 'b': /* Box */ + printf ("Hit another key to define the box...\n"); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + off); y2 = (int) (ry + off); + cdl_markBox (cdl, x, y, x2, y2, fill, color); + break; + case 'c': /* Circle */ + /* + printf ("Hit another key to set radius ...\n"); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + off); y2 = (int) (ry + off); + radius = (int) sqrt ((double) ((x2-x)*(x2-x) + (y2-y)*(y2-y))); + */ + cdl_markCircle (cdl, x, y, radius, fill, color); + break; + case 'd': /* Delete marker */ + cdl_deleteMark (cdl, x, y); + break; + case 'e': /* Ellipse */ + cdl_markEllipse (cdl, x, y, xrad, yrad, angle, fill, color); + break; + case 'l': /* Line */ + printf ("Hit another key to set line endpoint...\n"); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + off); y2 = (int) (ry + off); + cdl_markLine (cdl, x, y, x2, y2, color); + break; + case 't': /* Text string */ + printf ("Text string: "); + fgets (str, 64, stdin); + for (cp = (char *)str; *cp != NULL && (char)*cp != '\n'; cp++) + ; + *cp = '\0'; + cdl_markText (cdl, x, y, str, txsize, angle, color); + break; + case 'C': /* Circular annuli */ + cdl_markCircAnnuli (cdl, x, y, radius, nannuli, sep, color); + break; + case 'D': /* Delete all markers */ + cdl_clearOverlay (cdl); + break; + case 'E': /* Elliptical annuli */ + cdl_markEllipAnnuli (cdl, x, y, xrad, yrad, angle, nannuli, + sep, color); + break; + case 'P': /* Polygon */ + break; + + + case 'z': + /* A more complex example to display a rectangular region + * 'size' pixels wide to an area 'mag' times bigger on each + * side. The first keystroke in the center of the zoomed + * region, the second is the center of the magnified area. + * Corners are connected and boxes drawn around each area. + * An expensive oepration but you can a cute result. + */ + printf ("Hit another key to position zoomed raster...\n"); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + x2 = (int) (rx + off); y2 = (int) (ry + off); + + { register int i, j, ii, jj; + int llx = x - size / 2, lly = y - size / 2, + urx = x + size / 2, ury = y + size / 2; + int zllx = x2 - (mag*size) / 2, zlly = y2 - (mag*size) / 2, + zurx = x2 + (mag*size) / 2, zury = y2 + (mag*size) / 2; + uchar *ras = (uchar *) malloc (size*size); + uchar *zoom = (uchar *) malloc ((mag*size)*(mag*size)); + uchar *rp, *zp, *line; + + /* Read the image pixels and magnify it. */ + cdl_readSubRaster (cdl, llx, lly, size, size, &ras); + rp = ras, zp = zoom; + for (i=0; i < size; i++) { + line = ras + i * size; + for (ii=0; ii < mag; ii++) { + for (j=0; j < size; j++) { + for (jj=0; jj < mag; jj++) + *zp++ = *rp; + rp++; + } + rp = line; + } + } + + /* Draw a box around the zoom area and connect the corners + * to the zoomed subraster. */ + cdl_markBox (cdl, llx, lly, urx, ury, 0, color); + cdl_markLine (cdl, llx, lly, zllx, zlly, color); + cdl_markLine (cdl, llx, ury, zllx, zury, color); + cdl_markLine (cdl, urx, lly, zurx, zlly, color); + cdl_markLine (cdl, urx, ury, zurx, zury, color); + + /* Now draw the magnified raster and put a box around it.*/ + cdl_writeSubRaster (cdl,zllx,zlly,mag*size,mag*size,zoom); + cdl_markBox (cdl, zllx, zlly, zurx, zury, 0, color); + } + + default: + break; + } + } +} + + +/* TVMPRINTHELP -- Print a help summary. */ + +static void +tvmPrintHelp () +{ + printf ("\t\t\tCommand Summary\n"); + printf ("\n"); + printf (" :angle <real> - set ellipse of text rotation angle\n"); + printf (" :color <int> - set marker color\n"); + printf (" :fill <0|1> - set fill option (zero or one)\n"); + printf (" :font <font> - set text font (roman, greek, times)\n"); + printf (" :number <int> - set point number\n"); + printf (" :nannuli <int> - set number of annuli\n"); + printf (" :label <0|1> - set point label option\n"); + printf (" :linewidth <int> - set line width\n"); + printf (" :linestyle <int> - set line style\n"); + printf (" :textwidth <int> - set text width\n"); + printf (" :mag <val> - set magnify value for 'z' keystroke\n"); + printf (" :sep <int> - set annuli separation (pixels)\n"); + printf (" :size <int> - set point marker size\n"); + printf (" :txsize <real> - set relative text size\n"); + printf (" :xrad <int> - set ellipse x radius\n"); + printf (" :yrad <int> - set ellipse y radius\n"); + printf (" :status - print current settings\n"); + printf (" :snap <file> - snap frame buffer as EPS to file\n"); + printf (" :print - print frame buffer to default printer\n"); + printf ("\n"); + printf ("Point Markers:\n"); + printf (" v - diamond mark \tp - plus mark \t\tx - cross mark\n"); + printf (" . - point mark \t* - star mark \t\t_ - horiz dash mark\n"); + printf (" | - vert dash mark o - circle mark \ts - square mark\n"); + printf ("\n"); + printf ("Misc. Commands\n"); + printf (" ? - Print Help \tq - Quit\n"); + printf (" b - Box\t\tc - Circle\n"); + printf (" d - Delete marker\te - Ellipse marker\n"); + printf (" l - Line\t\tt - Text string\n"); + printf (" C - Circular annuli D - Delete all markers\n"); + printf (" E - Elliptical annuli\n"); + printf (" z - zoom in on region\n"); +} diff --git a/vendor/x11iraf/cdl/imd.c b/vendor/x11iraf/cdl/imd.c new file mode 100644 index 00000000..e1630ac3 --- /dev/null +++ b/vendor/x11iraf/cdl/imd.c @@ -0,0 +1,2095 @@ +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <sys/file.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <sys/un.h> +#include <netdb.h> +#include <fcntl.h> +#include <stdio.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + + +/* + * IMAGE DISPLAY -- The image display interface is responsible for actually + * displaying an image to the server, for reading back a raster from the + * server, and cursor positioning. This is a mid-level interface for + * handling the steps necessary for image display operations without dealing + * directly with the details of communicating with the server. + * + * imd = imd_open (imtdev) + * imd_displayImage (imd, pix, nx, ny, frame, fbconfig, comp_wcs) + * imd_readCursor (imd, sample, &x, &y, &wcs, &key) + * imd_[set|get]WCS (imd, name, title, a, b, c, d, tx, ty, z1, z2, zt) + * imd_[set|get]Mapping (imd, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) + * imd_close (imd) + * + * Low Level Procedures + * -------------------- + * imd_writeImage (imd, pix, nx, ny, lx, ly) + * imd_readImage (imd, &pix, &nx, &ny) + * imd_readFrameBuffer (imd, &pix, &nx, &ny) + * imd_setFrame (imd, frame) + * imd_setFBConfig (imd, configno) + * imd_getFBConfig (imd, &configno, &width, &height, &nframes)) + * imd_setName (imd, name) + * imd_setTitle (imd, title) + * imd_setCursor (imd, x, y, wcs) + * imd_clearFrame (imd) + * imd_writeSubRaster (imd, lx, ly, nx, ny, pix) + * imd_readSubRaster (imd, lx, ly, nx, ny, &pix) + * + * We leave it to the higher level procedures to handle Z-scale trans- + * formations, spatial scaling, and high level image I/O. All display pixels + * are assumed to be scaled to 8-bits already. + */ + +/* Function prototypes */ +#ifdef __STDC__ +#include <stddef.h> +#include <stdlib.h> +#endif + +#define SZ_BLOCK 16384 + +/* Types of coordinate and greyscale transformations. */ +#define W_UNITARY 0 /* values map without change */ +#define W_LINEAR 1 /* linear mapping */ +#define W_LOG 2 /* logarithmic mapping */ +#define W_USER 3 /* user transformation */ + +/* Connection types. */ +#define UNIX 10 +#define INET 11 +#define FIFO 12 + +/* Default Values. */ +#define DEF_FBCONFIG 1 /* default frame buffer config */ +#define DEF_OSDEV_1 "unix:/tmp/.IMT%d" +#define DEF_OSDEV_2 "fifo:/dev/imt1i:/dev/imt1o" + +/* Frame buffer configuration file definitions. */ +#define FBCONFIG_1 ".imtoolrc" +#define FBCONFIG_2 "/usr/local/lib/imtoolrc" +#define FBCONFIG_ENV1 "imtoolrc" +#define FBCONFIG_ENV2 "IMTOOLRC" +#define DEF_FRAME_WIDTH 512 +#define DEF_FRAME_HEIGHT 512 + + +int imd_debug = 0; /* deug flag */ +char buf[SZ_LINE]; /* temp buffer */ + + +#ifdef ANSI_FUNC + +static int imd_writeLine(IMDPtr imd, uchar *pix, int nbytes, int x, int y); +static int imd_readLine(IMDPtr imd, uchar *pix, int nbytes, int x, int y); +static int imd_writeRawBuf(IMDPtr imd, uchar *pix, int nbytes, int x, int y, int nx, int ny); +static int imd_readRawBuf(IMDPtr imd, uchar *pix, int nbytes, int x, int y, int nx, int ny); +static IMDPtr imd_initialize(int fdin, int fdout, int domain); +static int imd_parseImtdev(char *imtdev, char *unixaddr, unsigned short *host_port, unsigned long *host_addr, char *ififo, char *ofifo); +static int imd_loadImtoolrc(IMDPtr imd); +static int imd_getstr(char **ipp, char *obuf, int maxch); +static void imd_minmax(uchar *pix, int nbytes, int *pmin, int *pmax); +static int imd_wcsVersion (IMDPtr imd); + +#else + +static IMDPtr imd_initialize(); +static int imd_writeLine(), imd_readLine(); +static int imd_writeRawBuf(), imd_readRawBuf(); +static int imd_parseImtdev(), imd_loadImtoolrc(), imd_getstr(); +static int imd_writeLine(), imd_readLine(), imd_wcsVersion(); +static void imd_minmax(); + +#endif + +#ifndef __STDC__ + char *getenv(); +#endif + + + +/* IMD_OPEN -- Open a connection to the display server. The caller may + * either specify a connection at device open time, or the procedure will + * attempt to first connect on a unix socket or fifo pipe if that fails. + * The syntax for the imtdev argument is as follows: + * + * <domain> : <address> + * + * where <domain> is one of "inet" (internet tcp/ip socket), "unix" (unix + * domain socket) or "fifo" (named pipe). The form of the address depends + * upon the domain, as illustrated in the examples below. + * + * inet:5137 Server connection to port 5137 on the local + * host. For a client, a connection to the + * given port on the local host. + * + * inet:5137:foo.bar.edu Client connection to port 5137 on internet + * host foo.bar.edu. The dotted form of address + * may also be used. + * + * unix:/tmp/.IMT212 Unix domain socket with the given pathname + * IPC method, local host only. + * + * fifo:/dev/imt1i:/dev/imt1o FIFO or named pipe with the given pathname. + * IPC method, local host only. Two pathnames + * are required, one for input and one for + * output, since FIFOs are not bidirectional. + * For a client the first fifo listed will be + * the client's input fifo; for a server the + * first fifo will be the server's output fifo. + * This allows the same address to be used for + * both the client and the server, as for the + * other domains. + * + * The address field may contain up to two "%d" fields. If present, the + * user's UID will be substituted (e.g. "unix:/tmp/.IMT%d"). The default + * connection if no imtdev is specified is "unix:/tmp/.IMT%d", failing that, + * a connection is attempted on the /dev/imt1[io] named fifo pipes. + */ + +#ifdef ANSI_FUNC + +IMDPtr +imd_open ( + char *imtdev /* connection type */ +) +#else + +IMDPtr +imd_open (imtdev) +char *imtdev; /* connection type */ +#endif +{ + IMDPtr imd; + int domain, fd, fdin, fdout, free_imtdev=0, model; + unsigned short host_port; + unsigned long host_addr; + char unixaddr[SZ_NAME]; + char input_fifo[SZ_NAME], output_fifo[SZ_NAME]; + + + if (imtdev == NULL) { + struct sockaddr_un sockaddr; + + /* Try first to connect on a unix socket. */ + if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { + imtdev = DEF_OSDEV_2; + if (imd_debug) + printf ("Can't get unix socket...\n"); + goto retry; + } + + /* Compose network address. */ + bzero ((char *)&sockaddr, sizeof(sockaddr)); + sockaddr.sun_family = AF_UNIX; + sprintf (sockaddr.sun_path, "/tmp/.IMT%d", (int)getuid()); + + if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr))<0){ + close (fd); + imtdev = DEF_OSDEV_2; + if (imd_debug) + printf ("Can't connect to socket '%s'\n",sockaddr.sun_path); + goto retry; /* no connection */ + } else { + imtdev = (char *) calloc (SZ_IMTDEV, sizeof(char)); + free_imtdev++; + strcpy (imtdev, sockaddr.sun_path); + fdin = fdout = fd; + } + model = DEF_MODEL; + + } else { +retry: domain = imd_parseImtdev (imtdev, unixaddr, &host_port, &host_addr, + input_fifo, output_fifo, &model); + + switch (domain) { + case FIFO: + /* Open the fifos. */ + if ((fdin = open (input_fifo, O_RDONLY|O_NDELAY)) != ERR) + fcntl (fdin, F_SETFL, O_RDONLY); + if ((fdout = open (output_fifo, O_WRONLY|O_NDELAY)) != ERR) + fcntl (fdout, F_SETFL, O_WRONLY); + + /* Clean up if there is an error. */ + if (fdin < 0 || fdout < 0) { + (void) close (fdin); + (void) close (fdout); + if (imd_debug) + printf ("Can't connect to fifo '%s'\n",input_fifo); + goto err; + } + break; + + case UNIX: + { struct sockaddr_un sockaddr; + + /* Try first to connect on a unix socket. */ + if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { + if (imd_debug) + printf ("Can't get unix socket...\n"); + goto err; + } + + /* Compose network address. */ + bzero ((char *)&sockaddr, sizeof(sockaddr)); + sockaddr.sun_family = AF_UNIX; + strcpy (sockaddr.sun_path, unixaddr); + + if (connect(fd, (struct sockaddr *)&sockaddr, + sizeof(sockaddr))<0){ + close (fd); + if (imd_debug) + printf ("Can't connect to socket '%s'\n", + sockaddr.sun_path); + goto err; /* no connection */ + } else + fdin = fdout = fd; + } + break; + + case INET: + { struct sockaddr_in sockaddr; + + /* Get socket. */ + if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { + if (imd_debug) + printf ("Can't get inet socket...\n"); + goto err; + } + + /* Compose network address. */ + bzero ((char *)&sockaddr, sizeof(sockaddr)); + sockaddr.sin_family = AF_INET; + sockaddr.sin_port = host_port; + bcopy ((char *)&host_addr, (char *)&sockaddr.sin_addr, + sizeof(host_addr)); + + /* Connect to server. */ + if (connect (fd, (struct sockaddr *)&sockaddr, + sizeof(sockaddr)) < 0) { + close (fd); + if (imd_debug) + printf ("Can't connect to socket '%s'\n", + (char *)sockaddr.sin_addr.s_addr); + goto err; + } else + fdin = fdout = fd; + } + break; + + default: + goto err; + } + } + + /* Allocate and initialize imd structure. */ + imd = imd_initialize (fdin, fdout, domain, model); + + + if (imd_debug) + fprintf (stderr, "Connection established on '%s'\n", imtdev); + if (free_imtdev) + free ((char *)imtdev); + return (imd); + +err: + fprintf (stderr, "Cannot open server connection on '%s'.\n", imtdev); + if (free_imtdev) + free ((char *)imtdev); + return NULL; +} + + +/* IMD_DISPLAYIMAGE -- Display an image to the server, setting the WCS and + * frame as needed. This is a high-level procedure used to make image + * display easy. It is assumed that the pixel array has already been scaled + * to 8-bits. + */ + +int +imd_displayImage (imd, pix, nx, ny, frame, fbconfig, comp_wcs) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixels to display */ +int nx, ny; /* dimensions */ +int frame; /* frame to display */ +int fbconfig; /* fb config number */ +int comp_wcs; /* compute a WCS */ +{ + register uchar *ip = pix; + register uchar *bp, *pp; + register int i, nnx = nx, nny = ny; + int status, use_subras = 0; + int pmin, pmax, x_off = 0, y_off = 0, lx, ly; + int fbwidth = imd->fbtab[fbconfig-1]->width; + int fbheight = imd->fbtab[fbconfig-1]->height; + int imd_writeImage(); + + if (imd_debug) + printf ("[imd_displayImage] frame=%d fb=%d->[%d,%d] %dx%d bytes\n", + frame, fbconfig, fbwidth, fbheight, nx, ny); + + imd_setFrame (imd, frame); /* select frame */ + imd_clearFrame (imd); /* erase frame */ + imd_setFBConfig (imd, fbconfig); /* set fbconfig */ + + /* Check to see if the image to be displayed is larger than the + * current frame buffer. If so we'll need to pull out a subraster + * the size of the FB for display. + */ + if (nx > fbwidth || ny > fbheight) { + nnx = min(nx, fbwidth); /* get new dimensions */ + nny = min(ny, fbheight); + bp = ip = (uchar *) calloc (nnx * nny, sizeof (uchar)); + use_subras++; + + /* Pull out the subraster for display */ + x_off = (nx>fbwidth ? ((nx - fbwidth) / 2 - 1) : 0); + y_off = (ny>fbheight ? ((ny - fbheight) / 2 - 1) : 0); + pp = pix + (y_off * nx) + x_off; + for (i=0; i < nny; i++) { + bcopy (pp, bp, nnx); + pp += nx; + bp += nnx; + } + } + + if (imd_debug) + printf("[imd_displayImage] nnx=%d nny=%d xo=%d yo=%d\n", + nnx, nny, x_off, y_off); + + /* Center the placement in user coords. + */ + lx = (fbwidth / 2) - (nnx / 2); + ly = fbheight - ((fbheight / 2) + (nny / 2)); + + /* Compute a WCS for this image if it's not already defined. */ + if (comp_wcs) { + imd->a = 1.0; + imd->b = 0.0; + imd->c = 0.0; + imd->d = -1.0; + imd->tx = (float) (nnx / 2) - (fbwidth / 2) + 1 + (float) x_off; + imd->ty = (float) (fbheight / 2) + (nny / 2) + (float) y_off; + + if (imd->z1 == INDEF || imd->z2 == INDEF) { + imd_minmax (pix, nnx*nny, &pmin, &pmax); + imd->z1 = (imd->z1 == INDEF) ? (float) pmin : imd->z1; + imd->z2 = (imd->z2 == INDEF) ? (float) pmax : imd->z2; + } + imd->ztrans = W_LINEAR; + + /* Initialize the mapping. */ + imd->sx = 1.0; + imd->sy = 1.0; + imd->snx = nnx; + imd->sny = nny; + imd->dx = lx; + imd->dy = ly; + imd->dnx = nnx; + imd->dny = nny; + imd->iis_valid = 1; + + if (imd_setWCS (imd, imd->name, imd->title, imd->a, imd->b, imd->c, + imd->d, imd->tx, imd->ty, imd->z1, imd->z2, imd->ztrans)) + return (ERR); + } + + /* Finally, display the image. + */ + status = imd_writeImage (imd, ip, nnx, nny, lx, ly); + + if (use_subras) + free ((char *)ip); + return (status); +} + + +/* IMD_READCURSOR -- Read the current cursor position. If sample is defined + * logical cursor position will be sampled and returned immediately, otherwise + * the server will block until a key is hit and we return that value as well. + */ + +#ifdef ANSI_FUNC + +int +imd_readCursor ( + IMDPtr imd, /* package pointer */ + int sample, /* wait for keystroke? */ + float *x, + float *y, /* position */ + int *wcs, /* WCS */ + char *key /* keystroke */ +) +#else + +int +imd_readCursor (imd, sample, x, y, wcs, key) +IMDPtr imd; /* package pointer */ +int sample; /* wait for keystroke? */ +float *x, *y; /* position */ +int *wcs; /* WCS */ +char *key; /* keystroke */ +#endif +{ + if (imd_debug) + printf ("[imd_readCursor]\n"); + + return (com_readCursor(imd->datain, imd->dataout, + sample, x, y, wcs, key)); +} + + +/* IMD_SETWCS -- Set the WCS of the screen. The WCS is passed in a string + * defined as: + * Image_Name_String\n a b c d tx ty z1 z2 zt + * where: + * X' = a*X + c*Y + tx + * Y' = b*X + d*Y + ty + * + * z1 is the minimum pixel value, z2 is the maximum pixel value, zt + * defines the type of transformation to use. + */ + +#ifdef ANSI_FUNC + +int +imd_setWCS ( + IMDPtr imd, /* package pointer */ + char *name, /* name string */ + char *title, /* title string */ + float a, + float b, + float c, + float d, /* WCS values */ + float tx, + float ty, /* translation */ + float z1, + float z2, /* zscale values */ + int zt /* transformation type */ +) +#else + +int +imd_setWCS (imd, name, title, a, b, c, d, tx, ty, z1, z2, zt) +IMDPtr imd; /* package pointer */ +char *name; /* name string */ +char *title; /* title string */ +float a, b, c, d; /* WCS values */ +float tx, ty; /* translation */ +float z1, z2; /* zscale values */ +int zt; /* transformation type */ +#endif +{ + int nbytes = 0, status = 0, version = imd->iis_version; + char old_wcs[SZ_OLD_WCSBUF], mapping[SZ_OLD_WCSBUF]; + char wcstext[SZ_WCSBUF]; + + + /* Format the string to set world coordinate parameters. */ + (void) sprintf (old_wcs, "%s%s%s\n%g %g %g %g %g %g %g %g %d\n", + (*name ? name : " "), (title ? " - " : " "), (*title ? title : " "), + a, b, c, d, tx, ty, z1, z2, zt); + + if (imd->iis_version > 0 && imd->iis_valid) { + char *path_prefix, *node, *path; +#ifdef SOLARIS + char *getcwd(); +#else + char *getwd(); +#endif + + path_prefix = (char *) calloc (1025, sizeof(char)); + path = (char *) calloc (512, sizeof(char)); + node = (char *) calloc (512, sizeof(char)); + + + /* Get a node!path prefix for the data file. */ + gethostname (node, SZ_FNAME); + +#ifdef SOLARIS + (void) getcwd (path, 511); +#else + (void) getwd (path); +#endif + if (*name == '/') + (void) sprintf (path_prefix, "%s!%s", node, name); + else + (void) sprintf (path_prefix, "%s!%s/%s", node, path, name); + + (void) sprintf (mapping, "%s %g %g %d %d %d %d %d %d\n%s\n", + (*imd->region ? imd->region : "image"), + imd->sx, imd->sy, imd->snx, imd->sny, + imd->dx, imd->dy, imd->dnx, imd->dny, + (*imd->ref ? imd->ref : path_prefix)); + + (void) sprintf (wcstext, "%s%s", old_wcs, mapping); + + free ((char *)path_prefix); + free ((char *)path); + free ((char *)node); + + } else + (void) strcpy (wcstext, old_wcs); + + + if (imd_debug) { printf ("[imd_setWCS] wcs='%s'\n", wcstext); } + + /* Send the WCS buffer. */ + nbytes = strlen (wcstext) + 1; + status = com_writeWCS (imd->dataout, wcstext, nbytes, version); + + /* Invalidate the mapping once it's been sent. */ + imd->iis_valid = 0; + + return (status); +} + + +#ifdef USE_OLD_GETWCS + +/* IMD_OLDGETWCS -- Get the current display frame WCS information. + */ + +#ifdef ANSI_FUNC + +int +imd_getWCS ( + IMDPtr imd, /* package pointer */ + int wcs, /* WCS number to get */ + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt /* transformation type */ +) +#else + +int +imd_getWCS (imd, wcs, name, title, a, b, c, d, tx, ty, z1, z2, zt) +IMDPtr imd; /* package pointer */ +int wcs; /* WCS number to get */ +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +#endif +{ + int datain = imd->datain; + int dataout = imd->dataout; + int nbytes = 0, version = imd->iis_version; + int tokens, status = 0; + char wcs_info[SZ_WCSBUF]; + + + /* Read the WCS from the server. */ + if (com_readWCS (datain, dataout, wcs_info, &nbytes, wcs, version)) + return (ERR); + + /* Parse the return buffer. */ + name[0] = title[0] = '\0'; + if (version == 0) { + tokens = sscanf (wcs_info, "%[^\n]\n%g%g%g%g%g%g%g%g%d", + buf, a, b, c, d, tx, ty, z1, z2, zt); + if (tokens == EOF) { + /* Had no WCS info, can't even get name, but no error. */ + *a = *b = *c = *d = *tx = *ty = *z1 = *z2 = *zt = 0; + + } else if (tokens < 10) { + /* partial read, something must be wrong. */ + return (ERR); + } + sscanf (buf, "%s - %s", name, title); + } + + if (imd_debug) { + printf ("[imd_getWCS] wcs=%d wcsbuf='%s'\n", wcs, wcsbuf); + } + + return (OK); +} +#endif + + +/* IMD_GETWCS -- Get the current display frame WCS information. + */ + +#ifdef ANSI_FUNC + +int +imd_getWCS ( + IMDPtr imd, /* package pointer */ + int wcs, /* WCS number to get */ + char *name, /* name string */ + char *title, /* title string */ + float *a, + float *b, + float *c, + float *d, /* WCS values */ + float *tx, + float *ty, /* translation */ + float *z1, + float *z2, /* zscale values */ + int *zt /* transformation type */ +) +#else + +int +imd_getWCS (imd, wcs, name, title, a, b, c, d, tx, ty, z1, z2, zt) +IMDPtr imd; /* package pointer */ +int wcs; /* WCS number to get */ +char *name; /* name string */ +char *title; /* title string */ +float *a, *b, *c, *d; /* WCS values */ +float *tx, *ty; /* translation */ +float *z1, *z2; /* zscale values */ +int *zt; /* transformation type */ +#endif +{ + int fbwidth = imd->fbtab[imd->fbconfig-1]->width; + int fbheight = imd->fbtab[imd->fbconfig-1]->height; + int datain = imd->datain; + int dataout = imd->dataout; + int nbytes = 0, version = imd->iis_version; + int tokens, status = 0; + char wcsbuf[SZ_WCSBUF]; + + + /* Read the WCS from the server. */ + if (com_readWCS (datain, dataout, wcsbuf, &nbytes, wcs, version)) + return (ERR); + + if (imd_debug) { + printf ("[imd_getWCS] wcs=%d wcsbuf='%s'\n", wcs, wcsbuf); + } + + /* Attempt to read the WCS and set up a unitary transformation + * if the information cannot be read. + */ + if (sscanf (wcsbuf, "%[^\n]\n%f%f%f%f%f%f%f%f%d", + buf, a, b, c, d, tx, ty, z1, z2, zt) < 7) { + + strcpy (title, "[NO WCS]\n"); + *a = *d = 1; + *b = *c = 0; + *tx = *ty = 0; + *zt = 0; + } else { + if (name == NULL) + name = imd->name; + if (title == NULL) + title = imd->title; + sscanf (buf, "%s - %s", name, title); + } + + /* Now try to read the mapping if we're expecting one, otherwise + * set up a default mapping of the entire frame buffer. + */ + if (imd->iis_version > 0) { + register int i, j; + + /* Skip over the first two lines of WCS data. */ + strcpy (buf, wcsbuf); + for (i=0, j=0; j < 2 && buf[i]; i++) + if (buf[i] == '\n') j++; + + /* Attempt to read the mapping. */ + imd->ref[0] = '\0'; + imd->region[0] = '\0'; + if (sscanf (&buf[i], "%s%f%f%d%d%d%d%d%d\n%s\n", + imd->region, &imd->sx, &imd->sy, &imd->snx, &imd->sny, + &imd->dx, &imd->dy, &imd->dnx, &imd->dny, imd->ref) < 10) { + + /* Error in the read, set a default. */ + strcpy (imd->region, "none"); + strcpy (imd->ref, "none"); + imd->sx = 1.0; + imd->sy = 1.0; + imd->snx = fbwidth; + imd->sny = fbheight; + imd->dx = 1; + imd->dy = 1; + imd->dnx = fbwidth; + imd->dny = fbheight; + + imd->iis_valid = 0; + return (ERR); + } else + imd->iis_valid = 1; + } + + return (OK); +} + + +/* IMD_SETMAPPING -- Set the mapping information to be sent with the next + * imd_setWcs() call. + */ +#ifdef ANSI_FUNC + +int +imd_setMapping ( + IMDPtr imd, /* package ptr */ + char *region, /* region name */ + float sx, /* source rect */ + float sy, + int snx, /* source extent */ + int sny, + int dx, /* dest rect */ + int dy, + int dnx, /* dest extent */ + int dny, + char *ref /* reference name */ +) +#else + +int +imd_setMapping (imd, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +IMDPtr imd; /* package ptr */ +char *region; /* region name */ +float sx, sy; /* source rect */ +int snx, sny; /* source extent */ +int dx, dy; /* dest rect */ +int dnx, dny; /* dest extent */ +char *ref; /* reference name */ +#endif +{ + if (imd_debug) { + printf ("[imd_setMapping] region='%s' ref='%s'\n", + ( region ? region : ""), (ref ? ref : "")); + printf ("\tsrc = %g,%g%d,%d dest = %d,%d,%d,%d\n", + sx, sy, snx, sny, dx, dy, dnx, dny); + } + + strcpy (imd->region, (region ? region : "")); + strcpy (imd->ref, (ref ? ref : "")); + imd->sx = sx; + imd->sy = sy; + imd->snx = snx; + imd->sny = sny; + imd->dx = dx; + imd->dy = dy; + imd->dnx = dnx; + imd->dny = dny; + + return ((imd->iis_valid = 1)); +} + + +/* IMD_GETMAPPING -- Get the mapping information returned with the last + * imd_getWcs() call. + */ +#ifdef ANSI_FUNC +int +imd_getMapping ( + IMDPtr imd, /* package ptr */ + char *region, /* region name */ + float *sx, /* source rect */ + float *sy, + int *snx, /* source extent */ + int *sny, + int *dx, /* dest rect */ + int *dy, + int *dnx, /* dest extent */ + int *dny, + char *ref /* reference name */ +) + +#else +int +imd_getMapping (imd, region, sx,sy,snx,sny, dx,dy,dnx,dny, ref) +IMDPtr imd; /* package ptr */ +char *region; /* region name */ +float *sx, *sy; /* source rect */ +int *snx, *sny; /* source extent */ +int *dx, *dy; /* dest rect */ +int *dnx, *dny; /* dest extent */ +char *ref; /* reference name */ +#endif +{ + if (imd->iis_valid) { + strcpy (region, imd->region); + *sx = imd->sx; + *sy = imd->sy; + *snx = imd->snx; + *sny = imd->sny; + *dx = imd->dx; + *dy = imd->dy; + *dnx = imd->dnx; + *dny = imd->dny; + strcpy (ref, imd->ref); + } + + if (imd_debug) { + printf ("[imd_getMapping] valid=%d region='%s' ref='%s'\n", + imd->iis_valid, (region ? region : ""), (ref ? ref : "")); + printf ("\tsrc = %g,%g,%d,%d dest = %d,%d,%d,%d\n", + *sx, *sy, *snx, *sny, *dx, *dy, *dnx, *dny); + } + + return (imd->iis_valid); +} + + +/* IMD_CLOSE -- Close the connection to the display server. + */ + +#ifdef ANSI_FUNC + +int +imd_close ( + IMDPtr imd /* package pointer */ +) +#else + +int +imd_close (imd) +IMDPtr imd; /* package pointer */ +#endif +{ + if (imd_debug) + printf ("[imd_close]\n"); + + if (imd) { + register int i; + + /* Close the connection. */ + if (imd->datain) + close (imd->datain); + if (imd->dataout) + close (imd->dataout); + + /* Free the frame buffer configuration table. */ + for (i=0; i < MAX_FBCONFIG; i++) + free ((char *)imd->fbtab[i]); + + /* Free the pointers in the imd structure. */ + free (imd->title); + free (imd->name); + free (imd->region); + free (imd->ref); + free (imd); + } + + return (OK); +} + + +/* -------------------- + * Low-Level Procedures + * --------------------*/ + +/* IMD_WRITEIMAGE -- Display a raw pixel array to the server given the array + * dimensions, and a location. We use this instead of imd_writeSubRaster() + * since we can assume the frame is blank and we wish to avoid the overhead + * having to read back the frame buffer. The image corner position is given + * in user coords where the [0,0] origin is in the LL of the display window, + * we convert this to frame buffer coords where the origin is in the UL. + */ + +int +imd_writeImage (imd, pix, nx, ny, llx, lly) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixels to display */ +int nx, ny; /* dimensions */ +int llx, lly; /* LL corner of image */ +{ + register int i, j, k, y, nbytes, nl = ny, imline; + register int nnx = nx, nny = ny, block_has_data = 0; + register uchar *ip = pix; + register uchar *bp, *block, *ep; + register int lx, ly, nblocks, lines_per_block, fbline; + int x_off = 0, y_off = 0; + int fbwidth = imd->fbtab[imd->fbconfig-1]->width; + int fbheight = imd->fbtab[imd->fbconfig-1]->height; + + + /* Check to see if the image to be displayed is larger than the + * current frame buffer. + */ + if (nx > fbwidth || ny > fbheight) { + nnx = min(nx, fbwidth); /* get new dimensions */ + nny = min(ny, fbheight); + x_off = (nx>fbwidth ? ((nx - fbwidth) / 2 - 1) : 0); + y_off = (ny>fbheight ? ((ny - fbheight) / 2 - 1) : 0); + } + + /* Now see whether the image extends over the boundaries of the + * frame buffer in any direction. If so we'll set up to write + * only those pixels on the frame buffer. + */ + if (llx < 0) { /* image is left of frame */ + x_off = -llx; + nnx = nx + llx; + } + if (lly < 0) { /* image is below frame */ + y_off = -lly; + nny = ny + lly; + } + if ((llx + nx) > fbwidth) /* image overflows frame to right */ + nnx = fbwidth - llx; + if ((lly + ny) > fbheight) /* image overflows frame at top */ + nny = fbheight - lly; + ip = pix + (y_off * nx) + x_off; + + /* Convert corner position to frame buffer coords. */ + lx = max (0, llx); + ly = min (fbheight - 1, fbheight - lly - 1); + + /* Compute the corner points in user units. */ + imd->xs = llx; + imd->xe = llx + nnx - 1; + imd->ys = lly; + imd->ye = lly + nny - 1; + + if (imd_debug) { + printf("[imd_writeImage] %dx%d bytes at [%d,%d] of [%d,%d]\n", + nx, ny, lx, ly, fbwidth, fbheight); + printf("[imd_writeImage] Xends = [%d,%d] Yends = [%d,%d]\n", + imd->xs, imd->xe, imd->ys, imd->ye); + printf("[imd_writeImage] nnx=%d nny=%d llx=%d lly=%d xo=%d yo=%d\n", + nnx, nny, llx, lly, x_off, y_off); + imd_debug = 1; + } + + /* Display image. */ + lines_per_block = (int) (SZ_BLOCK / fbwidth); + nblocks = (int) (fbheight / lines_per_block); + nbytes = fbwidth * lines_per_block; + block = (uchar *) calloc (nbytes, sizeof (uchar)); + + if (imd_debug) { + printf ("height=%d nblocks=%d lines/block=%d\n", + fbheight, nblocks, lines_per_block); + } + + /* For each of the blocks we're sending.... */ + fbline = fbheight - 1; + imline = ly; + ep = ip + nx * ny; + for (i=0, y = fbheight - lines_per_block; i < nblocks; i++) { + bp = block + (lines_per_block - 1) * fbwidth; + block_has_data = 0; + + if (nnx != fbwidth || nny != fbheight) + /* Clear the block array */ + for (k=0; k < nbytes; k++) + block[k] = 0; + + /* Map image pixels to the data block. */ + for (j=0; j < lines_per_block && nl >= 0; j++) { + if (fbline == imline && ip < ep) { + block_has_data = 1; + bcopy (ip, bp+lx, nnx); + ip += nx; + imline--; + nl--; + } + bp -= fbwidth; + fbline--; + } + + if (block_has_data) + if (imd_writeLine(imd, block, nbytes, 0, y)) + return (ERR); + y -= lines_per_block; + } + + /* Now take care of any remaining pixels in the frame buffer. */ + nbytes = (fbwidth * fbheight) - (nblocks * nbytes); + if (nbytes && nl >= 0) { + lines_per_block = nbytes / fbwidth; + bp = block + (lines_per_block - 1) * fbwidth; + + if (nnx != fbwidth || nny != fbheight) { + /* Clear the block array */ + for (k=0; k < nbytes; k++) + block[k] = 0; + } + + /* Map image pixels to the data block. */ + if (nl >= 0) { + for (j=0; j < lines_per_block && nl >= 0; j++) { + if (fbline == imline) { + bcopy (ip, bp+lx, nnx); + ip += nx; + imline--; + nl--; + } + bp -= fbwidth; + fbline--; + } + if (imd_writeLine(imd, block, nbytes, 0, 0)) + return (ERR); + } + } + + free ((char *)block); + return (OK); +} + + +/* IMD_READIMAGE -- Read the currently displayed image and return a pointer to + * the array and it's dimensions. Since we know where the image was written + * in the frame buffer this is really just a large subregion read. + */ + +int +imd_readImage (imd, pix, nx, ny) +IMDPtr imd; /* package pointer */ +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +{ + *nx = (imd->xe - imd->xs + 1); + *ny = (imd->ye - imd->ys + 1); + + if (imd_debug) + printf ("[imd_readImage] nx=%d ny=%d at [%d,%d]\n", + *nx, *ny, imd->xs, imd->ys); + + /* Read the image region buffer. */ + if (!pix) + pix = (uchar *) malloc ((*nx) * (*ny)); + return (imd_readSubRaster(imd, imd->xs, imd->ys, *nx, *ny, pix)); +} + + +/* IMD_READFRAMEBUFFER -- Read the contents of the entire frame buffer and + * return a pointer to the array and it's dimensions. + */ + +int +imd_readFrameBuffer (imd, pix, nx, ny) +IMDPtr imd; /* package pointer */ +uchar *pix; /* image pixels (output)*/ +int *nx, *ny; /* dimensions (output) */ +{ + if (imd_debug) + printf ("[imd_readFrameBuffer]\n"); + + *nx = imd->fbtab[imd->fbconfig-1]->width; + *ny = imd->fbtab[imd->fbconfig-1]->height; + + if (imd_debug) + printf ("[imd_readFrameBuffer] nx=%d ny=%d at [%d,%d]\n", + *nx, *ny, 0, 0); + + /* Read the frame buffer. */ + if (!pix) + pix = (uchar *) malloc ((*nx) * (*ny)); + return (imd_readSubRaster(imd, 0, 0, *nx, *ny, pix)); +} + + +/* IMD_SETFRAME -- Set the current display frame. + */ + +#ifdef ANSI_FUNC + +int +imd_setFrame ( + IMDPtr imd, /* package pointer */ + int frame /* frame number */ +) +#else + +int +imd_setFrame (imd, frame) +IMDPtr imd; /* package pointer */ +int frame; /* frame number */ +#endif +{ + if (imd_debug) + printf ("[imd_setFrame] frame = %d\n", frame); + + imd->frame = frame; + return (com_setFrame (imd->dataout, imd->frame)); +} + + +/* IMD_SETFBCONFIG -- Select the frame buffer configuration. + */ + +#ifdef ANSI_FUNC + +int +imd_setFBConfig ( + IMDPtr imd, /* package pointer */ + int configno /* frame config number */ +) +#else + +int +imd_setFBConfig (imd, configno) +IMDPtr imd; /* package pointer */ +int configno; /* frame config number */ +#endif +{ + if (imd_debug) + printf ("[imd_setFBConfig] config = %d\n", configno); + + imd->fbconfig = configno; + return (com_setFBConfig (imd->dataout, imd->fbconfig)); +} + + +/* IMD_GETFBCONFIG -- Get the current frame buffer config info used by the + * the interface. + */ + +#ifdef ANSI_FUNC + +int +imd_getFBConfig ( + IMDPtr imd, /* package pointer */ + int *configno, /* frame config number */ + int *width, + int *height, /* frame buffer size */ + int *nframes /* number of frames */ +) +#else + +int +imd_getFBConfig (imd, configno, width, height, nframes) +IMDPtr imd; /* package pointer */ +int *configno; /* frame config number */ +int *width, *height; /* frame buffer size */ +int *nframes; /* number of frames */ +#endif +{ + *configno = imd->fbconfig; + *width = imd->fbtab[imd->fbconfig-1]->width; + *height = imd->fbtab[imd->fbconfig-1]->height; + *nframes = imd->fbtab[imd->fbconfig-1]->nframes; + if (imd_debug) + printf ("[imd_getFBConfig] config=%d w=%d h=%d nf=%d\n", + *configno, *width, *height, *nframes); + + return (com_setFBConfig (imd->dataout, imd->fbconfig)); +} + + +/* IMD_SETNAME -- Set the current image name (for the WCS string); + */ + +#ifdef ANSI_FUNC + +int +imd_setName ( + IMDPtr imd, /* package pointer */ + char *name /* image name */ +) +#else + +int +imd_setName (imd, name) +IMDPtr imd; /* package pointer */ +char *name; /* image name */ +#endif +{ + if (imd_debug) + printf ("[imd_setName] Name = %s\n", name); + + strcpy (imd->name, name); + return (OK); +} + + +/* IMD_SETTITLE -- Set the current image title (for the WCS string) + */ + +#ifdef ANSI_FUNC + +int +imd_setTitle ( + IMDPtr imd, /* package pointer */ + char *title /* image title */ +) +#else + +int +imd_setTitle (imd, title) +IMDPtr imd; /* package pointer */ +char *title; /* image title */ +#endif +{ + if (imd_debug) + printf ("[imd_setTitle] title = %s\n", title); + + strcpy (imd->title, title); + return (OK); +} + + +/* IMD_SETCURSOR -- Set the image cursor position. + */ + +#ifdef ANSI_FUNC + +int +imd_setCursor ( + IMDPtr imd, /* package pointer */ + int x, + int y, /* position */ + int wcs /* cursor wcs */ +) +#else + +int +imd_setCursor (imd, x, y, wcs) +IMDPtr imd; /* package pointer */ +int x, y; /* position */ +int wcs; /* cursor wcs */ +#endif +{ + if (imd_debug) + printf ("[imd_setCursor] position = [%d,%d]\n", x, y); + + /* need to convert to frame coords? */ + + return (com_setCursor(imd->dataout, x, y, wcs)); +} + + +/* IMD_CLEARFRAME -- Clear the current display frame. + */ + +#ifdef ANSI_FUNC + +int +imd_clearFrame ( + IMDPtr imd /* package pointer */ +) +#else + +int +imd_clearFrame (imd) +IMDPtr imd; /* package pointer */ +#endif +{ + if (imd_debug) + printf ("[imd_eraseFrame]\n"); + + return (com_eraseFrame(imd->dataout)); +} + + +/* IMD_READSUBRASTER -- Read a rectangular region of the frame buffer. + */ + +int +imd_readSubRaster (imd, llx, lly, nx, ny, pix) +IMDPtr imd; /* package pointer */ +int llx, lly; /* region corner */ +int nx, ny; /* dimensions */ +uchar *pix; /* image pixels (output)*/ +{ + register int i, j, nl, y, nbytes, lx, ly; + register uchar *ip = NULL, *bp = NULL, *block = NULL; + register int nblocks, lines_per_block; + register int nnx = nx, nny = ny, x_off = 0, y_off = 0; + int fbwidth = imd->fbtab[imd->fbconfig-1]->width; + int fbheight = imd->fbtab[imd->fbconfig-1]->height; + + + /* Make sure we've got a reasonable request. */ + if (nx > fbwidth || ny > fbheight) { + fprintf (stderr, + "Error: attempt to read raster larger than display.\n"); + return (ERR); + } + + /* Now see whether the raster extends over the boundaries of the + * frame buffer in any direction. If so we'll clip the raster to + * write only those pixels on the frame buffer. + */ + + if (-llx > imd->xs) { /* raster overflows bottom */ + x_off = -llx + imd->xs; + nnx = nx - x_off; + } + if (-lly > imd->ys) { /* raster overflows left */ + y_off = -lly + imd->ys; + nny = ny - y_off; + } + if ((llx + nx) > fbwidth) { /* raster overflows right */ + nnx = fbwidth - llx; + } + if ((lly + ny) > fbheight) { /* raster overflows top */ + nny = fbheight - lly; + /*y_off = ny - nny;*/ + } + + /* Allocate the pointer if needed. Clear the output array if we're + * clipping to guarantee zero values. + */ + if (!pix) + pix = (uchar *) calloc (nx * ny, sizeof (uchar)); + + /* Convert corner position to frame buffer coords. */ + lx = max (0, llx + imd->xs); + ly = min (fbheight - 1, fbheight - (lly + imd->ys) - 0); + + if (imd_debug) { + printf ("[imd_readSubRas] %d bytes at [%d,%d] orig [%d,%d]\n", + nx*ny, lx, ly, llx, lly); + printf ("[imd_readSubRas] img corner at [%d,%d] -> [%d,%d]\n", + imd->xs, imd->ys, imd->xe, imd->ye); + } + + /* Figure out how many reads we'll need. */ + if (imd->model == MOD_NORMAL) { + lines_per_block = min (nny, (int)(SZ_BLOCK / fbwidth)); + nbytes = fbwidth * lines_per_block; + } else { + lines_per_block = min (nny, (int)(SZ_BLOCK / nx)); + nbytes = nx * lines_per_block; + } + nblocks = (int) (nny / lines_per_block); + block = (uchar *) calloc (nbytes, sizeof (uchar)); + + if (imd_debug) { + printf("[imd_readSubRas] ny=%d nblks=%d lin/bl=%d nbytes=%d\n", + ny, nblocks, lines_per_block, nbytes); + printf("[imd_readSubRas] nnx=%d nny=%d llx=%d lly=%d xo=%d yo=%d\n", + nnx, nny, llx, lly, x_off, y_off); + } + + + /* Loop over each of the blocks needed to get the region. */ + nl = nny; + ip = pix + (y_off * nx) + x_off; + y = ly - lines_per_block + 1; + for (i=0; i < nblocks; i++, y -= lines_per_block) { + if (imd_readLine(imd, block, nbytes, 0, y)) + return (ERR); + + /* Pull the requested pixels from the block. */ + bp = block + (lines_per_block - 1) * fbwidth; + for (j=0; j < lines_per_block && nl; j++) { + /*bcopy (bp+lx+x_off-1, ip, nnx);*/ + bcopy (bp+lx, ip, nnx); + bp -= fbwidth; + ip += nx; + nl--; + } + } + + /* Take care of the remaining pixels. */ + if (nl) { + nbytes = nl * fbwidth; + y += lines_per_block - nl + 1; + + /* Read the last block. */ + if (imd_readLine(imd, block, nbytes, 0, y)) + return (ERR); + + /* Pull the requested pixels from the block. */ + bp = block + (nl - 1) * fbwidth; + for (j=0; j < nl; j++) { + /*bcopy (bp+lx+x_off-1, ip, nx);*/ + bcopy (bp+lx, ip, nnx); + bp -= fbwidth; + ip += nx; + } + } + + free ((char *)block); + return (OK); +} + + +/* IMD_WRITESUBRASTER -- Write a rectangular region of the frame buffer. + */ + +int +imd_writeSubRaster (imd, llx, lly, nx, ny, pix) +IMDPtr imd; /* package pointer */ +int llx, lly; /* region corner */ +int nx, ny; /* dimensions */ +uchar *pix; /* subraster pixels */ +{ + register int i, j, nl, y, nbytes, lx, ly; + register uchar *ip = NULL, *bp = NULL, *block = NULL; + register int nblocks, lines_per_block; + register int nnx = nx, nny = ny, x_off = 0, y_off = 0; + int fbwidth = imd->fbtab[imd->fbconfig-1]->width; + int fbheight = imd->fbtab[imd->fbconfig-1]->height; + + + /* Make sure at least part of the raster is on the frame buffer, + * otherwise it's an error. + */ + if (llx > fbwidth || lly > fbheight || (llx+nx) < 0 || (lly+ny) < 0) { + fprintf (stderr, "Error: attempt to write raster out of bounds.\n"); + return (ERR); + } + + /* Now see whether the raster extends over the boundaries of the + * frame buffer in any direction. If so we'll clip the raster to + * write only those pixels on the frame buffer. + */ + if (-llx > imd->xs) { /* raster overflows bottom */ + x_off = -llx + imd->xs; + nnx = nx - x_off; + } + if (-lly > imd->ys) { /* raster overflows left */ + y_off = -lly + imd->ys; + nny = ny - y_off; + } + if ((llx + nx) > fbwidth) /* raster overflows right */ + nnx = fbwidth - llx; + if ((lly + ny) > fbheight) /* raster overflows top */ + nny = fbheight - lly; + + /* Check to see if the image to be displayed is larger than the + * current frame buffer. + */ + if (nx > fbwidth || ny > fbheight) { + nnx = min(nx, fbwidth); /* get new dimensions */ + nny = min(ny, fbheight); + x_off = (nx>fbwidth ? ((nx - fbwidth) / 2 - 1) : 0); + y_off = (ny>fbheight ? ((ny - fbheight) / 2 - 1) : 0); + } + + ip = pix + (y_off * nx) + x_off; + + /* Convert corner position to frame buffer coords. */ + lx = max (0, llx + imd->xs); + ly = min (fbheight - 1, fbheight - (lly + imd->ys) - 0); + + if (imd_debug) + printf ("[imd_writeSubRaster] %d bytes at [%d,%d] of [%d,%d]\n", + nx*ny, lx, ly, fbwidth, fbheight); + + /* Figure out how many reads we'll need. */ + if (imd->model == MOD_NORMAL) { + lines_per_block = min (nny, (int)(SZ_BLOCK / fbwidth)); + nbytes = fbwidth * lines_per_block; + } else { + lines_per_block = min (nny, (int)(SZ_BLOCK / nx)); + nbytes = nx * lines_per_block; + } + nblocks = (int) (nny / lines_per_block); + block = (uchar *) calloc (nbytes, sizeof (uchar)); + + if (imd_debug) { + printf ("\tnnx=%d nny=%d llx=%d lly=%d xo=%d yo=%d xs=%d ys=%d\n", + nnx, nny, llx, lly, x_off, y_off, imd->xs, imd->ys); + printf ("\tny=%d nblocks=%d lines/block=%d nbytes=%d\n", + ny, nblocks, lines_per_block, nbytes); + } + + /* Loop over each of the blocks needed to get the region. */ + nl = nny; + y = ly - lines_per_block + 1; + for (i=0; i < nblocks; i++, y -= lines_per_block) { + + if (imd->model == MOD_NORMAL) { + + /* Read a block of data containing the subraster but only if + * we need to. + */ + if (nnx != fbwidth) + if (imd_readLine(imd, block, nbytes, 0, y)) + return (ERR); + + /* Copy the subraster pixels to the block just read. */ + bp = block + (lines_per_block - 1) * fbwidth; + for (j=0; j < lines_per_block && nl; j++) { + bcopy (ip, bp+lx, nnx); + bp -= fbwidth; + ip += nx; + nl--; + } + + /* Write the edited block back to the server. */ + if (imd_writeLine(imd, block, nbytes, 0, y)) + return (ERR); + + } else { + /* Copy the subraster pixels to the block just read. */ + bp = block + (lines_per_block - 1) * nx; + for (j=0; j < lines_per_block && nl; j++) { + bcopy (ip, bp, nnx); + bp -= nx; + ip += nx; + nl--; + } + + /* Write the edited block back to the server. */ + nbytes = lines_per_block * ny; + if (imd_writeRawBuf(imd, block, nbytes, lx, y, + nx, lines_per_block)) + return (ERR); + } + } + + /* Take care of the remaining pixels. */ + if (nl) { + nbytes = nl * fbwidth; + + /* Read the last block. */ + y += lines_per_block - nl; + + + if (imd->model == MOD_NORMAL) { + if (nnx != fbwidth) + if (imd_readLine(imd, block, nbytes, 0, y)) + return (ERR); + + /* Copy the subraster pixels to the block just read. */ + bp = block + (nl - 1) * fbwidth; + for (j=0; j < nl; j++) { + bcopy (ip, bp+lx, nnx); + bp -= fbwidth; + ip += nx; + } + + /* Write the edited block back to the server. */ + if (imd_writeLine(imd, block, nbytes, 0, y)) + return (ERR); + + } else { + /* Copy the subraster pixels to the block just read. */ + bp = block + (nl - 1) * nx; + for (j=0; j < nl; j++) { + bcopy (ip, bp, nnx); + bp -= nx; + ip += nx; + } + + /* Write the edited block back to the server. */ + nbytes = nl * ny; + if (imd_writeRawBuf(imd, block, nbytes, lx, y, nx, nl)) + return (ERR); + } + } + + free ((char *)block); + return (OK); +} + + +/* IMD_SETDEBUG -- Set the state of the debug flag. + */ + +#ifdef ANSI_FUNC + +int +imd_setDebug (int state) +#else + +int +imd_setDebug (state) +int state; +#endif +{ + imd_debug = state; + return (OK); +} + + + +/* ------------------ + * PRIVATE PROCEDURES + * ------------------*/ + +/* IMD_WRITELINE -- Send the command to write a block of pixels to the + * server. This is a low-level routine called to either write a single + * line of data, or when the number of bytes exceeds the frame buffer width + * it can be used to send a complete "block" in the image display. + */ + +static int +imd_writeLine (imd, pix, nbytes, x, y) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixel array */ +int nbytes; /* npix to write */ +int x, y; /* coords for start */ +{ + register short sx=x, sy=y; + + if (imd_debug > 1) + printf ("[imd_writeLine] %d bytes at [%d,%d]\n", nbytes, x, y); + + return (com_writeData(imd->dataout, sx, sy, pix, nbytes)); +} + + +/* IMD_READLINE -- Send the command to read a sequential block of pixels + * from the server. + */ + +static int +imd_readLine (imd, pix, nbytes, x, y) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixel array */ +int nbytes; /* npix to write */ +int x, y; /* coords for start */ +{ + register short sx=x, sy=y; + + if (imd_debug) + printf ("[imd_readLine] %d bytes at [%d,%d]\n", nbytes, x, y); + + return (com_readData(imd->datain, imd->dataout, sx, sy, pix, &nbytes)); +} + + +/* IMD_WRITERAWBUF -- Send the command to write a block of pixels to the + * server. This is a low-level routine called to either write a single + * line of data, or when the number of bytes exceeds the frame buffer width + * it can be used to send a complete "block" in the image display. + */ + +static int +imd_writeRawBuf (imd, pix, nbytes, x, y, nx, ny) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixel array */ +int nbytes; /* npix to write */ +int x, y; /* coords for start */ +int nx, ny; /* dimensions of buf */ +{ + register short sx=x, sy=y; + + if (imd_debug > 1) + printf ("[imd_writeRawBuf] %d bytes at [%d,%d][%d,%d]\n", + nbytes, x, y, nx, ny); + + return (com_writeSubraster(imd->dataout, sx, sy, pix, nx, ny)); +} + + +/* IMD_READRAWBUF -- Send the command to write a block of pixels to the + * server. This is a low-level routine called to either write a single + * line of data, or when the number of bytes exceeds the frame buffer width + * it can be used to send a complete "block" in the image display. + */ + +static int +imd_readRawBuf (imd, pix, nbytes, x, y, nx, ny) +IMDPtr imd; /* package pointer */ +uchar *pix; /* pixel array */ +int nbytes; /* npix to read */ +int x, y; /* coords for start */ +int nx, ny; /* dimensions of buf */ +{ + register short sx=x, sy=y; + + if (imd_debug > 1) + printf ("[imd_readRawBuf] %d bytes at [%d,%d][%d,%d]\n", + nbytes, x, y, nx, ny); + + return (com_readSubraster(imd->dataout, sx, sy, pix, nx, ny)); +} + + +/* IMD_INITIALIZE -- Allocate and initialize the imd package structure. + */ + +#ifdef ANSI_FUNC + +static IMDPtr +imd_initialize ( + int fdin, + int fdout, /* device descriptors */ + int domain, /* connection type */ + int model /* subraster model */ +) +#else + +static IMDPtr +imd_initialize (fdin, fdout, domain, model) +int fdin, fdout; /* device descriptors */ +int domain; /* connection type */ +int model; /* subraster model */ +#endif +{ + IMDPtr imd; + + /* Allocate and initialize imd structure. */ + imd = (struct IMD *) calloc (1, sizeof (struct IMD)); + + imd->datain = fdin; + imd->dataout = fdout; + imd->domain = domain; + imd->ztrans = W_LINEAR; + imd->frame = 1; + imd->fbconfig = 1; + + /* Initialize a WCS, set the defaults for 512x512 framebuffer. */ + imd->a = 1.0; + imd->b = 0.0; + imd->c = 0.0; + imd->d = -1.0; + imd->tx = 1.0; + imd->ty = 512.0; + imd->z1 = 0.0; + imd->z2 = 255.0; + + /* Initialize the mapping. */ + imd->sx = 1.0; + imd->sy = 1.0; + imd->snx = 512; + imd->sny = 512; + imd->dx = 0; + imd->dy = 0; + imd->dnx = 511; + imd->dny = 511; + imd->iis_valid = 0; + + /* Allocate the structure pointers. */ + imd->name = (char *) calloc (SZ_NAME, sizeof(char)); + imd->title = (char *) calloc (SZ_NAME, sizeof(char)); + imd->region = (char *) calloc (SZ_NAME, sizeof(char)); + imd->ref = (char *) calloc (SZ_NAME, sizeof(char)); + + /* Get the server IIS version number. */ + imd->iis_version = imd_wcsVersion (imd); + +printf ("init: model = %d\n", model); + if (imd->iis_version > 10) { + /* Server supports fast subraster writes. + */ + if (model == MOD_NORMAL) + imd->model = MOD_FAST; + } else { + if (model == MOD_FAST) + imd->model = MOD_NORMAL; + } +printf ("\n\niis_version=%d model=%d -> %d\n", imd->iis_version, model, +imd->model); + + /* Load the frame buffer configuration file. */ + imd_loadImtoolrc (imd); + + return (imd); +} + + +/* IMD_PARSEIMTDEV -- Parse an IMTDEV device string, returning the domain + * type as the function value and loading the path/host information as + * needed. + */ + +#ifdef ANSI_FUNC + +static int +imd_parseImtdev ( + char *imtdev, /* device string */ + char *unixaddr, /* unix socket path */ + unsigned short *host_port, /* inet port number */ + unsigned long *host_addr, /* inet host address */ + char *ififo, /* fifo paths */ + char *ofifo, + int *model /* subraster display model */ +) +#else + +static int +imd_parseImtdev (imtdev, unixaddr, host_port, host_addr, ififo, ofifo, model) +char *imtdev; /* device string */ +char *unixaddr; /* unix socket path */ +unsigned short *host_port; /* inet port number */ +unsigned long *host_addr; /* inet host address */ +char *ififo, *ofifo; /* fifo paths */ +int *model; /* subraster display model */ +#endif +{ + char *ip, *dp; + char osfn[SZ_LINE*2]; + + + if (imtdev == NULL) + return ERR; + else { + /* Extract any subraster display model option from the IMTDEV + ** string. This will be the word "fast:" or "normal:" prefixed + ** to the device string. A missing option will use the default + ** model, either way we'll update the device string before parsing + ** for the connection. + */ + if (strncmp (imtdev, "fast:", 5) == 0) { + *model = MOD_FAST; + dp = &imtdev[5]; + } else if (strncmp (imtdev, "normal:", 5) == 0) { + *model = MOD_NORMAL; + dp = &imtdev[7]; + } else { + *model = DEF_MODEL; + dp = imtdev; + } +printf ("parse: model = %d (def=%d)\n", *model, DEF_MODEL); + + + /* Expand any %d fields in the network address to the UID. */ + sprintf (osfn, (char *)dp, getuid(), getuid()); + + if (strncmp (osfn, "fifo:", 5) == 0) { + /* FIFO (named pipe) connection. */ + ip = osfn + 5; + if (!imd_getstr (&ip, ififo, SZ_NAME)) + return ERR; + if (!imd_getstr (&ip, ofifo, SZ_NAME)) + return ERR; + + return FIFO; + + } else if (strncmp (osfn, "inet:", 5) == 0) { + + /* Internet connection. */ + char port_str[SZ_NAME], host_str[SZ_NAME]; + unsigned short port; + struct servent *sv; + struct hostent *hp; + + /* Get port number. This may be specified either as a service + * name or as a decimal port number. + */ + ip = osfn + 5; + if (imd_getstr (&ip, port_str, SZ_NAME) <= 0) + return ERR; + if (isdigit (port_str[0])) { + port = atoi (port_str); + *host_port = htons (port); + } else if ((sv = getservbyname(port_str,"tcp"))) { + *host_port = sv->s_port; + } else + return ERR; + + /* Get host address. This may be specified either has a host + * name or as an Internet address in dot notation. If no host + * name is specified default to the local host. + */ + if (imd_getstr (&ip, host_str, SZ_NAME) <= 0) + strcpy (host_str, "localhost"); + if (isdigit (host_str[0])) { + *host_addr = inet_addr (host_str); + if ((int)*host_addr == -1) + return ERR; + } else if ((hp = gethostbyname(host_str))) { + bcopy (hp->h_addr, (char *)host_addr, sizeof(*host_addr)); + } else + return ERR; + + return INET; + + } else if (strncmp (osfn, "unix:", 5) == 0) { + /* Unix domain socket connection. */ + ip = osfn + 5; + if (!imd_getstr (&ip, unixaddr, SZ_NAME)) + return ERR; + + return UNIX; + } + } + + + return (ERR); +} + + +/* IMD_WCSVERSION -- Query the server for the support IIS WCS version. + */ + +#ifdef ANSI_FUNC + +static int +imd_wcsVersion ( + IMDPtr imd /* package pointer */ +) +#else + +static int +imd_wcsVersion (imd) +IMDPtr imd; /* package pointer */ +#endif +{ + /* Allow the user to disable the use of maps. */ + if (getenv ("CDL_NOMAPS")) + return (0); + else + return (com_wcsVersion (imd->datain, imd->dataout)); +} + + +/* IMD_LOADIMTOOLRC -- Load the frame buffer configuration table into a + * runtime table. An error is returned if the table cannot be found and + * a default frame buffer size of 512x512 with 2 frames is available (this + * is all the server will have abvailable anyway). + */ + +#ifdef ANSI_FUNC + +static int +imd_loadImtoolrc ( + IMDPtr imd /* package pointer */ +) +#else + +static int +imd_loadImtoolrc (imd) +IMDPtr imd; /* package pointer */ +#endif +{ + register char *ip; + register FILE *fp = NULL; + int config, nframes, width, height, i; + char *fname; + + + /* Initialize the config table. */ + for (i=0; i < MAX_FBCONFIG; i++) { + imd->fbtab[i] = (FBTab *) calloc (sizeof(FBTab), sizeof(char)); + imd->fbtab[i]->config = i; + imd->fbtab[i]->nframes = 2; + imd->fbtab[i]->width = DEF_FRAME_WIDTH; + imd->fbtab[i]->height = DEF_FRAME_HEIGHT; + } + + /* Attempt to open the config file. */ + if ((fname=getenv(FBCONFIG_ENV1)) || (fname=getenv(FBCONFIG_ENV2))) { + fp = fopen (fname, "r"); + if (imd_debug) + printf ("Using IMTOOLRC='%s'...\n", fname); + } + if (!fp && (fname = getenv ("HOME"))) { + if (imd_debug) + printf ("$IMTOOLRC not found...\n"); + sprintf (buf, "%s/%s", fname, FBCONFIG_1); + fp = fopen (fname = buf, "r"); + if (fp && imd_debug) + printf ("Using $HOME/.imtoolrc...\n"); + } + if (!fp) { + if (imd_debug) + printf ("$HOME/.imtoolrc not found...\n"); + fp = fopen ((fname = FBCONFIG_2), "r"); + if (fp && imd_debug) + printf ("Using /usr/local/lib/imtoolrc...\n"); + } + if (!fp) { + fprintf (stderr, + "Warning: cannot find frame buffer configuration table.\n"); + return (ERR); + } + + /* Scan the frame buffer configuration file. + */ + while (fgets (buf, SZ_LINE, fp) != NULL) { + /* Skip comment lines and blank lines. */ + for (ip=buf; *ip == ' ' || *ip == '\t'; ip++) + ; + if (*ip == '\n' || *ip == '#') + continue; + if (!isdigit (*ip)) + continue; + switch (sscanf (ip, "%d%d%d%d",&config,&nframes,&width,&height)) { + case 4: + break; /* normal case */ + case 3: + height = width; /* default to square format */ + break; + default: + fprintf (stderr, "Warning: bad config `%s'\n", ip); + continue; + } + + nframes = max (1, nframes); + width = max (1, width); + height = max (1, height); + + /* Since the frame buffer is stored in a memory pixrect + * (effectively), the line length should be an integral number + * of 16 bit words. + */ + if (width & 1) { + fprintf (stderr, "Warning: fb config %d [%d-%dx%d] - ", + config, nframes, width, height); + fprintf (stderr, "frame width should be even, reset to %d\n", + --width); + } + + imd->fbtab[config-1]->config = max(1,min(MAX_FBCONFIG, config)); + imd->fbtab[config-1]->nframes = nframes; + imd->fbtab[config-1]->width = width; + imd->fbtab[config-1]->height = height; + + if (imd_debug > 1) + printf ("%3d %2d %6d %6d\n", config, nframes, width, height); + } + + fclose (fp); + return (OK); +} + + +/* IMD_GETSTR -- Internal routine to extract a colon delimited string from a + * network filename. + */ +#ifdef ANSI_FUNC + +static int +imd_getstr (char **ipp, char *obuf, int maxch) +#else + +static int +imd_getstr (ipp, obuf, maxch) +char **ipp; +char *obuf; +int maxch; +#endif +{ + register char *ip = *ipp, *op = obuf; + register char *otop = obuf + maxch; + char *start; + + while (isspace(*ip)) + ip++; + for (start=ip; *ip; ip++) { + if (*ip == ':') { + ip++; + break; + } else if (op && op < otop) + *op++ = *ip; + } + + if (op) + *op = '\0'; + *ipp = ip; + + return (ip - start); +} + + +/* IMD_MINMAX -- Compute the min/max values of an array. + */ + +static void +imd_minmax (pix, nbytes, pmin, pmax) +uchar *pix; +int nbytes; +int *pmin, *pmax; +{ + register int i; + + *pmin = *pmax = pix[0]; + for (i=1; i<nbytes; i++) { + *pmin = min (*pmin, pix[i]); + *pmax = max (*pmax, pix[i]); + } +} diff --git a/vendor/x11iraf/cdl/mkpkg b/vendor/x11iraf/cdl/mkpkg new file mode 100644 index 00000000..70605b03 --- /dev/null +++ b/vendor/x11iraf/cdl/mkpkg @@ -0,0 +1,45 @@ +# Mkpkg file for the CDL Image Display Library +# + +$call update +$exit + +update: + $ifeq (MACH, alpha) then + $set XFLAGS = "$(XFLAGS) -DOSF1" + $else $ifeq (MACH, dsux, dmip) then + $set XFLAGS = "$(XFLAGS) -DULTRIX" + $else $ifeq (MACH, hp700, rs6000) then + $set XFLAGS = "$(XFLAGS) -D_NO_US_" + $endif + $endif + $endif + + $set XFLAGS = "$(XFLAGS) -Inolibc" + + # Uncomment the following if you want to compile the library + # using ANSI C function prototypes. NOTE: If the library is + # compiled with prototypes then *all* client applications must + # also be compiled with prototypes. + + #$set XFLAGS = "$(XFLAGS) -DCDL_ANSIC" + + #$checkout libcdl.a ../ + $update libcdl.a + #$checkin libcdl.a ../ + ; + + +libcdl.a: + cdl.c cdl.h cdlP.h + cdlmark.c cdl.h cdlP.h cdlfont.h + cdl_f77.c cdl.h cdlP.h cdl_f77.h + cdl_spp.c cdl.h cdlP.h cdl_f77.h + cdlfits.c cdl.h cdlP.h + cdliraf.c cdl.h cdlP.h + cdlzscale.c cdl.h cdlP.h + comm.c cdl.h cdlP.h + imd.c cdl.h cdlP.h + eps.c cdl.h cdlP.h eps.h + ; + diff --git a/vendor/x11iraf/cdl/test/Imakefile b/vendor/x11iraf/cdl/test/Imakefile new file mode 100644 index 00000000..64339465 --- /dev/null +++ b/vendor/x11iraf/cdl/test/Imakefile @@ -0,0 +1,22 @@ +# +# IMakefile for CDL Test tasks. +# + +X11IRAFDIR = ../../ +#include <../../X11IRAF.tmpl> + + + CDLDIR = ../ + INCLUDES = -I. -I$(CDLDIR) + LOCAL_LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + +AllTarget(cdltest imdtest) + +NormalProgramTarget(cdltest,cdltest.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(imdtest,imdtest.o,../libcdl.a,$(LIBS),-lm) + +depend:: + +LintTarget() diff --git a/vendor/x11iraf/cdl/test/Imakefile.standalone b/vendor/x11iraf/cdl/test/Imakefile.standalone new file mode 100644 index 00000000..ff6fd3fa --- /dev/null +++ b/vendor/x11iraf/cdl/test/Imakefile.standalone @@ -0,0 +1,39 @@ +# +# IMakefile for CDL Test tasks. +# + + CDLDIR = ../ + INCLUDES = -I. -I$(CDLDIR) + LOCAL_LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + +# Hack to compile under SunPRO V4 on Solaris +#if defined (SunArchitecture) && OSMajorVersion >= 5 && HasSunC +#if OSMinorVersion <= 5 +#if !defined (i386Architecture) + CCOPTIONS = -Xs +EXTRA_LDOPTIONS = -xildoff +#endif +#else + CCOPTIONS = +EXTRA_LDOPTIONS = -xildoff +#endif + +#else +#if defined (UltrixArchitecture) + CCOPTIONS = -DULTRIX +#endif +#if defined (OSF1Architecture) && OSMajorVersion >= 4 + CCOPTIONS = -DOSF1 +#endif +#endif + +AllTarget(cdltest imdtest) + +NormalProgramTarget(cdltest,cdltest.o,../libcdl.a,$(LIBS),-lm) +NormalProgramTarget(imdtest,imdtest.o,../libcdl.a,$(LIBS),-lm) + +depend:: + +LintTarget() diff --git a/vendor/x11iraf/cdl/test/Makefile.generic b/vendor/x11iraf/cdl/test/Makefile.generic new file mode 100644 index 00000000..c64c90b2 --- /dev/null +++ b/vendor/x11iraf/cdl/test/Makefile.generic @@ -0,0 +1,76 @@ +# +# Generic Makefile for CDL Test tasks. +# + + CDLDIR = ../ + RM = rm + CFLAGS = -I. -I$(CDLDIR) + LDFLAGS = -L$(CDLDIR) + LIBS = -lcdl + + LDLIBS = + + +all:: cdltest imdtest + +cdltest: cdltest.o ../libcdl.a + $(RM) -f $@ + $(CC) -o $@ cdltest.o $(LDFLAGS) $(LDOPTIONS) $(LIBS) $(LDLIBS) -lm + +clean:: + $(RM) -f cdltest + +imdtest: imdtest.o ../libcdl.a + $(RM) -f $@ + $(CC) -o $@ imdtest.o $(LDFLAGS) $(LDOPTIONS) $(LIBS) $(LDLIBS) -lm + +clean:: + $(RM) -f imdtest + +depend:: + +lint: + $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) +lint1: + $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) + +clean:: + $(RM) -f *.o + +# ------------------------------------------------------------------------- +# common rules for all Makefiles - do not edit + +emptyrule:: + +Makefile:: + -@if [ -f Makefile ]; then set -x; \ + $(RM) -f Makefile.bak; $(MV) Makefile Makefile.bak; \ + else exit 0; fi + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + +tags:: + $(TAGS) -w *.[ch] + $(TAGS) -xw *.[ch] > TAGS + +saber: + # load $(ALLDEFINES) $(SRCS) + +osaber: + # load $(ALLDEFINES) $(OBJS) + +# ------------------------------------------------------------------------- +# empty rules for directories that do not have SUBDIRS - do not edit + +install:: + @echo "install in $(CURRENT_DIR) done" + +install.man:: + @echo "install.man in $(CURRENT_DIR) done" + +Makefiles:: + +includes:: + +# ------------------------------------------------------------------------- +# dependencies generated by makedepend + diff --git a/vendor/x11iraf/cdl/test/cdltest.c b/vendor/x11iraf/cdl/test/cdltest.c new file mode 100644 index 00000000..85c4b590 --- /dev/null +++ b/vendor/x11iraf/cdl/test/cdltest.c @@ -0,0 +1,635 @@ +#include <stdio.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + +/* CDLTEST -- Test routines for the CDL package. + */ + +#define TEST_PATTERN -1 + +/* Utility macros. */ +#define max(a,b) (a > b ? a : b) +#define min(a,b) (a < b ? a : b) + +extern int cdl_debug; + +main() +{ + CDLPtr cdl; + char key, cmd[2], name[SZ_NAME], title[SZ_NAME], obj[SZ_NAME]; + int i, j, zt=1, frame=1, fbconfig=1, color=3, lwidth=1, twidth=1; + int debug = 0, nx, ny, bitpix, ix=128, iy=128, lstyle=0; + int lx, ly, ux, uy; + int fb_w, fb_h, nframes, wcs; + int xarray[1024], yarray[1024]; + float rx=128., ry=128., sx, sy; + float a, b, c, d, tx, ty, z1=0.0, z2=0.0; + int snx, sny, dnx, dny, dx, dy; + uchar *pix, *c_ras; + double sin(); + + cdl = cdl_open ((char *)getenv("IMTDEV")); + if (cdl == (CDLPtr) NULL) + exit (); + + c_ras = (uchar *) malloc (1024 * 1024); + + cmd[0] = 'f'; + cmd[1] = '\n'; + print_help(); + do { + switch (cmd[0]) { + case '<': /* ENABLE DEBUG */ + cdl_setDebug (1); + break; + + case '>': /* DISABLE DEBUG */ + cdl_setDebug (0); + break; + + case 'S': /* SAMPLE CURSOR */ + (void) cdl_readCursor (cdl, 1, &rx, &ry, &wcs, &key); + printf ("cursor: x=%g y=%g wcs=%d key='%d' (%c)\n", + rx, ry, wcs, key, key); + break; + + case 'C': /* CLIP TEST TOP */ + if (cdl_readSubRaster (cdl, 128, -32, 128, 128, &c_ras)) + printf ("...read returns an error\n"); + if (cdl_writeSubRaster (cdl, 128, -32, 128, 128, c_ras)) + printf ("...write returns an error\n"); + if (cdl_readSubRaster (cdl, 128, -8, 16, 16, &c_ras)) + printf ("...read returns an error\n"); + for (i=0;i<16;i++) { + for (j=0; j<16; j++) + printf ("%3d ", c_ras[i*16+j]); + printf ("\n"); + } + printf ("\n"); + if (cdl_readSubRaster (cdl, 128, 504, 16, 16, &c_ras)) + printf ("...read returns an error\n"); + for (i=0;i<16;i++) { + for (j=0; j<16; j++) + printf ("%3d ", c_ras[i*16+j]); + printf ("\n"); + } + break; + + case 'c': /* CLEAR FRAME */ + if (cdl_clearFrame (cdl)) + printf ("...returns an error\n"); + break; + + case 'd': /* DELETE MARKER */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_deleteMark (cdl, ix, iy)) + printf ("...returns an error\n"); + break; + + case 'D': /* DELETE OVERLAY */ + (void) cdl_clearOverlay (cdl); + break; + + case 'f': /* DISPLAY FITS */ + if (cdl_displayFITS (cdl, "dpix.fits", frame, FB_AUTO, 1)) + printf ("...returns an error\n"); + break; + + case 'g': /* READ IMAGE */ + if (cdl_readImage (cdl, &c_ras, &nx, &ny)) + printf ("...returns an error\n"); + printf ("corners: nx=%d ny=%d LL = [%d] UR = [%d]\n", + nx, ny, c_ras[0], c_ras[nx*ny-1]); + if (cdl_displayPix (cdl, c_ras, nx, ny, 8, frame, FB_AUTO, 0)) + printf ("...returns an error\n"); + break; + + case 'G': /* READ FB */ + if (cdl_readFrameBuffer (cdl, &c_ras, &nx, &ny)) + printf ("...returns an error\n"); + printf ("fb corners: nx=%d ny=%d LL = [%d] UR = [%d]\n", + nx, ny, c_ras[0], c_ras[nx*ny-1]); + if (cdl_displayPix (cdl, c_ras, nx, ny, 8, frame, FB_AUTO, 0)) + printf ("...returns an error\n"); + break; + + case 'i': /* DISPLAY IRAF */ + if (cdl_displayIRAF (cdl, "examples/dpix.imh", 1, frame, + FB_AUTO, 0)) + printf ("...returns an error\n"); + break; + + case 'm': /* MARK POINT */ + i = 1; + while (cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key) != 'q') { + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", + rx, ix, ry, iy, key); + if (cdl_markPoint (cdl, ix, iy, i++, 7, M_STAR, C_GREEN)) + printf ("...returns an error\n"); + } + break; + + case 'n': /* NEXT FRAME */ + frame = (frame+1 > 16 ? 1 : frame+1); + cdl_setFrame (cdl, frame); + printf ("set cdl->frame = %d\n", cdl->frame); + cdl_getFrame (cdl, &frame); + printf ("get cdl->frame = %d\n", frame); + break; + + case 'N': /* NEXT CONFIG */ + fbconfig = (fbconfig+1 > 12 ? 1 : fbconfig+1); + cdl_setFBConfig (cdl, fbconfig); + i = cdl->fbconfig - 1; + printf ("cdl->fbconfig = %d/%d [%d %d %d %d]\n", cdl->fbconfig, + i, cdl->imd->fbtab[i]->config, cdl->imd->fbtab[i]->nframes, + cdl->imd->fbtab[i]->width, cdl->imd->fbtab[i]->height); + break; + + case 'p': /* PREVIOUS FRAME */ + frame = (frame-1 < 1 ? 4 : frame-1); + cdl_setFrame (cdl, frame); + printf ("set cdl->frame = %d\n", cdl->frame); + cdl_getFrame (cdl, &frame); + printf ("get cdl->frame = %d\n", frame); + break; + + case 'P': /* PREV CONFIG */ + cdl_setFBConfig (cdl, fbconfig); + fbconfig = (fbconfig-1 < 1 ? 12 : fbconfig)-1; + i = cdl->fbconfig - 1; + printf ("cdl->fbconfig = %d/%d [%d %d %d %d]\n", cdl->fbconfig, + i, cdl->imd->fbtab[i]->config, cdl->imd->fbtab[i]->nframes, + cdl->imd->fbtab[i]->width, cdl->imd->fbtab[i]->height); + break; + + case 'q': /* QUIT */ + goto quit; + + case 'r': /* READ CURSOR */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf("cursor: x=%g/%d y=%g/%d wcs = %d key='%c' frame=%d\n", + rx, ix, ry, iy, wcs, key, wcs / 100); + break; + + case 's': /* TEXT STRING */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + if (cdl_markText (cdl, -20, iy, "testing 123", 1., 0.0, C_RED)) + printf ("...returns an error\n"); + break; + + case 't': /* TEST IMAGE */ + printf ("creating raster....\n"); + make_raster (c_ras, 512, 512, TEST_PATTERN); + cdl_setName (cdl, "test image"); + cdl_setTitle (cdl, "test title"); + printf ("displaying raster....\n"); + if (cdl_displayPix (cdl, c_ras, 512, 512, 8, frame,fbconfig,0)) + printf ("...returns an error\n"); + break; + + case 'T': /* TEST TILE */ + if (cdl_readFITS ("dpix.fits", &pix, &nx, &ny, + &bitpix, obj)) + printf ("...returns an error\n"); + printf ("nx=%d ny=%d bitpix=%d\n", nx, ny, bitpix); + cdl_clearFrame (cdl); + cdl_selectFB (cdl, 2*nx, 2*ny, &fbconfig, &fb_w, &fb_h, + &nframes, 1); + if (cdl_setWCS (cdl, "imaname", "imtitle", 1., 0., 0., -1., 0., + (float) 2*ny, 1., 255., 1)) + printf ("...returns an error\n"); + cdl_computeZscale (cdl, pix, nx ,ny, bitpix, &z1, &z2); + cdl_zscaleImage (cdl, &pix, nx ,ny, bitpix, z1, z2); + if (cdl_writeSubRaster (cdl, 0, 0, nx, ny, pix)) + printf ("...returns an error\n"); + if (cdl_writeSubRaster (cdl, nx, 0, nx, ny, pix)) + printf ("...returns an error\n"); + if (cdl_writeSubRaster (cdl, 0, ny, nx, ny, pix)) + printf ("...returns an error\n"); + if (cdl_writeSubRaster (cdl, nx, ny, nx, ny, pix)) + printf ("...returns an error\n"); + break; + + case 'w': /* SET WCS */ + if (cdl_setWCS (cdl, "imname", "imtitle", 1., 0., 0., -1., 0., + 512., 1., 255., 1)) + printf ("...returns an error\n"); + break; + + case 'W': /* GET WCS */ + if (cdl_getWCS (cdl, name, title, &a, &b, &c, &d, &tx, &ty, + &z1, &z2, &zt)) + printf ("...returns an error\n"); + printf ("name='%s' title='%s'\n a=%g b=%g c=%g d=%g ", + name, title, a, b, c, d); + printf ("tx=%g ty=%g z1=%g z2=%g zt=%d\n", tx, ty, z1, z2, zt); + break; + + case 'b': /* MARK BOX */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + lx = (int) (rx + 0.5); ly = (int) (ry + 0.5); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ux = (int) (rx + 0.5); uy = (int) (ry + 0.5); + printf ("cursor: x=%d/%d y=%d/%d\n", lx,ux,ly,uy); + if (cdl_markBox (cdl, lx, ly, ux, uy, 0, C_RED)) + printf ("...returns an error\n"); + break; + + case 'B': /* FILL BOX */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + lx = (int) (rx + 0.5); ly = (int) (ry + 0.5); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ux = (int) (rx + 0.5); uy = (int) (ry + 0.5); + printf ("cursor: x=%d/%d y=%d/%d\n", lx,ux,ly,uy); + if (cdl_markBox (cdl, lx, ly, ux, uy, 1, C_RED)) + printf ("...returns an error\n"); + break; + + case 'L': /* MARK LINE STYLES */ + break; + + case 'l': /* MARK LINE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + lx = (int) (rx + 0.5); ly = (int) (ry + 0.5); + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ux = (int) (rx + 0.5); uy = (int) (ry + 0.5); + printf ("cursor: x=%d/%d y=%d/%d\n", lx,ux,ly,uy); + if (cdl_markLine (cdl, lx, ly, ux, uy, C_YELLOW)) + printf ("...returns an error\n"); + break; + + case '[': + cdl_setTextWidth (cdl, twidth = (twidth-1 < 1 ? 1 : --twidth)); + break; + + case ']': + cdl_setTextWidth (cdl, ++twidth); + break; + + case ',': + cdl_setLineWidth (cdl, lwidth = (lwidth-1 < 1 ? 1 : --lwidth)); + break; + + case '.': + cdl_setLineWidth (cdl, ++lwidth); + break; + + case '{': + cdl_setLineStyle (cdl, lstyle = (lstyle-1 < 1 ? 1 : --lstyle)); + break; + + case '}': + cdl_setLineStyle (cdl, ++lstyle); + break; + + case '(': /* MARK POLYLINE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + for (i=0; i < 145; i++) { + xarray[i] = ix + i; + yarray[i] = iy + (int)(32*sin((double)(i*0.17453))); + } + if (cdl_markPolyline (cdl, xarray, yarray, 145, C_GREEN)) + printf ("...returns an error\n"); + break; + + case ')': /* MARK POLYGON */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + xarray[0] = ix - 9; yarray[0] = iy - 9; + xarray[1] = ix + 0; yarray[1] = iy + 9; + xarray[2] = ix + 9; yarray[2] = iy - 9; + if (cdl_markPolygon (cdl, xarray, yarray, 3, 1, C_GREEN)) + printf ("...returns an error\n"); + break; + + case 'e': /* MARK ELLIPSE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markEllipse (cdl, ix, iy, 11, 7, 45.0, 0, C_RED)) + printf ("...returns an error\n"); + break; + + case 'E': /* MARK ELLIPSE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markEllipAnnuli (cdl, ix, iy, 11, 7, 45.0, 2, 5, C_RED)) + printf ("...returns an error\n"); + break; + + case 'o': /* MARK CIRCLE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markCircle (cdl, ix, iy, 27, 0, C_YELLOW)) + printf ("...returns an error\n"); + break; + + case 'O': /* MARK CIRCLE */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markCircAnnuli (cdl, ix, iy, 13, 2, 5, C_YELLOW)) + printf ("...returns an error\n"); + break; + + case 'M': /* MARK ALL PTS */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + cdl_markPoint (cdl,ix+00,iy, 0,13, M_BOX, C_GREEN); + cdl_markPoint (cdl,ix+15,iy, 0,13, M_PLUS, C_GREEN); + cdl_markPoint (cdl,ix+30,iy, 0,13, M_CROSS, C_GREEN); + cdl_markPoint (cdl,ix+45,iy, 0,13, M_DIAMOND,C_GREEN); + cdl_markPoint (cdl,ix+60,iy, 0,13, M_CIRCLE, C_GREEN); + cdl_markPoint (cdl,ix+75,iy, 0,13, M_STAR, C_GREEN); + cdl_markPoint (cdl,ix+90,iy, 0,13, M_HLINE, C_GREEN); + cdl_markPoint (cdl,ix+105,iy, 0,13, M_VLINE, C_GREEN); + cdl_markPoint (cdl,ix+120,iy, 0,13, M_HBLINE, C_GREEN); + cdl_markPoint (cdl,ix+135,iy, 0,13, M_VBLINE, C_GREEN); + cdl_markPoint (cdl,ix+00,iy-16,0,13, M_FILL|M_BOX, C_GREEN); + cdl_markPoint (cdl,ix+45,iy-16,0,13, M_FILL|M_DIAMOND,C_GREEN); + cdl_markPoint (cdl,ix+60,iy-16,0,13, M_FILL|M_CIRCLE, C_GREEN); + cdl_markPoint (cdl,ix+90,iy-16,0,13, M_VLINE|M_HLINE, C_GREEN); + cdl_markPoint (cdl,ix+105,iy-16,0,13, M_VLINE|M_HLINE, C_GREEN); + cdl_markPoint (cdl,ix+120,iy-16,0,13,M_VBLINE|M_HBLINE,C_GREEN); + cdl_markPoint (cdl,ix+135,iy-16,0,13,M_VBLINE|M_HBLINE,C_GREEN); + cdl_markPoint (cdl,ix+00,iy-32,0,13, M_PLUS|M_BOX, C_GREEN); + cdl_markPoint (cdl,ix+45,iy-32,0,13, M_PLUS|M_DIAMOND,C_GREEN); + cdl_markPoint (cdl,ix+60,iy-32,0,13, M_PLUS|M_CIRCLE, C_GREEN); + cdl_markPoint (cdl,ix+90,iy-32,0,13, M_HLINE|M_POINT, C_GREEN); + cdl_markPoint (cdl,ix+105,iy-32,0,13, M_VLINE|M_POINT, C_GREEN); + cdl_markPoint (cdl,ix+120,iy-32,0,13, M_HBLINE|M_POINT,C_GREEN); + cdl_markPoint (cdl,ix+135,iy-32,0,13, M_VBLINE|M_POINT,C_GREEN); + cdl_markPoint (cdl,ix+00,iy-48,0,13, M_CROSS|M_BOX, C_GREEN); + cdl_markPoint (cdl,ix+45,iy-48,0,13, M_CROSS|M_DIAMOND,C_GREEN); + cdl_markPoint (cdl,ix+60,iy-48,0,13, M_CROSS|M_CIRCLE, C_GREEN); + cdl_markPoint (cdl,ix+90,iy-48,0,13, M_VLINE|M_HLINE|M_POINT, + C_GREEN); + cdl_markPoint (cdl,ix+105,iy-48,0,13, M_HLINE|M_VLINE|M_POINT, + C_GREEN); + cdl_markPoint (cdl,ix+120,iy-48,0,13, M_VBLINE|M_HBLINE|M_POINT, + C_GREEN); + cdl_markPoint (cdl,ix+135,iy-48,0,13, M_HBLINE|M_VBLINE|M_POINT, + C_GREEN); + break; + + case '+': /* MARK PLUS */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markPoint (cdl, ix, iy, 1, 7, M_PLUS, C_KHAKI)) + printf ("...returns an error\n"); + break; + + case 'x': /* MARK CROSS */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markPoint (cdl, ix, iy, 1, 7, M_CROSS, C_CYAN)) + printf ("...returns an error\n"); + break; + + case '*': /* MARK STAR */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", rx,ix,ry,iy,key); + if (cdl_markPoint (cdl, ix, iy, 1, 7, M_STAR, C_GREEN)) + printf ("...returns an error\n"); + break; + + case '-': + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + (void) cdl_markPoint (cdl,ix, iy, 0, 30, M_HBLINE, C_RED); + break; + + case '|': + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + (void) cdl_markPoint (cdl,ix, iy, 0, 30, M_VBLINE, C_RED); + break; + + case '=': + cdl_readFrameBuffer (cdl, &pix, &nx, &ny); + cdl_printPixToFile (cdl, "foo.eps", pix, nx, ny, 1); + break; + + case '&': + clock (); + for (i=0, ix=16, iy=16; i < 512; i++) { + ix = xarray[i] = (ix+10 > 500 ? 16 : ix + 10); + iy = yarray[i] = (ix == 16 ? iy + 16: iy); + } + for (i=0; i < 512; i++) { + if (cdl_markPoint (cdl, xarray[i], yarray[i], 0, 7, + M_PLUS, C_RED)) + printf ("...returns an error\n"); + } + printf ("takes %d microseconds\n", clock()); + break; + + case 'Q': + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + printf("cursor: x=%g/%d y=%g/%d wcs = %d key='%c' frame=%d\n", + rx, ix, ry, iy, wcs, key, wcs / 100); + + (void) cdl_queryMap (cdl, wcs, name, &sx, &sy, &snx, &sny, + &dx, &dy, &dnx, &dny, obj); + printf ("\tregion='%s' ref='%s'\n", name, obj); + printf ("\tsrc = %g,%g,%d,%d dest = %d,%d,%d,%d\n", + sx, sy, snx, sny, dx, dy, dnx, dny); + + break; + + case '?': + print_help(); + break; + + case '1': /* TEXT STRING */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + if (cdl_markText (cdl, ix, iy, "test", 2, 0.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-5, iy+15, "test", 2, 45.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-20, iy+30, "test", 2, 90.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-35, iy+30, "test", 2, 135.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-40, iy+15, "test", 2, 180.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-40, iy-10, "test", 2, 225.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-30, iy-25, "test", 2, 270.0, C_GREEN)) + printf ("...returns an error\n"); + if (cdl_markText (cdl, ix-15, iy-15, "test", 2, 315.0, C_GREEN)) + printf ("...returns an error\n"); + break; + + case '2': /* TEXT STRING */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + if (cdl_markText (cdl, ix, iy, "testing", 2, 180.0, C_GREEN)) + printf ("...returns an error\n"); + break; + + case '3': /* BLINKING MARKER */ + (void) cdl_readCursor (cdl, 0, &rx, &ry, &wcs, &key); + ix = (int) (rx + 0.5); iy = (int) (ry + 0.5); + cdl_blinkCircle (cdl, ix, iy, 10, C_YELLOW, 5); + break; + + case '4': /* BLINKING MARKER */ + (void) cdl_setCursor (cdl, 100, 100, 0); + break; + } + printf ("Command: "); + + /* gets(cmd); */ + scanf ("%s", cmd); + } while (cmd[0] != 'q'); + +quit: (void) cdl_close (cdl); +} + +cdl_blinkCircle (cdl, x, y, r, color, nblinks) +CDLPtr cdl; +int x; +int y; +int r; +int color; +int nblinks; +{ + char *init, *mark, *blink; + int i, dim = 2*r + 2, DIM=4*r + 2; + + init = (char *) malloc (DIM*DIM); + mark = (char *) malloc (dim*dim); + blink = (char *) malloc (DIM*DIM); + + cdl_readSubRaster (cdl, x-dim, y-dim, DIM, DIM, &init); + + cdl_setLineWidth (cdl, 3); + cdl_markCircle (cdl, x, y, 2*r-1, 0, color); + cdl_readSubRaster (cdl, x-dim, y-dim, DIM, DIM, &blink); + cdl_setLineWidth (cdl, 1); + + cdl_markCircle (cdl, x, y, r, 0, color); + cdl_readSubRaster (cdl, x-r, y-r, 2*r, 2*r, &mark); + + for (i=0; i<nblinks; i++) { + cdl_writeSubRaster (cdl, x-dim, y-dim, DIM, DIM, blink); + usleep (333*1000); + cdl_writeSubRaster (cdl, x-r, y-r, 2*r, 2*r, mark); + usleep (333*1000); + cdl_writeSubRaster (cdl, x-dim, y-dim, DIM, DIM, init); + usleep (333*1000); + } + cdl_writeSubRaster (cdl, x-r, y-r, 2*r, 2*r, mark); + + free ((char *)init); + free ((char *)blink); + free ((char *)mark); +} + + +print_help () +{ + printf ("\n"); + printf (" b - mark box "); + printf (" B - fill box "); + printf (" c - clear frame "); printf ("\n"); + printf (" d - delete marker "); + printf (" D - delete overlay "); + printf (" e - mark ellipse "); printf ("\n"); + printf (" E - mark ellip ann "); + printf (" f - display FITS "); + printf (" g - read image "); printf ("\n"); + printf (" G - read fb "); + printf (" i - display iraf "); + printf (" l - mark line "); printf ("\n"); + printf (" m - mark point "); + printf (" n - next frame "); + printf (" N - next config "); printf ("\n"); + printf (" M - mark all pts "); + printf (" o - mark circle "); + printf (" O - mark circle ann "); printf ("\n"); + printf (" p - previous frame "); + printf (" P - prev config "); + printf (" q - quit "); printf ("\n"); + printf (" r - read cursor "); + printf (" s - text string "); + printf (" S - sample cursor "); printf ("\n"); + printf (" t - test image "); + printf (" T - tile image "); + printf (" w - set wcs "); printf ("\n"); + printf (" W - get wcs "); + printf (" ( - mark polyline "); + printf (" ) - mark polygon "); printf ("\n"); + printf (" + - mark plus "); + printf (" x - mark cross "); + printf (" * - mark star "); printf ("\n"); + printf (" = - test hardcopy "); + printf (" & - time 512 points "); + printf (" > - enable debug "); printf ("\n"); + printf (" < - disable debug "); + printf (" ? - help "); + printf (" , - dec linewidth "); printf ("\n"); + printf (" . - inc linewidth "); + printf (" [ - dec textwidth "); + printf (" ] - inc textwidth "); printf ("\n"); + printf (" { - dec linestyle "); + printf (" } - inc linestyle "); + printf (" Q - query mapping "); printf ("\n"); +} + + +make_raster (raster, nx, ny, color) +uchar *raster; +int nx, ny, color; +{ + register uchar pix; + register int i, j; + register float scale; + + if (color > 0) { + /* Build a solid color */ + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { + raster[i * nx + j] = (uchar) color; + } + } + } else { + /* Make a test pattern. */ + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { +/* Diagonal ramp +*/ + scale = 200. / (float)(ny) / 2.; + pix = (uchar) max(2, (min(200,(scale*i + scale*j)))); +/* Vertical ramp + scale = 200. / (float)(ny); + pix = (uchar) max(2, (min(200,(scale * i)))); +*/ +/* Horizontal ramp + scale = 200. / (float)(nx); + pix = (uchar) max(2, (min(200,(scale * j)))); +*/ + raster[i * nx + j] = pix; + } + } + } +} + diff --git a/vendor/x11iraf/cdl/test/coords b/vendor/x11iraf/cdl/test/coords new file mode 100644 index 00000000..7f6fcdf5 --- /dev/null +++ b/vendor/x11iraf/cdl/test/coords @@ -0,0 +1,42 @@ + 49 343 + 59 226 + 68 459 + 87 481 + 92 319 + 97 106 +113 143 +126 117 +133 391 +134 109 +134 221 +144 345 +150 83 +179 355 +182 63 +211 328 +218 439 +219 314 +225 129 +241 403 +265 340 +269 355 +288 133 +292 104 +294 178 +320 327 +321 32 +329 409 +338 325 +348 231 +349 188 +364 325 +365 124 +377 368 +381 67 +405 274 +415 187 +442 409 +452 212 +466 62 +472 232 +508 445 diff --git a/vendor/x11iraf/cdl/test/imdtest.c b/vendor/x11iraf/cdl/test/imdtest.c new file mode 100644 index 00000000..d43c023e --- /dev/null +++ b/vendor/x11iraf/cdl/test/imdtest.c @@ -0,0 +1,336 @@ +#include <stdio.h> +#define CDL_LIBRARY_SOURCE +#include "cdl.h" + +#define TEST_PATTERN -1 + +/* Utility macros. */ +#define max(a,b) (a > b ? a : b) +#define min(a,b) (a < b ? a : b) + + +/* IMDTEST -- Test routines for the IMD package. + */ + +main() +{ + IMDPtr imd, imd_open(); + char key, cmd[2], name[SZ_NAME], title[SZ_NAME]; + int i, j, zt=1, frame=1, fbconfig=2, color=201; + int debug = 1, nx, ny, ix=128, iy=128, wcs=0; + int xarray[1024], yarray[1024]; + float rx=128., ry=128.; + float a, b, c, d, tx, ty, z1, z2; + uchar pix, raster[1024*1024]; + + imd_setDebug (debug); + com_setDebug (debug); + if ((imd = imd_open ((char *)getenv("IMTDEV"))) == (IMDPtr) NULL) + exit (); + + cmd[0] = 'd'; + cmd[1] = '\n'; + print_help(); + do { + switch (cmd[0]) { + case '+': /* ENABLE DEBUG */ + imd_setDebug (++debug); + break; + + case '-': /* DISABLE DEBUG */ + imd_setDebug (--debug); + break; + + case 's': /* SAMPLE CURSOR */ + sleep (2); + if (imd_readCursor (imd, 1, &rx, &ry, &wcs, &key)) + printf ("...returns an error\n"); + printf ("cursor: x=%g y=%g key='%c'\n", rx, ry, key); + break; + + case 'c': /* SET CURSOR */ + sleep (2); + if (imd_setCursor (imd, 256, 256)) + printf ("...returns an error\n"); + break; + + case 'C': /* READ CURSOR */ + if (imd_readCursor (imd, 0, &rx, &ry, &wcs, &key)) + printf ("...returns an error\n"); + ix = (int) rx; + iy = (int) ry; + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", + rx, ix, ry, iy, key); + break; + + case 'd': /* WRITE IMAGE */ + printf ("creating raster....\n"); + /* + make_raster (raster, 1024, 1024, TEST_PATTERN); + */ + make_raster (raster, 512, 512, TEST_PATTERN); + imd_setName (imd, "test image"); + imd_setTitle (imd, "test title"); + printf ("displaying raster....\n"); + /* + if (imd_displayImage(imd,raster,1024,1024,frame,fbconfig,1)) + printf ("...returns an error\n"); + */ + if (imd_displayImage(imd,raster,512,512,frame,fbconfig,1)) + printf ("...returns an error\n"); + break; + + case 'D': /* READ IMAGE */ + if (imd_readImage (imd, raster, &nx, &ny)) + printf ("...returns an error\n"); + printf ("corners: nx=%d ny=%d LL = [%d] UR = [%d]\n", + nx, ny, raster[0], raster[nx*ny-1]); + if (imd_displayImage(imd,raster,nx,ny,frame,fbconfig,1)) + printf ("...returns an error\n"); + break; + + case 'e': /* ERASE FRAME */ + if (imd_clearFrame (imd)) + printf ("...returns an error\n"); + break; + + case 'F': /* READ FB */ + if (imd_readFrameBuffer (imd, raster, &nx, &ny)) + printf ("...returns an error\n"); + printf ("fb corners: nx=%d ny=%d LL = [%d] UR = [%d]\n", + nx, ny, raster[0], raster[nx*ny-1]); + if (imd_displayImage(imd,raster,nx,ny,frame,fbconfig,1)) + printf ("...returns an error\n"); + break; + + case 'm': /* MARK POINT */ + for (key='z'; key != 'q'; ) { + if (imd_readCursor (imd, 0, &rx, &ry, &wcs, &key)) + printf ("...returns an error\n"); + ix = (int) rx; + iy = (int) ry; + printf ("cursor: x=%g/%d y=%g/%d key='%c'\n", + rx, ix, ry, iy, key); + make_raster (raster, 16, 16, color); + color = (color+1 > 209 ? 201 : color+1); + if (imd_writeSubRaster (imd, ix-8, iy-8, 16, 16, raster)) + printf ("...returns an error\n"); + } + break; + + case 'n': /* NEXT FRAME */ + frame = (frame+1 > 4 ? 1 : frame+1); + if (imd_setFrame (imd, frame)) + printf ("...returns an error\n"); + printf ("imd->frame = %d\n", imd->frame); + break; + + case 'N': /* NEXT CONFIG */ + fbconfig = (fbconfig+1 > 12 ? 1 : fbconfig+1); + if (imd_setFBConfig (imd, fbconfig)) + printf ("...returns an error\n"); + i = imd->fbconfig - 1; + printf ("imd->fbconfig = %d/%d [%d %d %d %d]\n", imd->fbconfig, + i, imd->fbtab[i]->config, imd->fbtab[i]->nframes, + imd->fbtab[i]->width, imd->fbtab[i]->height); + break; + + case 'p': /* PREVIOUS FRAME */ + frame = (frame-1 < 1 ? 4 : frame-1); + if (imd_setFrame (imd, frame)) + printf ("...returns an error\n"); + printf ("imd->frame = %d\n", imd->frame); + break; + + case 'P': /* PREV CONFIG */ + if (imd_setFBConfig (imd, fbconfig)) + printf ("...returns an error\n"); + fbconfig = (fbconfig-1 < 1 ? 12 : fbconfig)-1; + i = imd->fbconfig - 1; + printf ("imd->fbconfig = %d/%d [%d %d %d %d]\n", imd->fbconfig, + i, imd->fbtab[i]->config, imd->fbtab[i]->nframes, + imd->fbtab[i]->width, imd->fbtab[i]->height); + break; + + case 'q': /* QUIT */ + goto quit; + case 'f': /* (FAST) REGION */ + make_raster (raster, 256, 256, TEST_PATTERN); + for (i=0; i < 256; i++) /* diagonal */ + (void) imd_writeSubRaster(imd,i,i,256,256,raster); + for (; i > 0; i--) /* left */ + (void) imd_writeSubRaster(imd,i,256,256,256,raster); + for (i=256; i > 0; i--) /* down */ + (void) imd_writeSubRaster(imd,0,i,256,256,raster); + for (i=0; i < 256; i++) /* right */ + (void) imd_writeSubRaster(imd,i,0,256,256,raster); + for (i=0; i < 256; i++) /* up */ + (void) imd_writeSubRaster(imd,256,i,256,256,raster); + break; + case 'r': /* WRITE REGION */ + make_raster (raster, 256, 256, TEST_PATTERN); + for (i=0; i < 100; i++) { + if (imd_writeSubRaster (imd,103+i,103+i,256,256,raster)) { + printf ("...returns an error\n"); + break; + } + } + + /* Old test to make sure we clip properly. + + make_raster (raster, 32, 32, color); + if (imd_writeSubRaster (imd, -16, -16, 32, 32, raster)) + printf ("...returns an error\n"); + if (imd_writeSubRaster (imd, -16, 496, 32, 32, raster)) + printf ("...returns an error\n"); + if (imd_writeSubRaster (imd, 496, -16, 32, 32, raster)) + printf ("...returns an error\n"); + if (imd_writeSubRaster (imd, 496, 496, 32, 32, raster)) + printf ("...returns an error\n"); + */ + color = (color+1 > 209 ? 201 : color+1); + break; + + case 'R': /* READ REGION */ + if (imd_readSubRaster (imd, -8, -8, 16, 16, raster)) + printf ("...returns an error\n"); + for (i=15; i > 0; i--) { + for (j=0; j < 16; j++) { + printf ("%3d ", raster[i * 16 + j]); + raster[i * 16 + j] = 0; + } + printf ("\n"); + } + if (imd_writeSubRaster (imd, -8, -8, 16, 16, raster)) + printf ("...returns an error\n"); + break; + + case 'w': /* SET WCS */ + if (imd_setWCS (imd, "imaname", "imtitle", 1., 0., 0., -1., 0., + 0., 1., 255., 1)) + printf ("...returns an error\n"); + break; + + case 'W': /* GET WCS */ + if (imd_setWCS (imd, name, title, &a, &b, &c, &d, &tx, &ty, + &z1, &z2, &zt)) + printf ("...returns an error\n"); + printf ("name='%s' title='%s'\n a=%g b=%g c=%g d=%g tx=%g ty=%g z1=%g z2=%g zt=%d\n", name, title, a, b, c, d, tx, ty, z1, z2, zt); + break; + + case '?': + print_help(); + break; + + case '1': /* WRITE CLIPPING */ + printf ("creating raster....\n"); + make_raster (raster, 512, 512, TEST_PATTERN); + imd_setFrame (imd, frame); + imd_clearFrame (imd); + imd_setFBConfig (imd, fbconfig); + imd_setName (imd, "test image"); + imd_setTitle (imd, "test title"); + printf ("displaying raster....\n"); + if (imd_writeImage(imd,raster,512,512,-8, -8)) + printf ("...returns an error\n"); + break; + + case '2': /* READ CLIPPING */ + if (imd_readSubRaster (imd, -8, -8, 16, 16, raster)) + printf ("...returns an error\n"); + for (i=15; i >= 0; i--) { + for (j=0; j < 16; j++) + printf ("%3d ", raster[i * 16 + j]); + printf ("\n"); + } + if (imd_writeSubRaster (imd, -8, -8, 16, 16, raster)) + printf ("...returns an error\n"); + break; + + case 'a': + clock (); + for (i=0, ix=16, iy=16; i < 1024; i++) { + ix = xarray[i] = (ix+10 > 500 ? 16 : ix + 10); + iy = yarray[i] = (ix == 16 ? iy + 16: iy); + } + for (i=0; i < 1024; i++) { + make_raster (raster, 8, 8, color); + color = (color+1 > 209 ? 201 : color+1); + if (imd_writeSubRaster (imd, xarray[i], yarray[i], + 8, 8, raster)) + printf ("...returns an error\n"); + } + printf ("takes %d microseconds\n", clock()); + } + printf ("Command: "); + + scanf ("%s", cmd); + } while (cmd[0] != 'q'); + +quit: (void) imd_close (imd); +} + + +print_help () +{ + printf ("\n"); + printf (" c - set cursor "); + printf (" C - read cursor "); + printf (" d - write image "); printf ("\n"); + printf (" D - read image "); + printf (" e - erase frame "); + printf (" F - read frame buf "); printf ("\n"); + printf (" m - mark points "); + printf (" n - next frame "); + printf (" N - next config "); printf ("\n"); + printf (" p - previous frame "); + printf (" P - prev config "); + printf (" q - quit "); printf ("\n"); + printf (" r - write region "); + printf (" R - read region "); + printf (" s - sample cursor "); printf ("\n"); + printf (" w - set wcs "); + printf (" W - get wcs "); + printf (" ? - print help "); printf ("\n"); + printf (" + - enable debug "); + printf (" - - disable debug "); printf ("\n"); +} + + +make_raster (raster, nx, ny, color) +uchar *raster; +int nx, ny, color; +{ + register uchar pix; + register int i, j; + register float scale; + + if (color > 0) { + /* Build a solid color */ + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { + raster[i * nx + j] = (uchar) color; + } + } + } else { + /* Make a test pattern. */ + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { +/* Diagonal ramp +*/ + scale = 200. / (float)(ny) / 2.; + pix = (uchar) max(2, (min(200,(scale*i + scale*j)))); +/* Vertical ramp + scale = 200. / (float)(ny); + pix = (uchar) max(2, (min(200,(scale * i)))); +*/ +/* Horizontal ramp + scale = 200. / (float)(nx); + pix = (uchar) max(2, (min(200,(scale * j)))); +*/ + raster[i * nx + j] = pix; + } + } + } +} + diff --git a/vendor/x11iraf/cdl/test/zzdebug.x b/vendor/x11iraf/cdl/test/zzdebug.x new file mode 100644 index 00000000..352b0657 --- /dev/null +++ b/vendor/x11iraf/cdl/test/zzdebug.x @@ -0,0 +1,44 @@ +include "../cdlspp.h" + +# ZZDEBUG -- Quickie demo tasks of the CDL SPP language binding. + + +task display = t_display, + tvmark = t_tvmark, + rimcur = t_rimcur + + +procedure t_display () +int ier +begin + call cdl_open ("", ier) + call cdl_displayIRAF ("/iraf/iraf/dev/pix.imh", 1, 1, 1, 1, ier) + call cdl_close () +end + +procedure t_tvmark () +int ier +begin + call cdl_open ("", ier) + call cdl_displayIRAF ("/iraf/iraf/dev/pix.imh", 1, 1, 1, 1, ier) + call cdl_markCoordsFile ("coords", M_PLUS, 11, C_GREEN, YES, ier) + call cdl_close () +end + +procedure t_rimcur () +int ier +char key +real x, y +begin + call cdl_open ("", ier) + key = 'a' + while (key != 'q' && key != EOS) { + call cdl_readCursor (0, x, y, key, ier) + call printf ("x=%.2g y=%.2g key='%c' ier=%d\n") + call pargr (x) + call pargr (y) + call pargc (key) + call pargi (ier) + } + call cdl_close () +end diff --git a/vendor/x11iraf/cdl/vximtool.c b/vendor/x11iraf/cdl/vximtool.c new file mode 100644 index 00000000..e0b4b0fe --- /dev/null +++ b/vendor/x11iraf/cdl/vximtool.c @@ -0,0 +1,2130 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#include <sys/times.h> +#include <sys/types.h> +#include <sys/socket.h> +#if defined(AIX) || defined(AIXV3) || defined (AIXV4) +#include <sys/select.h> +#endif +#include <netinet/in.h> +#include <sys/un.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> + + +#ifdef HAVE_CDL /* If we have the CDL we can build a proxy server. */ +#include "cdl.h" +#endif + + +/* + * VXIMTOOL.C -- Virtual image display server. This is a server process much + * like XIMTOOL, except that all the process does is respond to datastream + * requests to read and write to internal frame buffers maintained as arrays + * in memory. Multiple frame buffers and frame buffer configurations are + * supported. A log is kept to the stderr of all datastream requests. The + * process is terminated with an EOF on the stdin. + * + * + * To build: cc vximtool.c -o vximtool + * cc vximtool.c -o vximtool -lsocket # For Solaris systems + * cc -DANSI_FUNC vximtool.c # Use ANSI function prototypes + * + * Usage: vximtool -verbose >& spool # run server, log output + * vximtool -i # run interactively + * vximtool -noraster # don't store images in memory + * vximtool -i < cursor_file # take cursor input from file + * + * Options + * + * vximtool [-background] [-config <num>] [-fifo <pipe>] [-fifo_only] [-help] + * [-i] [-imtoolrc <file>] [-inet_only | -port_only] [-noraster] + * [-nframes <num>] [-port <num>] [-proxy] [-verbose] [-unix <name>] + * [-unix_only] + * + * + * Minimal match for command line options may be used. In interactive mode, + * cursor value strings may be typed in on the server stdin in response to + * cursor read requests from the client. Otherwise, a constant cursor value + * "1.0 1.0 101 q" is returned. + */ + + +/* Default values, size limiting values. + */ +#define MAX_FBCONFIG 128 /* max possible frame buf sizes */ +#ifndef HAVE_CDL +#define MAX_FRAMES 16 /* max number of frames */ +#endif +#define MAX_MAPPINGS 32 /* max number mappings/frame */ +#define MAX_CLIENTS 8 /* max display server clients */ +#define DEF_NFRAMES 1 /* save memory; only one frame */ +#define DEF_FRAME_WIDTH 512 /* 512 square frame */ +#define DEF_FRAME_HEIGHT 512 /* 512 square frame */ + +#define SZ_LABEL 256 /* main frame label string */ +#define SZ_IMTITLE 128 /* image title string */ +#define SZ_FIFOBUF 4000 /* transfer size for FIFO i/o */ +#define SZ_FNAME 256 +#define SZ_LINE 256 + +/* Magic numbers. */ +#define DEF_PORT 5137 /* default tcp/ip socket */ +#define DEF_PROXY_PORT 5136 /* default proxy socket */ +#define I_DEVNAME "/dev/imt1o" /* pseudo device names */ +#define O_DEVNAME "/dev/imt1i" /* our IN is client's OUT */ +#define DEF_UNIXADDR "/tmp/.IMT%d" /* default unix socket */ +#define FBCONFIG_1 ".imtoolrc" +#define FBCONFIG_2 "/usr/local/lib/imtoolrc" +#define FBCONFIG_ENV1 "imtoolrc" +#define FBCONFIG_ENV2 "IMTOOLRC" + +/* IIS definitions. */ +#define IO_TIMEOUT 30 +#define MAXCONN 5 +#define SZ_IOBUF 65536 /* max size data transfer */ +#define SZ_FIFOBUF 4000 +#define SZ_OLD_WCSBUF 320 /* old WCS text buffer size */ +#define SZ_WCSBUF 1024 /* WCS text buffer size */ +#define SZ_FNAME 256 +#define SZ_IMCURVAL 160 + +#define IIS_VERSION 10 /* version 10 -> 1.0 */ + +#define MEMORY 01 /* frame buffer i/o */ +#define LUT 02 /* lut i/o */ +#define FEEDBACK 05 /* used for frame clears */ +#define IMCURSOR 020 /* logical image cursor */ +#define WCS 021 /* used to set WCS */ + +#define PACKED 0040000 +#define COMMAND 0100000 +#define IIS_READ 0100000 +#define IMC_SAMPLE 0040000 +#define IMT_FBCONFIG 077 +#define XYMASK 077777 + +struct iism70 { /* DO NOT change the order of */ + short tid; /* this structure. */ + short thingct; + short subunit; + short checksum; + short x, y, z; + short t; +}; + +/* IIS data pixel values. */ +#define CMS_DATASTART 1 +#define CMS_DATAEND 200 +#define CMS_DATARANGE 200 + +/* WCS definitions. */ +#define W_UNITARY 0 +#define W_LINEAR 1 +#define W_LOG 2 +#define W_DEFFORMAT " %7.2f %7.2f %7.1f%c" + +/* Rotation matrix defining world coordinate system (WCS) of a frame. */ +typedef struct { + int valid; /* has WCS been set? */ + float a, b; /* x, y scale factors */ + float c, d; /* x, y cross factors */ + float tx, ty; /* x, y translation */ + float z1, z2; /* greyscale range */ + int zt; /* greyscale mapping */ + char format[32]; /* wcs output format */ + char imtitle[SZ_IMTITLE+1]; /* image title from WCS */ +} Ctran, *CtranPtr; + +/* Coordinate mappings on each frame buffer. */ +typedef struct { + int id; /* object id */ + Ctran ctran; /* world coordinate system */ + char ref[SZ_FNAME+1]; /* image reference from WCS */ + int regid; /* region id */ + char region[SZ_FNAME+1]; /* region name from WCS */ + float sx, sy; /* source rect */ + int snx, sny; + int dx, dy; /* destination rect */ + int dnx, dny; +} Mapping, *MappingPtr; + +/* The frame buffers. */ +typedef struct { + int frameno; /* frame number */ + char *framebuf; /* frame buffer raster */ + char label[SZ_LABEL+1]; /* frame label string */ + Ctran ctran; /* world coordinate system */ + char wcsbuf[SZ_WCSBUF]; /* wcs info string */ + Mapping mapping[MAX_MAPPINGS]; /* coordinate mappings */ + int nmaps; /* number of defined mappings */ +} FrameBuf, *FrameBufPtr; + +/* Possible frame buffer sizes. */ +typedef struct { + int nframes; /* number of frames */ + int width; /* frame buffer width */ + int height; /* frame buffer height */ +} FbConfig, *FbConfigPtr; + +/* Client I/O channel. */ +typedef struct { + void *vxim; /* backpointer to vxim descriptor */ + int type; /* channel type */ + int listen_fd; /* socket server fd */ + int datain; /* input channel */ + int dataout; /* output channel */ + int keepalive; /* used to keep input fifo ready */ + int connected; /* channel is connected to client */ + int port; /* inet port number */ + char path[SZ_FNAME+1]; /* for unix sockets */ + int reference_frame; /* reference (cmd i/o) frame */ + int version; /* flags capability of client */ + FrameBufPtr rf_p; /* reference frame descriptor */ +} IoChan, *IoChanPtr; + +#define IO_FIFO 1 +#define IO_INET 2 +#define IO_UNIX 3 + + +/* Application runtime descriptor. + * -------------------------------- + */ +typedef struct { + int def_config; /* default FB config */ + int def_nframes; /* default number of frames */ + char *imtoolrc; /* imtoolrc file name */ + char *input_fifo; /* client's output */ + char *output_fifo; /* client's input */ + char *unixaddr; /* format for unix socket path */ + int port; /* port for INET socket */ + + /* Internal state. */ + int display_frame; /* currently displayed frame */ + int fb_configno; /* current config number */ + int nframes; /* current number of frame bufs */ + int width, height; /* current width, height */ + IoChan chan[MAX_CLIENTS]; /* client i/o descriptors */ + FrameBufPtr df_p; /* display frame descriptor */ + FrameBuf frames[MAX_FRAMES]; /* array of frame descriptors */ + FbConfig fb_config[MAX_FBCONFIG]; /* fb config table */ + +} VXimData, *VXimDataPtr; + + +/* Initialize the structure with out starting values. These can be reset + * with command line options. + */ +VXimData server_data = { + 1, /* def_config */ + DEF_NFRAMES, /* def_nframes */ + FBCONFIG_2, /* def_imtoolrc */ + O_DEVNAME, /* input_fifo */ + I_DEVNAME, /* output_fifo */ + DEF_UNIXADDR, /* unixaddr */ + DEF_PORT, /* port */ + 1, /* display_frame */ + 1, /* fb_configno */ + 2, /* nframes */ + 512, 512 /* width, height */ +}; + +/* Functions. + */ +#ifndef abs +#define abs(a) (((a)<0)?(-(a)):(a)) +#endif +#ifndef min +#define min(a,b) ((a)<(b)?(a):(b)) +#endif +#ifndef max +#define max(a,b) ((a)<(b)?(b):(a)) +#endif + +#ifdef SOLARIS +#define bzero(a,n) memset(a,0,n) +#define bcopy(a,b,n) memmove(b,a,n) +#endif + +#define SELWIDTH 32 + +#ifdef HAVE_CDL +static int proxy = 0; +static int nclients = 0; +CDLPtr cdl[MAX_CLIENTS]; +#endif +static int keep_raster = 1; +extern int errno; +static int background = 0; +static int objid = 0; +static int verbose = 0; +static int interactive = 0; +static float cursor_x = 1.0, cursor_y = 1.0; +static fd_set fds, allset; + + +#ifdef ANSI_FUNC + +int main(int argc, char **argv); +static int vx_iisopen(register VXimDataPtr vxim); +static void vx_iisclose(register VXimDataPtr vxim); +static IoChanPtr open_fifo(register VXimDataPtr vxim); +static IoChanPtr open_inet(register VXimDataPtr vxim); +static IoChanPtr open_unix(register VXimDataPtr vxim); +static void vx_connectClient(IoChanPtr chan, int *source); +static void vx_disconnectClient(register IoChanPtr chan); +static IoChanPtr get_iochan(register VXimDataPtr vxim); +static void vx_iisio(IoChanPtr chan, int *fd_addr, int source); +static void set_fbconfig(IoChanPtr chan, int config, int frame); +static int decode_frameno(register int z); +static void bswap2(char *a, char *b, int nbytes); +static void vx_retCursorVal(register int dataout, float sx, float sy, + int wcs, int key, char *strval); +static CtranPtr wcs_update(register VXimDataPtr vxim, FrameBufPtr fr); +static void vx_initialize(register VXimDataPtr vxim, int config, + int nframes, int reset); +static void vx_initFrame(register VXimDataPtr vxim, int frame, + int nframes, FbConfigPtr config); +static void vx_eraseFrame(register VXimDataPtr vxim, int frame); +static void get_fbconfig(register VXimDataPtr vxim); +static void Usage(void); +static void printoption(char *st); +static void add_mapping(register VXimDataPtr vxim, CtranPtr ctran, + char *wcsbuf, FrameBufPtr fr); +#ifdef HAVE_CDL +static void vx_flip(char *buffer, int nx, int ny); +#endif +static int iis_read (int fd, void *vptr, int nbytes); +static int iis_write (int fd, void *vptr, int nbytes); + +#else + +static void vx_iisclose(), vx_connectClient(), vx_disconnectClient(); +static void vx_iisio(), set_fbconfig(), vx_retCursorVal(); +static void vx_initialize(), vx_initFrame(), vx_eraseFrame(); +static void get_fbconfig(), Usage(), printoption(); +static void add_mapping(); +#ifdef HAVE_CDL +static void vx_flip(); +#endif +static int vx_iisopen(), decode_frameno(), iis_read(), iis_write(); +static void bswap2(); +static IoChanPtr open_fifo(), open_inet(), open_unix(), get_iochan(); +static CtranPtr wcs_update(); + +#endif + + +/* + * VXIMTOOL -- Virtual display server process. This task is an image display + * server like XImtool, responding to datastream requests on fifo pipes, + * inet sockets, or unix sockets. Up to 16 frames are supported, frame + * buffers may be any of the defined frames in the imtoolrc file. Images + * are stored in memory, allowing readback by the client. Cursor input can + * come from stdin (or a redirected file) allowing the user to respond to + * client cursor requests. The task is terminated with an EOF on stdin. + */ + +#ifdef ANSI_FUNC + +int +main (int argc, char **argv) +#else + +main (argc, argv) +int argc; +char **argv; +#endif +{ + register VXimDataPtr vxim = &server_data; + register IoChanPtr chan; + register int i, nopen, n; + char buf[SZ_FNAME]; + int fd; + + /* Process the command line arguments. */ + for (i=1; i < argc; i++) { + +#ifdef HAVE_CDL + /* Anything without a '-' is a client device to add to the proxy + * list. Format of the arg must be a valid IMTDEV string. + */ + if (proxy && argv[i][0] != '-') { + if ((cdl[nclients++] = cdl_open (argv[i])) == (CDLPtr) NULL) + nclients--; + else if (verbose) + printf ("Connected to server on %s\n", argv[i]); + continue; + } +#endif + if (strncmp (argv[i], "-background", 2) == 0) { + background = 1; + } else if (strncmp (argv[i], "-config", 2) == 0) { + vxim->def_config = atoi (argv[++i]); + } else if (strncmp (argv[i], "-fifo_only", 6) == 0) { + vxim->unixaddr = "none"; + vxim->port = 0; + } else if (strncmp (argv[i], "-fifo", 5) == 0) { + vxim->input_fifo = (char *) calloc (SZ_FNAME, sizeof(char)); + vxim->output_fifo = (char *) calloc (SZ_FNAME, sizeof(char)); + sprintf (vxim->input_fifo, "%si", argv[++i]); + sprintf (vxim->output_fifo, "%so", argv[i]); + } else if (strncmp (argv[i], "-help", 2) == 0) { + Usage (); + exit (0); + } else if (strncmp (argv[i], "-imtoolrc", 3) == 0) { + vxim->imtoolrc = argv[++i]; + } else if (strncmp (argv[i], "-inet_only", 3) == 0) { + vxim->input_fifo = ""; + vxim->unixaddr = "none"; + } else if (strcmp (argv[i], "-i") == 0) { + interactive++; + } else if (strncmp (argv[i], "-noraster", 3) == 0) { + keep_raster = 0; + } else if (strncmp (argv[i], "-nframes", 3) == 0) { + i++; + vxim->def_nframes = min (MAX_FRAMES, atoi (argv[i])); + } else if (strncmp (argv[i], "-port_only", 6) == 0) { + vxim->input_fifo = ""; + vxim->unixaddr = "none"; + } else if (strncmp (argv[i], "-port", 5) == 0) { + vxim->port = atoi (argv[++i]); +#ifdef HAVE_CDL + } else if (strncmp (argv[i], "-proxy", 5) == 0) { + proxy = 1; + vxim->port = DEF_PROXY_PORT; /* re-assign port */ + vxim->input_fifo = ""; /* shut off other connections */ + vxim->unixaddr = "none"; +#endif + } else if (strncmp (argv[i], "-verbose", 2) == 0) { + verbose = 1; + } else if (strncmp (argv[i], "-unix_only", 6) == 0) { + vxim->input_fifo = ""; + vxim->port = 0; + } else if (strncmp (argv[i], "-unix", 5) == 0) { + vxim->unixaddr = argv[++i]; + } + } + +#ifdef HAVE_CDL + /* If we're acting as a proxy server, but can't connect to anything, + * exit. In this case it is required that the servers be running + * before starting the proxy program so we have a connection waiting. + */ + if (!nclients && proxy) { + fprintf (stderr, "Error: No servers available for display.\007\n"); + exit (-1); + } +#endif + + /* Initialize the frame buffers */ + vx_initialize (vxim, vxim->def_config, vxim->def_nframes, 1); + + /* Listen for a client connection and initialize the fdset. */ + if (!(nopen = vx_iisopen (vxim))) { + fprintf (stderr, "Error: Cannot open client communications.\007\n"); + exit (-1); + } + FD_ZERO (&allset); + for (i=0; i < nopen; i++) { + chan = &vxim->chan[i]; + FD_SET (chan->datain, &allset); + } + if (!background || interactive) + FD_SET (fileno(stdin), &allset); + + /* Sit in a loop waiting on input, processing the events. */ + while (1) { + fds = allset; /* reset the FD set on each pass */ + + if ((n = select (SELWIDTH, &fds, NULL, NULL, NULL)) > 0) { + + /* Loop over each of the open connections, checking for and + * processing input on any that are ready. + */ + for (i=0; i < nopen; i++) { + chan = &vxim->chan[i]; + fd = chan->datain; + if (FD_ISSET(fd, &fds)) { + + /* Connect the client if not already connected. */ + if (!chan->connected) { + if (verbose) { + if (chan->type == IO_UNIX) + fprintf (stderr, + "connecting client on %s\n", + chan->path); + else if (chan->type == IO_INET) + fprintf (stderr, + "connecting client on port %d\n", + vxim->port); + } + vx_connectClient (chan, &chan->datain); + } + + /* Process any waiting input. */ + vx_iisio (chan, &chan->datain, chan->type); + fflush (stdout); fflush (stderr); + } + } + + /* Check the stdin for an EOF so we can quit gracefully. */ + if (!background) { + if (FD_ISSET(fileno(stdin), &fds)) { + if ((n = read (fileno(stdin), buf, SZ_FNAME)) <= 0) { + /* Shut it down. */ + vx_iisclose (vxim); + exit (0); + } + } + } + + } else if (n < 0) { + fprintf (stderr, "Error: select error\007\n"); + exit (-1); + } + } +} + + + +/* VX_IISOPEN -- Initialize the IIS protocol module and ready the module to + * accept client connections and begin processing client requests. Clients + * may connect to the server using a fifo connection or an internet or + * UNIX domain socket connection. All three types of server ports are + * simultaneously ready to receive client connections. + */ +#ifdef ANSI_FUNC + +static int +vx_iisopen (register VXimDataPtr vxim) +#else + +static int +vx_iisopen (vxim) +register VXimDataPtr vxim; +#endif +{ + int nopen = 0; + + if (open_fifo (vxim)) + nopen++; + if (open_inet (vxim)) + nopen++; + if (open_unix (vxim)) + nopen++; + + return (nopen); +} + + +/* VX_IISCLOSE -- Close down the IIS protocol module. + */ +#ifdef ANSI_FUNC + +static void +vx_iisclose (register VXimDataPtr vxim) +#else + +static void +vx_iisclose (vxim) +register VXimDataPtr vxim; +#endif +{ + register IoChanPtr chan = NULL; + register FrameBufPtr fb; + register int i, j; + + for (i=0; i < (sizeof(vxim->chan) / sizeof(vxim->chan[0])); i++) { + chan = &vxim->chan[i]; + + /* Free the in-memory frame buffer rasters. */ + for (j=0; j < vxim->nframes; j++) { + fb = &vxim->frames[j]; + if (keep_raster && fb->framebuf) + free (fb->framebuf); + } + + /* Close the I/O channels. */ + switch (chan->type) { + case IO_FIFO: + if (chan->keepalive >= 0) + close (chan->keepalive); + if (chan->datain >= 0) + close (chan->datain); + if (chan->dataout >= 0) + close (chan->dataout); + chan->type = 0; + if (verbose) + fprintf (stderr, "vximtool: closing fifo connection\n"); + break; + + case IO_INET: + close (chan->datain); + chan->type = 0; + if (verbose) + fprintf (stderr, "vximtool: closing inet socket\n"); + break; + + case IO_UNIX: + close (chan->datain); + unlink (chan->path); + chan->type = 0; + if (verbose) + fprintf (stderr, "vximtool: closing unix socket\n"); + break; + } + } +} + + +/* OPEN_FIFO -- Open the server fifo port and make ready to accept client + * connections and begin processing client requests. There is no client + * yet at this stage. + */ +#ifdef ANSI_FUNC + +static IoChanPtr +open_fifo (register VXimDataPtr vxim) +#else + +static IoChanPtr +open_fifo (vxim) +register VXimDataPtr vxim; +#endif +{ + register IoChanPtr chan; + int datain, dataout; + int keepalive; + + /* Setting the input fifo to "none" or the null string disables + * fifo support. + */ + if (!vxim->input_fifo[0] || strcmp(vxim->input_fifo,"none")==0) + return (NULL); + + datain = dataout = -1; + + /* Open the output fifo (which is the client's input fifo). We have + * to open it ourselves first as a client to get around the fifo + * open-no-client error. + */ + if ((datain = open (vxim->input_fifo, O_RDONLY|O_NDELAY)) != -1) { + if ((dataout = open (vxim->input_fifo, O_WRONLY|O_NDELAY)) != -1) + fcntl (dataout, F_SETFL, O_WRONLY); + else + goto done; + close (datain); + } else + goto done; + + /* Open the input stream, a FIFO pseudodevice file used by + * applications to send us commands and data. + */ + if ((datain = open (vxim->output_fifo, O_RDONLY|O_NDELAY)) == -1) + goto done; + else { + /* Clear O_NDELAY for reading. */ + fcntl (datain, F_SETFL, O_RDONLY); + + /* Open the client's output fifo as a pseudo-client to make it + * appear that a client is connected. + */ + keepalive = open (vxim->output_fifo, O_WRONLY); + } +done: + /* Allocate and fill in i/o channel descriptor. */ + if (datain > 0 && dataout > 0 && (chan = get_iochan(vxim))) { + chan->vxim = (void *) vxim; + chan->type = IO_FIFO; + chan->datain = datain; + chan->dataout = dataout; + chan->keepalive = keepalive; + chan->connected = 1; + chan->reference_frame = 1; + chan->rf_p = &vxim->frames[0]; + } else { + fprintf (stderr, "Warning: cannot open %s\n", vxim->output_fifo); + chan = NULL; + } + + /* Register input callback. */ + if (!chan) { + if (datain > 0) + close (datain); + if (dataout > 0) + close (dataout); + } else if (verbose) { + fprintf (stderr, + "vximtool: Open to accept input on fifo: %s\n", vxim->input_fifo); + } + + return (chan); +} + + +/* OPEN_INET -- Set up a port to be used for incoming client connections + * using internet domain sockets. + */ +#ifdef ANSI_FUNC + +static IoChanPtr +open_inet (register VXimDataPtr vxim) +#else + +static IoChanPtr +open_inet (vxim) +register VXimDataPtr vxim; +#endif +{ + register int s = 0; + register IoChanPtr chan; + struct sockaddr_in sockaddr; + + /* Setting the port to zero disables inet socket support. */ + if (vxim->port <= 0) + return (NULL); + + if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) + goto err; + + memset ((void *)&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sin_family = AF_INET; + sockaddr.sin_port = htons((short)vxim->port); + sockaddr.sin_addr.s_addr = htonl(INADDR_ANY); + if (bind (s, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) + goto err; + + if (listen (s, MAXCONN) < 0) + goto err; + + /* Allocate and fill in i/o channel descriptor. */ + if ((chan = get_iochan(vxim))) { + chan->vxim = (void *) vxim; + chan->type = IO_INET; + chan->port = vxim->port; + chan->datain = s; + chan->dataout = s; + chan->listen_fd = s; + chan->connected = 0; + chan->reference_frame = 1; + chan->rf_p = &vxim->frames[0]; + if (verbose) + fprintf (stderr, + "vximtool: Open to accept input on inet: port %d\n", + vxim->port); + return (chan); + } +err: + fprintf (stderr, "vximtool: cannot open socket on port %d, errno=%d\n", + vxim->port, errno); + if (s) + close (s); + return (NULL); +} + + +/* OPEN_UNIX -- Set up a port to be used for incoming client connections + * using unix domain sockets. + */ +#ifdef ANSI_FUNC + +static IoChanPtr +open_unix (register VXimDataPtr vxim) +#else + +static IoChanPtr +open_unix (vxim) +register VXimDataPtr vxim; +#endif +{ + register int s = 0; + register IoChanPtr chan; + struct sockaddr_un sockaddr; + char path[256]; + + /* Setting the addr to "none" or the null string disables unix + * socket support. + */ + if (!vxim->unixaddr[0] || strcmp(vxim->unixaddr,"none")==0) + return (NULL); + + /* Get path to be used for the unix domain socket. */ + sprintf (path, vxim->unixaddr, getuid()); + unlink (path); + + if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) + goto err; + + memset ((void *)&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sun_family = AF_UNIX; + strcpy (sockaddr.sun_path, path); + if (bind (s, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) + goto err; + + if (listen (s, MAXCONN) < 0) + goto err; + + /* Allocate and fill in i/o channel descriptor. */ + if ((chan = get_iochan(vxim))) { + chan->vxim = (void *) vxim; + chan->type = IO_UNIX; + chan->datain = s; + chan->dataout = s; + chan->listen_fd = s; + chan->connected = 0; + chan->reference_frame = 1; + chan->rf_p = &vxim->frames[0]; + strncpy (chan->path, path, SZ_FNAME); + if (verbose) + fprintf (stderr, + "vximtool: Open to accept input on unix: %s\n", path); + return (chan); + } +err: + fprintf (stderr, "vximtool: cannot open socket on port %s, errno=%d\n", + path, errno); + if (s) + close (s); + return (NULL); +} + + +/* VX_CONNECTCLIENT -- Called when a client has attempted a connection on + * a socket port. Accept the connection and set up a new i/o channel to + * communicate with the new client. + */ +#ifdef ANSI_FUNC + +static void +vx_connectClient (IoChanPtr chan, int *source) +#else + +static void +vx_connectClient (chan, source) +IoChanPtr chan; +int *source; +#endif +{ + register VXimDataPtr vxim = (VXimDataPtr) chan->vxim; + register int s; + + /* Accept connection. */ + if ((s = accept ((int)*source, (struct sockaddr *)0, (int *)0)) < 0) + return; +/* + if (fcntl (s, F_SETFD, O_RDWR|O_NDELAY) < 0) { + close (s); + return; + } +*/ + + /* Allocate and fill in i/o channel descriptor. */ + FD_SET(s, &allset); + chan->datain = s; + chan->dataout = s; + chan->connected = 1; + chan->reference_frame = 1; + chan->rf_p = &vxim->frames[0]; + + switch (chan->type) { + case IO_INET: + if (verbose) + fprintf (stderr, + "connecting client on port %d\n", chan->port); + case IO_UNIX: + if (verbose && chan->type == IO_UNIX) + fprintf (stderr, + "connecting client on %s\n", chan->path); + } +} + + +/* VX_DISCONNECTCLIENT -- Called to close a client connection when EOF is + * seen on the input port. Close the connection and free the channel + * descriptor. + */ +#ifdef ANSI_FUNC + +static void +vx_disconnectClient (register IoChanPtr chan) +#else + +static void +vx_disconnectClient (chan) +register IoChanPtr chan; +#endif +{ + switch (chan->type) { + case IO_INET: + if (verbose) + fprintf (stderr, + "disconnecting client on port %d\n", chan->port); + case IO_UNIX: + if (verbose && chan->type == IO_UNIX) + fprintf (stderr, + "disconnecting client on %s\n", chan->path); + FD_CLR(chan->datain, &allset); + close (chan->datain); + chan->datain = chan->dataout = chan->listen_fd; + chan->connected = 0; + break; + default: + break; + } +} + + +/* GET_IOCHAN --- Get an i/o channel descriptor. + */ +#ifdef ANSI_FUNC + +static IoChanPtr +get_iochan (register VXimDataPtr vxim) +#else + +static IoChanPtr +get_iochan (vxim) +register VXimDataPtr vxim; +#endif +{ + register int i; + + for (i=0; i < MAX_CLIENTS; i++) + if (!vxim->chan[i].type) + return (&vxim->chan[i]); + + return (NULL); +} + + +/* VX_IISIO -- File i/o callback procedure, called when there is input + * pending on the data stream to the vximtool client. + */ +#ifdef ANSI_FUNC + +static void +vx_iisio (IoChanPtr chan, int *fd_addr, int source) +#else + +static void +vx_iisio (chan, fd_addr, source) +IoChanPtr chan; +int *fd_addr; +int source; +#endif +{ + register VXimDataPtr vxim = (VXimDataPtr) chan->vxim; + register int sum, i; + register short *p; + int datain = *fd_addr; + int dataout = chan->dataout; + int ndatabytes, nbytes, n, ntrys=0; + struct iism70 iis; + char buf[SZ_FIFOBUF]; + static int errmsg=0, bswap=0; + + + /* Get the IIS header. */ + if ((n = iis_read (datain, (char *)&iis, sizeof(iis))) < sizeof(iis)) { + if (n != 0) + fprintf (stderr, + "vximtool: command input read error, n=%d of %d, errno=%d\n", + n, sizeof(iis), errno); + if (n <= 0) + vx_disconnectClient (chan); + return; + } else if (bswap) + bswap2 ((char *)&iis, (char *)&iis, sizeof(iis)); + + /* Verify the checksum. If it fails swap the bytes and try again. + */ + for (;;) { + for (i=0, sum=0, p=(short *)&iis; i < 8; i++) + sum += *p++; + if ((sum & 0177777) == 0177777) + break; + + if (ntrys++) { + if (!errmsg++) { + fprintf (stderr, "vximtool: bad data header checksum\n"); + if (bswap) + bswap2 ((char *)&iis, (char *)&iis, sizeof(iis)); + fprintf (stderr, "noswap:"); + for (i=0, p=(short *)&iis; i < 8; i++) + fprintf (stderr, " %6o", p[i]); + fprintf (stderr, "\n"); + + bswap2 ((char *)&iis, (char *)&iis, sizeof(iis)); + fprintf (stderr, " swap:"); + for (i=0, p=(short *)&iis; i < 8; i++) + fprintf (stderr, " %6o", p[i]); + fprintf (stderr, "\n"); + } + break; + + } else { + bswap2 ((char *)&iis, (char *)&iis, sizeof(iis)); + bswap = !bswap; + } + } + + ndatabytes = -iis.thingct; + if (!(iis.tid & PACKED)) + ndatabytes *= 2; + + if (verbose) { + fprintf (stderr, "%s: ", (source == IO_FIFO ? "fifo" : + (source == IO_INET ? "inet" : "unix"))); + fprintf (stderr, + "subunit=%03o tid=%06o nbytes=%6d x=%06o y=%06o z=%06o t=%06o\n", + iis.subunit & 077, + iis.tid, + ndatabytes, + iis.x & 0177777, + iis.y & 0177777, + iis.z & 0177777, + iis.t & 0177777); + fflush (stdout); + } + + + switch (iis.subunit & 077) { + case FEEDBACK: + /* The feedback unit is used only to clear a frame. + */ + chan->reference_frame = decode_frameno (iis.z & 07777); + vx_eraseFrame (vxim, chan->reference_frame); +#ifdef HAVE_CDL + if (proxy) { + for (i=0; i < nclients; i++) + cdl_clearFrame (cdl[i]); + } +#endif + if (verbose) + fprintf (stderr, "erase frame %d - ref = %d\n", + decode_frameno(iis.z & 0177777), chan->reference_frame); + break; + + case LUT: + /* Data mode writes to the frame lookup tables are not implemented. + * A command mode write to the LUT subunit is used to connect + * image memories up to the RGB channels, i.e., to select the frame + * to be displayed. We ignore any attempt to assign multiple + * frames to multiple color channels, and just do a simple frame + * select. + */ + if (iis.subunit & COMMAND) { + int frame, z, n; + short x[14]; + + if (iis_read (datain, (char *)x, ndatabytes) == ndatabytes) { + if (bswap) + bswap2 ((char *)x, (char *)x, ndatabytes); + + z = x[0]; + if (!z) z = 1; + for (n=0; !(z & 1); z >>= 1) + n++; + + frame = max (1, n + 1); + if (frame > vxim->nframes) { + if (frame <= MAX_FRAMES) { +#ifdef HAVE_CDL + if (proxy) { + for (i=0; i < nclients; i++) { + cdl_setFBConfig (cdl[i], vxim->fb_configno); + cdl_setFrame (cdl[i], frame); + } + } +#endif + set_fbconfig (chan, vxim->fb_configno, frame); + if (verbose) + fprintf (stderr, "set_fbconfig (%d, %d)\n", + vxim->fb_configno, frame); + } else { + fprintf (stderr, "imtool warning: "); + fprintf (stderr, + "attempt to display nonexistent frame %d\n", + frame); + return; + } + } + + vxim->display_frame = frame; + if (verbose) + fprintf (stderr, "set_frame (%d)\n", frame); + return; + } + } + + case MEMORY: + /* Load data into the frame buffer. Data is assumed to be byte + * packed. + */ + if (iis.tid & IIS_READ) { + /* Read from the display. + */ + register FrameBufPtr fb; + unsigned char *ip, iobuf[SZ_IOBUF]; + int nbytes, nleft, n, x, y; + long starttime; + + /* Get the frame to be read from. */ + chan->reference_frame = decode_frameno (iis.z & 0177777); + fb = &vxim->frames[chan->reference_frame-1]; + + nbytes = ndatabytes; + x = iis.x & XYMASK; + y = iis.y & XYMASK; + + if (x < 0 || x >= vxim->width || y < 0 || y >= vxim->height) { + fprintf (stderr, + "vximtool: attempted read out of bounds on framebuf\n"); + fprintf (stderr, + "read %d bytes at [%d,%d]\n", nbytes, x, y); + memset ((void *)iobuf, 0, min(SZ_IOBUF,nbytes)); + } else { + if (verbose) + fprintf (stderr, "read %d bytes at [%d,%d]\n", + nbytes, x, y); + if (keep_raster) + bcopy(&fb->framebuf[(y * vxim->width)+x], iobuf,nbytes); + else + bzero (iobuf, nbytes); +#ifdef HAVE_CDL + if (proxy) { + unsigned char *pix = (unsigned char *)malloc(SZ_IOBUF); + cdl_readSubRaster (cdl[0], x, + (vxim->height-y-max(1, nbytes/vxim->width)), + min(vxim->width, nbytes), + max(1, nbytes/vxim->width), + &pix); + bcopy(pix, iobuf, nbytes); + vx_flip ((char *)iobuf, min(vxim->width, nbytes), + max(1, nbytes/vxim->width)); + free ((char *)pix); + } +#endif + } + + /* Return the data from the frame buffer. */ + starttime = time(0); + for (nleft=nbytes, ip=iobuf; nleft > 0; nleft -= n) { + n = (nleft < SZ_FIFOBUF) ? nleft : SZ_FIFOBUF; + if ((n = iis_write (dataout, ip, n)) <= 0) { + if (n < 0 || (time(0) - starttime > IO_TIMEOUT)) { + fprintf (stderr, "IMTOOL: timeout on write\n"); + break; + } + } else + ip += n; + } + + return; + + } else { + /* Write to the display. + */ + register FrameBufPtr fb; + unsigned char *op, iobuf[SZ_IOBUF]; + int nbytes, nleft, n, x, y; + long starttime; + + /* Get the frame to be written into (encoded with a bit for + * each frame, 01 is frame 1, 02 is frame 2, 04 is frame 3, + * and so on). + */ + chan->reference_frame = decode_frameno (iis.z & 0177777); + fb = &vxim->frames[chan->reference_frame-1]; + + nbytes = ndatabytes; + x = iis.x & XYMASK; + y = iis.y & XYMASK; + + /* Read the data into the frame buffer. + */ + starttime = time(0); + for (nleft=nbytes, op=iobuf; nleft > 0; nleft -= n) { + n = (nleft < SZ_FIFOBUF) ? nleft : SZ_FIFOBUF; + if ((n = iis_read (datain, op, n)) <= 0) { + if (n < 0 || (time(0) - starttime > IO_TIMEOUT)) + break; + } else + op += n; + } + + if (x < 0 || x >= vxim->width || y < 0 || y >= vxim->height) { + fprintf (stderr, + "vximtool: attempted write out of bounds on framebuf\n"); + fprintf (stderr, + "write %d bytes at [%d,%d]\n", nbytes, x, y); + bzero ((void *)iobuf, nbytes); + } else { + if (verbose) + fprintf (stderr, "write %d bytes at x=%d, y=%d\n", + nbytes, x, y); + if (keep_raster) + bcopy(iobuf, &fb->framebuf[(y * vxim->width)+x],nbytes); +#ifdef HAVE_CDL + if (proxy) { + vx_flip ((char *)iobuf, min(vxim->width, nbytes), + max(1, nbytes/vxim->width)); + for (i=0; i < nclients; i++) + cdl_writeSubRaster (cdl[i], x, + (vxim->height-y-max(1, nbytes/vxim->width)), + min(vxim->width, nbytes), + max(1, nbytes/vxim->width), + iobuf); + } +#endif + } + + return; + } + break; + + case WCS: + /* Read or write the WCS for a frame. The frame number to + * which the WCS applies is passed in Z and the frame buffer + * configuration in T. The client changes the frame buffer + * configuration in a WCS set. The WCS text follows the header + * as byte packed ASCII data. + */ + if (iis.tid & IIS_READ) { + /* Return the WCS for the referenced frame. + */ + char emsg[SZ_FNAME]; + char *text; + int frame; + + if ((iis.y & 0177777)) { + /* This is a check by the client on our capabilities. + * Return with a version number which can be used by the + * client. However we write back using the old WCS + * buffer size for compatability. + */ + sprintf (text=emsg, "version=%d", IIS_VERSION); + chan->version = IIS_VERSION; + + iis_write (dataout, text, SZ_OLD_WCSBUF); + if (verbose) + fprintf (stderr, "version query wcs: %s\n",text); + + } else { + frame = decode_frameno (iis.z & 0177777); + chan->reference_frame = frame; + + if (chan->rf_p->frameno <= 0) + strcpy (text=emsg, "[NOSUCHFRAME]\n"); + else + text = chan->rf_p->wcsbuf; + + if ((iis.x & 0177777)) + iis_write (dataout, text, SZ_WCSBUF); + else + iis_write (dataout, text, SZ_OLD_WCSBUF); + + if (verbose) { + fprintf (stderr, "query wcs:\n"); + write (2, text, SZ_WCSBUF); + } + } + + } else { + /* Set the WCS for the referenced frame. + */ + register CtranPtr ct; + int fb_config, frame, new_wcs = 0; + + frame = decode_frameno (iis.z & 0177777); + fb_config = (iis.t & 0777) + 1; + new_wcs = (iis.t & 0777); + + /* See if we need to change the frame buffer configuration, + * or allocate a new frame. + */ + if (fb_config != vxim->fb_configno) { + set_fbconfig (chan, fb_config, frame); +#ifdef HAVE_CDL + if (proxy) { + for (i=0; i < nclients; i++) { + cdl_setFBConfig (cdl[i], fb_config); + cdl_setFrame (cdl[i], frame); + } + } +#endif + } else if (frame > vxim->nframes && frame < MAX_FRAMES) { + set_fbconfig (chan, vxim->fb_configno, frame); +#ifdef HAVE_CDL + if (proxy) { + for (i=0; i < nclients; i++) { + cdl_setFBConfig (cdl[i], vxim->fb_configno); + cdl_setFrame (cdl[i], frame); + } + } +#endif + } + + /* Read in and set up the WCS. */ + chan->reference_frame = frame; + memset ((char *)buf, 0, SZ_WCSBUF); + if (iis_read (datain, buf, ndatabytes) == ndatabytes) + strncpy (chan->rf_p->wcsbuf, buf, + (new_wcs ? SZ_WCSBUF : SZ_OLD_WCSBUF)); + + if (verbose) { + fprintf (stderr, "set wcs: nbytes=%d\n", ndatabytes); + write (2, buf, ndatabytes); + } + + strcpy (chan->rf_p->ctran.format, W_DEFFORMAT); + chan->rf_p->ctran.imtitle[0] = '\0'; + chan->rf_p->ctran.valid = 0; + ct = wcs_update (vxim, chan->rf_p); + +#ifdef HAVE_CDL + if (proxy) { + for (i=0; i < nclients; i++) + cdl_setWCS (cdl[i], " ", ct->imtitle, + ct->a, ct->b, ct->c, ct->d, + ct->tx, ct->ty, ct->z1, ct->z2, ct->zt); + } +#endif + + /* Add the mapping information. */ + add_mapping (vxim, ct, chan->rf_p->wcsbuf, + &vxim->frames[chan->reference_frame-1]); + } + return; + + case IMCURSOR: + /* Read or write the logical image cursor. This is an extension + * added to provide a high level cursor read facility; this is + * not the same as a low level access to the IIS cursor subunit. + * Cursor reads may be either nonblocking (immediate) or blocking, + * using the keyboard or mouse to terminate the read, and + * coordinates may be returned in either image (world) or frame + * buffer pixel coordinates. + */ + if (iis.tid & IIS_READ) { + /* Read the logical image cursor. In the case of a blocking + * read all we do is initiate a cursor read; completion occurs + * when the user hits a key or button. + */ + float sx, sy; + + if (verbose) + fprintf (stderr, "read cursor position\n"); + if (iis.tid & IMC_SAMPLE) { + /* Sample the cursor position and return the cursor value + * on the output datastream encoded in a fixed size + * ascii buffer. + */ + int wcs = iis.z; + + sx = cursor_x; + sy = cursor_y; +#ifdef HAVE_CDL + if (proxy) { + char key = ' '; + char curval[SZ_IMCURVAL], keystr[20]; + + cdl_readCursor (cdl[0], 1, &sx, &sy, &key); + + /* Encode the cursor value. */ + if (key == EOF) + sprintf (curval, "EOF\n"); + else { + if (isprint (key) && !isspace(key)) { + keystr[0] = key; + keystr[1] = '\0'; + } else + sprintf (keystr, "\\%03o", key); + + sprintf (curval, "%10.3f %10.3f %d %s %s\n", + sx, sy, 1, keystr, ""); + } + iis_write (dataout, curval, sizeof(curval)); + } else +#endif + vx_retCursorVal (chan->dataout, sx, sy, wcs, 0, ""); + + } else { + /* Initiate a user triggered cursor read. */ + char key = 'q'; +#ifdef HAVE_CDL + if (proxy) { + char curval[SZ_IMCURVAL], keystr[20]; + + cdl_readCursor (cdl[0], 0, &sx, &sy, &key); + + /* Encode the cursor value. */ + if (key == EOF) + sprintf (curval, "EOF\n"); + else { + if (isprint (key) && !isspace(key)) { + keystr[0] = key; + keystr[1] = '\0'; + } else + sprintf (keystr, "\\%03o", key); + + sprintf (curval, "%10.3f %10.3f %d %s %s\n\0", + sx, sy, 1, keystr, ""); + } + iis_write (chan->dataout, curval, sizeof(curval)); + } else +#endif + vx_retCursorVal (chan->dataout, 1., 1., 101, key, ""); + } + + } else { + /* Write (set) the logical image cursor position. */ + register CtranPtr ct; + int sx = iis.x, sy = iis.y; + float wx = sx, wy = sy; + int wcs = iis.z; + + if (verbose) + fprintf (stderr, "write cursor position: [%d,%d]\n", sx,sy); + if (wcs) { + ct = wcs_update (vxim, vxim->df_p); + if (ct->valid) { + if (abs(ct->a) > .001) + sx = (wx - ct->tx) / ct->a; + if (abs(ct->d) > .001) + sy = (wy - ct->ty) / ct->d; + } + } + + cursor_x = sx; + cursor_y = sy; +#ifdef HAVE_CDL + if (proxy) + cdl_setCursor (cdl[0], sx, sy, wcs); +#endif + } + return; + + default: + /* Ignore unsupported command input. + */ + fprintf (stderr, "unsupported input: subunit=%03o\n", + iis.subunit & 077); + break; + } + + /* Discard any data following the header. */ + if (!(iis.tid & IIS_READ)) + for (nbytes = ndatabytes; nbytes > 0; nbytes -= n) { + n = (nbytes < SZ_FIFOBUF) ? nbytes : SZ_FIFOBUF; + if ((n = iis_read (datain, buf, n)) <= 0) + break; + } +} + + +/* SET_FBCONFIG -- Set the frame buffer configuration, or add additional + * frames to the current configuration. + */ +#ifdef ANSI_FUNC + +static void +set_fbconfig (IoChanPtr chan, int config, int frame) +#else + +static void +set_fbconfig (chan, config, frame) +IoChanPtr chan; +int config; +int frame; +#endif +{ + register VXimDataPtr vxim = (VXimDataPtr) chan->vxim; + register FrameBufPtr fb = &vxim->frames[frame-1]; + register int i; + + if (config != vxim->fb_configno) { + /* Change the frame buffer configuration. */ + vx_initialize (vxim, config, + max (vxim->fb_config[config-1].nframes, frame), 1); + + } else if (frame > vxim->nframes) { + /* Add additional frames. */ + for (i=1; i <= frame; i++) { + fb = &vxim->frames[i-1]; + if (fb->frameno != i) + vx_initFrame (vxim, i, frame, &vxim->fb_config[config-1]); + } + } + + chan->reference_frame = frame; +} + + +/* DECODE_FRAMENO -- Decode encoded IIS register frame number. + */ +#ifdef ANSI_FUNC + +static int +decode_frameno (register int z) +#else + +static int +decode_frameno (z) +register int z; +#endif +{ + register int n; + + /* Get the frame number, encoded with a bit for each frame, 01 is + * frame 1, 02 is frame 2, 04 is frame 3, and so on. + */ + if (!z) z = 1; + for (n=0; !(z & 1); z >>= 1) + n++; + + return (max (1, n + 1)); +} + + +/* BSWAP2 - Move bytes from array "a" to array "b", swapping successive + * pairs of bytes. The two arrays may be the same but may not be offset + * and overlapping. + */ +#ifdef ANSI_FUNC + +static void +bswap2 ( + char *a, + char *b, /* input array */ + int nbytes /* number of bytes to swap */ +) +#else + +static void +bswap2 (a, b, nbytes) +char *a, *b; /* input array */ +int nbytes; /* number of bytes to swap */ +#endif +{ + register char *ip=a, *op=b, *otop; + register unsigned temp; + + /* Swap successive pairs of bytes. + */ + for (otop = op + (nbytes & ~1); op < otop; ) { + temp = *ip++; + *op++ = *ip++; + *op++ = temp; + } + + /* If there is an odd byte left, move it to the output array. + */ + if (nbytes & 1) + *op = *ip; +} + + +/* VX_RETCURSORVAL -- Return the cursor value on the output datastream to + * the client which requested the cursor read. + */ +#ifdef ANSI_FUNC + +static void +vx_retCursorVal ( + register int dataout, + float sx, + float sy, /* cursor screen coordinates */ + int wcs, /* nonzero if WCS coords desired */ + int key, /* keystroke used as trigger */ + char *strval /* optional string value */ +) +#else + +static void +vx_retCursorVal (dataout, sx, sy, wcs, key, strval) +register int dataout; +float sx, sy; /* cursor screen coordinates */ +int wcs; /* nonzero if WCS coords desired */ +int key; /* keystroke used as trigger */ +char *strval; /* optional string value */ +#endif +{ + char curval[SZ_IMCURVAL]; + char keystr[20]; + + /* If running SERVER in interactive mode, allow the user to type + * in the cursor value on the standard input. + */ + if (interactive) { + printf ("enter cursor value string (x y wcs key str): "); + fflush (stdout); + if (fgets (curval, SZ_IMCURVAL, stdin) != NULL) + goto ret; + } + + /* Encode the cursor value. */ + if (key == EOF) + sprintf (curval, "EOF\n"); + else { + if (isprint (key) && !isspace(key)) { + keystr[0] = key; + keystr[1] = '\0'; + } else + sprintf (keystr, "\\%03o", key); + + sprintf (curval, "%10.3f %10.3f %d %s %s\n", + sx, sy, wcs, keystr, strval); + } +ret: + fprintf (stderr, "%s", curval); + + /* Send it to the client program and terminate cursor mode. */ + write (dataout, curval, sizeof(curval)); +} + + +/* WCS_UPDATE -- Load the screen WCS, if not yet validated, from the user + * wcs file, if any. + * + * File format (two lines): + * + * image title (imtool header label string)\n + * a b c d tx ty z1 z2 zt + * + * The WCS text is passed in via the data stream as a write to the subunit + * WCS and left in the buffer "wcsbuf". + */ +#ifdef ANSI_FUNC + +static CtranPtr +wcs_update (register VXimDataPtr vxim, FrameBufPtr fr) +#else + +static CtranPtr +wcs_update (vxim, fr) +register VXimDataPtr vxim; +FrameBufPtr fr; +#endif +{ + register CtranPtr ct = &fr->ctran; + char buf[1024], *format; + + /* Get the new WCS. */ + if (!ct->valid) { + fr->label[0] = '\0'; + ct->zt = W_UNITARY; + + /* Attempt to read the WCS and set up a unitary transformation + * if the information cannot be read. + */ + if (sscanf (fr->wcsbuf, "%[^\n]\n%f%f%f%f%f%f%f%f%d", + buf, &ct->a, &ct->b, &ct->c, &ct->d, &ct->tx, &ct->ty, + &ct->z1, &ct->z2, &ct->zt) < 7) { + + if (fr->wcsbuf[0]) + fprintf (stderr, "vximtool: error decoding WCS\n"); + + strncpy (ct->imtitle, "[NO WCS]\n", SZ_IMTITLE); + ct->a = ct->d = 1; + ct->b = ct->c = 0; + ct->tx = ct->ty = 0; + ct->zt = W_UNITARY; + + } else + strncpy (ct->imtitle, buf, SZ_IMTITLE); + + ct->valid++; + } + + /* Determine best format for wcs output. */ + if (ct->valid && ct->zt == W_LINEAR) { + float z1, z2, zrange; + z1 = ct->z1; + z2 = ct->z2; + zrange = (z1 > z2) ? z1 - z2 : z2 - z1; + if (zrange < 100.0 && (abs(z1) + abs(z2)) / 2.0 < 200.0) + format = " %7.2f %7.2f %7.3f%c"; + else if (zrange > 99999.0 || (abs(z1) + abs(z2)) / 2.0 > 99999.0) + format = " %7.2f %7.2f %7.3g%c"; + else + format = W_DEFFORMAT; + } else + format = " %7.2f %7.2f %7.0f%c"; + + strcpy (ct->format, format); + return (ct); +} + + +/* VX_INITIALIZE -- Initialize the imaging subsystem. Read the config file + * and create the frame buffers, mappings, and colormaps. + */ +#ifdef ANSI_FUNC + +static void +vx_initialize (register VXimDataPtr vxim, int config, int nframes, int reset) +#else + +static void +vx_initialize (vxim, config, nframes, reset) +register VXimDataPtr vxim; +int config; +int nframes; +int reset; +#endif +{ + if (reset) + get_fbconfig (vxim); + + vxim->fb_configno = config; + vxim->nframes = vxim->fb_config[config].nframes; + vxim->width = vxim->fb_config[config].width; + vxim->height = vxim->fb_config[config].height; + vx_initFrame (vxim, vxim->display_frame, nframes, + &vxim->fb_config[config-1]); +} + + +/* VX_INITFRAME -- Initialize a frame buffer. + */ +#ifdef ANSI_FUNC + +static void +vx_initFrame (register VXimDataPtr vxim, int frame, int nframes, FbConfigPtr config) +#else + +static void +vx_initFrame (vxim, frame, nframes, config) +register VXimDataPtr vxim; +int frame, nframes; +FbConfigPtr config; +#endif +{ + register FrameBufPtr fb = &vxim->frames[frame-1]; + + if (frame < 1 || frame > MAX_FRAMES) + return; + + /* Create the frame buffer. */ + fb->frameno = frame; + if (keep_raster) { + if (fb->framebuf) + free (fb->framebuf); + fb->framebuf = (char *) malloc (config->width * config->height); + } + vxim->width = config->width; + vxim->height = config->height; + vxim->nframes = nframes; +} + +/* VX_ERASEFRAME -- Erase a frame. + */ +#ifdef ANSI_FUNC + +static void +vx_eraseFrame (register VXimDataPtr vxim, int frame) +#else + +static void +vx_eraseFrame (vxim, frame) +register VXimDataPtr vxim; +int frame; +#endif +{ + register FrameBufPtr fb = &vxim->frames[frame-1]; + + if (keep_raster) + bzero (fb->framebuf, vxim->width * vxim->height); +} + + +/* GET_FBCONFIG -- Read the XIMTOOL startup file to get the set of possible + * frame buffer sizes. + * + * File format: configno nframes width height [extra fields] + * e.g., 1 2 512 512 + * 2 2 800 800 + * 3 1 1024 1024 # comment + */ +#ifdef ANSI_FUNC + +static void +get_fbconfig (register VXimDataPtr vxim) +#else + +static void +get_fbconfig (vxim) +register VXimDataPtr vxim; +#endif +{ + register char *ip; + register FILE *fp = NULL; + int config, nframes, width, height, i; + char lbuf[SZ_LINE+1], *fname; + static char *fb_paths[] = { + "/usr/local/lib/imtoolrc", + "/opt/local/lib/imtoolrc", + "/iraf/iraf/dev/imtoolrc", + "/local/lib/imtoolrc", + "/usr/iraf/dev/imtoolrc", + "/usr/local/iraf/dev/imtoolrc", + NULL}; + + /* Initialize the config table. */ + vxim->fb_configno = 1; + for (i=0; i < MAX_FBCONFIG; i++) { + vxim->fb_config[i].nframes = 1; + vxim->fb_config[i].width = DEF_FRAME_WIDTH; + vxim->fb_config[i].height = DEF_FRAME_HEIGHT; + } + + /* Now add in some defaults for commonly used sizes based on the + * standard IRAF imtoolrc file, we'll avoid any instrument specific + * configurations. + */ + vxim->fb_config[0].width = vxim->fb_config[0].height = 512; + vxim->fb_config[1].width = vxim->fb_config[1].height = 800; + vxim->fb_config[2].width = vxim->fb_config[2].height = 1024; + vxim->fb_config[3].width = vxim->fb_config[3].height = 1600; + vxim->fb_config[4].width = vxim->fb_config[4].height = 2048; + vxim->fb_config[5].width = vxim->fb_config[5].height = 4096; + + /* Attempt to open the config file. */ + if ((fname=getenv(FBCONFIG_ENV1)) || (fname=getenv(FBCONFIG_ENV2))) + fp = fopen (fname, "r"); + if (!fp && (fname = getenv ("HOME"))) { + sprintf (lbuf, "%s/%s", fname, FBCONFIG_1); + fp = fopen (fname = lbuf, "r"); + if (fp) { + vxim->imtoolrc = (char *) calloc (strlen(fname+1),sizeof(char)); + strncpy (vxim->imtoolrc, fname, strlen(fname)); + } + } + if (!fp) + fp = fopen (fname = vxim->imtoolrc, "r"); + for (i=0; !fp && fb_paths[i]; i++) { + if ((fp = fopen (fname = fb_paths[i], "r"))) { + vxim->imtoolrc = (char *) calloc (strlen(fb_paths[i]+1), + sizeof(char)); + strncpy (vxim->imtoolrc, fb_paths[i],strlen(fb_paths[i])); + break; + } + } + if (!fp) { + fprintf (stderr, + "Warning: No frame buffer configuration file found.\n"); + return; + } + + + /* Scan the frame buffer configuration file. + */ + while (fgets (lbuf, SZ_LINE, fp) != NULL) { + /* Skip comment lines and blank lines. */ + for (ip=lbuf; *ip == ' ' || *ip == '\t'; ip++) + ; + if (*ip == '\n' || *ip == '#') + continue; + if (!isdigit (*ip)) + continue; + switch (sscanf (ip, "%d%d%d%d", &config,&nframes,&width,&height)) { + case 4: + break; /* normal case */ + case 3: + height = width; /* default to square format */ + break; + default: + fprintf (stderr, "vximtool: bad config `%s'\n", ip); + continue; + } + + nframes = max (1, nframes); + width = max (1, width); + height = max (1, height); + + /* Since the frame buffer is stored in a memory pixrect + * (effectively), the line length should be an integral number + * of 16 bit words. + */ + if (width & 1) { + fprintf (stderr, "imtool warning: fb config %d [%d-%dx%d] - ", + config, nframes, width, height); + fprintf (stderr, "frame width should be even, reset to %d\n", + --width); + } + + config = max(1, min(MAX_FBCONFIG, config)) - 1; + vxim->fb_config[config].nframes = nframes; + vxim->fb_config[config].width = width; + vxim->fb_config[config].height = height; + } + + fclose (fp); +} + + + +/* USAGE -- Print a list of command-line options. + */ +#ifdef ANSI_FUNC + +static void +Usage (void) +#else + +static void +Usage () +#endif +{ + fprintf (stderr, "Usage:\n\n"); + printoption (" vximtool"); + printoption ("[-background]"); /* run in background */ + printoption ("[-config <num>]"); /* initial config */ + printoption ("[-fifo <pipe>]"); /* fifo pipe */ + printoption ("[-fifo_only]"); /* use fifo only */ + printoption ("[-help]"); /* Print help */ + printoption ("[-i]"); /* interactive */ + printoption ("[-imtoolrc <file>]"); /* fbconfig file */ + printoption ("[-inet_only | -port_only]"); /* use inet only */ + printoption ("[-noraster]"); /* don't save pix */ + printoption ("[-nframes <num>]"); /* # of frames */ + printoption ("[-port <num>]"); /* inet port */ + printoption ("[-proxy]"); /* run a proxy server */ + printoption ("[-verbose]"); /* verbose output */ + printoption ("[-unix <name>]"); /* unix socket */ + printoption ("[-unix_only]"); /* use unix only */ + fprintf (stderr,"\n"); +} + + +/* PRINTOPTION -- Pretty-print an option string. + */ +static int cpos = 0; +#ifdef ANSI_FUNC + +static void +printoption (char *st) +#else + +static void +printoption(st) +char *st; +#endif +{ + if (strlen(st) + cpos > 78) { + fprintf (stderr,"\n\t"); + cpos = 8; + } + fprintf (stderr,"%s ",st); + cpos = cpos + strlen(st) + 1; +} + + +#ifdef HAVE_CDL +/* VX_FLIP -- Reverse order of lines in raster. + */ + +#ifdef ANSI_FUNC + +static void +vx_flip (char *buffer, int nx, int ny) +#else + +static void +vx_flip (buffer, nx, ny) +char *buffer; +int nx; +int ny; +#endif +{ + register int i, j, v; + register char *buff1, *buff2; + + for (i = 0; i < ny / 2; i++) { + buff1 = &buffer[i*nx]; + buff2 = &buffer[(ny-1-i)*nx]; + for (j = 0; j < nx; j++) { + v = *buff1; + *(buff1++) = *buff2; + *(buff2++) = v; + } + } +} +#endif + + +/* ADD_MAPPING -- Add a mapping for the current frame. + * + * File format (two lines): + * + * image title (imtool header label string)\n + * a b c d tx ty z1 z2 zt \n + * region_name sx sy snx sny dx dy dnx dny\n + * object_ref + * + * The WCS text is passed in via the data stream as a write to the subunit + * WCS and left in the buffer "wcsbuf". Mapping information is parsed + * elsewhere if needed, our only purpose here is to extract the frame WCS. + */ + +static void +add_mapping (vxim, ctran, wcsbuf, fr) +register VXimDataPtr vxim; +CtranPtr ctran; +char *wcsbuf; +FrameBufPtr fr; +{ + register MappingPtr mp = &fr->mapping[fr->nmaps]; + register CtranPtr ct = &mp->ctran; + register int i, j; + char buf[SZ_WCSBUF], *format; + + /* Attempt to read the WCS and set up a unitary transformation + * if the information cannot be read. + */ + if (sscanf (wcsbuf, "%[^\n]\n%f%f%f%f%f%f%f%f%d", + buf, &ct->a, &ct->b, &ct->c, &ct->d, &ct->tx, &ct->ty, + &ct->z1, &ct->z2, &ct->zt) < 7) { + + if (wcsbuf[0]) + fprintf (stderr, "vximtool: error decoding WCS\n"); + + strncpy (ct->imtitle, "[NO WCS]\n", SZ_IMTITLE); + ct->a = ct->d = 1; + ct->b = ct->c = 0; + ct->tx = ct->ty = 0; + ct->zt = W_UNITARY; + } else + strncpy (ct->imtitle, buf, SZ_IMTITLE); + + ct->zt = W_UNITARY; + ct->valid = 1; + + + mp->ref[0] = '\0'; + mp->region[0] = '\0'; + + /* Skip over the first two lines of WCS data. + */ + strcpy (buf, wcsbuf); + for (i=0, j=0; j < 2 && buf[i]; i++) + if (buf[i] == '\n') + j++; + + /* Attempt to read the mapping. + */ + mp->id = mp->regid = ++objid; + if (sscanf (&buf[i], "%s%f%f%d%d%d%d%d%d\n%s\n", + mp->region, &mp->sx, &mp->sy, &mp->snx, &mp->sny, + &mp->dx, &mp->dy, &mp->dnx, &mp->dny, mp->ref) < 10) { + + if (!wcsbuf[0]) + fprintf (stderr, "vximtool: error decoding WCS mapping\n"); + strncpy (mp->ref, "none", SZ_IMTITLE); + + mp->sx = 1.0; + mp->sy = 1.0; + mp->snx = vxim->width; + mp->sny = vxim->height; + mp->dx = 1; + mp->dy = 1; + mp->dnx = vxim->width; + mp->dny = vxim->height; + } + memmove (ctran, &mp->ctran, sizeof (Ctran)); + + fr->nmaps++; +} + + +/* PRINT_MAPPINGS -- Debug routine to print all mappings on a frame. + */ +print_mappings (fr) +FrameBufPtr fr; +{ + MappingPtr mp; + register int i; + + if (fr->nmaps == 0) printf ("No mappings for frame %d\n", fr->frameno); + for (i=0; i < fr->nmaps; i++) { + mp = &fr->mapping[i]; + printf ("Mapping %d frame=%d:\n", fr->nmaps, fr->frameno); + printf ("\t%s %f %f %d %d %d %d %d %d\n\t%s\n", + mp->region, mp->sx, mp->sy, mp->snx, mp->sny, + mp->dx, mp->dy, mp->dnx, mp->dny, mp->ref); + } +} + + +/* IIS_READ -- Read exactly "n" bytes from a descriptor. + */ + +#ifdef ANSI_FUNC +static int +iis_read (int fd, void *vptr, int nbytes) + +#else +static int +iis_read (fd, vptr, nbytes) +int fd; +void *vptr; +int nbytes; +#endif +{ + char *ptr = vptr; + int nread = 0, nleft = nbytes, nb = 0; + + while (nleft > 0) { + if ( (nb = read(fd, ptr, nleft)) < 0) { + if (errno == EINTR) + nb = 0; /* and call read() again */ + else + return(-1); + } else if (nb == 0) + break; /* EOF */ + nleft -= nb; + ptr += nb; + nread += nb; + } + return (nread); /* return no. of bytes read */ +} + + +/* IIS_WRITE -- Write exactly "n" bytes to a descriptor. + */ +#ifdef ANSI_FUNC +static int +iis_write (int fd, void *vptr, int nbytes) + +#else + +static int +iis_write (fd, vptr, nbytes) +int fd; +void *vptr; +int nbytes; +#endif + +{ + char *ptr = vptr; + int nwritten = 0, nleft = nbytes, nb = 0; + + while (nleft > 0) { + if ( (nb = write(fd, ptr, nleft)) <= 0) { + if (errno == EINTR) + nb = 0; /* and call write() again */ + else + return(-1); /* error */ + } + nleft -= nb; + ptr += nb; + nwritten += nb; + } + return (nwritten); +} |