summaryrefslogtreecommitdiff
path: root/utils/xbox/toollib/piclib.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/xbox/toollib/piclib.h')
-rw-r--r--utils/xbox/toollib/piclib.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/utils/xbox/toollib/piclib.h b/utils/xbox/toollib/piclib.h
new file mode 100644
index 0000000..346d94c
--- /dev/null
+++ b/utils/xbox/toollib/piclib.h
@@ -0,0 +1,61 @@
+#ifndef _PICLIB_H_
+#define _PICLIB_H_
+
+typedef enum
+{
+ ms_none,
+ ms_mask,
+ ms_transcolor,
+ ms_lasso
+}
+mask_t;
+
+typedef enum
+{
+ cm_none,
+ cm_rle1
+}
+compress_t;
+
+typedef struct
+{
+ char manufacturer;
+ char version;
+ char encoding;
+ char bits_per_pixel;
+ unsigned short xmin,ymin,xmax,ymax;
+ unsigned short hres,vres;
+ unsigned char palette[48];
+ char reserved;
+ char color_planes;
+ unsigned short bytes_per_line;
+ unsigned short palette_type;
+ char filler[58];
+ unsigned char data;
+} pcx_t;
+
+typedef struct
+{
+ unsigned char id_length;
+ unsigned char colormap_type;
+ unsigned char image_type;
+ unsigned char pad1; // not in file
+ unsigned short colormap_index;
+ unsigned short colormap_length;
+ unsigned char colormap_size;
+ unsigned char pad2; // not in file
+ unsigned short x_origin;
+ unsigned short y_origin;
+ unsigned short width;
+ unsigned short height;
+ unsigned char pixel_size;
+ unsigned char attributes;
+} tga_t;
+
+extern void TL_LoadPCX(char* filename, byte_t** picture, byte_t** palette, int* width, int* height);
+extern void TL_SavePCX(char* filename, byte_t* data, int width, int height, byte_t* palette);
+extern void TL_LoadTGA(char* name, byte_t** pixels, int* width, int* height);
+extern void TL_SaveTGA(char* filename, byte_t* pixels, int width, int height, int sbpp, int tbpp);
+extern void TL_LoadImage(char* name, byte_t** pixels, byte_t** palette, int* width, int* height);
+
+#endif