354f044810c4c16703a9987faecd5080d4cc075a
[gnuplot] / src / bitmap.h
1 /*
2  * $Id: bitmap.h,v 1.13 2004/04/13 17:23:52 broeker Exp $
3  */
4
5 /* GNUPLOT - bitmap.h */
6
7 /*[
8  * Copyright 1986 - 1993, 1998, 2004   Thomas Williams, Colin Kelley
9  *
10  * Permission to use, copy, and distribute this software and its
11  * documentation for any purpose with or without fee is hereby granted,
12  * provided that the above copyright notice appear in all copies and
13  * that both that copyright notice and this permission notice appear
14  * in supporting documentation.
15  *
16  * Permission to modify the software is granted, but not the right to
17  * distribute the complete modified source code.  Modifications are to
18  * be distributed as patches to the released version.  Permission to
19  * distribute binaries produced by compiling modified sources is granted,
20  * provided you
21  *   1. distribute the corresponding source modifications from the
22  *    released version in the form of a patch file along with the binaries,
23  *   2. add special version identification to distinguish your version
24  *    in addition to the base release version number,
25  *   3. provide your name and address as the primary contact for the
26  *    support of your modified version, and
27  *   4. retain our contact information in regard to use of the base
28  *    software.
29  * Permission to distribute the released version of the source code along
30  * with corresponding source modifications in the form of a patch file is
31  * granted with same provisions 2 through 4 for binary distributions.
32  *
33  * This software is provided "as is" without express or implied warranty
34  * to the extent permitted by applicable law.
35 ]*/
36
37 #ifndef GNUPLOT_BITMAP_H
38 # define GNUPLOT_BITMAP_H
39
40 #include "syscfg.h"
41
42 /* allow up to 16 bit width for character array */
43 typedef unsigned int char_row;
44 typedef char_row const GPFAR * GPFAR char_box;
45
46 #define FNT_CHARS   96          /* Number of characters in the font set */
47
48 #define FNT5X9 0
49 #define FNT5X9_VCHAR 11         /* vertical spacing between characters */
50 #define FNT5X9_VBITS 9          /* actual number of rows of bits per char */
51 #define FNT5X9_HCHAR 7          /* horizontal spacing between characters */
52 #define FNT5X9_HBITS 5          /* actual number of bits per row per char */
53 extern const char_row GPFAR fnt5x9[FNT_CHARS][FNT5X9_VBITS];
54
55 #define FNT9X17 1
56 #define FNT9X17_VCHAR 21        /* vertical spacing between characters */
57 #define FNT9X17_VBITS 17        /* actual number of rows of bits per char */
58 #define FNT9X17_HCHAR 13        /* horizontal spacing between characters */
59 #define FNT9X17_HBITS 9         /* actual number of bits per row per char */
60 extern const char_row GPFAR fnt9x17[FNT_CHARS][FNT9X17_VBITS];
61
62 #define FNT13X25 2
63 #define FNT13X25_VCHAR 31       /* vertical spacing between characters */
64 #define FNT13X25_VBITS 25       /* actual number of rows of bits per char */
65 #define FNT13X25_HCHAR 19       /* horizontal spacing between characters */
66 #define FNT13X25_HBITS 13       /* actual number of bits per row per char */
67 extern const char_row GPFAR fnt13x25[FNT_CHARS][FNT13X25_VBITS];
68
69
70 typedef unsigned char pixels;  /* the type of one set of 8 pixels in bitmap */
71 typedef pixels *bitmap[];       /* the bitmap */
72
73 extern bitmap *b_p;             /* global pointer to bitmap */
74 extern unsigned int b_xsize, b_ysize; /* the size of the bitmap */
75 extern unsigned int b_planes;   /* number of color planes */
76 extern unsigned int b_psize;    /* size of each plane */
77 extern unsigned int b_rastermode; /* raster mode rotates -90deg */
78 extern unsigned int b_linemask; /* 16 bit mask for dotted lines */
79 extern unsigned int b_angle;    /* rotation of text */
80 extern int b_maskcount;
81
82 /* RGB colour table moved out of gif.trm */
83 /*
84  * Common RGB color table for use by all devices.
85  * It's a subset of the 216-color Web palette.
86  */
87 #define WEB_N_COLORS 99
88 struct rgb
89 {
90     unsigned char r, g, b;
91 };
92
93 extern struct rgb web_color_rgbs[];
94
95
96 /* Prototypes from file "bitmap.c" */
97
98 unsigned int b_getpixel __PROTO((unsigned int, unsigned int));
99 void b_makebitmap __PROTO((unsigned int, unsigned int, unsigned int));
100 void b_freebitmap __PROTO((void));
101 void b_charsize __PROTO((unsigned int));
102 void b_setvalue __PROTO((unsigned int));
103
104 void b_setlinetype __PROTO((int));
105 void b_move __PROTO((unsigned int, unsigned int));
106 void b_vector __PROTO((unsigned int, unsigned int));
107 void b_put_text __PROTO((unsigned int, unsigned int, const char *));
108 int b_text_angle __PROTO((int));
109 void b_boxfill __PROTO((int, unsigned int, unsigned int, unsigned int, unsigned int));
110
111 #endif /* GNUPLOT_BITMAP_H */