caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Orlin Grigorov" <ogrigorov@gmail.com>
To: "Jacques Garrigue" <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] saving/loading Raw to/from file
Date: Tue, 16 Oct 2007 19:00:51 -0400	[thread overview]
Message-ID: <b17e12b30710161600p4ff67e0bw40b0fb7d0b9e3f3f@mail.gmail.com> (raw)
In-Reply-To: <20071016.062840.255394361.garrigue@math.nagoya-u.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

The last worked like a charm!   Thanks a lot to all of you for the great
help!!!!

Orlin

On 10/15/07, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:
>
> From: "Orlin Grigorov" <ogrigorov@gmail.com>
>
> > With "GlPix.to_raw image" I can make the it raw, if that will help.
> >
> > The question is, I really need a way to save this "image" in a file, and
> be
> > able to recreate it.
>
> Once it is raw, you can read it with
>    Raw.gets_string raw ~pos:0 ~len:(Raw.byte_size raw)
>
> You can read it back in the same way:
>    let raw = Raw.create `ubyte ~len:(w*h*4) in
>    Raw.sets_string raw ~pos:0 ~len:(w*h*4) s;
>    GlPix.of_raw raw ~format:`rgba ~width:w ~height:h
>
> This should be efficient enough.
> Once you get a string, you know how to do the I/O.
>
> Jacques Garrigue
>

[-- Attachment #2: Type: text/html, Size: 1249 bytes --]

      reply	other threads:[~2007-10-16 23:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 18:54 Orlin Grigorov
2007-10-15 19:03 ` [Caml-list] " Adrien
2007-10-15 21:27 ` Christophe Raffalli
2007-10-15 21:28 ` Jacques Garrigue
2007-10-16 23:00   ` Orlin Grigorov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b17e12b30710161600p4ff67e0bw40b0fb7d0b9e3f3f@mail.gmail.com \
    --to=ogrigorov@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).