source: soft/giet_vm/applications/rosenfeld/include/bmpNR.h @ 779

Last change on this file since 779 was 772, checked in by meunier, 9 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 3.4 KB
Line 
1/* --------------- */
2/* --- bmpNR.h --- */
3/* --------------- */
4
5/*
6 * Gestion des bmp
7 */
8/*
9 * Copyright (c) 1997 Lionel Lacassagne EIA
10 * Copyright (c) 2001 Lionel Lacassagne PARC-LIS-UPMC (Paris 6)
11 * Init 97-09-30
12 * Modif : 97-09-30
13 * modif : 01-01-30 : integration into Foundation
14 *                    Note that return code have been added without testing (right now)
15 * modif : 03-05-05 : windows independant, stand-alone version ready for linux
16 */
17
18#ifndef __BMP_NR_H__
19#define __BMP_NR_H__
20
21#ifdef __cplusplus
22#ifdef PRAGMA_VERBOSE
23#pragma message ("C++")
24#endif
25extern "C" {
26#endif
27
28#define Warning
29#define Error
30 
31#ifdef PRAGMA_VERBOSE
32//#pragma message ("- include bmpio.h")
33//#pragma message ("  MARCHE MEME POUR LES NON MULTIPLES DE 4")
34#endif
35/*
36 * La structure RGBQuad est definie dans palette.h, donc a inclure
37 * structure analogue a RGBQUAD, mais permet d'etre independant de windows
38 */
39
40
41  /*
42   * Windows definition
43   * WORD  = unsigned short = uint16
44   * DWORD = unsigned long  = uint32
45   * LONG  = unsigned long  = uint32
46   */
47
48//#include <windows.h>
49//#include <wingdi.h>
50
51#pragma pack(1)
52   
53#ifndef WIN32
54typedef unsigned short WORD;
55typedef unsigned long DWORD;
56typedef unsigned long LONG;
57#endif
58
59#ifndef WIN32
60typedef struct {
61        WORD    bfType;
62        DWORD   bfSize;
63        WORD    bfReserved1;
64        WORD    bfReserved2;
65        DWORD   bfOffBits;
66} BITMAPFILEHEADER;
67#endif
68
69#ifndef WIN32
70typedef struct {
71        DWORD      biSize;
72        LONG       biWidth;
73        LONG       biHeight;
74        WORD       biPlanes;
75        WORD       biBitCount;
76        DWORD      biCompression;
77        DWORD      biSizeImage;
78        LONG       biXPelsPerMeter;
79        LONG       biYPelsPerMeter;
80        DWORD      biClrUsed;
81        DWORD      biClrImportant;
82} BITMAPINFOHEADER;
83#endif
84   
85typedef struct {
86  uint16    bfType;      //  WORD
87  uint32    bfSize;      // DWORD
88  uint16    bfReserved1; //  WORD
89  uint16    bfReserved2; //  WORD
90  uint32    bfOffBits;   // DWORD
91} BitmapFileHeader;
92
93typedef struct {
94  uint32    biSize;           // DWORD
95  uint32    biWidth;          // LONG
96  uint32    biHeight;         // LONG
97  uint16    biPlanes;         // WORD
98  uint16    biBitCount;       // WORD
99  uint32    biCompression;    // DWORD
100  uint32    biSizeImage;      // DWORD
101  uint32    biXPelsPerMeter;  // LONG
102  uint32    biYPelsPerMeter;  // LONG
103  uint32    biClrUsed;        // DWORD
104  uint32    biClrImportant;   // DWORD
105} BitmapInfoHeader;
106
107#pragma pack()
108   
109//IMAGE_EXPORT(int) SaveBMP0(Image *image, RGBQuad *palette_RGBQuad, char *filename); // windows dependant
110IMAGE_EXPORT(int) SaveBMP2_ui8matrix (uint8 **m, int width, int height, RGBQuad *palette_RGBQuad, char *filename); // linux stand-alone
111
112//IMAGE_EXPORT(int) LoadBMP(char *filename, Image **image);
113
114//IMAGE_EXPORT(int) MLoadBMP     (char *filename, Image *image);
115//IMAGE_EXPORT(int) MLoadNextBMP (char *path, char *filename, int k, Image *Buff);
116//IMAGE_EXPORT(int) MSaveNextBMP (Image *image, RGBQuad *palette, char *path, char *filename, int k);
117//IMAGE_EXPORT(int) MSaveNextBMP2(Image *image, RGBQuad *palette, char *path, char *filename, int k, int l);
118
119//IMAGE_EXPORT(int) MSaveNextBMP_ndigit (Image *image, RGBQuad *palette, char *path, char *filename, int k, int ndigit);
120//IMAGE_EXPORT(int) MSaveNextBMP2_ndigit(Image *image, RGBQuad *palette, char *path, char *filename, int k, int l, int ndigit);
121
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif /* __BMP_NR_H__ */
Note: See TracBrowser for help on using the repository browser.