OSDN Git Service

Modified: doc
[eos/optional.git] / doc / Objects / gifFile.html
1 <HR>
2 <A NAME="Information">
3 <H2>Information from source codes</H2>
4 </A>
5 <PRE>
6 </PRE>
7 <HR>
8 <A NAME="include">
9 <H2>gifFile.h</H2>
10 </A>
11 <PRE>
12 #ifndef GIF_FILE_H
13 #define GIF_FILE_H
14
15 #include "gif_lib.h"
16
17 /* struct begin */
18
19 typedef struct gifFileHeader {
20         char sig[3];
21         char ver[3];
22 } gifFileHeader;
23 /* struct end */
24
25 /* constant begin */
26 #define scdGCT     (0x80)
27 #define scdGCTcres (0x70)
28 #define scdGCTsort (0x08)
29 #define scdGCTsize (0x07)
30 /* constant end */
31
32 /* struct begin */
33 typedef struct gifFileScreenDesc {
34         unsigned short scwidth;
35         unsigned short scheight;
36         unsigned char  flags;
37         unsigned char  bgclr;
38         unsigned char  pixasp;
39 } gifFileScreenDesc;
40 /* struct end */
41
42 /* constant begin */
43 #define imdLCT       (0x80)
44 #define imdInterlace (0x40)
45 #define imdLCTsort   (0x20)
46 #define imdRESV      (0x18)
47 #define imdLCTsize   (0x07)
48 /* constant end */
49
50 /* struct begin */
51 typedef struct gifFileImageDesc {
52         unsigned char id;
53         unsigned short xleft;
54         unsigned short ytop;
55         unsigned short imwidth;
56         unsigned short imheight;
57         unsigned char  flags;
58 } gifFileImageDesc;
59
60 typedef struct gifFileColorTable {
61         unsigned char r;
62         unsigned char g;
63         unsigned char b;
64 } gifFileColorTable;
65
66 typedef struct gifFileImageDefinition {
67         gifFileImageDesc   Desc;
68         gifFileColorTable* LCT; 
69 } gifFileImageDefinition;
70
71 typedef struct gifFileCtrlExtensions {
72         unsigned char  id;
73         unsigned char  label; 
74         unsigned char  size;
75         unsigned char  flags; 
76         unsigned short delay;
77         unsigned char  trcrl; 
78 } gifFileCtrlExtensions;
79
80 typedef struct gifFileCommentExtensions {
81         unsigned char id;
82         unsigned char label;
83 } gifFileCommentExtensions;
84
85 typedef struct gifFileTextExtensions {
86         unsigned char  id;
87         unsigned char  label; 
88         unsigned char  size;
89         unsigned char  xleft; 
90         unsigned short ytop;
91         unsigned char  txwidth; 
92         unsigned char  txheight;
93         unsigned char  cewidth; 
94         unsigned char  ceheight;
95         unsigned char  fgclr; 
96         unsigned short bgclr;
97 } gifFileTextExtensions;
98
99 typedef struct gifFileApplicationExtensions {
100         unsigned char  id;
101         unsigned char  label; 
102         unsigned char  size;
103         char           apname[8];
104         char           apcode[3];
105 } gifFileApplicationExtensions;
106
107
108 typedef struct gifFile {
109         gifFileHeader                   Header;
110         gifFileScreenDesc               ScrDesc;
111         gifFileColorTable*      GCT;
112         long nImage;
113         gifFileImageDefinition* ImageDef;
114         char                    Tailer;
115 } gifFile;
116
117 /* struct end */
118
119 /* constant begin */
120 #define OUT_OF_MEMORY -10
121 #define BAD_CODE_SIZE -20
122 #define READ_ERROR -1
123 #define WRITE_ERROR -2
124 #define OPEN_ERROR -3
125 #define CREATE_ERROR -4
126 /* constant end */
127
128 /* struct begin */
129 #define LOCAL static
130 #define IMPORT extern
131
132 #define FAST register
133
134 typedef short WORD;
135 typedef unsigned short UWORD;
136 typedef char TEXT;
137 typedef unsigned char UTINY;
138 typedef long LONG;
139 typedef unsigned long ULONG;
140 typedef int INT;
141 /* struct end */
142
143
144 #include "mrcImage.h"
145 /* prototype begin */
146 extern int lmrc2gif(char* out, mrcImage* in, ColorMapObject* ColorMap, long mode);
147 extern int lmrc2gifColor(char* out, mrcImage* r, mrcImage* g, mrcImage* b, ColorMapObject* ColorMap, int n, int nr, int ng, int nb, long mode);
148
149 extern ColorMapObject* gifColorMapInit(int n, long mode);
150 extern ColorMapObject* gifColorMapGrey(ColorMapObject* ColorMap, int n);
151 extern ColorMapObject* gifColorMapColor(ColorMapObject* ColorMap, int n, int nr, int ng, int nb);
152 /* prototype end */
153
154 #endif /* GIF_FILE_H */
155 </PRE>