Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

  1. #ifndef _PICLIB_H_
  2. #define _PICLIB_H_
  3. typedef enum
  4. {
  5. ms_none,
  6. ms_mask,
  7. ms_transcolor,
  8. ms_lasso
  9. }
  10. mask_t;
  11. typedef enum
  12. {
  13. cm_none,
  14. cm_rle1
  15. }
  16. compress_t;
  17. typedef struct
  18. {
  19. char manufacturer;
  20. char version;
  21. char encoding;
  22. char bits_per_pixel;
  23. unsigned short xmin,ymin,xmax,ymax;
  24. unsigned short hres,vres;
  25. unsigned char palette[48];
  26. char reserved;
  27. char color_planes;
  28. unsigned short bytes_per_line;
  29. unsigned short palette_type;
  30. char filler[58];
  31. unsigned char data;
  32. } pcx_t;
  33. typedef struct
  34. {
  35. unsigned char id_length;
  36. unsigned char colormap_type;
  37. unsigned char image_type;
  38. unsigned char pad1; // not in file
  39. unsigned short colormap_index;
  40. unsigned short colormap_length;
  41. unsigned char colormap_size;
  42. unsigned char pad2; // not in file
  43. unsigned short x_origin;
  44. unsigned short y_origin;
  45. unsigned short width;
  46. unsigned short height;
  47. unsigned char pixel_size;
  48. unsigned char attributes;
  49. } tga_t;
  50. extern void TL_LoadPCX(char* filename, byte_t** picture, byte_t** palette, int* width, int* height);
  51. extern void TL_SavePCX(char* filename, byte_t* data, int width, int height, byte_t* palette);
  52. extern void TL_LoadTGA(char* name, byte_t** pixels, int* width, int* height);
  53. extern void TL_SaveTGA(char* filename, byte_t* pixels, int width, int height, int sbpp, int tbpp);
  54. extern void TL_LoadImage(char* name, byte_t** pixels, byte_t** palette, int* width, int* height);
  55. #endif