重量轻C ++的图片库 [英] light-weight C++ image library

查看:156
本文介绍了重量轻C ++的图片库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在四处寻找一个简单的小而强大和快速(不可以 COM prehensive!)图片库,用于C ++(C就足够了,如果没有C ++版本可用)

I've been looking around for a simple and small yet robust and fast (not comprehensive!) image library for C++ (C would suffice, if no C++ version is available).

我要找的主要特点是:


  • 自由(开源是一个加号)

  • 专为速度

  • 无巨大功能膨胀(如 ImageMagik ,这是真正的COM prehensive,而是一个庞大的)

  • 微小的内存占用

  • 仅支持功能的绝对最低负载一样/保存,调整大小,格式之间进行转换。没有什么花哨

  • 为破文件错误恢复(不像 stb_image.c ,其中有pretty错误恢复差)

  • MSVC和gcc友好(我用 CxImage的了数年,但与我在与2010年MSVC的问题,它似乎是积极发展的最新版本,它的支持现在死了,所以我要放弃它)

  • 应该支持现代流行格式,如JPEG2000,无论是直接还是通过像使用一般的库的libpng

  • 请不在乎它的DirectX或OpenGL,因为我不使用它来显示图像计划 - 只为文件处理他们的网站

  • 有静态和动态链接的支持是一个加号

  • 线程支持是一个巨大的加

  • Free (opensource is a plus)
  • Built for speed
  • No huge functional bloat (like ImageMagik, which is truly comprehensive but is a mammoth)
  • Tiny memory footprint
  • Only supports the absolute minimum of functions like load/save, resize, convert between formats. Nothing fancy
  • Error recovery for "broken" files (unlike stb_image.c, which has pretty poor error recovery)
  • MSVC and gcc friendly (I used CxImage for a number of years but with the latest version I'm having problems with MSVC 2010 and it would seem that active development and support for it has died out by now, so I'm about to drop it)
  • Should support popular modern formats, like JPEG2000, either directly or via a use of general libraries like libpng
  • Don't care if it's DirectX or OpenGL as I don't plan on using it to display the images - only to file-process them for a web site
  • Having support for both static and dynamic linking is a plus
  • Threading support is a huge plus

库我看了看,并驳回的原因之一或其他:

Libraries I looked at and dismissed for one reason or another:


  • CxImage的(它没有积极发展了)

  • ImageMagik - 过于庞大(慢)

  • stb_image.c - 糟糕的错误处理,不支持足够的图像格式

  • 恶魔(没有带还没有被解雇,但没有看着它要么得多 - 刚刚得知它几分钟前上一个类似的职位SO) - 根据它的大小和功能集,它看起来什么非常有前途我需要尽管

  • 的FreeImage(同魔鬼 - 将看看它很快,但它的规模有点大,我的口味)

  • 土壤(同stb_image.c)

  • TimThumb - 这是一个PHP的,而不是一个C / C ++

总之我只是想在仅仅有功能的绝对最低限度的代价是无数小越好,尽可能快的东西,但我还没有找到一个合适的人选迄今。

In short I just want something as tiny as possible and as fast as possible at the expense of just having the absolute bare minimum of functionality but I'm yet to find a suitable candidate thus far.

这是这个社会有什么建议吗?但请记住我上面列出的限制 - 我不认为这是确定以抛出形式的回答你试过X'其中X不符合一半我的需求:)

Any suggestions from this community, please? But keep in mind the constraints I listed above - I don't think it's OK to throw an answer of a form "have you tried X?" where "X" doesn't meet half of my needs :)

修改:展望更进魔鬼一点它似乎它可能是我所需要的。它重量轻,小,稳健。现在我只是需要确保它执行。
哦,还有的CImage(我忘了提及它在列表) - 不喜欢它的性能(虽然我不得不承认,只有模板实现的想法是可爱的,至少可以说)

Edit: Looking a bit more into DevIL it would seem it could be what I need. It's light, tiny, robust. Now I just need to make sure it performs. Oh, and CImage (I forgot to mention it in the list) - didn't like it's performance (though I have to admit that the idea of template-only implementation is cute, to say the least)

推荐答案

我强烈建议你周围写一个小库的的libpng jpeglib (以及你需要支持格式所有其他低级别的库)。这并不难,你可以code你需要的功能。

I strongly suggest you to write a little library around libpng and jpeglib (and every other low-level library for the formats you need to support). It is not that hard and you can code all the features you require.

作为替代方案,你可以使用一些良好的C ++包装已经存在该库。下面是一些例子:

As an alternative, you can use some of the good c++ wrappers that already exists for that libraries. Here are some examples:

  • png++
  • JPEGReader/JPEGWriter

这篇关于重量轻C ++的图片库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