English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] camlimages and kernel memory
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-12 (18:09)
From: Fernando Alegre <fernando@c...>
Subject: Re: [Caml-list] camlimages and kernel memory

Thank you for all the good suggestions. We are currently using Bigarrays and
mmap to read images from files, simulating the dcams. We map the whole
file into a bigarray and use ad-hoc functions to extract the rgb data
without worriying much about headers. This is OK  for now, but we may be
interested in the future in interfacing with the camlimages library.

So, the next question is: Can we use Obj.magic to convert a bigarray to a
string without copying data? Will this trick work   with boundary checks
turned off, so that we can have the advantage of mmap and no bound checks
at the same time?

Thanks again,

       Fernando Alegre
On Wed, Jun 12, 2002 at 06:20:37PM +0200, Jun P.FURUSE wrote:

> 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. 
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