1 | /*--------------------------------------------------------------------------------- |
---|
2 | $Id$ |
---|
3 | |
---|
4 | |
---|
5 | Copyright (C) 2005 |
---|
6 | Jason Rogers (dovoto) |
---|
7 | Dave Murphy (WinterMute) |
---|
8 | |
---|
9 | This software is provided 'as-is', without any express or implied |
---|
10 | warranty. In no event will the authors be held liable for any |
---|
11 | damages arising from the use of this software. |
---|
12 | |
---|
13 | Permission is granted to anyone to use this software for any |
---|
14 | purpose, including commercial applications, and to alter it and |
---|
15 | redistribute it freely, subject to the following restrictions: |
---|
16 | |
---|
17 | 1. The origin of this software must not be misrepresented; you |
---|
18 | must not claim that you wrote the original software. If you use |
---|
19 | this software in a product, an acknowledgment in the product |
---|
20 | documentation would be appreciated but is not required. |
---|
21 | 2. Altered source versions must be plainly marked as such, and |
---|
22 | must not be misrepresented as being the original software. |
---|
23 | 3. This notice may not be removed or altered from any source |
---|
24 | distribution. |
---|
25 | |
---|
26 | ---------------------------------------------------------------------------------*/ |
---|
27 | #ifndef IMAGE_H |
---|
28 | #define IMAGE_H |
---|
29 | |
---|
30 | #include <nds/arm9/video.h> |
---|
31 | |
---|
32 | //holds a rgb triplet |
---|
33 | typedef struct |
---|
34 | { |
---|
35 | unsigned char r,g,b; |
---|
36 | }__attribute__ ((packed)) RGB_24; |
---|
37 | |
---|
38 | //holds a basic image type for loading image files |
---|
39 | typedef struct |
---|
40 | { |
---|
41 | short height,width; |
---|
42 | int bpp; |
---|
43 | unsigned short* palette; |
---|
44 | |
---|
45 | union |
---|
46 | { |
---|
47 | unsigned char* data8; |
---|
48 | unsigned short* data16; |
---|
49 | unsigned int* data32; |
---|
50 | } image; |
---|
51 | |
---|
52 | } sImage, *psImage; |
---|
53 | |
---|
54 | #ifdef __cplusplus |
---|
55 | extern "C" { |
---|
56 | #endif |
---|
57 | |
---|
58 | void image24to16(sImage* img); |
---|
59 | void image8to16(sImage* img); |
---|
60 | void image8to16trans(sImage* img, u8 transperentColor); |
---|
61 | void imageDestroy(sImage* img); |
---|
62 | void imageTileData(sImage* img); |
---|
63 | |
---|
64 | #ifdef __cplusplus |
---|
65 | } |
---|
66 | #endif |
---|
67 | |
---|
68 | |
---|
69 | #include <nds/arm9/pcx.h> |
---|
70 | |
---|
71 | #endif |
---|