Path: blob/main/system/include/SDL/SDL_image.h
6169 views
/*1SDL_image: An example image loading library for use with SDL2Copyright (C) 1997-2012 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/* A simple library to load images of various formats as SDL surfaces */2223#ifndef _SDL_IMAGE_H24#define _SDL_IMAGE_H2526#include "SDL.h"27#include "SDL_version.h"28#include "begin_code.h"2930/* Set up for C function definitions, even when using C++ */31#ifdef __cplusplus32extern "C" {33#endif3435/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL36*/37#define SDL_IMAGE_MAJOR_VERSION 138#define SDL_IMAGE_MINOR_VERSION 239#define SDL_IMAGE_PATCHLEVEL 124041/* This macro can be used to fill a version structure with the compile-time42* version of the SDL_image library.43*/44#define SDL_IMAGE_VERSION(X) \45{ \46(X)->major = SDL_IMAGE_MAJOR_VERSION; \47(X)->minor = SDL_IMAGE_MINOR_VERSION; \48(X)->patch = SDL_IMAGE_PATCHLEVEL; \49}5051/* This function gets the version of the dynamically linked SDL_image library.52it should NOT be used to fill a version structure, instead you should53use the SDL_IMAGE_VERSION() macro.54*/55extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void);5657typedef enum58{59IMG_INIT_JPG = 0x00000001,60IMG_INIT_PNG = 0x00000002,61IMG_INIT_TIF = 0x00000004,62IMG_INIT_WEBP = 0x0000000863} IMG_InitFlags;6465/* Loads dynamic libraries and prepares them for use. Flags should be66one or more flags from IMG_InitFlags OR'd together.67It returns the flags successfully initialized, or 0 on failure.68*/69extern DECLSPEC int SDLCALL IMG_Init(int flags);7071/* Unloads libraries loaded with IMG_Init */72extern DECLSPEC void SDLCALL IMG_Quit(void);7374/* Load an image from an SDL data source.75The 'type' may be one of: "BMP", "GIF", "PNG", etc.7677If the image format supports a transparent pixel, SDL will set the78colorkey for the surface. You can enable RLE acceleration on the79surface afterwards by calling:80SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);81*/82extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);83/* Convenience functions */84extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);85extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);8687/* Invert the alpha of a surface for use with OpenGL88This function is now a no-op, and only provided for backwards compatibility.89*/90extern DECLSPEC int SDLCALL IMG_InvertAlpha(int on);9192/* Functions to detect a file type, given a seekable source */93extern DECLSPEC int SDLCALL IMG_isICO(SDL_RWops *src);94extern DECLSPEC int SDLCALL IMG_isCUR(SDL_RWops *src);95extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);96extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);97extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);98extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);99extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);100extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);101extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);102extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);103extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);104extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);105extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src);106extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src);107108/* Individual loading functions */109extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src);110extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_RW(SDL_RWops *src);111extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);112extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);113extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);114extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);115extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);116extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);117extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);118extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);119extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);120extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);121extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);122extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src);123extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src);124125extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);126127/* We'll use SDL for reporting errors */128#define IMG_SetError SDL_SetError129#define IMG_GetError SDL_GetError130131/* Ends C function definitions when using C++ */132#ifdef __cplusplus133}134#endif135#include "close_code.h"136137#endif /* _SDL_IMAGE_H */138139140