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=1.1 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id F38FABC69 for ; Mon, 22 Oct 2007 09:47:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFryG0fRVYC+kmdsb2JhbACCcotlAQEBAQcEBBMWgSk X-IronPort-AV: E=Sophos;i="4.21,309,1188770400"; d="scan'208";a="18447718" Received: from fk-out-0910.google.com ([209.85.128.190]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Oct 2007 09:47:00 +0200 Received: by fk-out-0910.google.com with SMTP id b27so1380219fka for ; Mon, 22 Oct 2007 00:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=xcC/XGUIF7AiI3obT8PrVM1Rmj/8mRlU3YBcRSTlFJs=; b=d1uUGYuC5fXe6NHzPDEwRNcVfwF0Z+SQ8Gr4C4PabpguFya2DMZlcauVAy88N54HChsREd4D3qKFbv0wpTp6lTtg8pDTRAZFwrcdBrNAH02Ll/6QddaNfV/aelOGBqH0uonmp8nsVH+txGzCISICazKLW+ypRSzzT2Mmydahn5k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Z0CugAq8t52iLSpsxJcAWjErgPjdBvEq26sChjP1gF+OkR2ztq/J1F15FS6ihL1rvQw8sE6wZ9w0j1gctU7S4cN4P0PCDc9TUORq9ac6x3B8Dft8xESdEEIlGKdVWUuMKE1dfkreXbXKlhVRh5n/xkdLq8H1zGbC6KQXw5v7egs= Received: by 10.82.189.6 with SMTP id m6mr7748090buf.1193039218203; Mon, 22 Oct 2007 00:46:58 -0700 (PDT) Received: by 10.82.120.16 with HTTP; Mon, 22 Oct 2007 00:46:58 -0700 (PDT) Message-ID: Date: Mon, 22 Oct 2007 03:46:58 -0400 From: "Orlin Grigorov" To: caml-list@yquem.inria.fr Subject: Re: joining two GlPix's together In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18906_4938076.1193039218199" References: X-Spam: no; 0.00; glpix:01 glpix:01 height:98 height:98 W8:98 char:01 char:01 wrote:01 wrote:01 width:97 width:97 len:02 len:02 let:03 let:03 ------=_Part_18906_4938076.1193039218199 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I figured it out, sorry for asking so fast before I even try it myself. Basically, I convert to and from raw, and just copy the bits and pieces in the right place. Here's part of my code, where "image" is the final one, and "char_image" is one of the smaller (I loop through all of them). Raw.sets (GlPix.to_raw image) ~pos:(3*(i*image_w + j + c*char_w)) (Raw.gets (GlPix.to_raw char_image) ~pos:(3*(i * char_w + j)) ~len:3) Best, Orlin On 10/22/07, Orlin Grigorov wrote: > > Hi. It's me again and my peculiar needs ;) > > At hand is the following problem. Let's assume that we have the > following: > > let image1 = GlPix.create `ubyte ~format:`rgb ~width:100 ~height:100 in > . > (* some code *) > . > let image2 = GlPix.create `ubyte ~format:`rgb ~width:100 ~height:100 in > . > (* some code *) > . > let image3 = GlPix.create `ubyte ~format:`rgb ~width:200 ~height:100 in > (* ?????????? *) > > The question marks are to be filled with code, which will join image1 and > image2 together (will glue them one next to the other), and the result will > be stored in image3 (notice how the width is the sum of the other two > widths). > > Please help! > ------=_Part_18906_4938076.1193039218199 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I figured it out, sorry for asking so fast before I even try it myself.

Basically, I convert to and from raw, and just copy the bits and pieces in the right place.  Here's part of my code, where "image" is the final one, and "char_image" is one of the smaller (I loop through all of them).

        Raw.sets (GlPix.to_raw image) ~pos:(3*(i*image_w + j + c*char_w))
             (Raw.gets (GlPix.to_raw char_image) ~pos:(3*(i * char_w + j)) ~len:3)

Best,

Orlin

On 10/22/07, Orlin Grigorov <ogrigorov@gmail.com> wrote:
Hi.  It's me again and my peculiar needs ;)

At hand is the following problem.  Let's assume that we have the following:

let image1 = GlPix.create `ubyte ~format:`rgb ~width:100 ~height:100 in
.
(* some code *)
.
let image2 = GlPix.create `ubyte ~format:`rgb ~width:100 ~height:100 in
.
(* some code *)
.
let image3 = GlPix.create `ubyte ~format:`rgb ~width:200 ~height:100 in
(* ?????????? *)

The question marks are to be filled with code, which will join image1 and image2 together (will glue them one next to the other), and the result will be stored in image3 (notice how the width is the sum of the other two widths).

Please help!

------=_Part_18906_4938076.1193039218199--