Back to index

plt-scheme  4.2.1
plplotP.h
Go to the documentation of this file.
00001 /* $Id: plplotP.h,v 1.1 2004/03/01 20:54:52 cozmic Exp $
00002 
00003     Copyright (C) 1993, 1994, 1995  by 
00004     Maurice J. LeBrun, Geoff Furnish, Tony Richardson.
00005 
00006     Internal (private) macros and prototypes for the PLplot package.  This
00007     header file must be included before all others, including system header
00008     files.  This file is typically needed when including driver specific
00009     header files (e.g. pltkd.h).
00010 
00011     This software may be freely copied, modified and redistributed without
00012     fee provided that this copyright notice is preserved intact on all
00013     copies and modified copies. 
00014  
00015     There is no warranty or other guarantee of fitness of this software.
00016     It is provided solely "as is". The author(s) disclaim(s) all
00017     responsibility and liability with respect to this software's usage or
00018     its effect upon hardware or computer systems. 
00019 */
00020 
00021 #ifndef __PLPLOTP_H__
00022 #define __PLPLOTP_H__
00023 
00024 /*--------------------------------------------------------------------------*\
00025  * Select environment.  Must be done before anything else.
00026  *
00027  * Basically we want the widest range of system services that are available.
00028  * Fortunately on many systems, that is the default.  To get "everything",
00029  * one of the following must be defined, as appropriate:
00030  *
00031  * _GNU_SOURCE     on Linux (default) 
00032  * _OSF_SOURCE     on OSF1 (default) 
00033  * _HPUX_SOURCE    on HP (not default) 
00034  * _ALL_SOURCE     on AIX (no idea) 
00035  *
00036  * To see where these are set, do the following:
00037  *
00038  *    cd /usr/include; grep SOURCE *.h | fgrep 'define '
00039  *
00040  * and the file containing lots of these is the one you want (features.h on
00041  * Linux, standards.h on OSF1, etc).  Follow the logic to see what needs to be
00042  * defined to get "everything", i.e. POSIX.*, XOPEN, etc.
00043  *
00044  * Note that for specific functionality, we test using autoconf.  Still it's
00045  * best to stick to ANSI C, POSIX.1, and POSIX.2, in that order, for maximum
00046  * portability.
00047 \*--------------------------------------------------------------------------*/
00048 
00049 /* HPUX - if this is no longer needed, please remove it */
00050 #ifdef _HPUX
00051 #define _HPUX_SOURCE
00052 #endif
00053 
00054 /* A/IX - if this is no longer needed, please remove it */
00055 #ifdef _AIX
00056 #define _ALL_SOURCE
00057 #endif
00058 
00059 /* Add others here as needed. */
00060 
00061 /*--------------------------------------------------------------------------*\
00062  *     Configuration settings
00063  * 
00064  * Some of the macros set during configuration are described here.
00065  *
00066  * If HAVE_TERMIOS_H is set, we employ POSIX.1 tty terminal I/O.  One purpose
00067  * of this is to select character-oriented (CBREAK) i/o in the tek driver and
00068  * all its variants.  It is usable without this but not as powerful.  The
00069  * reason for using this is that some supported systems are still not
00070  * POSIX.1 compliant (and some may never be).
00071  *
00072  * If STDC_HEADERS is defined, the system's libc is ANSI-compliant.
00073  * ANSI libc calls are used for: (a) setting up handlers to be called
00074  * before program exit (via the "atexit" call), and (b) for seek
00075  * operations.  Again, the code is usable without these.  An ANSI libc
00076  * should be available, given the requirement of an ANSI compiler.  Some
00077  * reasons why not: (a) the vendor didn't supply a complete ANSI
00078  * environment, or (b) the ANSI libc calls are buggy, or (c) you ported
00079  * gcc to your system but not glibc (for whatever reason).  Note: without
00080  * an ANSI C lib, if you ^C out of a program using one of the PLplot tek
00081  * drivers, your terminal may be left in a strange state.
00082 \*--------------------------------------------------------------------------*/
00083 
00084 #include "plConfig.h"
00085 #ifdef caddr_t
00086 #undef caddr_t
00087 #ifndef __USE_BSD
00088 typedef char * caddr_t;
00089 #endif
00090 #endif
00091 
00092 /* System headers */
00093 
00094 #include <ctype.h>
00095 #include <math.h>
00096 #include <string.h>
00097 #include <limits.h>
00098 #include <float.h>
00099 
00100 #if HAVE_DIRENT_H
00101 # include <dirent.h>
00102 # define NAMLEN(dirent) strlen((dirent)->d_name)
00103 #else
00104 # define dirent direct
00105 # define NAMLEN(dirent) (dirent)->d_namlen
00106 # if HAVE_SYS_NDIR_H
00107 #  include <sys/ndir.h>
00108 # endif
00109 # if HAVE_SYS_DIR_H
00110 #  include <sys/dir.h>
00111 # endif
00112 # if HAVE_NDIR_H
00113 #  include <ndir.h>
00114 # endif
00115 #endif
00116 
00117 /*
00118  * Macros for file positioning.  I tried switching to f[sg]etpos() because I
00119  * like the semantics better, but ran into the problem that fpos_t is not
00120  * always a base type (it may be a struct).  This is a problem because the
00121  * metafile driver needs to write relative offsets into the file itself.  So
00122  * instead we use f{seek,tell} at a low level but keep the f[sg]etpos
00123  * semantics using these macros. 
00124  */
00125 
00126 #ifdef STDC_FPOS_T
00127 #undef STDC_FPOS_T
00128 #endif
00129 
00130 #ifdef STDC_FPOS_T
00131 #define FPOS_T fpos_t
00132 #define pl_fsetpos(a,b) fsetpos(a, b)
00133 #define pl_fgetpos(a,b) fgetpos(a, b)
00134 
00135 #else
00136 #define FPOS_T long
00137 #define pl_fsetpos(a,b) fseek(a, *b, 0)
00138 #define pl_fgetpos(a,b) (-1L == (*b = ftell(a)))
00139 #endif
00140 
00141 /* Include all externally-visible definitions and prototypes */
00142 /* plplot.h also includes some handy system header files */
00143 
00144 #include "plplot.h"
00145 
00146 /* plstream definition */
00147 
00148 #include "plstrm.h"
00149 
00150 /* If not including this file from inside of plcore.h, declare plsc */
00151 
00152 #ifndef __PLCORE_H__
00153 #ifdef __cplusplus
00154 extern "C" {
00155 #endif
00156 extern PLStream      *plsc;
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160 #include "pldebug.h"
00161 #endif
00162 
00163 /*--------------------------------------------------------------------------*\
00164  *                       Utility macros
00165 \*--------------------------------------------------------------------------*/
00166 
00167 #ifndef TRUE
00168 #define TRUE  1
00169 #define FALSE 0
00170 #endif
00171 
00172 /* Used to help ensure everything malloc'ed gets freed */
00173 
00174 #define free_mem(a) \
00175     if (a != NULL) { free((void *) a); a = NULL; }
00176 
00177 /* Allows multi-argument setup calls to not affect selected arguments */
00178 
00179 #define plsetvar(a, b) \
00180     if (b != PL_NOTSET) a = b;
00181 
00182 /* Lots of cool math macros */
00183 
00184 #ifndef MAX
00185 #define MAX(a,b)    (((a) > (b)) ? (a) : (b))
00186 #endif
00187 #ifndef MIN
00188 #define MIN(a,b)    (((a) < (b)) ? (a) : (b))
00189 #endif
00190 #ifndef ABS
00191 #define ABS(a)      ((a)<0 ? -(a) : (a))
00192 #endif
00193 #ifndef ROUND
00194 #define ROUND(a)    (PLINT)((a)<0. ? ((a)-.5) : ((a)+.5))
00195 #endif
00196 #ifndef BETW
00197 #define BETW(ix,ia,ib)  (((ix)<=(ia)&&(ix)>=(ib)) || ((ix)>=(ia)&&(ix)<=(ib)))
00198 #endif
00199 #ifndef SSQR
00200 #define SSQR(a,b)       sqrt((a)*(a)+(b)*(b))
00201 #endif
00202 #ifndef SIGN
00203 #define SIGN(a)         ((a)<0 ? -1 : 1)
00204 #endif
00205 
00206 /* A coordinate value that should never occur */
00207 
00208 #define PL_UNDEFINED -9999999
00209 
00210 /*--------------------------------------------------------------------------*\
00211  *                       PLPLOT control macros
00212 \*--------------------------------------------------------------------------*/
00213 
00214 /* Some constants */
00215 
00216 #define PL_MAXPOLY   256    /* Max segments in polyline or polygon */
00217 #define PL_NSTREAMS  100    /* Max number of concurrent streams. */
00218 #define PL_RGB_COLOR 1<<7   /* A hack */
00219 
00220 #define TEXT_MODE    0
00221 #define GRAPHICS_MODE       1
00222 #ifndef PI
00223 #define PI           3.1415926535897932384
00224 #endif
00225 
00226 /* These define the virtual coordinate system used by the metafile driver.
00227    Others are free to use it, or some variation, or define their own. */
00228 
00229 /* Note desktop monitors of reasonable quality typically have 0.25 mm spacing 
00230  * between dots which corresponds to 4.0 dots per mm.  The parameters here
00231  * roughly correspond to a 14" monitor at 1024x768 resolution, which should
00232  * work fine at other sizes/resolutions.  The number of virtual dots per mm is
00233  * scaled by a factor of 32, with pixels scaled accordingly.  The customary
00234  * x/y ratio of 4:3 is used.
00235  */
00236 
00237 #define PIXELS_X     32768         /* Number of virtual pixels in x */
00238 #define PIXELS_Y     24576         /* Number of virtual pixels in x */
00239 #define DPMM         4.            /* dots per mm */
00240 #define VDPMM       (DPMM*32)             /* virtual dots per mm */
00241 #define LPAGE_X          (PIXELS_X/VDPMM) /* virtual page length in x in mm (256) */
00242 #define LPAGE_Y          (PIXELS_Y/VDPMM) /* virtual page length in y in mm (192) */
00243 
00244 /* This defines the first argument of the plRotPhy invocation that is made
00245  * in a number of device drivers (e.g., found in ljii.c, ljiip.c, ps.c,
00246  * and pstex.c) to rotate them "permanently" from portrait mode to non-
00247  * portrait mode.  ORIENTATION of 1 corresponds to seascape mode (90 deg
00248  * clockwise rotation from portrait).  This is the traditional value 
00249  * effectively used in all older versions of PLplot. ORIENTATION of 3 
00250  * corresponds to landscape mode (90 deg *counter*-clockwise rotation from 
00251  * portrait) which is the new default non-portrait orientation. */
00252 
00253 #define ORIENTATION  3
00254 
00255 /* Switches for state function call. */
00256 
00257 #define PLSTATE_WIDTH              1      /* pen width */
00258 #define PLSTATE_COLOR0             2      /* change to color in cmap 0 */
00259 #define PLSTATE_COLOR1             3      /* change to color in cmap 1 */
00260 #define PLSTATE_FILL        4      /* set area fill attribute */
00261 #define PLSTATE_CMAP0              5      /* change to cmap 0 */
00262 #define PLSTATE_CMAP1              6      /* change to cmap 1 */
00263 
00264 /* Bit switches used in the driver interface */
00265 
00266 #define PLDI_MAP     0x01
00267 #define PLDI_ORI     0x02
00268 #define PLDI_PLT     0x04
00269 #define PLDI_DEV     0x08
00270 
00271 /* Default size for family files, in KB. */
00272 
00273 #ifndef PL_FILESIZE_KB
00274 #define PL_FILESIZE_KB 1000
00275 #endif
00276 
00277 /* Font file names. */
00278 
00279 #define PLPLOT5_FONTS
00280 
00281 #ifdef PLPLOT5_FONTS
00282 #define PL_XFONT     "plxtnd5.fnt"
00283 #define PL_SFONT     "plstnd5.fnt"
00284 #else
00285 #define PL_XFONT     "plxtnd4.fnt"
00286 #define PL_SFONT     "plstnd4.fnt"
00287 #endif
00288 
00289 /*--------------------------------------------------------------------------*\
00290  * The following environment variables are defined:
00291  * 
00292  *     PLPLOT_BIN      # where to find executables
00293  *     PLPLOT_LIB      # where to find library files (fonts, maps, etc)
00294  *     PLPLOT_TCL      # where to find tcl scripts
00295  *
00296  *     PLPLOT_HOME     # basename of plplot hierarchy
00297  *
00298  * search order:
00299  *     1)     the most specific possible locators, one of
00300  *                   $(PLPLOT_BIN)
00301  *                   $(PLPLOT_LIB)
00302  *                   $(PLPLOT_TCL)
00303  *            as appropriate
00304  *
00305  *     2)     the current directory
00306  *
00307  *     3)     one of  $(PLPLOT_HOME)/bin
00308  *                   $(PLPLOT_HOME)/lib
00309  *                   $(PLPLOT_HOME)/tcl
00310  *            as appropriate
00311  *
00312  *     4)     as appropriate, the compile-time (Makefile)
00313  *            BIN_DIR, LIB_DIR, TCL_DIR
00314  *
00315  *  8 Jun 1994  mj olesen (olesen@weber.me.queensu.ca)
00316  *
00317  * Other notes:
00318  *
00319  * In addition to the directories above, the following are also used:
00320  *
00321  * Lib file search path: PLLIBDEV (see plctrl.c).  This is checked last,
00322  * and is a system-dependent hardwired location.
00323  *
00324  * Tcl search path: $HOME/tcl is searched before the install location,
00325  * TCL_DIR.
00326 \*--------------------------------------------------------------------------*/
00327 
00328 #define PLPLOT_BIN_ENV          "PLPLOT_BIN"
00329 #define PLPLOT_LIB_ENV          "PLPLOT_LIB"
00330 #define PLPLOT_TCL_ENV          "PLPLOT_TCL"
00331 #define PLPLOT_HOME_ENV         "PLPLOT_HOME"
00332 
00333 /*--------------------------------------------------------------------------*\
00334  *            Function Prototypes
00335  *
00336  * These typically should not be called directly by the user.
00337 \*--------------------------------------------------------------------------*/
00338 
00339 #ifdef __cplusplus
00340 extern "C" {
00341 #endif
00342 
00343 /* Determines interval between numeric labels */
00344 
00345 void
00346 pldtik(PLFLT vmin, PLFLT vmax, PLFLT *tick, PLINT *nsubt);
00347 
00348 /* Determines precision of box labels */
00349 
00350 void
00351 pldprec(PLFLT vmin, PLFLT vmax, PLFLT tick, PLINT lf, 
00352        PLINT *mode, PLINT *prec, PLINT digmax, PLINT *scale);
00353 
00354 /* Draws a polyline within the clip limits. */
00355 
00356 void
00357 plP_pllclp(PLINT *x, PLINT *y, PLINT npts,
00358           PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax, 
00359           void (*draw) (short *, short *, PLINT));
00360 
00361 /* Fills a polygon within the clip limits. */
00362 
00363 void
00364 plP_plfclp(PLINT *x, PLINT *y, PLINT npts,
00365           PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax, 
00366           void (*draw) (short *, short *, PLINT));
00367 
00368   /* Clip a polygon to the 3d bounding plane */
00369 int
00370 plP_clip_poly(int Ni, PLFLT *Vi[3], int axis, PLFLT dir, PLFLT offset);
00371 
00372 /* Pattern fills in software the polygon bounded by the input points. */
00373 
00374 void
00375 plfill_soft(short *x, short *y, PLINT npts);
00376 
00377 /* In case of an abort this routine is called.  It just prints out an */
00378 /* error message and tries to clean up as much as possible. */
00379 
00380 void
00381 plexit(char *errormsg);
00382 
00383 /* Just a front-end to exit().  */
00384 
00385 void
00386 pl_exit(void);
00387 
00388 /* A handy way to issue warnings, if need be. */
00389 
00390 void
00391 plwarn(char *errormsg);
00392 
00393 /* Same as plwarn(), but appends ", aborting plot" to the error message */
00394 
00395 void
00396 plabort(char *errormsg);
00397 
00398 /* Loads either the standard or extended font. */
00399 
00400 void
00401 plfntld(PLINT fnt);
00402 
00403 /* Release memory for fonts. */
00404 
00405 void
00406 plfontrel(void);
00407 
00408 /* A replacement for strdup(), which isn't portable. */
00409 
00410 char *
00411 plstrdup(const char *src);
00412 
00413 /* Bin up cmap 1 space and assign colors to make inverse mapping easy. */
00414 
00415 void
00416 plcmap1_calc(void);
00417 
00418 /* Draws a slanting tick at position (mx,my) (measured in mm) of */
00419 /* vector length (dx,dy). */
00420 
00421 void 
00422 plstik(PLFLT mx, PLFLT my, PLFLT dx, PLFLT dy);
00423 
00424 /* Prints out a "string" at reference position with physical coordinates */
00425 /* (refx,refy). */
00426 
00427 void
00428 plstr(PLINT base, PLFLT *xform, PLINT refx, PLINT refy, const char *string);
00429 
00430 /* Draws a tick parallel to x. */
00431 
00432 void
00433 plxtik(PLINT x, PLINT y, PLINT below, PLINT above);
00434 
00435 /* Draws a tick parallel to y. */
00436 
00437 void
00438 plytik(PLINT x, PLINT y, PLINT left, PLINT right);
00439 
00440   /* Driver interface filter -- 
00441      passes all coordinates through a variety of filters. */
00442 
00443 void
00444 difilt(PLINT *, PLINT *, PLINT,
00445        PLINT *, PLINT *, PLINT *, PLINT *);
00446 
00447   /* Driver draws text */
00448 
00449 void
00450 plP_text(PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y,
00451                PLINT refx, PLINT refy, const char *string);
00452 
00453   /* where should structure definitions that must be seen by drivers and core source files, be? */
00454 
00455   /* structure to be used by plcore.c and anydriver.c, related to plP_text() */
00456 
00457 typedef struct {
00458   PLINT base; /* ref point at base(1) or center(0) of text. Currently plplot only use 0 */
00459   PLFLT just; /* continuos justification, 0 left, 0.5 center, 1 right */
00460   PLFLT *xform; /* transformation (rotation) matrix */
00461   PLINT x; /* raw reference point--after any transformation */
00462   PLINT y;
00463   PLINT refx; /* processed ref. point--after justification, displacement, etc, processing */
00464   PLINT refy;
00465   const char *string; /* text to draw */
00466 }EscText;
00467 
00468 /* 
00469  * structure that contains driver specific information, to be used by plargs.c and anydriver.c,
00470  * related to plParseDrvOpts() and plHelpDrvOpts()
00471  */
00472 
00473 typedef struct {
00474   char *opt;     /* a string with the name of the option */
00475   PLINT type;    /* the type of the variable to be set, see bellow the available types */
00476   void *var_ptr; /* a pointer to the variable to be set */
00477   char *hlp_msg; /* help message of the option */
00478 } DrvOpt;
00479 
00480   /* the available variable types, DrvOpt.type, for driver specific options */
00481 
00482 enum {DRV_INT, DRV_FLT, DRV_STR};
00483 
00484   /* parse driver specific options, as in -drvopt <option[=value]>* */
00485 
00486 int
00487 plParseDrvOpts(DrvOpt *);
00488 
00489   /* give help on driver specific options */
00490 
00491 void
00492 plHelpDrvOpts(DrvOpt *);
00493 
00494   /*
00495    * structures to store contour lines
00496    */
00497 
00498 #define LINE_ITEMS 20
00499 
00500 typedef struct cont_line {
00501   PLFLT *x;
00502   PLFLT *y;
00503   PLINT npts;
00504   struct cont_line *next;
00505 } CONT_LINE;
00506 
00507 typedef struct cont_level {
00508   PLFLT level;
00509   struct cont_line *line; /* contour line */
00510   struct cont_level *next; /* contour level */
00511 } CONT_LEVEL;
00512 
00513 void
00514 cont_store(PLFLT *x, PLFLT *y, PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx,
00515           PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel, CONT_LEVEL **contour);
00516 void
00517 cont_clean_store(CONT_LEVEL *ct);
00518 
00519 /* Get x-y domain in world coordinates for 3d plots */
00520 
00521 void
00522 plP_gdom(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax);
00523 
00524 /* Get vertical (z) scale parameters for 3-d plot */
00525 
00526 void
00527 plP_grange(PLFLT *p_zscl, PLFLT *p_zmin, PLFLT *p_zmax);
00528 
00529 /* Get parameters used in 3d plots */
00530 
00531 void
00532 plP_gw3wc(PLFLT *p_dxx, PLFLT *p_dxy, PLFLT *p_dyx, PLFLT *p_dyy,
00533          PLFLT *p_dyz);
00534 
00535 /* Get clip boundaries in physical coordinates */
00536 
00537 void
00538 plP_gclp(PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax);
00539 
00540 /* Set clip boundaries in physical coordinates */
00541 
00542 void
00543 plP_sclp(PLINT ixmin, PLINT ixmax, PLINT iymin, PLINT iymax);
00544 
00545 /* Get physical device limits in physical coordinates */
00546 
00547 void
00548 plP_gphy(PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax);
00549 
00550 /* Get number of subpages on physical device and current subpage */
00551 
00552 void
00553 plP_gsub(PLINT *p_nx, PLINT *p_ny, PLINT *p_cs);
00554 
00555 /* Set number of subpages on physical device and current subpage */
00556 
00557 void
00558 plP_ssub(PLINT nx, PLINT ny, PLINT cs);
00559 
00560 /* Set up plot parameters according to the number of subpages. */
00561 
00562 void
00563 plP_subpInit(void);
00564 
00565 /* Get number of pixels to a millimeter */
00566 
00567 void
00568 plP_gpixmm(PLFLT *p_x, PLFLT *p_y);
00569 
00570 /* All the drivers call this to set physical pixels/mm. */
00571 
00572 void
00573 plP_setpxl(PLFLT xpmm0, PLFLT ypmm0);
00574 
00575 /* Get background parameters for 3d plot. */
00576 
00577 void
00578 plP_gzback(PLINT **zbf, PLINT **zbc, PLFLT **zbt);
00579 
00580 /* Move to physical coordinates (x,y). */
00581 
00582 void
00583 plP_movphy(PLINT x, PLINT y);
00584 
00585 /* Draw to physical coordinates (x,y). */
00586 
00587 void
00588 plP_draphy(PLINT x, PLINT y);
00589 
00590 /* Move to world coordinates (x,y). */
00591 
00592 void
00593 plP_movwor(PLFLT x, PLFLT y);
00594 
00595 /* Draw to world coordinates (x,y). */
00596 
00597 void
00598 plP_drawor(PLFLT x, PLFLT y);
00599 
00600 /* Draw polyline in physical coordinates. */
00601 
00602 void
00603 plP_draphy_poly(PLINT *x, PLINT *y, PLINT n);
00604 
00605 /* Draw polyline in world coordinates. */
00606 
00607 void
00608 plP_drawor_poly(PLFLT *x, PLFLT *y, PLINT n);
00609 
00610 /* Sets up physical limits of plotting device. */
00611 
00612 void
00613 plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax);
00614 
00615 /* Set up the subpage boundaries according to the current subpage selected */
00616 
00617 void
00618 plP_setsub(void);
00619 
00620 /* Get the floating point precision (in number of places) in numeric labels. */
00621 
00622 void
00623 plP_gprec(PLINT *p_setp, PLINT *p_prec);
00624 
00625 /* Computes the length of a string in mm, including escape sequences. */
00626 
00627 PLFLT
00628 plstrl(const char *string);
00629 
00630 /* Similar to strpos, but searches for occurence of string str2. */
00631 
00632 PLINT
00633 plP_stindex(const char *str1, const char *str2);
00634 
00635 /* Searches string str for first occurence of character chr.  */
00636 
00637 PLINT
00638 plP_strpos(char *str, int chr);
00639 
00640 /* Searches string str for character chr (case insensitive). */
00641 
00642 PLINT
00643 plP_stsearch(const char *str, int chr);
00644 
00645        /* Conversion functions */
00646 
00647 /* device coords to physical coords (x) */
00648 
00649 PLINT
00650 plP_dcpcx(PLFLT x);
00651 
00652 /* device coords to physical coords (y) */
00653 
00654 PLINT
00655 plP_dcpcy(PLFLT y);
00656 
00657 /* millimeters from bottom left-hand corner to physical coords (x) */
00658 
00659 PLINT
00660 plP_mmpcx(PLFLT x);
00661 
00662 /* millimeters from bottom left-hand corner to physical coords (y) */
00663 
00664 PLINT
00665 plP_mmpcy(PLFLT y);
00666 
00667 /* world coords to physical coords (x) */
00668 
00669 PLINT
00670 plP_wcpcx(PLFLT x);
00671 
00672 /* world coords to physical coords (y) */
00673 
00674 PLINT
00675 plP_wcpcy(PLFLT y);
00676 
00677 /* physical coords to device coords (x) */
00678 
00679 PLFLT
00680 plP_pcdcx(PLINT x);
00681 
00682 /* physical coords to device coords (y) */
00683 
00684 PLFLT
00685 plP_pcdcy(PLINT y);
00686 
00687 /* millimeters from bottom left corner to device coords (x) */
00688 
00689 PLFLT
00690 plP_mmdcx(PLFLT x);
00691 
00692 /* millimeters from bottom left corner to device coords (y) */
00693 
00694 PLFLT
00695 plP_mmdcy(PLFLT y);
00696 
00697 /* world coords into device coords (x) */
00698 
00699 PLFLT
00700 plP_wcdcx(PLFLT x);
00701 
00702 /* world coords into device coords (y) */
00703 
00704 PLFLT
00705 plP_wcdcy(PLFLT y);
00706 
00707 /* subpage coords to device coords (x) */
00708 
00709 PLFLT
00710 plP_scdcx(PLFLT x);
00711 
00712 /* subpage coords to device coords (y) */
00713 
00714 PLFLT
00715 plP_scdcy(PLFLT y);
00716 
00717 /* device coords to millimeters from bottom left-hand corner (x) */
00718 
00719 PLFLT
00720 plP_dcmmx(PLFLT x);
00721 
00722 /* device coords to millimeters from bottom left-hand corner (y) */
00723 
00724 PLFLT
00725 plP_dcmmy(PLFLT y);
00726 
00727 /* world coords into millimeters (x) */
00728 
00729 PLFLT
00730 plP_wcmmx(PLFLT x);
00731 
00732 /* world coords into millimeters (y) */
00733 
00734 PLFLT
00735 plP_wcmmy(PLFLT y);
00736 
00737 /* device coords to subpage coords (x) */
00738 
00739 PLFLT
00740 plP_dcscx(PLFLT x);
00741 
00742 /* device coords to subpage coords (y) */
00743 
00744 PLFLT
00745 plP_dcscy(PLFLT y);
00746 
00747 /* 3-d coords to 2-d projection (x) */
00748 
00749 PLFLT
00750 plP_w3wcx(PLFLT x, PLFLT y, PLFLT z);
00751 
00752 /* 3-d coords to 2-d projection (y) */
00753 
00754 PLFLT
00755 plP_w3wcy(PLFLT x, PLFLT y, PLFLT z);
00756 
00757        /* Driver calls */
00758 
00759 /* Initialize device. */
00760 
00761 void
00762 plP_init(void);
00763 
00764 /* Draw line between two points */
00765 
00766 void
00767 plP_line(short *x, short *y);
00768 
00769 /* Draw polyline */
00770 
00771 void
00772 plP_polyline(short *x, short *y, PLINT npts);
00773 
00774 /* Fill polygon */
00775 
00776 void
00777 plP_fill(short *x, short *y, PLINT npts);
00778 
00779 /* draw image */
00780 
00781 void
00782 plP_image(short *x, short *y, unsigned short *z, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy, unsigned short zmin, unsigned short zmax);
00783 
00784 /* End of page */
00785 
00786 void
00787 plP_eop(void);
00788 
00789 /* End of page */
00790 
00791 void
00792 plP_bop(void);
00793 
00794 /* Tidy up device (flush buffers, close file, etc.) */
00795 
00796 void
00797 plP_tidy(void);
00798 
00799 /* Change state. */
00800 
00801 void
00802 plP_state(PLINT op);
00803 
00804 /* Escape function, for driver-specific commands. */
00805 
00806 void
00807 plP_esc(PLINT op, void *ptr);
00808 
00809 /* Set up plot window parameters. */
00810 
00811 void
00812 plP_swin(PLWindow *plwin);
00813 
00814 /* Return file pointer to lib file. */
00815 
00816 FILE *
00817 plLibOpen(char *fn);
00818 
00819 /* Does required startup initialization of library.  */
00820 
00821 void
00822 pllib_init(void);
00823 
00824 /* Does preliminary setup of device driver. */
00825 
00826 void
00827 pllib_devinit(void);
00828 
00829 /* Utility to copy one PLColor to another. */
00830 
00831 void
00832 pl_cpcolor(PLColor *to, PLColor *from);
00833 
00834 /* Does required startup initialization of a stream.  */
00835 
00836 void
00837 plstrm_init(void);
00838 
00839 /* Builds a list of the active devices/streams by device name */
00840 
00841 void
00842 plP_getinitdriverlist(char *names);
00843 
00844 /* Checks a give list of device names against active streams and returns the number of matches */
00845 
00846 PLINT 
00847 plP_checkdriverinit( char *names);
00848 
00849   /* disable writing to plot buffer and pixmap */
00850 void
00851 NoBufferNoPixmap(void);
00852 
00853   /* restart writing to plot buffer and pixmap */
00854 void
00855 RestoreWrite2BufferPixmap(void);
00856 
00857 void
00858 grimage(short *x, short *y, unsigned short *z, PLINT nx, PLINT ny);
00859 
00860 void
00861 plimageslow(short *x, short *y, unsigned short *data, PLINT nx, PLINT ny, 
00862            PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy,
00863            unsigned short zmin,  unsigned short zmax);
00864 
00865 typedef struct {
00866   PLFLT xmin, ymin, dx, dy;} IMG_DT;
00867 
00868 #ifdef __cplusplus
00869 }
00870 #endif
00871 
00872 #endif /* __PLPLOTP_H__ */