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?
> > void* data = istream->current_frame()->data();
> >> ... data will be deleted as soon as you make that assignment
> I would avoid this last one.
> (since the smart pointer goes out of scope). You end up withAgreed. Thanks for pointing out.
> "data" pointing to deallocating memory.
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).
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