SDL_image.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 14 Dec 2001 13:02:16 +0000
changeset 53 96b084473b47
parent 52 bdc316d7a38a
child 64 ee887f68af8e
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@53
    23
/* $Id$ */
slouken@52
    24
slouken@0
    25
/* A simple library to load images of various formats as SDL surfaces */
slouken@0
    26
slouken@0
    27
#ifndef _IMG_h
slouken@0
    28
#define _IMG_h
slouken@0
    29
slouken@0
    30
#include "SDL.h"
slouken@0
    31
#include "begin_code.h"
slouken@0
    32
slouken@0
    33
/* Set up for C function definitions, even when using C++ */
slouken@0
    34
#ifdef __cplusplus
slouken@0
    35
extern "C" {
slouken@0
    36
#endif
slouken@0
    37
slouken@0
    38
/* Load an image from an SDL data source.
slouken@0
    39
   The 'type' may be one of: "BMP", "GIF", "PNG", etc.
slouken@0
    40
slouken@0
    41
   If the image format supports a transparent pixel, SDL will set the
slouken@0
    42
   colorkey for the surface.  You can enable RLE acceleration on the
slouken@0
    43
   surface afterwards by calling:
slouken@0
    44
	SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
slouken@0
    45
 */
slouken@0
    46
extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc,
slouken@0
    47
					      char *type);
slouken@0
    48
/* Convenience functions */
slouken@0
    49
extern DECLSPEC SDL_Surface *IMG_Load(const char *file);
slouken@0
    50
extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
slouken@0
    51
slouken@0
    52
/* Invert the alpha of a surface for use with OpenGL
slouken@4
    53
   This function is now a no-op, and only provided for backwards compatibility.
slouken@4
    54
*/
slouken@0
    55
extern DECLSPEC int IMG_InvertAlpha(int on);
slouken@0
    56
slouken@0
    57
/* Functions to detect a file type, given a seekable source */
slouken@0
    58
extern DECLSPEC int IMG_isBMP(SDL_RWops *src);
slouken@24
    59
extern DECLSPEC int IMG_isPNM(SDL_RWops *src);
slouken@7
    60
extern DECLSPEC int IMG_isXPM(SDL_RWops *src);
slouken@26
    61
extern DECLSPEC int IMG_isXCF(SDL_RWops *src);
slouken@0
    62
extern DECLSPEC int IMG_isPCX(SDL_RWops *src);
slouken@0
    63
extern DECLSPEC int IMG_isGIF(SDL_RWops *src);
slouken@0
    64
extern DECLSPEC int IMG_isJPG(SDL_RWops *src);
slouken@0
    65
extern DECLSPEC int IMG_isTIF(SDL_RWops *src);
slouken@0
    66
extern DECLSPEC int IMG_isPNG(SDL_RWops *src);
slouken@45
    67
extern DECLSPEC int IMG_isLBM(SDL_RWops *src);
slouken@0
    68
slouken@0
    69
/* Individual loading functions */
slouken@0
    70
extern DECLSPEC SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src);
slouken@24
    71
extern DECLSPEC SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src);
slouken@7
    72
extern DECLSPEC SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src);
slouken@26
    73
extern DECLSPEC SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src);
slouken@0
    74
extern DECLSPEC SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src);
slouken@0
    75
extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src);
slouken@0
    76
extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src);
slouken@0
    77
extern DECLSPEC SDL_Surface *IMG_LoadTIF_RW(SDL_RWops *src);
slouken@0
    78
extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src);
slouken@0
    79
extern DECLSPEC SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src);
slouken@45
    80
extern DECLSPEC SDL_Surface *IMG_LoadLBM_RW(SDL_RWops *src);
slouken@0
    81
slouken@35
    82
extern DECLSPEC SDL_Surface *IMG_ReadXPMFromArray(char **xpm);
slouken@35
    83
slouken@0
    84
/* We'll use SDL for reporting errors */
slouken@0
    85
#define IMG_SetError	SDL_SetError
slouken@0
    86
#define IMG_GetError	SDL_GetError
slouken@0
    87
slouken@0
    88
/* Ends C function definitions when using C++ */
slouken@0
    89
#ifdef __cplusplus
slouken@19
    90
}
slouken@0
    91
#endif
slouken@0
    92
#include "close_code.h"
slouken@0
    93
slouken@0
    94
#endif /* _IMG_h */