bmp.h

Go to the documentation of this file.
00001 #ifndef BMP_H_HEADER_INCLUDED
00002 #define BMP_H_HEADER_INCLUDED
00003 
00004 #include "asimage.h"
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008 
00009 #define BMP_SIGNATURE           0x4D42             /* "BM" */
00010 
00011 #if defined(_WIN32) && !defined(_WINGDI_)
00012 #include <windows.h>
00013 #endif
00014 
00015 #ifndef _WINGDI_
00016 
00017 typedef struct tagRGBQUAD { /* rgbq */ 
00018     CARD8    rgbBlue; 
00019     CARD8    rgbGreen; 
00020     CARD8    rgbRed; 
00021     CARD8    rgbReserved; 
00022 } RGBQUAD; 
00023 
00024 typedef struct tagBITMAPFILEHEADER {
00025         CARD16  bfType;
00026     CARD32  bfSize;
00027     CARD16  bfReserved1;
00028     CARD16  bfReserved2;
00029     CARD32  bfOffBits;
00030 } BITMAPFILEHEADER;
00031 
00032 typedef struct tagBITMAPINFOHEADER
00033 {
00034         CARD32 biSize;
00035         CARD32 biWidth,  biHeight;
00036         CARD16 biPlanes, biBitCount;
00037         CARD32 biCompression;
00038         CARD32 biSizeImage;
00039         CARD32 biXPelsPerMeter, biYPelsPerMeter;
00040         CARD32 biClrUsed, biClrImportant;
00041 }BITMAPINFOHEADER;
00042 
00043 typedef struct tagBITMAPINFO { /* bmi */ 
00044     BITMAPINFOHEADER bmiHeader; 
00045     RGBQUAD          bmiColors[1]; 
00046 } BITMAPINFO; 
00047 
00048 #endif
00049 
00050 #ifndef BI_RGB     
00051 #define BI_RGB        0L
00052 #endif
00053 
00054 
00055 void 
00056 dib_data_to_scanline( ASScanline *buf, 
00057                       BITMAPINFOHEADER *bmp_info, CARD8 *gamma_table, 
00058                                           CARD8 *data, CARD8 *cmap, int cmap_entry_size); 
00059 
00060 BITMAPINFO *
00061 ASImage2DIB( ASVisual *asv, ASImage *im, 
00062                       int offset_x, int offset_y,
00063                            unsigned int to_width,
00064                            unsigned int to_height,
00065                            void **pBits, int mask );
00066 /* fixing a typo : */
00067 #define ASImage2DBI ASImage2DIB
00068 
00069 /* DIB colormap and data should follow the header as a continuous 
00070  * memory block !*/
00071 ASImage *DIB2ASImage(BITMAPINFO *bmp_info, int compression);
00072 
00073 ASImage      *
00074 bitmap2asimage (unsigned char *xim, int width, int height,
00075                 unsigned int compression, unsigned char *mask);
00076 
00077 #ifdef __cplusplus
00078 }
00079 #endif
00080 
00081 #endif
00082 

Generated on Tue Jul 5 14:13:27 2011 for ROOT_528-00b_version by  doxygen 1.5.1