1 /*--------------------------------------------------------------------
2  *
3  *	Copyright (c) 1991-2021 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
4  *	See LICENSE.TXT file for copying and redistribution conditions.
5  *
6  *	This program is free software; you can redistribute it and/or modify
7  *	it under the terms of the GNU Lesser General Public License as published by
8  *	the Free Software Foundation; version 3 or any later version.
9  *
10  *	This program is distributed in the hope that it will be useful,
11  *	but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *	GNU Lesser General Public License for more details.
14  *
15  *	Contact info: www.generic-mapping-tools.org
16  *--------------------------------------------------------------------*/
17 
18 /*
19  * Include file for gmt_customio functions.
20  *
21  * Author:	Paul Wessel
22  * Date:	1-JAN-2010
23  * Version:	6 API
24  *
25  */
26 
27 /*!
28  * \file gmt_customio.h
29  * \brief Include file for gmt_customio functions.
30  */
31 
32 #ifndef GMT_CUSTOMIO_H
33 #define GMT_CUSTOMIO_H
34 
35 /*! Definition for Sun rasterfiles [THESE MUST REMAIN int32_t]  */
36 struct rasterfile {
37 	int32_t magic;     /* magic number */
38 	int32_t width;     /* width (pixels) of image */
39 	int32_t height;    /* height (pixels) of image */
40 	int32_t depth;     /* depth (1, 8, or 24 bits) of pixel */
41 	int32_t length;    /* length (bytes) of image */
42 	int32_t type;      /* type of file; see RT_* below */
43 	int32_t maptype;   /* type of colormap; see RMT_* below */
44 	int32_t maplength; /* length (bytes) of following map */
45 	/* color map follows for maplength bytes, followed by image */
46 };
47 
48 #define	RAS_MAGIC	0x59a66a95	/* Magic number for Sun rasterfile */
49 #define EPS_MAGIC	0x25215053	/* Magic number for EPS file */
50 #define RT_OLD		0		/* Old-style, unencoded Sun rasterfile */
51 #define RT_STANDARD	1		/* Standard, unencoded Sun rasterfile */
52 #define RT_BYTE_ENCODED	2		/* Run-length-encoded Sun rasterfile */
53 #define RT_FORMAT_RGB	3		/* [X]RGB instead of [X]BGR Sun rasterfile */
54 #define RMT_NONE	0		/* maplength is expected to be 0 */
55 #define RMT_EQUAL_RGB	1		/* red[maplength/3], green[], blue[] follow */
56 
57 EXTERN_MSC char **gmt_grdformats_sorted (struct GMT_CTRL *Ctrl);
58 
59 #endif /* GMT_CUSTOMIO_H */
60