manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.22 File I/O (Pure C)

C function: void mgl_data_read (HMDT dat, const char *fname)

Reads data from tab-separated text file with auto determining sizes of the data.

C function: void mgl_data_read_dim (HMDT dat, const char *fname, int mx, int my, int mz)

Reads data from text file with specified data sizes. This function does nothing if one of parameters mx, my or mz is zero or negative.

C function: void mgl_data_read_mat (HMDT dat, const char *fname, int dim)

Read data from text file with size specified at beginning of the file by first dim numbers. At this, variable dim set data dimensions.

C function: void mgl_data_save (const HMDT dat, const char *fname, int ns)

Saves the whole data array (for ns=-1) or only ns-th slice to text file. If ns>0 then only ns-th slice (or column for 2D array) will be saved.

C function: void mgl_data_import (HMDT dat, const char *fname, const char *scheme, float v1, float v2)

Reads data from bitmap file (now support only PNG format). The RGB values of bitmap pixels are transformed to float values in range [v1, v2] using color scheme scheme (see section Color scheme).

C function: void mgl_data_export (HMDT dat, const char *fname, const char *scheme, float v1, float v2, int ns) const

Saves data matrix (or ns-th slice for 3d data) to bitmap file (now support only PNG format). The data values are transformed from range [v1, v2] to RGB pixels of bitmap using color scheme scheme (see section Color scheme). If v1>=v2 then the values of v1, v2 are automatically determined as minimal and maximal value of the data array.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2026
Individual documents may contain additional copyright information.