~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to include/plplot.h

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: plplot.h,v 1.154 2004/06/14 21:51:57 rlaboiss Exp $
 
1
/* $Id: plplot.h,v 1.175 2006/05/13 05:22:43 airwin Exp $
2
2
 
3
3
    Macros and prototypes for the PLplot package.  This header file must
4
4
    be included by all user codes.
27
27
 
28
28
    You should have received a copy of the GNU Library General Public License
29
29
    along with PLplot; if not, write to the Free Software
30
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
30
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31
31
*/
32
32
 
33
33
#ifndef __PLPLOT_H__
115
115
 * Only those that are necessary for function prototypes are defined here.
116
116
 * Notes:
117
117
 *
118
 
 * PLINT is typedef'd to an int by default.  This is a change from some
119
 
 * previous versions, where a long was used.  Under MSDOS, a PLINT is
120
 
 * typedef'd to a long, since 16 bits is too inaccurate for some PLplot
121
 
 * functions.  So under MSDOS you must use type PLINT for integer array
122
 
 * arguments to PLplot functions, but on other systems you can just use
123
 
 * an int.
 
118
 * PLINT is typedef'd to a long by default.  This is a change from some
 
119
 * previous versions, where a int was used.  However, so long as you have
 
120
 * used type PLINT for integer array arguments as specified by the API,
 
121
 * this change will be transparent for you.
124
122
 *
125
123
 * short is currently used for device page coordinates, so they are
126
124
 * bounded by (-32767, 32767).  This gives a max resolution of about 3000
127
125
 * dpi, and improves performance in some areas over using a PLINT.
 
126
 *
 
127
 * PLUNICODE should be a 32-bit unsigned integer on all platforms.
 
128
 * For now, we are using unsigned int for our Linux ix86 unicode experiments,
 
129
 * but that doesn't guarantee 32 bits exactly on all platforms so this will
 
130
 * be subject to change.
128
131
\*--------------------------------------------------------------------------*/
129
132
 
130
133
#if defined(PL_DOUBLE) || defined(DOUBLE)
137
140
#define PLFLT_MIN  FLT_MIN
138
141
#endif
139
142
 
140
 
#if defined(MSDOS) && !defined(__WIN32__)
141
 
typedef long PLINT;
 
143
#if (defined(HAVE_STDINT_H) && !defined(__cplusplus)) ||\
 
144
(defined(__cplusplus) && defined(HAVE_CXX_STDINT_H))
 
145
#include <stdint.h>
 
146
/* This is apparently portable if stdint.h exists. */
 
147
typedef uint32_t PLUNICODE;
 
148
typedef int32_t PLINT;
142
149
#else
 
150
/* A reasonable back-up in case stdint.h does not exist on the platform. */
 
151
typedef unsigned int PLUNICODE;
143
152
typedef int PLINT;
144
153
#endif
145
154
 
 
155
/* For identifying logical (boolean) arguments */
 
156
typedef PLINT PLBOOL;
 
157
 
146
158
/* For passing user data, as with X's XtPointer */
147
159
 
148
160
typedef void* PLPointer;
225
237
#define PL_PARSE_NODASH         0x0040  /* Set if leading dash NOT required */
226
238
#define PL_PARSE_SKIP           0x0080  /* Skip over unrecognized args */
227
239
 
 
240
/* FCI (font characterization integer) related constants. */
 
241
#define PL_FCI_MARK 0x80000000
 
242
#define PL_FCI_IMPOSSIBLE 0x00000000
 
243
#define PL_FCI_HEXDIGIT_MASK 0xf
 
244
#define PL_FCI_HEXPOWER_MASK 0x7
 
245
#define PL_FCI_HEXPOWER_IMPOSSIBLE 0xf
 
246
/* These define hexpower values corresponding to each font attribute. */
 
247
#define PL_FCI_FAMILY  0x0
 
248
#define PL_FCI_STYLE  0x1
 
249
#define PL_FCI_WEIGHT  0x2
 
250
/* These are legal values for font family attribute */
 
251
#define PL_FCI_SANS 0x0
 
252
#define PL_FCI_SERIF 0x1
 
253
#define PL_FCI_MONO 0x2
 
254
#define PL_FCI_SCRIPT 0x3
 
255
#define PL_FCI_SYMBOL 0x4
 
256
/* These are legal values for font style attribute */
 
257
#define PL_FCI_UPRIGHT 0x0
 
258
#define PL_FCI_ITALIC 0x1
 
259
#define PL_FCI_OBLIQUE 0x2
 
