On 11/02/2012 06:24 PM, Johannes Engels wrote:
> Hello, is anybody aware of an image processing package in Pure? Most
> urgently I would need functions which read and write *.jpg, *.png,
> *.tiff and/or *.bmp files. Or are there any wrappers of foreign
> libraries (e.g. devIL)?
Under pure-gl/examples you can find a pure-gen generated wrapper for
Imlib2. An example showing its use is in pure-gl/examples/texture.pure
(see line 23f.). I can't say whether this still works with the current
Imlib2 versions, but the Imlib2 header file is quite clean IIRC, so
generating your own wrapper with pure-gen should be a piece of cake. You
can find all that stuff either in the pure-gl package or in the hg repo
here:
http://code.google.com/p/pure-lang/source/browse/#hg%2Fpure-gl%2Fexamples
In my private repo I also found a wrapper for the ImageMagick library I
did some time ago. I never got around comitting it to the official repo
but I just tried it and it seems to work (on Linux at least). Note that
I don't have any examples for this, so you'll have to find your way
yourself. Anyway, I'm attaching this as a tarball, a Makefile is
included so that you can build the shared lib yourself (the Makefile is
for 64 bit Linux right now, but it should be easy to adapt it for other
systems). The wrapper was generated for ImageMagick 6.6.2.6 which is
what I have on my Ubuntu 11.04 system. If you have pure-gen installed,
you can also regenerate the wrapper with `make realclean all`. By
fiddling with the Makefile, you can probably also use this to generate a
wrapper for GraphicsMagick if you prefer that, but I haven't tried this yet.
If these don't fit your purpose, then it shouldn't be too hard to use
pure-gen in order to create your own wrappers of whatever C image
library your prefer. If you do, please post the results here so that
others can benefit. :)
HTH,
Albert
--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:
Dr.G...@t-online.de,
a...@muwiinfa.geschichte.uni-mainz.de
WWW:
http://www.musikinformatik.uni-mainz.de/ag