Thank you guys, now I can use the convert functions! And now I understand more about smart pointers :)

But there's one last doubt: what's the difference between the functions vidl2_convert_to_view and vidl2_convert_wrap_in_view? I want to get a vil_image_view out of a vidl2_frame to convert it to another format (in Java), so which of those functions is better for me?

On Mon, Jun 30, 2008 at 7:12 PM, Peter Vanroose <peter_vanroose@yahoo.co.uk> wrote:
> > void* data = istream->current_frame()->data();
> >
>
> I would avoid this last one.
> ... data will be deleted as soon as you make that assignment
> (since the smart pointer goes out of scope).  You end up with
> "data" pointing to deallocating memory.

Agreed. Thanks for pointing out.
That's actually the difference between "normal" pointers and smart pointers!
By assigning istream->current_frame() to a variable of datatype vidl2_frame_sptr, the counter will be incremented; when that variable goes out of scope, the count is decremented (and the data deleted if this was the last smart pointer referencing it).

--      Peter.







     ___________________________________________________
Sök efter kärleken!
Hitta din tvillingsjäl på Yahoo! Dejting: http://ad.doubleclick.net/clk;185753627;24584539;x?http://se.meetic.yahoo.net/index.php?mtcmk=148783



--
Crístian Deives dos Santos Viana [aka CD1]
Google Talk: cristiandeives@gmail.com