260
/* These are legal values for font weight attribute */
 
261
#define PL_FCI_MEDIUM 0x0
 
262
#define PL_FCI_BOLD 0x1
 
263
 
228
264
/* Obsolete names */
229
265
 
230
 
#define plParseInternalOpts(a, b, c)    plParseOpts(a, b, c)
 
266
#define plParseInternalOpts(a, b, c)    c_plparseopts(a, b, c)
231
267
#define plSetInternalOpt(a, b)          plSetOpt(a, b)
232
 
 
233
268
/* Option table definition */
234
269
 
235
270
typedef struct {
460
495
#define    plgdiori     c_plgdiori
461
496
#define    plgdiplt     c_plgdiplt
462
497
#define    plgfam       c_plgfam
 
498
#define    plgfci       c_plgfci
463
499
#define    plgfnam      c_plgfnam
464
500
#define    plglevel     c_plglevel
465
501
#define    plgpage      c_plgpage
475
511
#define    plgzax       c_plgzax
476
512
#define    plhist       c_plhist
477
513
#define    plhls        c_plhls
 
514
#define    plhlsrgb     c_plhlsrgb
478
515
#define    plinit       c_plinit
479
516
#define    pljoin       c_pljoin
480
517
#define    pllab        c_pllab
482
519
#define    plline       c_plline
483
520
#define    plline3      c_plline3
484
521
#define    pllsty       c_pllsty
 
522
#define    plmap        c_plmap
 
523
#define    plmeridians  c_plmeridians
485
524
#define    plmesh       c_plmesh
486
525
#define    plmeshc      c_plmeshc
487
526
#define    plmkstrm     c_plmkstrm
489
528
#define    plot3d       c_plot3d
490
529
#define    plot3dc      c_plot3dc
491
530
#define    plot3dcl     c_plot3dcl
 
531
#define    plparseopts  c_plparseopts
492
532
#define    plpat        c_plpat
493
533
#define    plpoin       c_plpoin
494
534
#define    plpoin3      c_plpoin3
499
539
#define    plreplot     c_plreplot
500
540
#define    plrgb        c_plrgb
501
541
#define    plrgb1       c_plrgb1
 
542
#define    plrgbhls     c_plrgbhls
502
543
#define    plschr       c_plschr
503
544
#define    plscmap0     c_plscmap0
504
545
#define    plscmap0n    c_plscmap0n
518
559
#define    plsesc       c_plsesc
519
560
#define    plsetopt     c_plsetopt
520
561
#define    plsfam       c_plsfam
 
562
#define    plsfci       c_plsfci
521
563
#define    plsfnam      c_plsfnam
522
564
#define    plshade      c_plshade
523
565
#define    plshade1     c_plshade1
612
654
 
613
655
void
614
656
c_plvect(PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale,
615
 
void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
616
 
              PLPointer pltr_data);
 
657
        void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
 
658
        PLPointer pltr_data);
617
659
 
618
660
void
619
 
c_plsvect(PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLINT fill);
 
661
c_plsvect(PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLBOOL fill);
620
662
 
621
663
/* This functions similarly to plbox() except that the origin of the axes */
622
664
/* is placed at the user-specified point (x0, y0). */
627
669
 
628
670
/* Plot a histogram using x to store data values and y to store frequencies */
629
671
 
 
672
/* Flags for plbin() - opt argument */
 
673
#define PL_BIN_DEFAULT          0
 
674
#define PL_BIN_CENTRED          1
 
675
#define PL_BIN_NOEXPAND         2
 
676
#define PL_BIN_NOEMPTY          4
 
677
 
630
678
void
631
 
c_plbin(PLINT nbin, PLFLT *x, PLFLT *y, PLINT center);
 
679
c_plbin(PLINT nbin, PLFLT *x, PLFLT *y, PLINT opt);
632
680
 
633
681
/* Start new page.  Should only be used with pleop(). */
634
682
 
694
742
/* Copies state parameters from the reference stream to the current stream. */
695
743
 
696
744
void
697
 
c_plcpstrm(PLINT iplsr, PLINT flags);
 
745
c_plcpstrm(PLINT iplsr, PLBOOL flags);
698
746
 
699
747
/* Converts input values from relative device coordinates to relative plot */
700
748
/* coordinates. */
817
865
void
818
866
c_plgdiplt(PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax);
819
867
 
 
868
/* Get FCI (font characterization integer) */
 
869
 
 
870
void
 
871
c_plgfci(PLUNICODE *pfci);
 
872
 
