00001 /*--------------------------------------------------------------------------------- 00002 00003 Copyright (C) 2005 00004 Jason Rogers (dovoto) 00005 Dave Murphy (WinterMute) 00006 00007 This software is provided 'as-is', without any express or implied 00008 warranty. In no event will the authors be held liable for any 00009 damages arising from the use of this software. 00010 00011 Permission is granted to anyone to use this software for any 00012 purpose, including commercial applications, and to alter it and 00013 redistribute it freely, subject to the following restrictions: 00014 00015 1. The origin of this software must not be misrepresented; you 00016 must not claim that you wrote the original software. If you use 00017 this software in a product, an acknowledgment in the product 00018 documentation would be appreciated but is not required. 00019 2. Altered source versions must be plainly marked as such, and 00020 must not be misrepresented as being the original software. 00021 3. This notice may not be removed or altered from any source 00022 distribution. 00023 00024 ---------------------------------------------------------------------------------*/ 00036 #ifndef IMAGE_H 00037 #define IMAGE_H 00038 00039 #include <nds/arm9/video.h> 00040 00044 typedef struct RGB_24 00045 { 00046 unsigned char r,g,b; 00047 }__attribute__ ((packed)) RGB_24; 00048 00052 typedef struct sImage 00053 { 00054 short height; 00055 short width; 00056 int bpp; 00057 unsigned short* palette ; 00058 00062 union 00063 { 00064 u8* data8; 00065 u16* data16; 00066 u32* data32; 00067 } image; 00068 00069 } sImage, *psImage; 00070 00071 #ifdef __cplusplus 00072 extern "C" { 00073 #endif 00074 00078 void image24to16(sImage* img); 00082 void image8to16(sImage* img); 00088 void image8to16trans(sImage* img, u8 transparentColor); 00093 void imageDestroy(sImage* img); 00097 void imageTileData(sImage* img); 00098 00099 #ifdef __cplusplus 00100 } 00101 #endif 00102 00103 00104 #include <nds/arm9/pcx.h> 00105 00106 #endif