Math-Pari
view release on metacpan or search on metacpan
patches/diff_add_gnuplotAdd view on Meta::CPAN
+typedef int (*FUNC_PTR)(...);
+#else
+typedef int (*FUNC_PTR)();
+#endif
+
+#ifndef __PROTO
+# define __PROTO(proto) proto
+#endif
+
+#if 1
+/* this order means we can use x-(just*strlen(text)*t->h_char)/2 if
+ * term cannot justify
+ */
+typedef enum JUSTIFY {
+ LEFT,
+ CENTRE,
+ RIGHT
+} JUSTIFY;
+
+/*
+ * color modes
+ */
+typedef enum {
+ SMPAL_COLOR_MODE_NONE = '0',
+ SMPAL_COLOR_MODE_GRAY = 'g', /* grayscale only */
+ SMPAL_COLOR_MODE_RGB = 'r', /* one of several fixed transforms */
+ SMPAL_COLOR_MODE_FUNCTIONS = 'f', /* user definded transforms */
+ SMPAL_COLOR_MODE_GRADIENT = 'd' /* interpolated table:
+ * explicitly defined or read from file */
+} palette_color_mode;
+
+/* Contains a colour in RGB scheme.
+ Values of r, g and b are all in range [0;1] */
+typedef struct {
+ double r, g, b;
+} rgb_color;
+
+/* to build up gradients: whether it is really red, green and blue or maybe
+ * hue saturation and value in col depends on cmodel */
+typedef struct {
+ double pos;
+ rgb_color col;
+} gradient_struct;
+
+typedef struct value t_value;
+
+# define MAX_NUM_VAR 5
+
+/* user-defined function table entry */
+typedef struct udft_entry {
+ struct udft_entry *next_udf; /* pointer to next udf in linked list */
+ char *udf_name; /* name of this function entry */
+ struct at_type *at; /* pointer to action table to execute */
+ char *definition; /* definition of function as typed */
+ t_value dummy_values[MAX_NUM_VAR]; /* current value of dummy variables */
+} udft_entry;
+
+typedef struct {
+ /** Constants: **/
+
+ /* (Fixed) number of formulae implemented for gray index to RGB
+ * mapping in color.c. Usage: somewhere in `set' command to check
+ * that each of the below-given formula R,G,B are lower than this
+ * value. */
+ int colorFormulae;
+
+ /** Values that can be changed by `set' and shown by `show' commands: **/
+
+ /* can be SMPAL_COLOR_MODE_GRAY or SMPAL_COLOR_MODE_RGB */
+ palette_color_mode colorMode;
+ /* mapping formulae for SMPAL_COLOR_MODE_RGB */
+ int formulaR, formulaG, formulaB;
+ char positive; /* positive or negative figure */
+
+ /* Now the variables that contain the discrete approximation of the
+ * desired palette of smooth colours as created by make_palette in
+ * pm3d.c. This is then passed into terminal's make_palette, who
+ * transforms this [0;1] into whatever it supports. */
+
+ /* Only this number of colour positions will be used even though
+ * there are some more available in the discrete palette of the
+ * terminal. Useful for multiplot. Max. number of colours is taken
+ * if this value equals 0. Unused by: PostScript */
+ int use_maxcolors;
+ /* Number of colours used for the discrete palette. Equals to the
+ * result from term->make_palette(NULL), or restricted by
+ * use_maxcolor. Used by: pm, gif. Unused by: PostScript */
+ int colors;
+ /* Table of RGB triplets resulted from applying the formulae. Used
+ * in the 2nd call to term->make_palette for a terminal with
+ * discrete colours. Unused by PostScript which has calculates them
+ * analytically. */
+ rgb_color *color;
+
+ /** Variables used by some terminals **/
+
+ /* Option unique for output to PostScript file. By default,
+ * ps_allcF=0 and only the 3 selected rgb color formulae are written
+ * into the header preceding pm3d map in the file. If ps_allcF is
+ * non-zero, then print there all color formulae, so that it is easy
+ * to play with choosing manually any color scheme in the PS file
+ * (see the definition of "/g"). Like that you can get the
+ * Rosenbrock multiplot figure on my gnuplot.html#pm3d demo page.
+ * Note: this option is used by all terminals of the postscript
+ * family, i.e. postscript, pslatex, epslatex, so it will not be
+ * comfortable to move it to the particular .trm files. */
+ char ps_allcF;
+
+ /* These variables are used to define interpolated color palettes:
+ * gradient is an array if (gray,color) pairs. This array is
+ * gradient_num entries big.
+ * Interpolated tables are used if colorMode==SMPAL_COLOR_MODE_GRADIENT */
+ int gradient_num;
+ gradient_struct *gradient;
+
+ /* the used color model: RGB, HSV, XYZ, etc. */
+ int cmodel;
+
+ /* Three mapping function for gray->RGB/HSV/XYZ/etc. mapping
+ * used if colorMode == SMPAL_COLOR_MODE_FUNCTIONS */
+ struct udft_entry Afunc; /* R for RGB, H for HSV, C for CMY, ... */
+ struct udft_entry Bfunc; /* G for RGB, S for HSV, M for CMY, ... */
+ struct udft_entry Cfunc; /* B for RGB, V for HSV, Y for CMY, ... */
+
+ /* gamma for gray scale palettes only */
+ double gamma;
+} t_sm_palette;
+
+/* a point (with integer coordinates) for use in polygon drawing */
+typedef struct {
+ unsigned int x, y;
+#ifdef EXTENDED_COLOR_SPECS
+ double z;
+ colorspec_t spec;
+#endif
+} gpiPoint;
+
+typedef struct TERMENTRY {
+ const char *name;
+#ifdef WIN16
+ const char GPFAR description[80]; /* to make text go in FAR segment */
+#else
+ const char *description;
+#endif
+ unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
+
+ void (*options) __PROTO((void));
+ void (*init) __PROTO((void));
+ void (*reset) __PROTO((void));
+ void (*text) __PROTO((void));
+ int (*scale) __PROTO((double, double));
+ void (*graphics) __PROTO((void));
+ void (*move) __PROTO((unsigned int, unsigned int));
+ void (*vector) __PROTO((unsigned int, unsigned int));
+ void (*linetype) __PROTO((int));
+ void (*put_text) __PROTO((unsigned int, unsigned int, const char*));
+ /* the following are optional. set term ensures they are not NULL */
+ int (*text_angle) __PROTO((int));
+ int (*justify_text) __PROTO((enum JUSTIFY));
+ void (*point) __PROTO((unsigned int, unsigned int,int));
( run in 0.447 second using v1.01-cache-2.11-cpan-39bf76dae61 )