4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Giving Russians Opium May Alter Current Situation
40 static char *SRCID_matio_h = "$Id$";
46 #ident "@(#) matio.h 1.11 5/20/97"
47 #endif /* HAVE_IDENT */
50 extern bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2);
52 extern t_matelmt searchcmap(int n,t_mapping map[],t_xpmelmt c);
53 /* Seach in the map for code 'c' and return entry number.
54 * return -1 if not found
57 extern int getcmap(FILE *in,char *fn,t_mapping **map);
58 /* Read the mapping table from in, return number of entries */
60 extern int readcmap(char *fn,t_mapping **map);
61 /* Read the mapping table from fn, return number of entries */
63 extern void printcmap(FILE *out,int n,t_mapping map[]);
64 /* print mapping table to out */
66 extern void writecmap(char *fn,int n,t_mapping map[]);
67 /* print mapping table to fn */
69 extern int read_xpm_matrix(char *fnm, t_matrix **matrix);
70 /* Reads a number of matrices from .xpm file fnm and returns this number */
72 extern real **matrix2real(t_matrix *matrix,real **mat);
73 /* Converts an matrix in a t_matrix struct to a matrix of reals
74 * When mat==NULL memory will be allocated
75 * Returns NULL when something went wrong
78 extern void write_xpm_m(FILE *out, t_matrix m);
79 /* Writes a t_matrix struct to .xpm file */
81 extern void write_xpm3(FILE *out,
82 char *title,char *legend,char *label_x,char *label_y,
83 int n_x,int n_y,real axis_x[],real axis_y[],
84 real *matrix[],real lo,real mid,real hi,
85 t_rgb rlo,t_rgb rmid,t_rgb rhi,int *nlevels);
87 * Writes a colormap varying as rlo -> rmid -> rhi.
90 extern void write_xpm(FILE *out,
91 char *title,char *legend,char *label_x,char *label_y,
92 int n_x,int n_y,real t_x[],real t_y[],
93 real *matrix[],real lo,real hi,
94 t_rgb rlo,t_rgb rhi,int *nlevels);
97 * legend label for the continuous legend
98 * label_x label for the x-axis
99 * label_y label for the y-axis
100 * n_x, n_y size of the matrix
101 * axis_x[] the x-ticklabels
102 * axis_y[] the y-ticklables
103 * *matrix[] element x,y is matrix[x][y]
104 * lo output lower than lo is set to lo
105 * hi output higher than hi is set to hi
106 * rlo rgb value for level lo
107 * rhi rgb value for level hi
108 * nlevels number of color levels for the output
111 #endif /* _matio_h */