820
873
/* Get family file parameters */
821
874
 
822
875
void
901
954
 
902
955
/* Draws a histogram of n values of a variable in array data[0..n-1] */
903
956
 
 
957
/* Flags for plhist() - opt argument; note: some flags are passed to
 
958
   plbin() for the actual plotting */
 
959
#define PL_HIST_DEFAULT         0
 
960
#define PL_HIST_NOSCALING       1
 
961
#define PL_HIST_IGNORE_OUTLIERS 2
 
962
#define PL_HIST_NOEXPAND        8
 
963
#define PL_HIST_NOEMPTY        16
 
964
 
904
965
void
905
966
c_plhist(PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax,
906
 
         PLINT nbin, PLINT oldwin);
 
967
         PLINT nbin, PLINT opt);
907
968
 
908
969
/* Set current color (map 0) by hue, lightness, and saturation. */
909
970
 
910
971
void
911
972
c_plhls(PLFLT h, PLFLT l, PLFLT s);
912
973
 
 
974
/* Functions for converting between HLS and RGB color space */
 
975
 
 
976
void
 
977
c_plhlsrgb(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b);
 
978
 
913
979
/* Initializes PLplot, using preset or default options */
914
980
 
915
981
void
947
1013
/* plot continental outline in world coordinates */
948
1014
 
949
1015
void
950
 
plmap( void (*mapform)(PLINT, PLFLT *, PLFLT *), char *type,
 
1016
c_plmap( void (*mapform)(PLINT, PLFLT *, PLFLT *), char *type,
951
1017
         PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
952
1018
 
953
1019
/* Plot the latitudes and longitudes on the background. */
954
1020
 
955
1021
void
956
 
plmeridians( void (*mapform)(PLINT, PLFLT *, PLFLT *),
 
1022
c_plmeridians( void (*mapform)(PLINT, PLFLT *, PLFLT *),
957
1023
               PLFLT dlong, PLFLT dlat,
958
1024
               PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
959
1025
 
983
1049
 
984
1050
void
985
1051
c_plot3d(PLFLT *x, PLFLT *y, PLFLT **z,
986
 
         PLINT nx, PLINT ny, PLINT opt, PLINT side);
 
1052
         PLINT nx, PLINT ny, PLINT opt, PLBOOL side);
987
1053
 
988
1054
/* Plots a 3-d representation of the function z[x][y] with contour. */
989
1055
 
998
1064
void
999
1065
c_plot3dcl(PLFLT *x, PLFLT *y, PLFLT **z,
1000
1066
         PLINT nx, PLINT ny, PLINT opt,
1001
 
         PLFLT *clevel, PLINT nlevel, 
 
1067
         PLFLT *clevel, PLINT nlevel,
1002
1068
         PLINT ixstart, PLINT ixn, PLINT *indexymin, PLINT*indexymax);
1003
1069
 
1004
1070
/*
1047
1113
/* Draws a polygon in 3 space.  */
1048
1114
 
1049
1115
void
1050
 
c_plpoly3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, PLINT ifcc);
 
1116
c_plpoly3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL ifcc);
1051
1117
 
1052
1118
/* Set the floating point precision (in number of places) in numeric labels. */
1053
1119
 
1079
1145
void
1080
1146
c_plrgb1(PLINT r, PLINT g, PLINT b);
1081
1147
 
 
1148
/* Functions for converting between HLS and RGB color space */
 
1149
 
 
1150
void
 
1151
c_plrgbhls(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s);
 
1152
 
1082
1153
/* Set character height. */
1083
1154
 
1084
1155
void
1103
1174
/* intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. */
1104
1175
 
1105
1176
void
1106
 
c_plscmap1l(PLINT itype, PLINT npts, PLFLT *intensity,
1107
 
            PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev);
 
1177
c_plscmap1l(PLBOOL itype, PLINT npts, PLFLT *intensity,
 
1178
            PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev);
1108
1179
 
1109
1180
/* Set number of colors in cmap 1 */
1110
1181
 
1173
1244
void
1174
1245
c_plsfam(PLINT fam, PLINT num, PLINT bmax);
1175
1246
 
 
1247
/* Set FCI (font characterization integer) */
 
1248
 
 
1249
void
 
1250
c_plsfci(PLUNICODE fci);
 
1251
 
1176
1252
/* Set the output file name. */
1177
1253
 
1178
1254
void
1187
1263
          PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1188
1264
          PLINT min_color, PLINT min_width,
1189
1265
          PLINT max_color, PLINT max_width,
1190
 
          void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
 
1266
          void (*fill) (PLINT, PLFLT *, PLFLT *), PLBOOL rectangular,
1191
1267
          void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
1192
1268
          PLPointer pltr_data);
