1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
-
- #ifndef _UTILS_TGA_H
- #define _UTILS_TGA_H
-
-
- typedef enum {
- TGA_TYPE__NO_DATA = 0,
- TGA_TYPE__MAPPED = 1,
- TGA_TYPE__COLOR = 2,
- TGA_TYPE__GREYSCALE = 3,
- TGA_TYPE__MAPPED_RLE = 9,
- TGA_TYPE__COLOR_RLE = 10
-
-
-
- } tga_type_t;
-
-
- typedef struct {
- unsigned char comment_lenght;
- unsigned char colormap_type;
- unsigned char image_type;
- unsigned short colormap_index;
- unsigned short colormap_lenght;
- unsigned char colormap_bbp;
- unsigned short origin_x;
- unsigned short origin_y;
- unsigned short width;
- unsigned short height;
- unsigned char bpp;
- unsigned char desc_flags;
- } tga_t;
-
-
- int tgaCheck(FILE *f);
-
-
- int tgaLoad(FILE *f, unsigned char **image,
- unsigned int *width, unsigned int *height, char *type);
-
-
- int tgaSave(FILE *f, unsigned char *image,
- unsigned int width, unsigned int height, char type);
-
-
- int tgaSaveFilename(unsigned char *image,
- unsigned int width, unsigned int height,
- char type, const char *s, ...)
- __attribute__((format(printf, 5, 6)));
-
- #endif
|