File: bitmfile.h

package info (click to toggle)
nethack 3.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,468 kB
  • sloc: ansic: 266,495; cpp: 13,652; yacc: 2,903; perl: 1,426; lex: 581; sh: 535; xml: 372; awk: 98; makefile: 68; fortran: 51; sed: 11
file content (33 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/****************************\
* Bitmap mit Farbtabelle als *
* Graphik-Datei speichern		 *
* Autor: Gabriel Schmidt		 *
* (c} 1992 by MAXON-Computer *
* -> Header-Datei						 *
\****************************/

#ifndef H_TO_FILE
#define H_TO_FILE

/*	#include <portab.h>	*/
#define UWORD unsigned short
#define ULONG unsigned long
#define UBYTE unsigned char

#define XIMG_MAGIC 0x58494D47

typedef enum { IMG, XIMG } FILE_TYP;

const char *get_file_ext(FILE_TYP typ);

struct RGB {
    UWORD r, g, b;
};

int bitmap_to_file(FILE_TYP typ, int ww, int wh, unsigned int pwx,
                   unsigned int pwy, unsigned int planes, unsigned int colors,
                   const char *filename,
                   void (*get_color)(unsigned int colind, struct RGB *rgb),
                   void (*get_pixel)(int x, int y, unsigned int *colind));

#endif