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