Skip to content

Latest commit

 

History

History
116 lines (96 loc) · 4.46 KB

SDL_image.h

File metadata and controls

116 lines (96 loc) · 4.46 KB
 
Aug 10, 2000
Aug 10, 2000
1
/*
Dec 14, 2001
Dec 14, 2001
2
SDL_image: An example image loading library for use with SDL
Feb 4, 2006
Feb 4, 2006
3
Copyright (C) 1997-2006 Sam Lantinga
Aug 10, 2000
Aug 10, 2000
4
Dec 14, 2001
Dec 14, 2001
5
This library is free software; you can redistribute it and/or
Feb 4, 2006
Feb 4, 2006
6
modify it under the terms of the GNU Lesser General Public
Dec 14, 2001
Dec 14, 2001
7
License as published by the Free Software Foundation; either
Feb 4, 2006
Feb 4, 2006
8
version 2.1 of the License, or (at your option) any later version.
Aug 10, 2000
Aug 10, 2000
9
Dec 14, 2001
Dec 14, 2001
10
This library is distributed in the hope that it will be useful,
Aug 10, 2000
Aug 10, 2000
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
Dec 14, 2001
Dec 14, 2001
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Feb 4, 2006
Feb 4, 2006
13
Lesser General Public License for more details.
Aug 10, 2000
Aug 10, 2000
14
Feb 4, 2006
Feb 4, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Aug 10, 2000
Aug 10, 2000
18
19
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Aug 10, 2000
Aug 10, 2000
21
22
23
24
*/
/* A simple library to load images of various formats as SDL surfaces */
Jul 23, 2003
Jul 23, 2003
25
26
#ifndef _SDL_IMAGE_H
#define _SDL_IMAGE_H
Aug 10, 2000
Aug 10, 2000
27
28
#include "SDL.h"
Jul 23, 2003
Jul 23, 2003
29
#include "SDL_version.h"
Aug 10, 2000
Aug 10, 2000
30
31
32
33
34
35
36
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
Jul 23, 2003
Jul 23, 2003
37
38
39
40
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_IMAGE_MAJOR_VERSION 1
#define SDL_IMAGE_MINOR_VERSION 2
Jul 13, 2007
Jul 13, 2007
41
#define SDL_IMAGE_PATCHLEVEL 6
Jul 23, 2003
Jul 23, 2003
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_image library.
*/
#define SDL_IMAGE_VERSION(X) \
{ \
(X)->major = SDL_IMAGE_MAJOR_VERSION; \
(X)->minor = SDL_IMAGE_MINOR_VERSION; \
(X)->patch = SDL_IMAGE_PATCHLEVEL; \
}
/* This function gets the version of the dynamically linked SDL_image library.
it should NOT be used to fill a version structure, instead you should
use the SDL_IMAGE_VERSION() macro.
*/
extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void);
Aug 10, 2000
Aug 10, 2000
59
60
61
62
63
64
65
66
/* Load an image from an SDL data source.
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
If the image format supports a transparent pixel, SDL will set the
colorkey for the surface. You can enable RLE acceleration on the
surface afterwards by calling:
SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
*/
Apr 13, 2002
Apr 13, 2002
67
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);
Aug 10, 2000
Aug 10, 2000
68
/* Convenience functions */
Apr 13, 2002
Apr 13, 2002
69
70
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
Aug 10, 2000
Aug 10, 2000
71
72
/* Invert the alpha of a surface for use with OpenGL
Sep 1, 2000
Sep 1, 2000
73
74
This function is now a no-op, and only provided for backwards compatibility.
*/
Apr 13, 2002
Apr 13, 2002
75
extern DECLSPEC int SDLCALL IMG_InvertAlpha(int on);
Aug 10, 2000
Aug 10, 2000
76
77
/* Functions to detect a file type, given a seekable source */
Apr 13, 2002
Apr 13, 2002
78
79
80
81
extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);
Feb 4, 2006
Feb 4, 2006
82
83
84
85
86
87
88
extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);
extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src);
Aug 10, 2000
Aug 10, 2000
89
90
/* Individual loading functions */
Apr 13, 2002
Apr 13, 2002
91
92
93
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);
Feb 4, 2006
Feb 4, 2006
94
95
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);
Apr 13, 2002
Apr 13, 2002
96
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
Feb 4, 2006
Feb 4, 2006
97
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);
Apr 13, 2002
Apr 13, 2002
98
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);
Feb 4, 2006
Feb 4, 2006
99
100
101
102
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src);
Apr 13, 2002
Apr 13, 2002
103
104
extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);
Apr 28, 2001
Apr 28, 2001
105
Aug 10, 2000
Aug 10, 2000
106
107
108
109
110
111
/* We'll use SDL for reporting errors */
#define IMG_SetError SDL_SetError
#define IMG_GetError SDL_GetError
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
Feb 17, 2001
Feb 17, 2001
112
}
Aug 10, 2000
Aug 10, 2000
113
114
115
#endif
#include "close_code.h"
Jul 23, 2003
Jul 23, 2003
116
#endif /* _SDL_IMAGE_H */