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