123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
-
- #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
|