2698
|
1 |
/*
|
|
2 |
SDL_image: An example image loading library for use with SDL
|
|
3 |
Copyright (C) 1997-2009 Sam Lantinga
|
|
4 |
|
|
5 |
This library is free software; you can redistribute it and/or
|
|
6 |
modify it under the terms of the GNU Lesser General Public
|
|
7 |
License as published by the Free Software Foundation; either
|
|
8 |
version 2.1 of the License, or (at your option) any later version.
|
|
9 |
|
|
10 |
This library is distributed in the hope that it will be useful,
|
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13 |
Lesser General Public License for more details.
|
|
14 |
|
|
15 |
You should have received a copy of the GNU Lesser General Public
|
|
16 |
License along with this library; if not, write to the Free Software
|
|
17 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
|
|
19 |
Sam Lantinga
|
|
20 |
slouken@libsdl.org
|
|
21 |
*/
|
|
22 |
|
|
23 |
/* A simple library to load images of various formats as SDL surfaces */
|
|
24 |
|
|
25 |
#ifndef _SDL_IMAGE_H
|
|
26 |
#define _SDL_IMAGE_H
|
|
27 |
|
|
28 |
#include "SDL.h"
|
|
29 |
#include "SDL_version.h"
|
|
30 |
#include "begin_code.h"
|
|
31 |
|
|
32 |
/* Set up for C function definitions, even when using C++ */
|
|
33 |
#ifdef __cplusplus
|
|
34 |
extern "C" {
|
|
35 |
#endif
|
|
36 |
|
|
37 |
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
|
38 |
*/
|
|
39 |
#define SDL_IMAGE_MAJOR_VERSION 1
|
|
40 |
#define SDL_IMAGE_MINOR_VERSION 2
|
|
41 |
#define SDL_IMAGE_PATCHLEVEL 10
|
|
42 |
|
2723
|
43 |
typedef enum {
|
2698
|
44 |
IMG_INIT_JPG = 0x00000001,
|
|
45 |
IMG_INIT_PNG = 0x00000002,
|
|
46 |
IMG_INIT_TIF = 0x00000004
|
|
47 |
} IMG_InitFlags;
|
|
48 |
|
|
49 |
/* Loads dynamic libraries and prepares them for use. Flags should be
|
|
50 |
one or more flags from IMG_InitFlags OR'd together.
|
|
51 |
It returns the flags successfully initialized, or 0 on failure.
|
|
52 |
*/
|
|
53 |
extern DECLSPEC int SDLCALL IMG_Init(int flags);
|
|
54 |
|
|
55 |
/* Unloads libraries loaded with IMG_Init */
|
|
56 |
extern DECLSPEC void SDLCALL IMG_Quit(void);
|
|
57 |
|
|
58 |
/* Load an image from an SDL data source.
|
|
59 |
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
|
|
60 |
|
|
61 |
If the image format supports a transparent pixel, SDL will set the
|
|
62 |
colorkey for the surface. You can enable RLE acceleration on the
|
|
63 |
surface afterwards by calling:
|
|
64 |
SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
|
|
65 |
*/
|
|
66 |
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);
|
|
67 |
/* Convenience functions */
|
|
68 |
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
|
|
69 |
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
|
|
70 |
|
|
71 |
/* Functions to detect a file type, given a seekable source */
|
|
72 |
extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
|
|
73 |
|
|
74 |
/* Individual loading functions */
|
|
75 |
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
|
|
76 |
|
|
77 |
/* We'll use SDL for reporting errors */
|
|
78 |
#define IMG_SetError SDL_SetError
|
|
79 |
#define IMG_GetError SDL_GetError
|
|
80 |
|
|
81 |
/* Ends C function definitions when using C++ */
|
|
82 |
#ifdef __cplusplus
|
|
83 |
}
|
|
84 |
#endif
|
|
85 |
#include "close_code.h"
|
|
86 |
|
|
87 |
#endif /* _SDL_IMAGE_H */
|