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.

42 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "typedefs.h"
  9. #define MIN(x,y) (((x) < (y)) ? (x) : (y))
  10. #define MAX(x,y) (((x) > (y)) ? (x) : (y))
  11. typedef struct {
  12. int32 w,h;
  13. uint8 *data;
  14. uint32 *data32;
  15. } t_i_image;
  16. // IMAGE
  17. t_i_image *new_image(int32 w, int32 h);
  18. void del_image(t_i_image *img);
  19. // TGA
  20. t_i_image *i_load_tga(char *fname);
  21. void i_save_tga(t_i_image *image, char *fname);
  22. // SCALE
  23. t_i_image *powerof2(t_i_image *img1);
  24. // PIXEL
  25. uint32 i_rgb_to_32(uint32 r, uint32 g, uint32 b, uint32 a);
  26. void i_putpixel(t_i_image *img, int32 x, int32 y, uint32 co);
  27. void i_putpixel_rgba(t_i_image *img, int32 x, int32 y, int32 r, int32 g, int32 b, int32 a);
  28. uint32 i_getpixel(t_i_image *img, int32 x, int32 y);
  29. int32 i_getpixel_ch(t_i_image *img, int32 x, int32 y, int32 ch);
  30. uint32 i_pixel_alphamix(uint32 c1, uint32 c2, uint32 p);
  31. uint32 i_pixel_multiply_n(uint32 c1, uint32 n);
  32. uint32 i_pixel_add(uint32 co1, uint32 co2);