Newsgroups: fa.caml
From: Richard Jones <r...@annexia.org>
Date: Sat, 20 Sep 2008 23:04:12 UTC
Local: Sat, Sep 20 2008 7:04 pm
Subject: Re: [Caml-list] Portable PNG exporter
On Sat, Sep 20, 2008 at 08:37:22PM +0300, Janne Hellsten wrote: Hmmm .. GODI? > While working on a graphics related problem, I needed to save the > contents of a Graphics framebuffer to a .png file. Quick googling for > "ocaml png" didn't bring up any results for libraries that would be > easy to install via GODI. I am aware of CamlImages but unfortunately > I have never been successful at installing it due its heavy dependence > on external libraries. I also often work on Windows and installing > external OCaml libraries on Windows is usually a major PITA (if > possible at all). > I decided to write a simple self-contained .png exporter that wouldn't Your code is surprisingly elegant .. I didn't think it was possible to > depend on any external libraries (not even libpng or zlib). I thought > someone else might benefit from this piece of code and I thus made it > freely available here: > http://code.google.com/p/aihiot/source/browse/trunk/gfx/save_bitmap/o... write out a PNG file in such few lines. I wonder if it would be more concise using bitstring. For reference, I've found the easiest way to export PNGs (in any P3 <width> <height> 255 As a concrete example in OCaml: open Printf let () = Rich. -- _______________________________________________ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||