OSDN Git Service

modified: src/Tools/mrcImage/mrcImageShrink/src/test/Makefile
[eos/hostdependX86LINUX64.git] / include / bmpFile.h
1 /*
2 # bmpFile.h : $Revision$  
3 # $Date$ 
4 # Created by $Author$
5 # Usage : bmpFile.h 
6 # Attention
7 #   $Loccker$
8 #       $State$ 
9 #
10 */
11 /* $Log$ */
12 #ifndef BMP_FILE_H 
13 #define BMP_FILE_H 
14
15 #include <stdio.h>
16 #include "mrcImage.h"
17
18 /* constant begin */
19
20
21 /* constant end */
22
23 /* struct begin */
24
25 typedef struct bmpFileHeader {
26         char  bfType[2];                // BM
27         unsigned int   bfSize;                  // FileSize [Byte]      
28         char  bfReserved1[2];   
29         char  bfReserved2[2];   
30         unsigned int   bfOffBits;               // ImageOffset [Byte]   
31 } bmpFileHeader; /* 14 BYTE */
32
33 typedef struct bmpFileInfoHeader {
34         unsigned int biSize;
35         int     biWidth;  // [Pixel]
36         int     biHeight; // [Pixel]
37         unsigned short biPlanes;  // 1
38         unsigned short biBitCount; // bits/pixel
39         unsigned int biCompression;   
40         unsigned int biSizeImage;
41         int biXPixPerMeter;
42         int biYPixPerMeter;
43         unsigned int biCirUsed;
44         unsigned int biCirImportant;
45 } bmpFileCoreHeader;
46
47 typedef struct bmpFileColorPalette {
48         char rgbBlue;
49         char rgbGreen;
50         char rgbRed;
51         char rgbReserved;
52 } bmpFileColorPalette;
53
54 typedef struct bmpFile {
55         bmpFileHeader            Header;
56         bmpFileCoreHeader        Info;
57         bmpFileColorPalette* Palette ;
58         unsigned char*  Image;
59         unsigned char*  ColorImage;
60
61         int Width;
62         int Width4;
63         int Height;
64         int numPixel;
65         int numPixel4; 
66         int BytesPerPixel;
67         int BitsPerPixel;
68         int BytesPerImage;
69 } bmpFile;
70
71 typedef enum lbmp2mrcInfoMode {
72         lbmp2mrcInfoModeY=0,
73         lbmp2mrcInfoModeR=1,
74         lbmp2mrcInfoModeG=2,
75         lbmp2mrcInfoModeB=3
76 } lbmp2mrcInfoMode;
77
78 typedef struct lbmp2mrcInfo {
79         mrcImageParaTypeRealCoord Length;       
80         lbmp2mrcInfoMode mode;
81 } lbmp2mrcInfo;
82
83 /* struct end */
84
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88
89 /* prototype begin */
90
91 /* bmpFileRead.c */
92 extern void bmpFileRead(bmpFile* in, FILE* fpt, int mode);
93
94 /* lbmp2mrc.c */
95 extern void lbmp2mrc(mrcImage* out, bmpFile* in, lbmp2mrcInfo linfo, int mode);
96 extern void lbmp2mrcUsage(FILE* fpt);
97
98 /* bmpFileInfo.c */
99 extern void bmpFileInfo(FILE* fpt, bmpFile* in, int mode);
100 extern void bmpFileFileHeaderInfo(FILE* fpt, bmpFile* in, int mode);
101 extern void bmpFileInfoHeaderInfo(FILE* fpt, bmpFile* in, int mode);
102 extern void bmpFilePaletteInfo(FILE* fpt, bmpFile* in, int mode);
103
104 /* prototype end */
105
106 #ifdef __cplusplus
107 };
108 #endif
109
110 #endif  /* XXXX */