图片加载库 DevIL

C/C++第三方开源库的介绍和相关讨论
回复
头像
523066680
Administrator
Administrator
帖子: 573
注册时间: 2016年07月19日 12:14
联系:

图片加载库 DevIL

帖子 523066680 »

编辑:523066680@163.com

主页:http://openil.sourceforge.net/about.php
(从官网上看,这个库好像年份久远啊,2009?)
Developer's Image Library (DevIL) is a programmer's library to develop applications with very powerful image loading capabilities

DevIL can load, save, convert, manipulate, filter and display a wide variety of image formats.

Currently, DevIL can load .bmp, .cut, .dds, .doom, .exr, .hdr, .gif, .ico, .jp2, .jpg,.lbm, .mdl, .mng, .pal, .pbm, .pcd, .pcx, .pgm, .pic, .png, .ppm, .psd, .psp, .raw, .sgi, .tga and .tif files.
Formats supported for saving include .bmp, .dds, .h, .jpg, .pal, .pbm, .pcx, .pgm, .png, .ppm, .raw, .sgi, .tga and .tif.
编译好的库文件
DevIL 1.7.8 SDK for 32-bit Windows(1.48 MB)
DevIL 1.7.8 SDK for 64-bit Windows(1.63 MB)

源码和示例代码下载 https://github.com/DentonW/DevIL
从源码中编译(环境 - Win7 64bit MinGW gcc 6.1)
DevIL-master\DevIL>cmake -G "MinGW Makefiles" . -- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) -- Could NOT find Squish (missing: SQUISH_INSTALL_DIR SQUISH_CLIENT_EXECUTABLE SQUISH_SERVER_EXECUTABLE) -- Could NOT find LCMS (missing: LCMS_LIBRARIES LCMS_INCLUDE_DIR)
DevIL-master\DevIL>make
编译 IL、ILU 无误; 但 ILUT 编译失败,主要是以下几类问题:
CMakeFiles\ILUT.dir/objects.a(ilut_opengl.c.obj):ilut_opengl.c:(.text+0x17): und efined reference to `__imp_glEnable' CMakeFiles\ILUT.dir/objects.a(ilut_opengl.c.obj):ilut_opengl.c:(.text+0x8a5): un defined reference to `gluBuild2DMipmaps'
解决方法:
进入 \DevIL-master\DevIL\src-ILUT\CMakeFiles\ILUT.dir 目录,打开 linklibs.rsp 文件,追加两个参数:

-lopengl32 -lglu32

重新 make 即可
头像
523066680
Administrator
Administrator
帖子: 573
注册时间: 2016年07月19日 12:14
联系:

编译 DevIL 示例程序 (MinGW gcc)

帖子 523066680 »

以 DevIL-master\DevIL\examples\opengl_example 为例
gcc gltest.c -o gltest ^ -ID:\lib\freeglut-MinGW-3.0.0-1.mp\include ^ -LD:\lib\freeglut-MinGW-3.0.0-1.mp\lib\x64 ^ -I..\..\include ^ -L..\..\src-IL ^ -L..\..\src-ILU ^ -L..\..\src-ILUT ^ -lfreeglut -lopengl32 -lglu32 -lIL -lILU -lILUT
opengl_example.zip
(727.31 KiB) 已下载 65 次
回复

在线用户

正浏览此版面之用户: 没有注册用户 和 2 访客