Back to index

plt-scheme  4.2.1
plplot.h
Go to the documentation of this file.
00001 /* $Id: plplot.h,v 1.2 2005/03/17 21:39:21 eli Exp $
00002 
00003     Copyright (C) 1992 by 
00004     Maurice J. LeBrun, Geoff Furnish, Tony Richardson.
00005 
00006     Macros and prototypes for the PLplot package.  This header file must
00007     be included by all user codes.
00008 
00009     This software may be freely copied, modified and redistributed
00010     without fee provided that this copyright notice is preserved intact
00011     on all copies and modified copies.
00012 
00013     There is no warranty or other guarantee of fitness of this software.
00014     It is provided solely "as is". The author(s) disclaim(s) all
00015     responsibility and liability with respect to this software's usage
00016     or its effect upon hardware or computer systems.
00017 
00018     Note: some systems allow the Fortran & C namespaces to clobber each
00019     other.  So for PLplot to work from Fortran, we do some rather nasty
00020     things to the externally callable C function names.  This shouldn't
00021     affect any user programs in C as long as this file is included. 
00022 */
00023 
00024 #ifndef __PLPLOT_H__
00025 #define __PLPLOT_H__
00026 
00027 #include "scheme.h"
00028 
00029 #include "plConfig.h"
00030 
00031 /*--------------------------------------------------------------------------*\
00032  *    USING PLplot
00033  * 
00034  * To use PLplot from C or C++, it is only necessary to 
00035  * 
00036  *      #include "plplot.h"
00037  * 
00038  * This file does all the necessary setup to make PLplot accessible to
00039  * your program as documented in the manual.  Additionally, this file
00040  * allows you to request certain behavior by defining certain symbols
00041  * before inclusion.  At the moment the only one is:
00042  *
00043  * #define DOUBLE    or..
00044  * #define PL_DOUBLE
00045  *
00046  * This causes PLplot to use doubles instead of floats.  Use the type
00047  * PLFLT everywhere in your code, and it will always be the right thing.
00048  *
00049  * Note: most of the functions visible here begin with "pl", while all
00050  * of the data types and switches begin with "PL".  Eventually everything
00051  * will conform to this rule in order to keep namespace pollution of the
00052  * user code to a minimum.  All the PLplot source files actually include
00053  * "plplotP.h", which includes this file as well as all the internally-
00054  * visible declarations, etc.  
00055 \*--------------------------------------------------------------------------*/
00056 
00057 /* The majority of PLplot source files require these, so.. */
00058 /* Under ANSI C, they can be included any number of times. */
00059 
00060 #include <stdio.h>
00061 #include <stdlib.h>
00062 
00063 /*--------------------------------------------------------------------------*\
00064  *        SYSTEM IDENTIFICATION
00065  *
00066  * Several systems are supported directly by PLplot.  In order to avoid
00067  * confusion, one id macro per system is used.  Since different compilers
00068  * may predefine different system id macros, we need to check all the
00069  * possibilities, and then set the one we will be referencing.  These are:
00070  *
00071  * __cplusplus                Any C++ compiler
00072  * __unix                     Any Unix-like system
00073  * __hpux                     Any HP/UX system
00074  * __aix                      Any AIX system
00075  * __linux                    Linux for i386
00076  * (others...)
00077  *
00078 \*--------------------------------------------------------------------------*/
00079 
00080 #ifdef unix                 /* the old way */
00081 #ifndef __unix
00082 #define __unix
00083 #endif
00084 #endif
00085 
00086 /* Make sure Unix systems define "__unix" */
00087 
00088 #if defined(SX)      ||                          /* NEC Super-UX */      \
00089     (defined(_IBMR2) && defined(_AIX)) || /* AIX */               \
00090     defined(__hpux) ||                           /* HP/UX */             \
00091     defined(sun) ||                       /* SUN */               \
00092     defined(CRAY) ||                      /* Cray */              \
00093     defined(__convexc__) ||               /* CONVEX */            \
00094     (defined(__alpha) && defined(__osf__))       /* DEC Alpha AXP/OSF */
00095 
00096 #ifndef __unix
00097 #define __unix
00098 #endif
00099 #endif
00100 
00101 /* A wrapper used in some header files so they can be compiled with cc */
00102 
00103 #define PLARGS(a)    a
00104 
00105 /*--------------------------------------------------------------------------*\
00106  * Base types for PLplot
00107  *
00108  * Only those that are necessary for function prototypes are defined here.
00109  * Notes:
00110  *
00111  * PLINT is typedef'd to an int by default.  This is a change from some
00112  * previous versions, where a long was used.  Under MSDOS, a PLINT is
00113  * typedef'd to a long, since 16 bits is too inaccurate for some PLplot
00114  * functions.  So under MSDOS you must use type PLINT for integer array
00115  * arguments to PLplot functions, but on other systems you can just use
00116  * an int.
00117  *
00118  * short is currently used for device page coordinates, so they are
00119  * bounded by (-32767, 32767).  This gives a max resolution of about 3000
00120  * dpi, and improves performance in some areas over using a PLINT.
00121 \*--------------------------------------------------------------------------*/
00122 
00123 #if defined(PL_DOUBLE) || defined(DOUBLE)
00124 typedef double PLFLT;
00125 #define PLFLT_MAX DBL_MAX
00126 #define PLFLT_MIN DBL_MIN
00127 #else
00128 typedef float PLFLT;
00129 #define PLFLT_MAX  FLT_MAX
00130 #define PLFLT_MIN  FLT_MIN
00131 #endif
00132 
00133 #if defined(MSDOS) && !defined(__WIN32__)
00134 typedef long PLINT;
00135 #else
00136 typedef int PLINT;
00137 #endif
00138 
00139 /* For passing user data, as with X's XtPointer */
00140 
00141 typedef void* PLPointer;
00142 
00143 /*--------------------------------------------------------------------------*\
00144  * Complex data types and other good stuff
00145 \*--------------------------------------------------------------------------*/
00146 
00147 /* Switches for escape function call. */
00148 /* Some of these are obsolete but are retained in order to process
00149    old metafiles */
00150 
00151 #define PLESC_SET_RGB              1      /* obsolete */
00152 #define PLESC_ALLOC_NCOL    2      /* obsolete */
00153 #define PLESC_SET_LPB              3      /* obsolete */
00154 #define PLESC_EXPOSE        4      /* handle window expose */
00155 #define PLESC_RESIZE        5      /* handle window resize */
00156 #define PLESC_REDRAW        6      /* handle window redraw */
00157 #define PLESC_TEXT          7      /* switch to text screen */
00158 #define PLESC_GRAPH         8      /* switch to graphics screen */
00159 #define PLESC_FILL          9      /* fill polygon */
00160 #define PLESC_DI            10     /* handle DI command */
00161 #define PLESC_FLUSH         11     /* flush output */
00162 #define PLESC_EH            12      /* handle Window events */
00163 #define PLESC_GETC          13     /* get cursor position */
00164 #define PLESC_SWIN          14     /* set window parameters */
00165 #define PLESC_DOUBLEBUFFERING      15     /* configure double buffering */
00166 #define PLESC_XORMOD        16     /* set xor mode */
00167 #define PLESC_SET_COMPRESSION      17     /* AFR: set compression */
00168 #define PLESC_CLEAR         18      /* RL: clear graphics region */
00169 #define PLESC_DASH          19     /* RL: draw dashed line */
00170 #define PLESC_HAS_TEXT             20     /* driver draws text */
00171 #define PLESC_IMAGE         21     /* handle image */
00172 #define PLESC_IMAGEOPS          22      /* plimage related operations */
00173 #define PLESC_PL2DEVCOL            23     /* convert PLColor to device color */
00174 #define PLESC_DEV2PLCOL            24     /* convert device color to PLColor */
00175 #define PLESC_SETBGFG              25     /* set BG, FG colors */
00176 #define PLESC_DEVINIT              26     /* alternate device initialization */
00177 
00178 /* image operations */
00179 #define ZEROW2B   1
00180 #define ZEROW2D   2
00181 #define ONEW2B    3
00182 #define ONEW2D    4
00183 
00184 /* Window parameter tags */
00185 
00186 #define PLSWIN_DEVICE              1      /* device coordinates */
00187 #define PLSWIN_WORLD        2      /* world coordinates */
00188 
00189 /* PLplot Option table & support constants */
00190 
00191 /* Option-specific settings */
00192 
00193 #define PL_OPT_ENABLED             0x0001 /* Obsolete */
00194 #define PL_OPT_ARG          0x0002 /* Option has an argment */
00195 #define PL_OPT_NODELETE            0x0004 /* Don't delete after processing */
00196 #define PL_OPT_INVISIBLE    0x0008 /* Make invisible */
00197 #define PL_OPT_DISABLED            0x0010 /* Processing is disabled */
00198 
00199 /* Option-processing settings -- mutually exclusive */
00200 
00201 #define PL_OPT_FUNC         0x0100 /* Call handler function */
00202 #define PL_OPT_BOOL         0x0200 /* Set *var = 1 */
00203 #define PL_OPT_INT          0x0400 /* Set *var = atoi(optarg) */
00204 #define PL_OPT_FLOAT        0x0800 /* Set *var = atof(optarg) */
00205 #define PL_OPT_STRING              0x1000 /* Set var = optarg */
00206 
00207 /* Global mode settings */
00208 /* These override per-option settings */
00209 
00210 #define PL_PARSE_PARTIAL    0x0000 /* For backward compatibility */
00211 #define PL_PARSE_FULL              0x0001 /* Process fully & exit if error */
00212 #define PL_PARSE_QUIET             0x0002 /* Don't issue messages */
00213 #define PL_PARSE_NODELETE   0x0004 /* Don't delete options after */
00214                                    /* processing */
00215 #define PL_PARSE_SHOWALL    0x0008 /* Show invisible options */
00216 #define PL_PARSE_OVERRIDE   0x0010 /* Obsolete */
00217 #define PL_PARSE_NOPROGRAM  0x0020 /* Program name NOT in *argv[0].. */
00218 #define PL_PARSE_NODASH            0x0040 /* Set if leading dash NOT required */
00219 #define PL_PARSE_SKIP              0x0080 /* Skip over unrecognized args */
00220 
00221 /* Obsolete names */
00222 
00223 #define plParseInternalOpts(a, b, c)      plParseOpts(a, b, c)
00224 #define plSetInternalOpt(a, b)            plSetOpt(a, b)
00225 
00226 /* Option table definition */
00227 
00228 typedef struct {
00229     char *opt;
00230     int  (*handler)  (char *, char *, void *);
00231     void *client_data;
00232     void *var;
00233     long mode;
00234     char *syntax;
00235     char *desc;
00236 } PLOptionTable;
00237 
00238 /* PLplot Graphics Input structure */
00239 
00240 #define PL_MAXKEY 16
00241 
00242 typedef struct {
00243     int type;               /* of event (CURRENTLY UNUSED) */
00244     unsigned int state;            /* key or button mask */
00245     unsigned int keysym;    /* key selected */
00246     unsigned int button;    /* mouse button selected */
00247     PLINT subwindow;            /* subwindow (alias subpage, alias subplot) number */
00248     char string[PL_MAXKEY]; /* translated string */
00249     int pX, pY;                    /* absolute device coordinates of pointer */
00250     PLFLT dX, dY;           /* relative device coordinates of pointer */
00251     PLFLT wX, wY;           /* world coordinates of pointer */
00252 } PLGraphicsIn;
00253 
00254 /* Structure for describing the plot window */
00255 
00256 #define PL_MAXWINDOWS       64     /* Max number of windows/page tracked */
00257 
00258 typedef struct {
00259     PLFLT dxmi, dxma, dymi, dyma;  /* min, max window rel dev coords */
00260     PLFLT wxmi, wxma, wymi, wyma;  /* min, max window world coords */
00261 } PLWindow;
00262 
00263 /* Structure for doing display-oriented operations via escape commands */
00264 /* May add other attributes in time */
00265 
00266 typedef struct {
00267     unsigned int x, y;                    /* upper left hand corner */
00268     unsigned int width, height;           /* window dimensions */
00269 } PLDisplay;
00270 
00271 /* Macro used (in some cases) to ignore value of argument */
00272 /* I don't plan on changing the value so you can hard-code it */
00273 
00274 #define PL_NOTSET (-42)
00275 
00276 /* See plcont.c for examples of the following */
00277 
00278 /*
00279  * PLfGrid is for passing (as a pointer to the first element) an arbitrarily
00280  * dimensioned array.  The grid dimensions MUST be stored, with a maximum of 3
00281  * dimensions assumed for now.
00282  */
00283 
00284 typedef struct {
00285     PLFLT *f;
00286     PLINT nx, ny, nz;
00287 } PLfGrid;
00288 
00289 /*
00290  * PLfGrid2 is for passing (as an array of pointers) a 2d function array.  The
00291  * grid dimensions are passed for possible bounds checking.
00292  */
00293 
00294 typedef struct {
00295     PLFLT **f;
00296     PLINT nx, ny;
00297 } PLfGrid2;
00298 
00299 /*
00300  * NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet
00301  * so I'll leave it out for now.
00302  */
00303 
00304 /*
00305  * PLcGrid is for passing (as a pointer to the first element) arbitrarily
00306  * dimensioned coordinate transformation arrays.  The grid dimensions MUST be
00307  * stored, with a maximum of 3 dimensions assumed for now.
00308  */
00309 
00310 typedef struct {
00311     PLFLT *xg, *yg, *zg;
00312     PLINT nx, ny, nz;
00313 } PLcGrid;
00314 
00315 /*
00316  * PLcGrid2 is for passing (as arrays of pointers) 2d coordinate
00317  * transformation arrays.  The grid dimensions are passed for possible bounds
00318  * checking.
00319  */
00320 
00321 typedef struct {
00322     PLFLT **xg, **yg, **zg;
00323     PLINT nx, ny;
00324 } PLcGrid2;
00325 
00326 /*
00327  * NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet
00328  * so I'll leave it out for now.
00329  */
00330 
00331 /* PLColor is the usual way to pass an rgb color value. */
00332 
00333 typedef struct {
00334     unsigned char r;        /* red */
00335     unsigned char g;        /* green */
00336     unsigned char b;        /* blue */
00337     char *name;
00338 } PLColor;
00339 
00340 /* PLControlPt is how cmap1 control points are represented. */
00341 
00342 typedef struct {
00343     PLFLT h;                /* hue */
00344     PLFLT l;                /* lightness */
00345     PLFLT s;                /* saturation */
00346     PLFLT p;                /* position */
00347     int rev;                /* if set, interpolate through h=0 */
00348 } PLControlPt;
00349 
00350 /* A PLBufferingCB is a control block for interacting with devices
00351    that support double buffering. */
00352 
00353 typedef struct {
00354     PLINT cmd;
00355     PLINT result;
00356 } PLBufferingCB;
00357 
00358 #define PLESC_DOUBLEBUFFERING_ENABLE     1
00359 #define PLESC_DOUBLEBUFFERING_DISABLE    2
00360 #define PLESC_DOUBLEBUFFERING_QUERY      3
00361 
00362 
00363 /*--------------------------------------------------------------------------*\
00364  *            BRAINDEAD-ness
00365  *
00366  * Some systems allow the Fortran & C namespaces to clobber each other.
00367  * For PLplot to work from Fortran on these systems, we must name the the
00368  * externally callable C functions something other than their Fortran entry
00369  * names.  In order to make this as easy as possible for the casual user,
00370  * yet reversible to those who abhor my solution, I have done the
00371  * following:
00372  *
00373  *     The C-language bindings are actually different from those
00374  *     described in the manual.  Macros are used to convert the
00375  *     documented names to the names used in this package.  The
00376  *     user MUST include plplot.h in order to get the name
00377  *     redefinition correct.
00378  *
00379  * Sorry to have to resort to such an ugly kludge, but it is really the
00380  * best way to handle the situation at present.  If all available
00381  * compilers offer a way to correct this stupidity, then perhaps we can
00382  * eventually reverse it (there is a way now, by defining NOBRAINDEAD, but
00383  * be careful because this will totally hose the Fortran interface on some
00384  * systems).  If you feel like screaming at someone (I sure do), please
00385  * direct it at your nearest system vendor who has a braindead shared
00386  * C/Fortran namespace.  Some vendors do offer compiler switches that
00387  * change the object names, but then everybody who wants to use the
00388  * package must throw these same switches, leading to no end of trouble.
00389  *
00390  * Note that this definition should not cause any noticable effects except
00391  * when debugging PLplot calls, in which case you will need to remember
00392  * the real function names (same as before but with a 'c_' prepended).
00393  *
00394  * Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded
00395  * in the stub routines.
00396  *
00397  * Aside: the reason why a shared Fortran/C namespace is deserving of the
00398  * BRAINDEAD characterization is that it completely precludes the the kind
00399  * of universal API that is attempted (more or less) with PLplot, without
00400  * Herculean efforts (e.g. remapping all of the C bindings by macros as
00401  * done here).  The vendors of such a scheme, in order to allow a SINGLE
00402  * type of argument to be passed transparently between C and Fortran,
00403  * namely, a pointer to a conformable data type, have slammed the door on
00404  * insertion of stub routines to handle the conversions needed for other
00405  * data types.  Intelligent linkers could solve this problem, but these are
00406  * not anywhere close to becoming universal.  So meanwhile, one must live
00407  * with either stub routines for the inevitable data conversions, or a
00408  * different API.  The former is what is used here, but is made far more
00409  * difficult in a braindead shared Fortran/C namespace.
00410 \*--------------------------------------------------------------------------*/
00411 
00412 #ifndef BRAINDEAD
00413 #define BRAINDEAD
00414 #endif
00415 
00416 #ifdef NOBRAINDEAD
00417 #undef BRAINDEAD
00418 #endif
00419 
00420 #ifdef BRAINDEAD
00421 
00422 #ifndef __PLSTUBS_H__       /* i.e. do not expand this in the stubs */
00423 
00424 #define    pl_setcontlabelformat c_pl_setcontlabelformat
00425 #define    pl_setcontlabelparam c_pl_setcontlabelparam
00426 #define    pladv     c_pladv
00427 #define    plaxes    c_plaxes
00428 #define    plbin     c_plbin
00429 #define    plbop     c_plbop
00430 #define    plbox     c_plbox
00431 #define    plbox3    c_plbox3
00432 #define    plcalc_world     c_plcalc_world
00433 #define    plclear   c_plclear
00434 #define    plcol0    c_plcol0
00435 #define    plcol1    c_plcol1
00436 #define    plcont    c_plcont
00437 #define    plcpstrm  c_plcpstrm
00438 #define    plend     c_plend
00439 #define    plend1    c_plend1
00440 #define    plenv     c_plenv
00441 #define    plenv0    c_plenv0
00442 #define    pleop     c_pleop
00443 #define    plerrx    c_plerrx
00444 #define    plerry    c_plerry
00445 #define    plfamadv  c_plfamadv
00446 #define    plfill    c_plfill
00447 #define    plfill3   c_plfill3
00448 #define    plflush   c_plflush
00449 #define    plfont    c_plfont
00450 #define    plfontld  c_plfontld
00451 #define    plgchr    c_plgchr
00452 #define    plgcol0   c_plgcol0
00453 #define    plgcolbg  c_plgcolbg
00454 #define    plgcompression   c_plgcompression
00455 #define    plgdev    c_plgdev
00456 #define    plgdidev  c_plgdidev
00457 #define    plgdiori  c_plgdiori
00458 #define    plgdiplt  c_plgdiplt
00459 #define    plgfam    c_plgfam
00460 #define    plgfnam   c_plgfnam
00461 #define    plglevel  c_plglevel
00462 #define    plgpage   c_plgpage
00463 #define    plgra     c_plgra
00464 #define    plgriddata   c_plgriddata
00465 #define    plgspa    c_plgspa
00466 #define    plgstrm   c_plgstrm
00467 #define    plgver    c_plgver
00468 #define    plgvpd    c_plgvpd
00469 #define    plgvpw    c_plgvpw
00470 #define    plgxax    c_plgxax
00471 #define    plgyax    c_plgyax
00472 #define    plgzax    c_plgzax
00473 #define    plhist    c_plhist
00474 #define    plhls        c_plhls
00475 #define    plinit    c_plinit
00476 #define    pljoin    c_pljoin
00477 #define    pllab     c_pllab
00478 #define    pllightsource    c_pllightsource
00479 #define    plline    c_plline
00480 #define    plline3   c_plline3
00481 #define    pllsty    c_pllsty
00482 #define    plmesh    c_plmesh
00483 #define    plmeshc   c_plmeshc
00484 #define    plmkstrm  c_plmkstrm
00485 #define    plmtex    c_plmtex
00486 #define    plot3d    c_plot3d
00487 #define    plot3dc   c_plot3dc
00488 #define    plsurf3d  c_plsurf3d
00489 #define    plpat     c_plpat
00490 #define    plpoin    c_plpoin
00491 #define    plpoin3   c_plpoin3
00492 #define    plpoly3   c_plpoly3
00493 #define    plprec    c_plprec
00494 #define    plpsty    c_plpsty
00495 #define    plptex    c_plptex
00496 #define    plreplot  c_plreplot
00497 #define    plrgb     c_plrgb
00498 #define    plrgb1    c_plrgb1
00499 #define    plschr    c_plschr
00500 #define    plscmap0  c_plscmap0
00501 #define    plscmap1  c_plscmap1
00502 #define    plscmap0n c_plscmap0n
00503 #define    plscmap1n c_plscmap1n
00504 #define    plscmap1l c_plscmap1l
00505 #define    plscol0   c_plscol0
00506 #define    plscolbg  c_plscolbg
00507 #define    plscolor  c_plscolor
00508 #define    plscompression   c_plscompression
00509 #define    plsdev    c_plsdev
00510 #define    plsdiplt  c_plsdiplt
00511 #define    plsdiplz  c_plsdiplz
00512 #define    plsdidev  c_plsdidev
00513 #define    plsdimap  c_plsdimap
00514 #define    plsdiori  c_plsdiori
00515 #define    plsetopt  c_plsetopt
00516 #define    plsesc    c_plsesc
00517 #define    plsfam    c_plsfam
00518 #define    plsfnam   c_plsfnam
00519 #define    plshades  c_plshades
00520 #define    plshade   c_plshade
00521 #define    plshade1  c_plshade1
00522 #define    plsmaj    c_plsmaj
00523 #define    plsmem    c_plsmem
00524 #define    plsmin    c_plsmin
00525 #define    plsori    c_plsori
00526 #define    plspage   c_plspage
00527 #define    plspause  c_plspause
00528 #define    plsstrm   c_plsstrm
00529 #define    plssub    c_plssub
00530 #define    plssym    c_plssym
00531 #define    plstar    c_plstar
00532 #define    plstart   c_plstart
00533 #define    plstripa  c_plstripa
00534 #define    plstripc  c_plstripc
00535 #define    plstripd  c_plstripd
00536 #define    plstyl    c_plstyl
00537 #define    plsvpa    c_plsvpa
00538 #define    plsxax    c_plsxax
00539 #define    plsyax    c_plsyax
00540 #define    plsym     c_plsym
00541 #define    plszax    c_plszax
00542 #define    pltext    c_pltext
00543 #define    plvasp    c_plvasp
00544 #define    plvpas    c_plvpas
00545 #define    plvpor    c_plvpor
00546 #define    plvsta    c_plvsta
00547 #define    plw3d     c_plw3d
00548 #define    plwid     c_plwid
00549 #define    plwind    c_plwind
00550 #define    plxormod  c_plxormod
00551 
00552 #endif /* __PLSTUBS_H__ */
00553 
00554 #else
00555 
00556 #define    c_pl_setcontlabelformat pl_setcontlabelformat
00557 #define    c_pl_setcontlabelparam pl_setcontlabelparam
00558 #define    c_pladv   pladv
00559 #define    c_plaxes  plaxes
00560 #define    c_plbin   plbin
00561 #define    c_plbop   plbop
00562 #define    c_plbox   plbox
00563 #define    c_plbox3  plbox3
00564 #define    c_plcalc_world   plcalc_world
00565 #define    c_plclear plclear
00566 #define    c_plcol0  plcol0
00567 #define    c_plcol1  plcol1
00568 #define    c_plcpstrm       plcpstrm
00569 #define    c_plcont  plcont
00570 #define    c_plend   plend
00571 #define    c_plend1  plend1
00572 #define    c_plenv   plenv
00573 #define    c_plenv0  plenv0
00574 #define    c_pleop   pleop
00575 #define    c_plerrx  plerrx
00576 #define    c_plerry  plerry
00577 #define    c_plfamadv       plfamadv
00578 #define    c_plfill  plfill
00579 #define    c_plfill3 plfill3
00580 #define    c_plflush plflush
00581 #define    c_plfont  plfont
00582 #define    c_plfontld       plfontld
00583 #define    c_plgchr  plgchr
00584 #define    c_plgcol0 plgcol0
00585 #define    c_plgcolbg       plgcolbg
00586 #define    c_plgcompression plgcompression
00587 #define    c_plgdev  plgdev
00588 #define    c_plgdidev       plgdidev
00589 #define    c_plgdiori       plgdiori
00590 #define    c_plgdiplt       plgdiplt
00591 #define    c_plgfam  plgfam
00592 #define    c_plgfnam plgfnam
00593 #define    c_plglevel       plglevel
00594 #define    c_plgpage plgpage
00595 #define    c_plgra   plgra
00596 #define    c_plgriddata plgriddata   
00597 #define    c_plgspa  plgspa
00598 #define    c_plgstrm plgstrm
00599 #define    c_plgver  plgver
00600 #define    c_plgvpd  plgvpd
00601 #define    c_plgvpw  plgvpw
00602 #define    c_plgxax  plgxax
00603 #define    c_plgyax  plgyax
00604 #define    c_plgzax  plgzax
00605 #define    c_plhist  plhist
00606 #define    c_plhls   plhls       
00607 #define    c_plinit  plinit
00608 #define    c_pljoin  pljoin
00609 #define    c_pllab   pllab
00610 #define    c_pllightsource pllightsource
00611 #define    c_plline  plline
00612 #define    c_plline3 plline3
00613 #define    c_pllsty  pllsty
00614 #define    c_plmesh  plmesh
00615 #define    c_plmeshc plmeshc
00616 #define    c_plmkstrm       plmkstrm
00617 #define    c_plmtex  plmtex
00618 #define    c_plot3d  plot3d
00619 #define    c_plot3dc plot3dc
00620 #define    c_plsurf3d       plsurf3d
00621 #define    c_plpat   plpat
00622 #define    c_plpoin  plpoin
00623 #define    c_plpoin3 plpoin3
00624 #define    c_plpoly3 plpoly3
00625 #define    c_plprec  plprec
00626 #define    c_plpsty  plpsty
00627 #define    c_plptex  plptex
00628 #define    c_plreplot       plreplot
00629 #define    c_plrgb   plrgb
00630 #define    c_plrgb1  plrgb1
00631 #define    c_plschr  plschr
00632 #define    c_plscmap0       plscmap0
00633 #define    c_plscmap1       plscmap1
00634 #define    c_plscmap0n      plscmap0n
00635 #define    c_plscmap1n      plscmap1n
00636 #define    c_plscmap1l      plscmap1l
00637 #define    c_plscol0 plscol0
00638 #define    c_plscolbg       plscolbg
00639 #define    c_plscolor       plscolor
00640 #define    c_plscompression plscompression
00641 #define    c_plsdev  plsdev
00642 #define    c_plsdiplt       plsdiplt
00643 #define    c_plsdiplz       plsdiplz
00644 #define    c_plsdidev       plsdidev
00645 #define    c_plsdimap       plsdimap
00646 #define    c_plsdiori       plsdiori
00647 #define    c_plsetopt       plsetopt
00648 #define    c_plsesc  plsesc
00649 #define    c_plsfam  plsfam
00650 #define    c_plsfnam plsfnam
00651 #define    c_plshades       plshades
00652 #define    c_plshade plshade
00653 #define    c_plshade1       plshade1
00654 #define    c_plsmaj  plsmaj
00655 #define    c_plsmin  plsmin
00656 #define    c_plsori  plsori
00657 #define    c_plspage plspage
00658 #define    c_plspause       plspause
00659 #define    c_plsstrm plsstrm
00660 #define    c_plssub  plssub
00661 #define    c_plssym  plssym
00662 #define    c_plstar  plstar
00663 #define    c_plstart plstart
00664 #define    c_plstripa       plstripa
00665 #define    c_plstripc       plstripc
00666 #define    c_plstripd       plstripd
00667 #define    c_plstyl  plstyl
00668 #define    c_plsvpa  plsvpa
00669 #define    c_plsxax  plsxax
00670 #define    c_plsyax  plsyax
00671 #define    c_plsym   plsym
00672 #define    c_plszax  plszax
00673 #define    c_pltext  pltext
00674 #define    c_plvasp  plvasp
00675 #define    c_plvpas  plvpas
00676 #define    c_plvpor  plvpor
00677 #define    c_plvsta  plvsta
00678 #define    c_plw3d   plw3d
00679 #define    c_plwid   plwid
00680 #define    c_plwind  plwind
00681 #define    c_plxormod       plxormod
00682 
00683 #endif /* BRAINDEAD */
00684 
00685 /* Redefine some old function names for backward compatibility */
00686 
00687 #ifndef __PLSTUBS_H__       /* i.e. do not expand this in the stubs */
00688 
00689 #define    plclr     pleop
00690 #define    plpage    plbop
00691 #define    plcol     plcol0
00692 #define    plcontf   plfcont
00693 #define          Alloc2dGrid       plAlloc2dGrid
00694 #define          Free2dGrid plFree2dGrid
00695 #define    MinMax2dGrid plMinMax2dGrid
00696 #define    plP_gvpd  plgvpd
00697 #define    plP_gvpw  plgvpw
00698 #define    plotsh3d(x,y,z,nx,ny,opt)     plsurf3d(x,y,z,nx,ny,opt, NULL, 0)
00699 
00700 #endif /* __PLSTUBS_H__ */
00701 
00702 /*--------------------------------------------------------------------------*\
00703  *            Function Prototypes
00704 \*--------------------------------------------------------------------------*/
00705 
00706 #ifdef __cplusplus
00707 extern "C" {
00708 #endif
00709 
00710        /* All void types */
00711 
00712        /* C routines callable from stub routines come first */
00713 
00714 /* set the format of the contour labels */
00715 
00716 void
00717 c_pl_setcontlabelformat(PLINT lexp, PLINT sigdig);
00718 
00719 /* set offset and spacing of contour labels */
00720 
00721 void
00722 c_pl_setcontlabelparam(PLFLT offset, PLFLT size, PLFLT spacing, PLINT active);
00723 
00724 /* Advance to subpage "page", or to the next one if "page" = 0. */
00725 
00726 void
00727 c_pladv(PLINT page);
00728 
00729 /* simple arrow plotter. */
00730 
00731 void
00732 plarrows(PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n,
00733          PLFLT scale, PLFLT dx, PLFLT dy) ;
00734 
00735 /* This functions similarly to plbox() except that the origin of the axes */
00736 /* is placed at the user-specified point (x0, y0). */
00737 
00738 void
00739 c_plaxes(PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub,
00740         const char *yopt, PLFLT ytick, PLINT nysub);
00741 
00742 /* Plot a histogram using x to store data values and y to store frequencies */
00743 
00744 void
00745 c_plbin(PLINT nbin, PLFLT *x, PLFLT *y, PLINT center);
00746 
00747 /* Start new page.  Should only be used with pleop(). */
00748 
00749 void
00750 c_plbop(void);
00751 
00752 /* This draws a box around the current viewport. */
00753 
00754 void
00755 c_plbox(const char *xopt, PLFLT xtick, PLINT nxsub,
00756        const char *yopt, PLFLT ytick, PLINT nysub);
00757 
00758 /* This is the 3-d analogue of plbox(). */
00759 
00760 MZ_DLLEXPORT
00761 void
00762 c_plbox3(const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx,
00763         const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby,
00764         const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz);
00765 
00766 /* Calculate world coordinates and subpage from relative device coordinates. */
00767 
00768 void
00769 c_plcalc_world(PLFLT rx, PLFLT ry, PLFLT *wx, PLFLT *wy, PLINT *window);
00770    
00771 /* Clear current subpage. */
00772    
00773 void
00774 c_plclear(void);
00775 
00776 /* Set color, map 0.  Argument is integer between 0 and 15. */
00777 
00778 MZ_DLLEXPORT
00779 void
00780 c_plcol0(PLINT icol0);
00781 
00782 /* Set color, map 1.  Argument is a float between 0. and 1. */
00783 
00784 void
00785 c_plcol1(PLFLT col1);
00786 
00787 /* Draws a contour plot from data in f(nx,ny).  Is just a front-end to
00788  * plfcont, with a particular choice for f2eval and f2eval_data. 
00789  */
00790 
00791  MZ_DLLEXPORT
00792 void
00793 c_plcont(PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx,
00794         PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
00795         void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
00796         PLPointer pltr_data);
00797 
00798 /* Draws a contour plot using the function evaluator f2eval and data stored
00799  * by way of the f2eval_data pointer.  This allows arbitrary organizations
00800  * of 2d array data to be used. 
00801  */
00802 
00803 void
00804 plfcont(PLFLT (*f2eval) (PLINT, PLINT, PLPointer),
00805        PLPointer f2eval_data,
00806        PLINT nx, PLINT ny, PLINT kx, PLINT lx,
00807        PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
00808        void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
00809        PLPointer pltr_data);
00810 
00811 /* Copies state parameters from the reference stream to the current stream. */
00812 
00813 void
00814 c_plcpstrm(PLINT iplsr, PLINT flags);
00815 
00816 /* Converts input values from relative device coordinates to relative plot */
00817 /* coordinates. */
00818 
00819 void
00820 pldid2pc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax);
00821 
00822 /* Converts input values from relative plot coordinates to relative */
00823 /* device coordinates. */
00824 
00825 void
00826 pldip2dc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax);
00827 
00828 /* End a plotting session for all open streams. */
00829 
00830 MZ_DLLEXPORT
00831 void
00832 c_plend(void);
00833 
00834 /* End a plotting session for the current stream only. */
00835 
00836 void
00837 c_plend1(void);
00838 
00839 /* Simple interface for defining viewport and window. */
00840 
00841 MZ_DLLEXPORT
00842 void
00843 c_plenv(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00844        PLINT just, PLINT axis);
00845 
00846 
00847 /* similar to plenv() above, but in multiplot mode does not advance the subpage,
00848  instead the current subpage is cleared */
00849 
00850 void
00851 c_plenv0(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00852        PLINT just, PLINT axis);
00853 
00854 /* End current page.  Should only be used with plbop(). */
00855 
00856 void
00857 c_pleop(void);
00858 
00859 /* Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) */
00860 
00861 MZ_DLLEXPORT
00862 void
00863 c_plerrx(PLINT n, PLFLT *xmin, PLFLT *xmax, PLFLT *y);
00864 
00865 /* Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) */
00866 
00867 MZ_DLLEXPORT
00868 void
00869 c_plerry(PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax);
00870 
00871 /* Advance to the next family file on the next new page */
00872 
00873 void
00874 c_plfamadv(void);
00875 
00876 /* Pattern fills the polygon bounded by the input points. */
00877 
00878 
00879 MZ_DLLEXPORT
00880 void
00881 c_plfill(PLINT n, PLFLT *x, PLFLT *y);
00882 
00883 /* Pattern fills the 3d polygon bounded by the input points. */
00884 
00885 void
00886 c_plfill3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z);
00887 
00888 /* Flushes the output stream.  Use sparingly, if at all. */
00889 
00890 void
00891 c_plflush(void);
00892 
00893 /* Sets the global font flag to 'ifont'. */
00894 
00895 void
00896 c_plfont(PLINT ifont);
00897 
00898 /* Load specified font set. */
00899 
00900 void
00901 c_plfontld(PLINT fnt);
00902 
00903 /* Get character default height and current (scaled) height */
00904 
00905 void
00906 c_plgchr(PLFLT *p_def, PLFLT *p_ht);
00907 
00908 /* Returns 8 bit RGB values for given color from color map 0 */
00909 
00910 void
00911 c_plgcol0(PLINT icol0, PLINT *r, PLINT *g, PLINT *b);
00912 
00913 /* Returns the background color by 8 bit RGB value */
00914 
00915 void
00916 c_plgcolbg(PLINT *r, PLINT *g, PLINT *b);
00917 
00918 /* Returns the current compression setting */
00919 
00920 void
00921 c_plgcompression(PLINT *compression);
00922 
00923 /* Get the current device (keyword) name */
00924 
00925 void
00926 c_plgdev(char *p_dev);
00927 
00928 /* Retrieve current window into device space */
00929 
00930 void
00931 c_plgdidev(PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy);
00932 
00933 /* Get plot orientation */
00934 
00935 void
00936 c_plgdiori(PLFLT *p_rot);
00937 
00938 /* Retrieve current window into plot space */
00939 
00940 void
00941 c_plgdiplt(PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax);
00942 
00943 /* Get family file parameters */
00944 
00945 void
00946 c_plgfam(PLINT *p_fam, PLINT *p_num, PLINT *p_bmax);
00947 
00948 /* Get the (current) output file name.  Must be preallocated to >80 bytes */
00949 
00950 void
00951 c_plgfnam(char *fnam);
00952 
00953 /* Get the (current) run level.  */
00954 
00955 void
00956 c_plglevel(PLINT *p_level);
00957 
00958 /* Get output device parameters. */
00959 
00960 void
00961 c_plgpage(PLFLT *p_xp, PLFLT *p_yp,
00962          PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff);
00963 
00964 /* Switches to graphics screen. */
00965 
00966 void
00967 c_plgra(void);
00968 
00969   /* grid irregularly sampled data */
00970 
00971 void
00972 c_plgriddata(PLFLT *x, PLFLT *y, PLFLT *z, int npts,
00973           PLFLT *xg, int nptsx, PLFLT *yg,  int nptsy,
00974           PLFLT **zg, int type, PLFLT data);
00975 
00976   /* type of gridding algorithm for plgriddata() */
00977 
00978 #define GRID_CSA    1 /* Bivariate Cubic Spline approximation */
00979 #define GRID_DTLI   2 /* Delaunay Triangulation Linear Interpolation */
00980 #define GRID_NNI    3 /* Natural Neighbors Interpolation */
00981 #define GRID_NNIDW  4 /* Nearest Neighbors Inverse Distance Weighted */
00982 #define GRID_NNLI   5 /* Nearest Neighbors Linear Interpolation */
00983 #define GRID_NNAIDW 6 /* Nearest Neighbors Around Inverse Distance Weighted  */
00984 
00985 /* Get subpage boundaries in absolute coordinates */
00986 
00987 void
00988 c_plgspa(PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax);
00989 
00990 /* Get current stream number. */
00991 
00992 void
00993 c_plgstrm(PLINT *p_strm);
00994 
00995 /* Get the current library version number */
00996 
00997 void
00998 c_plgver(char *p_ver);
00999 
01000 /* Get viewport boundaries in normalized device coordinates */
01001 
01002 void
01003 c_plgvpd(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax);
01004 
01005 /* Get viewport boundaries in world coordinates */
01006 
01007 void
01008 c_plgvpw(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax);
01009 
01010 /* Get x axis labeling parameters */
01011 
01012 void
01013 c_plgxax(PLINT *p_digmax, PLINT *p_digits);
01014 
01015 /* Get y axis labeling parameters */
01016 
01017 void
01018 c_plgyax(PLINT *p_digmax, PLINT *p_digits);
01019 
01020 /* Get z axis labeling parameters */
01021 
01022 void
01023 c_plgzax(PLINT *p_digmax, PLINT *p_digits);
01024 
01025 /* Draws a histogram of n values of a variable in array data[0..n-1] */
01026 
01027 void
01028 c_plhist(PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax,
01029         PLINT nbin, PLINT oldwin);
01030 
01031 /* Set current color (map 0) by hue, lightness, and saturation. */
01032 
01033 void
01034 c_plhls(PLFLT h, PLFLT l, PLFLT s);
01035 
01036 /* Initializes PLplot, using preset or default options */
01037 
01038 MZ_DLLEXPORT
01039 void
01040 c_plinit(void);
01041 
01042 /* Draws a line segment from (x1, y1) to (x2, y2). */
01043 
01044 MZ_DLLEXPORT
01045 void
01046 c_pljoin(PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2);
01047 
01048 /* Simple routine for labelling graphs. */
01049 
01050 MZ_DLLEXPORT
01051 void
01052 c_pllab(const char *xlabel, const char *ylabel, const char *tlabel);
01053 
01054 /* Sets position of the light source */
01055 void
01056 c_pllightsource(PLFLT x, PLFLT y, PLFLT z);
01057 
01058 /* Draws line segments connecting a series of points. */
01059 
01060 MZ_DLLEXPORT
01061 void
01062 c_plline(PLINT n, PLFLT *x, PLFLT *y);
01063 
01064 /* Draws a line in 3 space.  */
01065 
01066 MZ_DLLEXPORT
01067 void
01068 c_plline3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z);
01069 
01070 /* Set line style. */
01071 
01072 void
01073 c_pllsty(PLINT lin);
01074 
01075 /* plot continental outline in world coordinates */
01076 
01077 void
01078 plmap( void (*mapform)(PLINT, PLFLT *, PLFLT *), char *type,
01079          PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
01080 
01081 /* Plot the latitudes and longitudes on the background. */
01082 
01083 void 
01084 plmeridians( void (*mapform)(PLINT, PLFLT *, PLFLT *), 
01085                PLFLT dlong, PLFLT dlat,
01086                PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
01087 
01088 /* Plots a mesh representation of the function z[x][y]. */
01089 
01090 void
01091 c_plmesh(PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt);
01092 
01093 /* Plots a mesh representation of the function z[x][y] with contour */
01094 
01095 MZ_DLLEXPORT
01096 void
01097 c_plmeshc(PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt,
01098          PLFLT *clevel, PLINT nlevel);
01099 
01100 /* Creates a new stream and makes it the default.  */
01101 
01102 void
01103 c_plmkstrm(PLINT *p_strm);
01104 
01105 /* Prints out "text" at specified position relative to viewport */
01106 
01107 void
01108 c_plmtex(const char *side, PLFLT disp, PLFLT pos, PLFLT just,
01109         const char *text);
01110 
01111 /* Plots a 3-d representation of the function z[x][y]. */
01112 
01113 MZ_DLLEXPORT
01114 void
01115 c_plot3d(PLFLT *x, PLFLT *y, PLFLT **z,
01116         PLINT nx, PLINT ny, PLINT opt, PLINT side);
01117 
01118 /* Plots a 3-d representation of the function z[x][y] with contour. */
01119 
01120 void
01121 c_plot3dc(PLFLT *x, PLFLT *y, PLFLT **z,
01122         PLINT nx, PLINT ny, PLINT opt,
01123         PLFLT *clevel, PLINT nlevel);
01124 
01125 /* 
01126  * definitions for the opt argument in plot3dc() and plsurf3d()
01127  * 
01128  * DRAW_LINEX *must* be 1 and DRAW_LINEY *must* be 2, because of legacy code!
01129  */
01130 
01131 #define DRAW_LINEX  (1 << 0) /* draw lines parallel to the X axis */
01132 #define DRAW_LINEY  (1 << 1) /* draw lines parallel to the Y axis */
01133 #define DRAW_LINEXY (DRAW_LINEX | DRAW_LINEY) /* draw lines parallel to both the X and Y axis */
01134 #define MAG_COLOR   (1 << 2) /* draw the mesh with a color dependent of the magnitude */
01135 #define BASE_CONT   (1 << 3) /* draw contour plot at bottom xy plane */
01136 #define TOP_CONT    (1 << 4) /* draw contour plot at top xy plane */
01137 #define SURF_CONT   (1 << 5) /* draw contour plot at surface */
01138 #define DRAW_SIDES  (1 << 6) /* draw sides */
01139 #define FACETED     (1 << 7) /* draw outline for each square that makes up the surface */
01140 #define MESH        (1 << 8) /* draw mesh */
01141 
01142   /*
01143    *  valid options for plot3dc():
01144    *
01145    *  DRAW_SIDES, BASE_CONT, TOP_CONT (not yet),
01146    *  MAG_COLOR, DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY.
01147    *
01148    *  valid options for plsurf3dc():
01149    *
01150    *  MAG_COLOR, BASE_CONT, SURF_CONT, FACETED, DRAW_SIDES.
01151    */
01152 
01153 /* Plots the 3d surface representation of the function z[x][y]. */
01154 
01155 void
01156 c_plsurf3d(PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny,
01157           PLINT opt, PLFLT *clevel, PLINT nlevel);
01158 
01159 /* Set fill pattern directly. */
01160 
01161 void
01162 c_plpat(PLINT nlin, PLINT *inc, PLINT *del);
01163 
01164 /* Plots array y against x for n points using ASCII code "code".*/
01165 
01166 MZ_DLLEXPORT
01167 void
01168 c_plpoin(PLINT n, PLFLT *x, PLFLT *y, PLINT code);
01169 
01170 /* Draws a series of points in 3 space. */
01171 
01172 void
01173 c_plpoin3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT code);
01174 
01175 /* Draws a polygon in 3 space.  */
01176 
01177 MZ_DLLEXPORT
01178 void
01179 c_plpoly3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, PLINT ifcc);
01180 
01181 /* Set the floating point precision (in number of places) in numeric labels. */
01182 
01183 void
01184 c_plprec(PLINT setp, PLINT prec);
01185 
01186 /* Set fill pattern, using one of the predefined patterns.*/
01187 
01188 void
01189 c_plpsty(PLINT patt);
01190 
01191 /* Prints out "text" at world cooordinate (x,y). */
01192 
01193 MZ_DLLEXPORT
01194 void
01195 c_plptex(PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, const char *text);
01196 
01197 /* Replays contents of plot buffer to current device/file. */
01198 
01199 void
01200 c_plreplot(void);
01201 
01202 /* Set line color by red, green, blue from  0. to 1. */
01203 
01204 void
01205 c_plrgb(PLFLT r, PLFLT g, PLFLT b);
01206 
01207 /* Set line color by 8 bit RGB values. */
01208 
01209 void
01210 c_plrgb1(PLINT r, PLINT g, PLINT b);
01211 
01212 /* Set character height. */
01213 
01214 void
01215 c_plschr(PLFLT def, PLFLT scale);
01216 
01217 /* Set number of colors in cmap 0 */
01218 
01219 void
01220 c_plscmap0n(PLINT ncol0);
01221 
01222 /* Set number of colors in cmap 1 */
01223 
01224 MZ_DLLEXPORT
01225 void
01226 c_plscmap1n(PLINT ncol1);
01227 
01228 /* Set color map 0 colors by 8 bit RGB values */
01229 
01230 void
01231 c_plscmap0(PLINT *r, PLINT *g, PLINT *b, PLINT ncol0);
01232 
01233 /* Set color map 1 colors by 8 bit RGB values */
01234 
01235 void
01236 c_plscmap1(PLINT *r, PLINT *g, PLINT *b, PLINT ncol1);
01237 
01238 /* Set color map 1 colors using a piece-wise linear relationship between */
01239 /* intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. */
01240 
01241 MZ_DLLEXPORT
01242 void
01243 c_plscmap1l(PLINT itype, PLINT npts, PLFLT *intensity,
01244            PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev);
01245 
01246 /* Set a given color from color map 0 by 8 bit RGB value */
01247 
01248 MZ_DLLEXPORT
01249 void
01250 c_plscol0(PLINT icol0, PLINT r, PLINT g, PLINT b);
01251 
01252 /* Set the background color by 8 bit RGB value */
01253 
01254 MZ_DLLEXPORT
01255 void
01256 c_plscolbg(PLINT r, PLINT g, PLINT b);
01257 
01258 /* Used to globally turn color output on/off */
01259 
01260 void
01261 c_plscolor(PLINT color);
01262 
01263 /* Set the compression level */
01264 
01265 void
01266 c_plscompression(PLINT compression);
01267 
01268 /* Set the device (keyword) name */
01269 
01270 MZ_DLLEXPORT
01271 void
01272 c_plsdev(const char *devname);
01273 
01274 /* Set window into device space using margin, aspect ratio, and */
01275 /* justification */
01276 
01277 void
01278 c_plsdidev(PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy);
01279 
01280 /* Set up transformation from metafile coordinates. */
01281 
01282 void
01283 c_plsdimap(PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax,
01284           PLFLT dimxpmm, PLFLT dimypmm);
01285 
01286 /* Set plot orientation, specifying rotation in units of pi/2. */
01287 
01288 void
01289 c_plsdiori(PLFLT rot);
01290 
01291 /* Set window into plot space */
01292 
01293 void
01294 c_plsdiplt(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
01295 
01296 /* Set window into plot space incrementally (zoom) */
01297 
01298 void
01299 c_plsdiplz(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax);
01300 
01301 /* Set the escape character for text strings. */
01302 
01303 void
01304 c_plsesc(char esc);
01305 
01306 /* Set family file parameters */
01307 
01308 void
01309 c_plsfam(PLINT fam, PLINT num, PLINT bmax);
01310 
01311 /* Set the output file name. */
01312 
01313 MZ_DLLEXPORT
01314 void
01315 c_plsfnam(const char *fnam);
01316 
01317 
01318 /* Shade region. */
01319 MZ_DLLEXPORT
01320 void
01321 c_plshades( PLFLT **a, PLINT nx, PLINT ny, PLINT (*defined) (PLFLT, PLFLT),
01322          PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
01323          PLFLT *clevel, PLINT nlevel, PLINT fill_width,
01324          PLINT cont_color, PLINT cont_width,
01325          void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
01326          void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
01327          PLPointer pltr_data);
01328 
01329    
01330 void 
01331 c_plshade(PLFLT **a, PLINT nx, PLINT ny, PLINT (*defined) (PLFLT, PLFLT),
01332          PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
01333          PLFLT shade_min, PLFLT shade_max,
01334          PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
01335          PLINT min_color, PLINT min_width,
01336          PLINT max_color, PLINT max_width,
01337          void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
01338          void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
01339          PLPointer pltr_data);
01340 
01341 void 
01342 plshade1(PLFLT *a, PLINT nx, PLINT ny, PLINT (*defined) (PLFLT, PLFLT),
01343         PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
01344         PLFLT shade_min, PLFLT shade_max,
01345         PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
01346         PLINT min_color, PLINT min_width,
01347         PLINT max_color, PLINT max_width,
01348         void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
01349         void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
01350         PLPointer pltr_data);
01351 
01352 void 
01353 plfshade(PLFLT (*f2eval) (PLINT, PLINT, PLPointer),
01354         PLPointer f2eval_data,
01355         PLFLT (*c2eval) (PLINT, PLINT, PLPointer),
01356         PLPointer c2eval_data,
01357         PLINT nx, PLINT ny, 
01358         PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
01359         PLFLT shade_min, PLFLT shade_max,
01360         PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
01361         PLINT min_color, PLINT min_width,
01362         PLINT max_color, PLINT max_width,
01363         void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
01364         void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
01365         PLPointer pltr_data);
01366 
01367 /* Set up lengths of major tick marks. */
01368 
01369 void
01370 c_plsmaj(PLFLT def, PLFLT scale);
01371 
01372 /* Set the memory area to be plotted (with the 'mem' driver) */
01373 
01374 void
01375 c_plsmem(PLINT maxx, PLINT maxy, void *plotmem);
01376 
01377 /* Set up lengths of minor tick marks. */
01378 
01379 void
01380 c_plsmin(PLFLT def, PLFLT scale);
01381 
01382 /* Set orientation.  Must be done before calling plinit. */
01383 
01384 void
01385 c_plsori(PLINT ori);
01386 
01387 /* Set output device parameters.  Usually ignored by the driver. */
01388 
01389 MZ_DLLEXPORT
01390 void
01391 c_plspage(PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng,
01392          PLINT xoff, PLINT yoff);
01393 
01394 /* Set the pause (on end-of-page) status */
01395 
01396 void
01397 c_plspause(PLINT pause);
01398 
01399 /* Set stream number.  */
01400 
01401 void
01402 c_plsstrm(PLINT strm);
01403 
01404 /* Set the number of subwindows in x and y */
01405 
01406 void
01407 c_plssub(PLINT nx, PLINT ny);
01408 
01409 /* Set symbol height. */
01410 
01411 void
01412 c_plssym(PLFLT def, PLFLT scale);
01413 
01414 /* Initialize PLplot, passing in the windows/page settings. */
01415 
01416 void
01417 c_plstar(PLINT nx, PLINT ny);
01418 
01419 /* Initialize PLplot, passing the device name and windows/page settings. */
01420 
01421 void
01422 c_plstart(const char *devname, PLINT nx, PLINT ny);
01423 
01424 /* Create 1d stripchart */
01425 
01426 void
01427 c_plstripc(PLINT *id, char *xspec, char *yspec,
01428        PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax,
01429        PLFLT xlpos, PLFLT ylpos,
01430        PLINT y_ascl, PLINT acc,
01431        PLINT colbox, PLINT collab,
01432        PLINT colline[], PLINT styline[], char *legline[],
01433        char *labx, char *laby, char *labtop);
01434 
01435 /* Add a point to a stripchart.  */
01436 
01437 void
01438 c_plstripa(PLINT id, PLINT pen, PLFLT x, PLFLT y);
01439 
01440 /* Deletes and releases memory used by a stripchart.  */
01441 
01442 void
01443 c_plstripd(PLINT id);
01444 
01445   /* plots a 2d image (or a matrix too large for plshade() ) */
01446 
01447 void
01448 plimage( PLFLT **data, PLINT nx, PLINT ny, 
01449         PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax,
01450         PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax);
01451 
01452 /* Set up a new line style */
01453 
01454 void
01455 c_plstyl(PLINT nms, PLINT *mark, PLINT *space);
01456 
01457 /* Sets the edges of the viewport to the specified absolute coordinates */
01458 
01459 void
01460 c_plsvpa(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
01461 
01462 /* Set x axis labeling parameters */
01463 
01464 void
01465 c_plsxax(PLINT digmax, PLINT digits);
01466 
01467 /* Set inferior X window */
01468 
01469 void
01470 plsxwin(PLINT window_id);
01471 
01472 /* Set y axis labeling parameters */
01473 
01474 void
01475 c_plsyax(PLINT digmax, PLINT digits);
01476 
01477 /* Plots array y against x for n points using Hershey symbol "code" */
01478 
01479 void
01480 c_plsym(PLINT n, PLFLT *x, PLFLT *y, PLINT code);
01481 
01482 /* Set z axis labeling parameters */
01483 
01484 void
01485 c_plszax(PLINT digmax, PLINT digits);
01486 
01487 /* Switches to text screen. */
01488 
01489 void
01490 c_pltext(void);
01491 
01492 /* Sets the edges of the viewport with the given aspect ratio, leaving */
01493 /* room for labels. */
01494 
01495 void
01496 c_plvasp(PLFLT aspect);
01497 
01498 /* Creates the largest viewport of the specified aspect ratio that fits */
01499 /* within the specified normalized subpage coordinates. */
01500 
01501 void
01502 c_plvpas(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect);
01503 
01504 /* Creates a viewport with the specified normalized subpage coordinates. */
01505 
01506 void
01507 c_plvpor(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
01508 
01509 /* Defines a "standard" viewport with seven character heights for */
01510 /* the left margin and four character heights everywhere else. */
01511 
01512 void
01513 c_plvsta(void);
01514 
01515 /* Set up a window for three-dimensional plotting. */
01516 
01517 MZ_DLLEXPORT
01518 void
01519 c_plw3d(PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0,
01520        PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0,
01521        PLFLT zmax0, PLFLT alt, PLFLT az);
01522 
01523 /* Set pen width. */
01524 
01525 MZ_DLLEXPORT
01526 void
01527 c_plwid(PLINT width);
01528 
01529 /* Set up world coordinates of the viewport boundaries (2d plots). */
01530 
01531 void
01532 c_plwind(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax);
01533 
01534 /*  set xor mode; mode = 1-enter, 0-leave, status = 0 if not interactive device  */
01535 
01536 void
01537 c_plxormod(PLINT mode, PLINT *status);
01538 
01539 /*--------------------------------------------------------------------------*\
01540  *            Functions for use from C or C++ only
01541 \*--------------------------------------------------------------------------*/
01542 
01543 /* Returns a list of file-oriented device names and their menu strings */
01544 
01545 void
01546 plgFileDevs(char ***p_menustr, char ***p_devname, int *p_ndev);
01547 
01548 /* Returns a list of all device names and their menu strings */
01549 
01550 void
01551 plgDevs(char ***p_menustr, char ***p_devname, int *p_ndev);
01552 
01553 /* Set the function pointer for the keyboard event handler */
01554 
01555 void
01556 plsKeyEH(void (*KeyEH) (PLGraphicsIn *, void *, int *), void *KeyEH_data);
01557 
01558 /* Set the function pointer for the (mouse) button event handler */
01559 
01560 void
01561 plsButtonEH(void (*ButtonEH) (PLGraphicsIn *, void *, int *),
01562            void *ButtonEH_data);
01563 
01564 /* Sets an optional user bop handler */
01565 
01566 void
01567 plsbopH(void (*handler) (void *, int *), void *handler_data);
01568 
01569 /* Sets an optional user eop handler */
01570 
01571 void
01572 plseopH(void (*handler) (void *, int *), void *handler_data);
01573 
01574 /* Set the variables to be used for storing error info */
01575 
01576 void
01577 plsError(PLINT *errcode, char *errmsg);
01578 
01579 /* Sets an optional user exit handler. */
01580 
01581 void
01582 plsexit(int (*handler) (char *));
01583 
01584        /* Transformation routines */
01585 
01586 /* Identity transformation. */
01587 
01588 void
01589 pltr0(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
01590 
01591 /* Does linear interpolation from singly dimensioned coord arrays. */
01592 
01593 MZ_DLLEXPORT
01594 void
01595 pltr1(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
01596 
01597 /* Does linear interpolation from doubly dimensioned coord arrays */
01598 /* (column dominant, as per normal C 2d arrays). */
01599 
01600 void
01601 pltr2(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
01602 
01603 /* Just like pltr2() but uses pointer arithmetic to get coordinates from */
01604 /* 2d grid tables.  */
01605 
01606 void
01607 pltr2p(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data);
01608 
01609 /* Identity transformation for plots from Fortran. */
01610 
01611 void
01612 pltr0f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data);
01613 
01614 /* Does linear interpolation from doubly dimensioned coord arrays */
01615 /* (row dominant, i.e. Fortran ordering). */
01616 
01617 void
01618 pltr2f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data);
01619 
01620 /* Example linear transformation function for contour plotter. */
01621 
01622 void 
01623 xform(PLFLT x, PLFLT y, PLFLT * tx, PLFLT * ty);
01624 
01625        /* Function evaluators */
01626 
01627 /* Does a lookup from a 2d function array.  Array is of type (PLFLT **), */
01628 /* and is column dominant (normal C ordering). */
01629 
01630 PLFLT
01631 plf2eval2(PLINT ix, PLINT iy, PLPointer plf2eval_data);
01632 
01633 /* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
01634 /* and is column dominant (normal C ordering). */
01635 
01636 PLFLT
01637 plf2eval(PLINT ix, PLINT iy, PLPointer plf2eval_data);
01638 
01639 /* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
01640 /* and is row dominant (Fortran ordering). */
01641 
01642 PLFLT
01643 plf2evalr(PLINT ix, PLINT iy, PLPointer plf2eval_data);
01644 
01645        /* Command line parsing utilities */
01646 
01647 /* Clear internal option table info structure. */
01648 
01649 void
01650 plClearOpts(void);
01651 
01652 /* Reset internal option table info structure. */
01653 
01654 void
01655 plResetOpts(void);
01656 
01657 /* Merge user option table into internal info structure. */
01658 
01659 int
01660 plMergeOpts(PLOptionTable *options, char *name, char **notes);
01661 
01662 /* Set the strings used in usage and syntax messages. */
01663 
01664 void
01665 plSetUsage(char *program_string, char *usage_string);
01666 
01667 /* Process input strings, treating them as an option and argument pair. */
01668 /* The first is for the external API, the second the work routine declared
01669    here for backward compatibilty. */
01670 
01671 int
01672 c_plsetopt(char *opt, char *optarg);
01673 
01674 int
01675 plSetOpt(char *opt, char *optarg);
01676 
01677 /* Process options list using current options info. */
01678 
01679 int
01680 plParseOpts(int *p_argc, char **argv, PLINT mode);
01681 
01682 /* Print usage & syntax message. */
01683 
01684 void
01685 plOptUsage(void);
01686 
01687        /* Miscellaneous */
01688 
01689 /* Set the output file pointer */
01690 
01691 void
01692 plgfile(FILE **p_file);
01693 
01694 /* Get the output file pointer */
01695 
01696 void
01697 plsfile(FILE *file);
01698 
01699 /* Get the escape character for text strings. */
01700 
01701 void
01702 plgesc(char *p_esc);
01703 
01704 /* Front-end to driver escape function. */
01705 
01706 void
01707 pl_cmd(PLINT op, void *ptr);
01708 
01709 /* Return full pathname for given file if executable */
01710 
01711 int 
01712 plFindName(char *p);
01713 
01714 /* Looks for the specified executable file according to usual search path. */
01715 
01716 char *
01717 plFindCommand(char *fn);
01718 
01719 /* Gets search name for file by concatenating the dir, subdir, and file */
01720 /* name, allocating memory as needed.  */
01721 
01722 void
01723 plGetName(char *dir, char *subdir, char *filename, char **filespec);
01724 
01725 /* Prompts human to input an integer in response to given message. */
01726 
01727 PLINT
01728 plGetInt(char *s);
01729 
01730 /* Prompts human to input a float in response to given message. */
01731 
01732 PLFLT
01733 plGetFlt(char *s);
01734 
01735        /* Nice way to allocate space for a vectored 2d grid */
01736 
01737 /* Allocates a block of memory for use as a 2-d grid of PLFLT's.  */
01738 
01739 void
01740 plAlloc2dGrid(PLFLT ***f, PLINT nx, PLINT ny);
01741 
01742 /* Frees a block of memory allocated with plAlloc2dGrid(). */
01743 
01744 void
01745 plFree2dGrid(PLFLT **f, PLINT nx, PLINT ny);
01746 
01747 /* Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid(). */
01748 
01749 void
01750 plMinMax2dGrid(PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmax, PLFLT *fmin);
01751 
01752 /* Functions for converting between HLS and RGB color space */
01753 
01754 void
01755 plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b);
01756 
01757 void
01758 plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s);
01759 
01760 /* Wait for graphics input event and translate to world coordinates */
01761 
01762 int
01763 plGetCursor(PLGraphicsIn *gin);
01764 
01765 /* Translates relative device coordinates to world coordinates.  */
01766 
01767 int
01768 plTranslateCursor(PLGraphicsIn *gin);
01769 
01770 #ifdef __cplusplus
01771 }
01772 #endif
01773 
01774 #endif /* __PLPLOT_H__ */