From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D851FBBAF for ; Sat, 20 Sep 2008 19:37:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhMDAObQ1EjAXQIniGdsb2JhbACSWz4BAQEPIJt2hl4BAoN4 X-IronPort-AV: E=Sophos;i="4.32,437,1217800800"; d="scan'208";a="15172899" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 20 Sep 2008 19:37:24 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m8KHbO9C008277 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 20 Sep 2008 19:37:24 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8BAJrR1EjRVcbulGdsb2JhbACSWz4BAQEBCQMKBxEDm26GXgECg3g X-IronPort-AV: E=Sophos;i="4.32,437,1217800800"; d="scan'208";a="17171778" Received: from rv-out-0506.google.com ([209.85.198.238]) by mail3-smtp-sop.national.inria.fr with ESMTP; 20 Sep 2008 19:37:23 +0200 Received: by rv-out-0506.google.com with SMTP id k40so773643rvb.57 for ; Sat, 20 Sep 2008 10:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=OdMTaQze/WySZN62C+VjBnF7l9FN6ASxTqWgnAp7GHk=; b=f867GS6DFLeo3gZaD4iZ3stJG6HSL2m28DVe/2xBOFJlha6Z128zaU/mze4vfkV7le QkNnlP/gNByoLmq8s7ITSdiVHwqlnvyJjGK99Z02c6/RwpJUrYSA/NZyD+gS91tZbf5C +ouznrN1oVEInsQ6+5yYegr0x5Oz7IuhreY4c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=ercszAz3miAYRAHea2Lot8u5JnYYsl9h2sErAuDYEzBSVEt1f66PFjkzb+aTAud3hM uA/WdEBQtNhezoLX4P6/VTCQlpUXEM7gEjhnRzJ3AUfAnzCcqR+nCbACATJ8hMYG2hfv 8KGI1Bsu5ohp/jN3DNc/Y2hSrUTdsc8cms53M= Received: by 10.142.192.11 with SMTP id p11mr599087wff.111.1221932242196; Sat, 20 Sep 2008 10:37:22 -0700 (PDT) Received: by 10.142.240.21 with HTTP; Sat, 20 Sep 2008 10:37:22 -0700 (PDT) Message-ID: <700d600f0809201037x3358a788v818d488c451ce7bf@mail.gmail.com> Date: Sat, 20 Sep 2008 20:37:22 +0300 From: "Janne Hellsten" To: caml-list@inria.fr Subject: Portable PNG exporter MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Miltered: at concorde with ID 48D534D4.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; framebuffer:01 ocaml:01 camlimages:01 ocaml:01 zlib:01 bitmap:01 graphics:02 graphics:02 external:03 external:03 dependence:03 problem:05 install:05 depend:07 thus:10 Hi list, 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 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/ocaml/png.ml Janne