help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast copy of buffer data into a matrix


From: Muthiah Annamalai
Subject: Re: Fast copy of buffer data into a matrix
Date: Thu, 08 Feb 2007 11:09:05 -0600

On Thu, 2007-02-08 at 10:49 -0500, John Swensen wrote:
> I am currently working on a module to capture data from a firewire 
> camera and returning it to a user in Octave.  I have it all working, but 
> currently copy from the buffer returned to me by the CamWire library 
> into a Matrix by doing the following
> 
> Matrix ret_img( settings.height, settings.width );
> for( int i = 0 ; i < settings.height, settings.width ; i++ )
>     ret_img(i) = imagebuffer[i];
> 
> where imagebuffer is an array of uint8_t.
> 
I think theres something like a 

double *val = ret_img.fortran_vec(); // in this case for Matrix,
what I gather from looking at liboctave/Marray2.cc|h &
liboctave/MArray-defs.h (where operator macros live).

-Muthiah

> I have searched around a bit, but can't find a way of just doing a 
> memcpy into the Matrix object, rather than my slow existing 
> implementation.  Any suggestions?
> 
> John Swensen
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]