From: Dominique <do...@vi...> - 2002-04-22 13:24:39
|
Hello, My easy2D tableau works great. I have however one question: how can I dump the contents of the tableau to a file? Would you please give me a line of code on how I can convert: struct my_tab : public vgui_easy2D{ my_tab(char const *f) : vgui_easy2D(f) {} ~my_tab() {} bool my_tab::handle(vgui_event const &e){ .... } } .... my_tab* tab = new my_tab("render"); to a "vil_image image" to use it with vil_save(image, "test.gif"); thank you Domi -- -------------------------------------------------------------------- Dominik Szczerba, Dr. Phone: +41 1 632 66 68 Computer Vision Lab, ETH Fax: +41 1 632 11 99 Gloriastr. 35 email: do...@vi... CH-8092 Zurich http://www.vision.ee.ethz.ch/~domi -------------------------------------------------------------------- |
From: <kar...@ya...> - 2002-04-22 13:40:53
|
As far as I know there is no mechanism in vxl for saving an easy2D as a gif (though this would not be imposible to write). You can save it as PostScript though, my_tab->print_psfile(filename, reduction_factor, print_geom_objects); where: filename is a vcl_string, reduction_factor is an int, print_geom_objects is a bool (true if you want to save the objects on your easy2D) Karen --- Dominique <do...@vi...> wrote: > Hello, > > My easy2D tableau works great. I have however one > question: how can I > dump the contents of the tableau to a file? Would > you please give me a > line of code on how I can convert: > > struct my_tab : public vgui_easy2D{ > my_tab(char const *f) : vgui_easy2D(f) {} > ~my_tab() {} > > bool my_tab::handle(vgui_event const &e){ > .... > } > } > > .... > > my_tab* tab = new my_tab("render"); > > > > to a "vil_image image" to use it with > vil_save(image, "test.gif"); > > > thank you > Domi > > -- > -------------------------------------------------------------------- > Dominik Szczerba, Dr. Phone: +41 1 632 > 66 68 > Computer Vision Lab, ETH Fax: +41 1 632 > 11 99 > Gloriastr. 35 email: > do...@vi... > CH-8092 Zurich > http://www.vision.ee.ethz.ch/~domi > -------------------------------------------------------------------- > > > > _______________________________________________ > Vxl-users mailing list > Vxl...@li... > https://lists.sourceforge.net/lists/listinfo/vxl-users __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com |
From: Peter V. <Pet...@es...> - 2002-04-22 14:56:37
|
> As far as I know there is no mechanism in vxl for > saving an easy2D as a gif (though this would not be > imposible to write). You can save it as PostScript > though, And from a PostScript file, you can generate an image file (png or whatever, but avoid gif since its LZW coder is copyrighted..) by using ImageMagick http://www.imagemagick.org/ Peter. |
From: Dominique <do...@vi...> - 2002-04-23 13:56:15
|
> my_tab->print_psfile(filename, > reduction_factor, print_geom_objects); thanks for a suggestion, but it crashes. For cerr << output.c_str() << endl; tab->print_psfile(output.c_str(), 1, true); I get: log.ps Segmentation fault I've been trying to debug it but with no success. is it my ignorance or something in vxl? dominique |
From: <kar...@ya...> - 2002-04-23 19:50:12
|
Hi again, I've just tried it out and your right - print_psfile crashes! But only when there is no image tableau under your easy2D. I'll fix it, but in the mean time you have to: - Use a vgui_image_tableau in the constructor of the vgui_easy2D. eg. vgui_image_tableau_new img("d:/kym/image.tif"); vgui_easy2D_new easy(img); - If you have made your own image tableau derived from vgui_image_tableau (like in xcv) make sure you cast it to an image_tableau when making an easy2D my_image_tableau_new img("d:/kym/image.tif"); vgui_easy2D_new easy((vgui_image_tableau_sptr)img); Let me know if this doesn't work, Karen McGaul VGG, Oxford University __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com |
From: Dominique <do...@vi...> - 2002-04-24 10:00:17
|
> under your easy2D. I'll fix it, but in the mean time > you have to: well honestly in the meantime I copied/pasted and modified the source code for print_psfile in vgui_easy2D.cxx. The image is needed only to get the size and color type (gray or RGB). It was crashing only because of this. It works fine after modification. But still I think some kind of save_bitmap would be very usefull, because print_psfile saves my tableau without antialiasing. The image in tableau looks *far* better. So for the moment I am commited to some screen grabbers... but thank you, I find print_psfile usefull anyway. Dominique |
From: Amitha P. <pe...@cs...> - 2002-04-24 14:14:59
|
> But still I think some kind of save_bitmap would be very usefull, > because print_psfile saves my tableau without antialiasing. The image in > tableau looks *far* better. So for the moment I am commited to some > screen grabbers... If you essentially want to do a screen grab, as opposed to actually saving the lines and such in the easy2D, perhaps vgui_utils::dump_colour_buffer would suit you better. I believe it just "renders" the OpenGL window into a file (via a block of memory), so you will get whatever is displayed on your screen, including zoom, etc. Amitha. |
From: Dominique <do...@vi...> - 2002-04-24 15:25:17
|
> vgui_utils::dump_colour_buffer would suit you better. I believe it YES YES YES that's what I need. And moreover, it worked just right away... thank you Dominique |