DevIL Manual (1265192)
Текст из файла
Developer’s Image Library ManualBy Denton WoodsAbysmal SoftwareMarch 2002Table of ContentsIntroduction............................................................................................................1Library Setup .........................................................................................................2Microsoft Visual C++ Setup ................................................................................2Directories ...................................................................................................2Post-Build.....................................................................................................3MSVC++ Bug Workaround .........................................................................4Multithreading .............................................................................................4DJGPP Setup .......................................................................................................4General GCC-Based Setup ..................................................................................4Basic Procedures ....................................................................................................6Initializing DevIL ................................................................................................6File Handling .......................................................................................................7Loading Images............................................................................................7Saving Images ..............................................................................................7Image Characterisitics ...........................................................................................8Image Manipulation...............................................................................................8Alienifying...........................................................................................................8Blurring................................................................................................................9Contrast................................................................................................................9Equalization.......................................................................................................10Gamma Correction ............................................................................................10Negativity ..........................................................................................................10Noise ..................................................................................................................11Pixelization........................................................................................................11Sharpening .........................................................................................................12Resizing Images....................................................................................................13Sub-Images ...........................................................................................................13Mipmaps ............................................................................................................13Animations ............................................................................................................Developer’s Image Library Manual 1IntroductionDeveloper’s Image Library was previously called OpenIL, but due to trademark issues,OpenIL is now known as DevIL.
DevIL is an open source programming library forprogrammers to incorporate in to their own programs. DevIL loads and saves a largevariety of images for use in a software developer’s program. This library is capable ofmanipulating images in various ways and passing image information to display APIs,such as OpenGL and Direct3D.The purpose of this manual is to guide users in coding with the Developer’s ImageLibrary. This manual is for users proficient in C and with competent knowledge of theintegrated development environment (IDE) or compiler they are using.Library ReferenceSeveral times throughout this document, the three different sub- libraries of DevIL arereferenced as IL, ILU and ILUT.
IL refers to the base library for loading, saving andconverting images. ILU refers to the middle level library for image manipulation. ILUTrefers to the high level library for displaying images. Functions in IL, ILU and ILUT areprefixed by ‘il’, ‘ilu’ and ‘ilut’, respectively.2Developer’s Image Library ManualLibrary SetupMicrosoft Visual C++ SetupDevIL setup for Windows is straightforward. Unzip DevIL in an empty directory. Ifusing WinZip, check the “Use folder names” box before unzipping.
Use the -d commandline option if using pkunzip. Then double-click on the ImageLib.dsw file in the installdirectory to load the DevIL workspace in Microsoft Visual C++ (MSVC++).DirectoriesYou will need to change some directory settings in MSVC++ to get DevIL working.1.2.3.4.5.Navigate to the Tools menu and select Options.Click on the Directories tab.Under Show directories for, select "Include files".Click the New button (to the left of the red 'X')Type the directory DevIL is installed in, plus "\Include". For example, if youinstalled DevIL to E:\ImageLib, enter "E:\ImageLib\Include".Figure 1-1. Include Directory Settings Dialog6. Under Show directories for, click on "Library files".7.
Click the New button (to the left of the red 'X').8. Type the directory DevIL is installed in, plus “\Lib". For example, if you installedDevIL to E:\ImageLib, enter "E:\ImageLib\Lib".9. Click the New button (to the left of the red ‘X’).Developer’s Image Library Manual 310. Type the directory DevIL is installed in, plus "\Lib\Debug". In the previous example,you would enter "E:\ImageLib \Lib\Debug".11. Choose OK.Figure 1-2. Library Directory Settings DialogMSVC++ Bug WorkaroundMicrosoft Visual C++ 6.0 has a bug that prevents debugging of a project.
The bugappears to occur when you use a #pragma to link a .lib file and link it via another method.The header files il.h, ilu.h and ilut.h automatically link the .lib files in via a #pragma forconvenience. To prevent this bug, check for and remove these:••devil.lib, devil-d.lib, ilu.lib, ilu-d.lib, ilut.lib and ilut-d.lib in your project settings(Project – Settings menu).devil.lib, devil-d.lib, ilu.lib, ilu-d.lib, ilut.lib and ilut-d.lib in your project’sworkspace. Some people link libraries into their project this way, which really shouldbe discouraged, due to the hardcoded paths.MultithreadingDevIL takes advantage of the multithreaded standard LIBC DLLs.
To use file streamswith DevIL, you must change the project settings of your project. If you do not performthese steps, your program will crash whenever you attempt to use a DevIL file stream.1. Navigate to the Project menu and choose Settings.2. Click the C/C++ tab.3. Change the Category drop-down menu to read Code Generation.4Developer’s Image Library Manual4. Change the Use run-time library drop-down menu to Multithreaded DLL if theSettings For menu says Win32 Release. Change the Use run-time library drop-downmenu to Debug Multithreaded DLL if the Settings For menu says Win32 Debug.5.
Choose OK.DJGPP SetupSetting up DevIL in DJGPP requires the following steps:1. Unzip DevIL in an empty directory. If using WinZip, check the “Use folder names”box before unzipping. Use the -d command line option if using pkunzip.2. Create a new subdirectory called ‘il’ in your DJGPP include directory.3. Copy the files to their respective places:• To use the precompiled libraries, copy libil.a, libilu.a and libilut.a fromImageLib \lib\djgpp to your DJGPP lib directory. Then copy il.h, ilu.h and ilut.hfrom your ImageLib\lib\il directory to your DJGPP include\il directory.• To compile the library yourself, change directories to ImageLib\Makefiles\Djgpp.This folder contains only a makefile for DJGPP.
Simply type ‘make’, and themakefile will compile DevIL and copy the files to their respective locations.To compile with DevIL in DJGPP, add –lil to your command line. To also use ILU andILUT, use –lil and –lilut, respectively.General GCC-based (Linux, Cygwin, Max OS X, etc.) SetupSetting up DevIL in this environment requires the following steps:1. Unzip DevIL in an empty directory, by typing “gzip –d gzipname” then “tar –xvftarname”, where ‘gzip’ and ‘tarname’ are DevIL-x.x.x.tar.gz and DevIL-x.x.x.tar.2.
Unzip should automatically use the directory structure present in the DevIL zip file.3. To use the precompiled libraries, copy libIL.so, libILU.so and libILUT.so to a placespecified in your library path, or use the full path to the libraries when compiling.4. To compile the library yourself:• Type ‘configure’.• Type ‘make’.• Type ‘make install’ to copy the .so files to /usr/lib and the headers to/usr/include/il.Developer’s Image Library Manual 5Basic UsageInitializing DevILYou must initialize DevIL, or it will most certainly crash. You need to initialize eachlibrary (il, ilu, and ilut) separately.
You do not need to initialize libraries you are notusing, but keep in mind that the higher level libraries are dependent on the lower ones.For example, ilut is dependent on ilu and il, so you have to initialize il and ilu, also.IL InitializationSimply call the ilInit function with no parameters:// Initialize ILilInit();ILU InitializationCall the iluInit function with no parameters:// Initialize ILUiluInit();ILUT InitializationILUT initialization is slightly more complex than IL and ILU initialization. The functionyou will use is ilutRenderer.
You must call ilutRenderer before you use any ILUTfunctions. This function initializes ILUT support for the API you desire to use by asingle parameter:•••ILUT_OPENGL – Initializes ILUT’s OpenGL support.ILUT_ALLEGRO – Initializes ILUT’s Allegro support.ILUT_WIN32 – Initializes ILUT’s Windows GDI and DirectX 8 support.An example of using ilutRenderer follows:// Initialize ILUT with OpenGL support.ilutRenderer(ILUT_OPENGL);Image Name HandlingImage names are DevIL’s way of keeping track of images it is currently containing.Some other image libraries return structs, but they generally seem more cluttered thanDevIL’s image name handling.6Developer’s Image Library ManualILvoid ilGenImages(ILs izei Num, ILuint *Images);ILvoid ilBindImage(ILuint Image);ILvoid ilDeleteImages(ILsizei Num, ILuint *Images);Listing 2-1.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.