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=AWL 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 8C910BBCA for ; Mon, 31 Mar 2008 12:30:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArQAAAda8EfBL1AZjWdsb2JhbACRQgEBAQEJBQcHGJZe X-IronPort-AV: E=Sophos;i="4.25,582,1199660400"; d="scan'208";a="8996726" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Mar 2008 12:30:14 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m2VAUE08021988 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 31 Mar 2008 12:30:14 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArQAAAda8EfBL1AZjWdsb2JhbACRQgEBAQEJBQcHGJZe X-IronPort-AV: E=Sophos;i="4.25,582,1199660400"; d="scan'208";a="8996725" Received: from gw.exalead.com (HELO exalead.com) ([193.47.80.25]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Mar 2008 12:30:13 +0200 Received: from [192.168.204.148] (madpc064.exalead.com [192.168.204.148]) (authenticated bits=0) by exalead.com (8.14.0/8.14.0) with ESMTP id m2VAUDiv027883; Mon, 31 Mar 2008 12:30:13 +0200 Message-ID: <47F0BD35.1010508@exalead.com> Date: Mon, 31 Mar 2008 12:30:13 +0200 From: Berke Durak User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Christoph Bauer Cc: caml-list List Subject: Re: [Caml-list] bigarray & int24 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at discorde with ID 47F0BD36.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 bigarray:01 byte:01 integers:01 bigarray:01 byte:01 caml-list:01 int:01 int:01 data:02 data:02 supported:02 Christoph Bauer a écrit : > Hi, > > my program should read unaligned 3 byte integers. (A real world > example for such a format would be an RGB image). What is > the best approach? > > - extend bigarray for the int24 format and send the patch to INRIA > - write a C-function, which converts the data to an int32-array > - read an 1-byte-bigarray and construct an int-bigarray > - ??? > > It should be a bigarray solution, because my program reads other > (supported) > formats as well. > > Speed matters, because there are a lot of data. > > Thanks, > > Christoph Bauer Last time I did this, I used a (m x n x 3) byte bigarray, also known pendantically as a rank 3 tensor, where m is the number of rows and n the number of columns. Should work reasonably well. -- Berke DURAK