SDL_image.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. SDL_image: An example image loading library for use with SDL
  3. Copyright (C) 1999, 2000, 2001 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with this library; if not, write to the Free
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. Sam Lantinga
  16. slouken@libsdl.org
  17. */
  18. /* $Id: SDL_image.h,v 1.1 2004/07/21 16:24:11 paigoddess Exp $ */
  19. /* A simple library to load images of various formats as SDL surfaces */
  20. #ifndef _IMG_h
  21. #define _IMG_h
  22. #include "SDL.h"
  23. #include "begin_code.h"
  24. /* Set up for C function definitions, even when using C++ */
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Load an image from an SDL data source.
  29. The 'type' may be one of: "BMP", "GIF", "PNG", etc.
  30. If the image format supports a transparent pixel, SDL will set the
  31. colorkey for the surface. You can enable RLE acceleration on the
  32. surface afterwards by calling:
  33. SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
  34. */
  35. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);
  36. /* Convenience functions */
  37. extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
  38. extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
  39. /* Invert the alpha of a surface for use with OpenGL
  40. This function is now a no-op, and only provided for backwards compatibility.
  41. */
  42. extern DECLSPEC int SDLCALL IMG_InvertAlpha(int on);
  43. /* Functions to detect a file type, given a seekable source */
  44. extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);
  45. extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);
  46. extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);
  47. extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);
  48. extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);
  49. extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);
  50. extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);
  51. extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);
  52. extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
  53. extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);
  54. /* Individual loading functions */
  55. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);
  56. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);
  57. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);
  58. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);
  59. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);
  60. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);
  61. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);
  62. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);
  63. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
  64. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);
  65. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);
  66. extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);
  67. /* We'll use SDL for reporting errors */
  68. #define IMG_SetError SDL_SetError
  69. #define IMG_GetError SDL_GetError
  70. /* Ends C function definitions when using C++ */
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #include "close_code.h"
  75. #endif /* _IMG_h */