Skip to content

Latest commit

 

History

History
98 lines (79 loc) · 3.44 KB

SDL_image.h

File metadata and controls

98 lines (79 loc) · 3.44 KB
 
Aug 10, 2000
Aug 10, 2000
1
/*
Dec 14, 2001
Dec 14, 2001
2
3
SDL_image: An example image loading library for use with SDL
Copyright (C) 1999, 2000, 2001 Sam Lantinga
Aug 10, 2000
Aug 10, 2000
4
Dec 14, 2001
Dec 14, 2001
5
6
7
8
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
Aug 10, 2000
Aug 10, 2000
14
Dec 14, 2001
Dec 14, 2001
15
16
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Aug 10, 2000
Aug 10, 2000
17
18
19
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Aug 10, 2000
Aug 10, 2000
21
22
*/
Dec 14, 2001
Dec 14, 2001
23
24
25
26
27
28
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
Aug 10, 2000
Aug 10, 2000
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* A simple library to load images of various formats as SDL surfaces */
#ifndef _IMG_h
#define _IMG_h
#include "SDL.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* 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);
*/
extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc,
char *type);
/* Convenience functions */
extern DECLSPEC SDL_Surface *IMG_Load(const char *file);
extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
/* Invert the alpha of a surface for use with OpenGL
Sep 1, 2000
Sep 1, 2000
57
58
This function is now a no-op, and only provided for backwards compatibility.
*/
Aug 10, 2000
Aug 10, 2000
59
60
61
62
extern DECLSPEC int IMG_InvertAlpha(int on);
/* Functions to detect a file type, given a seekable source */
extern DECLSPEC int IMG_isBMP(SDL_RWops *src);
Mar 7, 2001
Mar 7, 2001
63
extern DECLSPEC int IMG_isPNM(SDL_RWops *src);
Nov 29, 2000
Nov 29, 2000
64
extern DECLSPEC int IMG_isXPM(SDL_RWops *src);
Mar 7, 2001
Mar 7, 2001
65
extern DECLSPEC int IMG_isXCF(SDL_RWops *src);
Aug 10, 2000
Aug 10, 2000
66
67
68
69
70
extern DECLSPEC int IMG_isPCX(SDL_RWops *src);
extern DECLSPEC int IMG_isGIF(SDL_RWops *src);
extern DECLSPEC int IMG_isJPG(SDL_RWops *src);
extern DECLSPEC int IMG_isTIF(SDL_RWops *src);
extern DECLSPEC int IMG_isPNG(SDL_RWops *src);
Sep 23, 2001
Sep 23, 2001
71
extern DECLSPEC int IMG_isLBM(SDL_RWops *src);
Aug 10, 2000
Aug 10, 2000
72
73
74
/* Individual loading functions */
extern DECLSPEC SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src);
Mar 7, 2001
Mar 7, 2001
75
extern DECLSPEC SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src);
Nov 29, 2000
Nov 29, 2000
76
extern DECLSPEC SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src);
Mar 7, 2001
Mar 7, 2001
77
extern DECLSPEC SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src);
Aug 10, 2000
Aug 10, 2000
78
79
80
81
82
83
extern DECLSPEC SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadTIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src);
Sep 23, 2001
Sep 23, 2001
84
extern DECLSPEC SDL_Surface *IMG_LoadLBM_RW(SDL_RWops *src);
Aug 10, 2000
Aug 10, 2000
85
Apr 28, 2001
Apr 28, 2001
86
87
extern DECLSPEC SDL_Surface *IMG_ReadXPMFromArray(char **xpm);
Aug 10, 2000
Aug 10, 2000
88
89
90
91
92
93
/* 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
94
}
Aug 10, 2000
Aug 10, 2000
95
96
97
98
#endif
#include "close_code.h"
#endif /* _IMG_h */