1193
1269
 
1198
1274
         PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1199
1275
         PLINT min_color, PLINT min_width,
1200
1276
         PLINT max_color, PLINT max_width,
1201
 
         void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
 
1277
         void (*fill) (PLINT, PLFLT *, PLFLT *), PLBOOL rectangular,
1202
1278
         void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
1203
1279
         PLPointer pltr_data);
1204
1280
 
1207
1283
          PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1208
1284
          PLFLT *clevel, PLINT nlevel, PLINT fill_width,
1209
1285
          PLINT cont_color, PLINT cont_width,
1210
 
          void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
 
1286
          void (*fill) (PLINT, PLFLT *, PLFLT *), PLBOOL rectangular,
1211
1287
          void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
1212
1288
          PLPointer pltr_data);
1213
1289
 
1222
1298
         PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1223
1299
         PLINT min_color, PLINT min_width,
1224
1300
         PLINT max_color, PLINT max_width,
1225
 
         void (*fill) (PLINT, PLFLT *, PLFLT *), PLINT rectangular,
 
1301
         void (*fill) (PLINT, PLFLT *, PLFLT *), PLBOOL rectangular,
1226
1302
         void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
1227
1303
         PLPointer pltr_data);
1228
1304
 
1255
1331
/* Set the pause (on end-of-page) status */
1256
1332
 
1257
1333
void
1258
 
c_plspause(PLINT pause);
 
1334
c_plspause(PLBOOL pause);
1259
1335
 
1260
1336
/* Set stream number.  */
1261
1337
 
1293
1369
c_plstripc(PLINT *id, char *xspec, char *yspec,
1294
1370
        PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax,
1295
1371
        PLFLT xlpos, PLFLT ylpos,
1296
 
        PLINT y_ascl, PLINT acc,
 
1372
        PLBOOL y_ascl, PLBOOL acc,
1297
1373
        PLINT colbox, PLINT collab,
1298
1374
        PLINT colline[], PLINT styline[], char *legline[],
1299
1375
        char *labx, char *laby, char *labtop);
1407
1483
/*  set xor mode; mode = 1-enter, 0-leave, status = 0 if not interactive device  */
1408
1484
 
1409
1485
void
1410
 
c_plxormod(PLINT mode, PLINT *status);
 
1486
c_plxormod(PLBOOL mode, PLBOOL *status);
1411
1487
 
1412
1488
/*--------------------------------------------------------------------------*\
1413
1489
 *              Functions for use from C or C++ only
1494
1570
void
1495
1571
pltr2f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data);
1496
1572
 
1497
 
/* Example linear transformation function for contour plotter. */
1498
 
 
1499
 
void
1500
 
xform(PLFLT x, PLFLT y, PLFLT * tx, PLFLT * ty);
1501
 
 
1502
1573
        /* Function evaluators */
1503
1574
 
1504
1575
/* Does a lookup from a 2d function array.  Array is of type (PLFLT **), */
1554
1625
/* Process options list using current options info. */
1555
1626
 
1556
1627
int
1557
 
plParseOpts(int *p_argc, char **argv, PLINT mode);
 
1628
c_plparseopts(int *p_argc, char **argv, PLINT mode);
1558
1629
 
1559
1630
/* Print usage & syntax message. */
1560
1631
 
1626
1697
void
1627
1698
plMinMax2dGrid(PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmax, PLFLT *fmin);
1628
1699
 
1629
 
/* Functions for converting between HLS and RGB color space */
1630
 
 
1631
 
void
1632
 
plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b);
1633
 
 
1634
 
void
1635
 
plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s);
1636
 
 
1637
1700
/* Wait for graphics input event and translate to world coordinates */
1638
1701
 
1639
1702
int
1644
1707
int
1645
1708
plTranslateCursor(PLGraphicsIn *gin);
1646
1709
 
 
1710
/* Deprecated function names which are handled as wrappers for strict
 
1711
 * backwards compatibility of the library API*/
 
1712
 
 
1713
int
 
1714
plParseOpts(int *p_argc, char **argv, PLINT mode);
 
1715
 
 
1716
void
 
1717
plHLS_RGB(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b);
 
1718
 
 
1719
void
 
1720
plRGB_HLS(PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s);
1647
1721
#ifdef __cplusplus
1648
1722
}
1649
1723
#endif