caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jun P.FURUSE" <Jun.Furuse@inria.fr>
To: xavier.leroy@inria.fr
Cc: info@gerd-stolpmann.de, fernando@cc.gatech.edu, caml-list@inria.fr
Subject: Re: [Caml-list] camlimages and kernel memory
Date: Wed, 12 Jun 2002 18:20:37 +0200 (CEST)	[thread overview]
Message-ID: <20020612.182037.700403668.Jun.Furuse@inria.fr> (raw)
In-Reply-To: <20020608153614.A12902@pauillac.inria.fr>

Hello,

> This is the hard way :-)  A simpler way to memory map files or devices
> in a Caml program is to use the function "map_file" from the Bigarray
> library.  However, it currently always map the file from offset 0,
> which is probably not appropriate for /dev/kmem...  I'll have to look
> into this limitation.
> 
> > The other problem is whether camlimages can handle data that is
> > organized as ring.  I don't have any ideas.
> 
> The type Image.t is a relatively complex data structure, so some work
> is definitely needed to go from a raw string or bigarray
> (corresponding to the memory-mapped file) to a value of type Image.t.
> I'll let the authors of CamlImages comment on that.

If the kernel memory contains the same data structure as one of
the camlimages internal image formats, the solution may be... 
Somehow (= I do not know) get the kernel memory as a raw string,
then create an image using ???.create_with function. 

The kernel memory may use different pixel layout, I am afraid.
In such case, you have to write your own version of module like
Rgb24, Index8 and so on. I am sorry but they are not well documented...

BTW, once I tried to implement Image.t using Bigarray, but it was too
slow. It seemed to me that it performed the array boundary checks for
each access. For image manipulation purposes, the unsafe versions of set
and get are really required. 

--
jun
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-06-12 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-05 23:48 Fernando Alegre
2002-06-06 21:08 ` Gerd Stolpmann
2002-06-08 13:36   ` Xavier Leroy
2002-06-12 16:20     ` Jun P.FURUSE [this message]
2002-06-12 22:09       ` Fernando Alegre

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=20020612.182037.700403668.Jun.Furuse@inria.fr \
    --to=jun.furuse@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=fernando@cc.gatech.edu \
    --cc=info@gerd-stolpmann.de \
    --cc=xavier.leroy@inria.fr \
    /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).