-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBitmap.h
56 lines (47 loc) · 1.33 KB
/
Bitmap.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**********************************************
* *
* AGE v 0.4 *
* Amiga Game Engine *
* Copyright 2011-2018 *
* by Pedro Gil Guirado - Balrog Soft *
* www.amigaskool.net *
* *
**********************************************/
#ifndef _BITMAP_H
#define _BITMAP_H
#define ID_ILBM MAKE_ID('I','L','B','M')
#define ID_BMHD MAKE_ID('B','M','H','D')
#define ID_CMAP MAKE_ID('C','M','A','P')
#define ID_BODY MAKE_ID('B','O','D','Y')
#include <proto/graphics.h>
#include <graphics/rastport.h>
typedef struct {
WORD Width, Height;
LONG Reserved1;
UBYTE Depth,Reserved2,Compression,Reserved3;
WORD Transparency;
UBYTE pixelratiox, pixelratioy;
WORD ScreenWidth,ScreenHeight;
}BMHD;
typedef struct {
unsigned char *mask;
int width;
int height;
int depth;
int colors;
BOOL rasterOwn;
USHORT *colortable;
struct BitMap *bitmap;
struct RastPort *rastPort;
} Bitmap;
BOOL bitmap_init(void);
void bitmap_dealloc(void);
void bm_decodeILBM(struct BitMap* bm, BMHD* bmhdr, BYTE* body);
Bitmap* bm_load(char* name);
void bm_save(Bitmap* bm);
Bitmap* bm_create(int w, int h, int d);
Bitmap* bm_createDisp(int w, int h, int d);
void bm_createMask(Bitmap* bm, int color);
void bm_savePalette(Bitmap* bm, char* file);
void bm_dealloc(Bitmap* bm);
#endif