SDL_image.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 13 Apr 2002 15:06:00 +0000
changeset 64 ee887f68af8e
parent 53 96b084473b47
child 89 9a1b32277af8
permissions -rw-r--r--
Sam Lantinga - Sat Apr 13 07:49:47 PDT 2002
* Updated autogen.sh for new versions of automake
* Specify the SDL API calling convention (C by default)
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@64
    46
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);
slouken@0
    47
/* Convenience functions */
slouken@64
    48
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
slouken@64
    49
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
slouken@0
    50
slouken@0
    51
/* Invert the alpha of a surface for use with OpenGL
slouken@4
    52
   This function is now a no-op, and only provided for backwards compatibility.
slouken@4
    53
*/
slouken@64
    54
extern DECLSPEC int SDLCALL IMG_InvertAlpha(int on);
slouken@0
    55
slouken@0
    56
/* Functions to detect a file type, given a seekable source */
slouken@64
    57
extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);
slouken@64
    58
extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);
slouken@64
    59
extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);
slouken@64
    60
extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);
slouken@64
    61
extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);
slouken@64
    62
extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);
slouken@64
    63
extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);
slouken@64
    64
extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);
slouken@64
    65
extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
slouken@64
    66
extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);
slouken@0
    67
slouken@0
    68
/* Individual loading functions */
slouken@64
    69
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);
slouken@64
    70
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);
slouken@64
    71
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);
slouken@64
    72
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);
slouken@64
    73
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);
slouken@64
    74
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);
slouken@64
    75
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);
slouken@64
    76
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);
slouken@64
    77
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
slouken@64
    78
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);
slouken@64
    79
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);
slouken@0
    80
slouken@64
    81
extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);
slouken@35
    82
slouken@0
    83
/* We'll use SDL for reporting errors */
slouken@0
    84
#define IMG_SetError	SDL_SetError
slouken@0
    85
#define IMG_GetError	SDL_GetError
slouken@0
    86
slouken@0
    87
/* Ends C function definitions when using C++ */
slouken@0
    88
#ifdef __cplusplus
slouken@19
    89
}
slouken@0
    90
#endif
slouken@0
    91
#include "close_code.h"
slouken@0
    92
slouken@0
    93
#endif /* _IMG_h */