SDL_image.pdf
(
168 KB
)
Pobierz
20072923 UNPDF
SDLimage
24January2006
JonathanAtkins
Copyrightc
2002JonathanAtkins
Permissionisgrantedtodistributefreely,orinadistributionofanykind.Alldistributions
ofthisfilemustbeinanunalteredstate,exceptforcorrections.
Thelatestcopyofthisdocumentcanbefoundat
http://jcatki.no-ip.org/SDL_image
i
TableofContents
1Overview
..................................
1
2GettingStarted
............................
3
2.1Includes....................................................
4
2.2Compiling..................................................
5
3Functions
.................................
6
3.1Loading....................................................
7
3.1.1IMGLoad.............................................
8
3.1.2IMGLoadRW.........................................
9
3.1.3IMGLoadTypedRW..................................
10
3.1.4IMGLoadBMPRW...................................
11
3.1.5IMGLoadPNMRW...................................
12
3.1.6IMGLoadXPMRW...................................
13
3.1.7IMGLoadXCFRW...................................
14
3.1.8IMGLoadPCXRW...................................
15
3.1.9IMGLoadGIFRW....................................
16
3.1.10IMGLoadJPGRW...................................
17
3.1.11IMGLoadTIFRW...................................
18
3.1.12IMGLoadPNGRW..................................
19
3.1.13IMGLoadTGARW..................................
20
3.1.14IMGLoadLBMRW..................................
21
3.1.15IMGReadXPMFromArray............................
22
3.2Info.......................................................
23
3.2.1IMGisBMP...........................................
24
3.2.2IMGisPNM..........................................
25
3.2.3IMGisXPM..........................................
26
3.2.4IMGisXCF...........................................
27
3.2.5IMGisPCX...........................................
28
3.2.6IMGisGIF............................................
29
3.2.7IMGisJPG...........................................
30
3.2.8IMGisTIF............................................
31
3.2.9IMGisPNG...........................................
32
3.2.10IMGisLBM..........................................
33
3.3Errors.....................................................
34
3.3.1IMGSetError.........................................
35
3.3.2IMGGetError........................................
36
Index
.......................................
37
Chapter1:Overview 1
1Overview
ALittleBitAboutMe
Iamcurrently,asIwritethisdocument,aprogrammerforRaytheon.ThereIdoallsorts
ofcommunications,network,GUI,andothergeneralprogrammingtasksinC/C
++
onthe
SolarisandsometimesLinuxOperatingSystems.
Feelfreetocontactme:
jcatki@jcatki.no-ip.org
IamalsousuallyonIRCatirc.freenode.netinthe#SDLchannelasLIM
Whyisthisforyou?
Imagesprovidethebasicvisualbuildingblocksforanyuserinterface.Colorsandfun
shapesarethestuthatweaskidslookedatforhoursatatimewhiletryingtoshoot
downbigaliensandrescuepixelatedprincesses.Nowit’sourturntomaketheimagesthat
otherswillrememberlaterinlifeperhaps.Nowhowdowegetthisdangimagesintoour
SDLprograms,andbeflexibleinthehandlingoftheimagessothatwedon’tevenhave
toworryaboutwhatvariousformatstheymaybein?ThisiswhereSDLimagemakesall
ofourliveseasier.Thisdocumentdoesn’thelpyoumakeartwork,butitwillgiveyouthe
functionalknowledgeonhowtogetthatartintoyourgame.Nowgoforthandmakeyour
StickFigureofJustice,someoneelsemightfillinforyourlackofartistry,atleastyouwon’t
havetomakemuchofaneorttoincludethenewandbetterartintoyourcode.
Chapter1:Overview 2
ThisistheREADMEintheSDLimagesourcearchive.
SDL_image1.2
Thelatestversionofthislibraryisavailablefrom:
SDL_imageHomepage
ThisisasimplelibrarytoloadimagesofvariousformatsasSDLsurfaces.
ThislibrarysupportsBMP,PNM(PPM/PGM/PBM),XPM,LBM,PCX,GIF,JPEG,PNG,
TGA,andTIFFformats.
API:
#include"SDL_image.h"
SDL_Surface*IMG_Load(constchar*file);
or
SDL_Surface*IMG_Load_RW(SDL_RWops*src,intfreesrc);
or
SDL_Surface*IMG_LoadTyped_RW(SDL_RWops*src,intfreesrc,char*type);
wheretypeisastringspecifyingtheformat(i.e."PNG"or"pcx").
NotethatIMG_Load_RWcannotloadTGAimages.
TocreateasurfacefromanXPMimageincludedinCsource,use:
SDL_Surface*IMG_ReadXPMFromArray(char**xpm);
Anexampleprogram’showimage’isincluded,withsourceinshowimage.c
JPEGsupportrequirestheJPEGlibrary:
IJGHomepage
PNGsupportrequiresthePNGlibrary:
PNGHomepage
andtheZliblibrary:
ZlibHomepage
TIFFsupportrequirestheTIFFlibrary:
SGITIFFFTPSite
ThislibraryisundertheGNULibraryGeneralPublicLicense,seethefile
"COPYING"fordetails.Certainimageloadersmaybeunderadifferent
license,seetheindividualimageloadersourcefilesfordetails.
Plik z chomika:
Sinus32
Inne pliki z tego folderu:
sdl_gfx-2.0.18-sin32.DevPak
(574 KB)
Gra w statki - przykład wykorzystania biblioteki SDL.zip
(4115 KB)
SDL_ttf-2.0.9.tar.gz
(3070 KB)
SDL_mixer-1.2.8.tar.gz
(2047 KB)
SDL_image-1.2.6.tar.gz
(1278 KB)
Inne foldery tego chomika:
Allegro
Boost C++
Curses
GNU MP Bignum
GTK
Zgłoś jeśli
naruszono regulamin