4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Good ROcking Metal Altar for Chronical Sinners
33 static char *SRCID_matio_h
= "$Id$";
36 #ident "@(#) matio.h 1.11 5/20/97"
37 #endif /* HAVE_IDENT */
40 extern bool matelmt_cmp(t_xpmelmt e1
, t_xpmelmt e2
);
42 extern t_matelmt
searchcmap(int n
,t_mapping map
[],t_xpmelmt c
);
43 /* Seach in the map for code 'c' and return entry number.
44 * return -1 if not found
47 extern int getcmap(FILE *in
,char *fn
,t_mapping
**map
);
48 /* Read the mapping table from in, return number of entries */
50 extern int readcmap(char *fn
,t_mapping
**map
);
51 /* Read the mapping table from fn, return number of entries */
53 extern void printcmap(FILE *out
,int n
,t_mapping map
[]);
54 /* print mapping table to out */
56 extern void writecmap(char *fn
,int n
,t_mapping map
[]);
57 /* print mapping table to fn */
59 extern int read_xpm_matrix(char *fnm
, t_matrix
**matrix
);
60 /* Reads a number of matrices from .xpm file fnm and returns this number */
62 extern real
**matrix2real(t_matrix
*matrix
,real
**mat
);
63 /* Converts an matrix in a t_matrix struct to a matrix of reals
64 * When mat==NULL memory will be allocated
65 * Returns NULL when something went wrong
68 extern void write_xpm_m(FILE *out
, t_matrix m
);
69 /* Writes a t_matrix struct to .xpm file */
71 extern void write_xpm3(FILE *out
,
72 char *title
,char *legend
,char *label_x
,char *label_y
,
73 int n_x
,int n_y
,real axis_x
[],real axis_y
[],
74 real
*matrix
[],real lo
,real mid
,real hi
,
75 t_rgb rlo
,t_rgb rmid
,t_rgb rhi
,int *nlevels
);
77 * Writes a colormap varying as rlo -> rmid -> rhi.
80 extern void write_xpm(FILE *out
,
81 char *title
,char *legend
,char *label_x
,char *label_y
,
82 int n_x
,int n_y
,real t_x
[],real t_y
[],
83 real
*matrix
[],real lo
,real hi
,
84 t_rgb rlo
,t_rgb rhi
,int *nlevels
);
87 * legend label for the continuous legend
88 * label_x label for the x-axis
89 * label_y label for the y-axis
90 * n_x, n_y size of the matrix
91 * axis_x[] the x-ticklabels
92 * axis_y[] the y-ticklables
93 * *matrix[] element x,y is matrix[x][y]
94 * lo output lower than lo is set to lo
95 * hi output higher than hi is set to hi
96 * rlo rgb value for level lo
97 * rhi rgb value for level hi
98 * nlevels number of color levels for the output
101 #endif /* _matio_h */