Re: [osg-users] Introducing osgpdf
Hi Melchoir, Which version of Poppler do you have on your system? When I run pkg-config: pkg-config poppler-glib --modversion 0.6 pkg-config poppler-glib --libs -lpoppler-glib -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 Perhaps you're pkg-config isn't picking up on the correct libs. Robert. On Wed, Nov 12, 2008 at 11:40 PM, Melchior FRANZ [EMAIL PROTECTED] wrote: * Robert Osfield -- Wednesday 12 November 2008: fix to Poppler check now checked in. Now cmake tries to compile osgpdf, and fails: /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_new_from_data' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_n_channels' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_rowstride' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_height' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_width' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_pixels' Looks like the missing symbols are defined in libgdk-x11-2.0.so and libgdk_pixbuf-2.0.so. m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
* Robert Osfield -- Thursday 13 November 2008: pkg-config poppler-glib --modversion 0.6 $ pkg-config poppler-glib --modversion 0.10.0 pkg-config poppler-glib --libs -lpoppler-glib -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 $ pkg-config poppler-glib --libs -L/usr/local/lib -lpoppler-glib -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 Hmm, so it should pick up gdk-x11-2.0 and gdk_pixbuf-2.0, which are supposed to define the missing symbols. Perhaps you're pkg-config isn't picking up on the correct libs. pkg-config apparently is, and looking at the strace output it looks like cmake is as well. (Unfortunately, cmake is a bit too opaque for my taste. I couldn't yet figure out how to get the full gcc command line.) m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
[undefined reference to `gdk_pixbuf_new_from_data'] osgpdf is the only osg app that isn't linked correctly with LDFLAGS=-Wl,--as-needed. That's apparently globally on on some systems like Gentoo, and also on my non-Gentoo system. The problem is usually that libraries/objects aren't listed in the right order. Unfortunately, I couldn't yet find an order that works, even after stripping out all the duplicate lib entries. :-/ Turning off -Wl,--as-needed for OSG works, though. m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
* Melchior FRANZ -- Thursday 13 November 2008: I couldn't yet figure out how to get the full gcc command line.) OK, I figured it out. Will investigate ... m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Hi Melchoir, On Thu, Nov 13, 2008 at 9:31 AM, Melchior FRANZ [EMAIL PROTECTED] wrote: $ pkg-config poppler-glib --libs -L/usr/local/lib -lpoppler-glib -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 Hmm, so it should pick up gdk-x11-2.0 and gdk_pixbuf-2.0, which are supposed to define the missing symbols. This suggests it should be working, but somehow the osgpdf build isn't linking to them. Perhaps you're pkg-config isn't picking up on the correct libs. pkg-config apparently is, and looking at the strace output it looks like cmake is as well. (Unfortunately, cmake is a bit too opaque for my taste. I couldn't yet figure out how to get the full gcc command line.) make VERBOSE=1 You can also configure wth ccmake. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Very cool Robert Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Wednesday, November 12, 2008 10:10 AM To: OpenSceneGraph Users Subject: [osg-users] Introducing osgpdf Another day, another curious example... osgpdf ;-) In a similar vain to my work on adding vnc support that I did last week, the volume rendering project also has a need for viewing pdf documents as a way of mixing presentation text/imagery with 3D volumes so no I've embarked on adding pdf support directly into the core OSG. Last month Jeremy Moles added support for pdf reading to osgCairo so I knew it was possible, and I also had some code to learn from and leverage ;-) So today I embarked on the journey to adding pdf support into the core OSG. The first step is just a small example application, but like osgvnc I plan to distil this down into a plugin so that all applications can leverage it will little coding effort. I need to get a bit more experience with using Poppler/Cairo and also spend a bit more time thinking about the public interface before I make the plugin, and I'd also like some feedback from members of the community on how well osgpdf works at your end. To compile you'll need to latest OSG from svn/trunk. Cairo and Poppler libraries. These look like they should be available on all the major platforms, but I've only been able to test under Linux. Once you have Cairo and Poppler installed re-running CMake should be able to pick up on Cairo and Poppler and then osgpdf example should compile. If you get things working under Windows or OSX could you please write in with what you had to do to get things installed. To test osgpdf, simply pass it a pdf document: osgpdf mydocument.pdf Move the mouse of the resulting texture quad and then press 'n' and 'p' to step to next and previous pages. You can also run it with multiple documents at once. osgpdf *.pdf I've just tested this 22 documents and it worked just fine, although each of quads is a bit small on screen to read without zooming in! Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
On Wed, 2008-11-12 at 15:10 +, Robert Osfield wrote: Another day, another curious example... osgpdf ;-) In a similar vain to my work on adding vnc support that I did last week, the volume rendering project also has a need for viewing pdf documents as a way of mixing presentation text/imagery with 3D volumes so no I've embarked on adding pdf support directly into the core OSG. Last month Jeremy Moles added support for pdf reading to osgCairo so I knew it was possible, and I also had some code to learn from and leverage ;-) Your implementation of the CairoImage class is probably right on track with the simplest, cleanest way of supporting a Cairo surface to draw on. We'll need to support (and I'm willing to add this on after you commit it intially) all of the CAIRO_FORMAT_* args in the real implementation, but that's not hard--just requires settings the pixelFormat and whatnot. So today I embarked on the journey to adding pdf support into the core OSG. The first step is just a small example application, but like osgvnc I plan to distil this down into a plugin so that all applications can leverage it will little coding effort. I need to get a bit more experience with using Poppler/Cairo and also spend a bit more time thinking about the public interface before I make the plugin, and I'd also like some feedback from members of the community on how well osgpdf works at your end. To compile you'll need to latest OSG from svn/trunk. Cairo and Poppler libraries. These look like they should be available on all the major platforms, but I've only been able to test under Linux. Once you have Cairo and Poppler installed re-running CMake should be able to pick up on Cairo and Poppler and then osgpdf example should compile. If you get things working under Windows or OSX could you please write in with what you had to do to get things installed. To test osgpdf, simply pass it a pdf document: osgpdf mydocument.pdf How did you avoid not having to use a fully formed URI? In my code, I had to use file:/// syntax, or Poppler refused to cooperate. It could be a library version difference, so we'll need to keep an eye on this... Move the mouse of the resulting texture quad and then press 'n' and 'p' to step to next and previous pages. You can also run it with multiple documents at once. osgpdf *.pdf I've just tested this 22 documents and it worked just fine, although each of quads is a bit small on screen to read without zooming in! In the example code I'm using (svn update about 20 mins ago) the PageHandler object isn't being added to the viewer event handlers... Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Hi Jeremy, On Wed, Nov 12, 2008 at 3:41 PM, Jeremy Moles [EMAIL PROTECTED] wrote: Your implementation of the CairoImage class is probably right on track with the simplest, cleanest way of supporting a Cairo surface to draw on. CairoImage is just an experiment so far. I went for the absolute minimum glue code, which actually is tiny, thumbs up to the Cairo for being so simple to integrate. My thought is that if CairoImage looks like a good base then we could provide it with osgWidget, either with optional compilation of the implementation in the src/osgWidget directory, or just having the class interface and implementation all in the header. The later approach would mean that osgWidget itself needn't compile against Cairo at all - it'd only be the utilities/plugins that require it that would include the header and there fore require Cairo. A third but more complex approach would be to have the implementation of CairoImage loaded as a plugin, the complexity is something I'd rather avoid though. We'll need to support (and I'm willing to add this on after you commit it intially) all of the CAIRO_FORMAT_* args in the real implementation, but that's not hard--just requires settings the pixelFormat and whatnot. Would this mean adding a format parameter into the existing create() method that I have written and having a map between CAIRO_FORMAT and OSG_FORMAT. At what times is the RGBA format not appropriate? How did you avoid not having to use a fully formed URI? In my code, I had to use file:/// syntax, or Poppler refused to cooperate. It could be a library version difference, so we'll need to keep an eye on this... This same uri problem bit me too. Have a look at the code and you find that I use osgDB::getRealPath() to get the absolut path of the file, then I prepend file: to create the final uri with seems to work fine - so far. It'll be interesting to see what happens under Windows. In the example code I'm using (svn update about 20 mins ago) the PageHandler object isn't being added to the viewer event handlers... PageHandler isn't use right now and incomplete so is not used. The code is just experimental, me hope right now is to find out whether it works across platforms. Once I get more feedback and have a bit more time to reflect on the needs of the interface and implementation I'll refactor the PDF support to clean it up, at this time the osgpdf example can become a bit more refined too. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
On Wed, 2008-11-12 at 16:02 +, Robert Osfield wrote: Hi Jeremy, On Wed, Nov 12, 2008 at 3:41 PM, Jeremy Moles [EMAIL PROTECTED] wrote: Your implementation of the CairoImage class is probably right on track with the simplest, cleanest way of supporting a Cairo surface to draw on. CairoImage is just an experiment so far. I went for the absolute minimum glue code, which actually is tiny, thumbs up to the Cairo for being so simple to integrate. My thought is that if CairoImage looks like a good base then we could provide it with osgWidget, either with optional compilation of the implementation in the src/osgWidget directory, or just having the class interface and implementation all in the header. The later The end-user will want to get the cairo_context_t* for their own use, so there would be no way to only include the cairo headers in the source files. Looks like we'd have to use some conditional compilation in both the headers and the source (but it will still be clean, I think). approach would mean that osgWidget itself needn't compile against Cairo at all - it'd only be the utilities/plugins that require it that would include the header and there fore require Cairo. A third but more complex approach would be to have the implementation of CairoImage loaded as a plugin, the complexity is something I'd rather avoid though. We'll need to support (and I'm willing to add this on after you commit it intially) all of the CAIRO_FORMAT_* args in the real implementation, but that's not hard--just requires settings the pixelFormat and whatnot. Would this mean adding a format parameter into the existing create() method that I have written and having a map between CAIRO_FORMAT and OSG_FORMAT. At what times is the RGBA format not appropriate? Well, in OpenGL there are to main formats I envision many of us wanting to use: - ARGB32 (GL_RGBA) - A8 (GL_ALPHA) A8 is really helpful because it allows you to create small, compact alpha masks (maybe I'm using the wrong term here) for texturing. For example, in osgPango I use CAIRO_FORMAT_A8 to render just the alpha values for the font glyph, and later a osg::TexEnvCombine() object (courtesy of Cedric) comes along and sets the actual color. This reduces the texture memory size by 75%, since the RGB information is fully irrelevant inside the Cairo texture. I don't know if you agree with me here, but once people learn about the cool 2D stuff they can actually do with Cairo, I imagine many more people will be interested! How did you avoid not having to use a fully formed URI? In my code, I had to use file:/// syntax, or Poppler refused to cooperate. It could be a library version difference, so we'll need to keep an eye on this... This same uri problem bit me too. Have a look at the code and you find that I use osgDB::getRealPath() to get the absolut path of the file, then I prepend file: to create the final uri with seems to work fine - so far. It'll be interesting to see what happens under Windows. In the example code I'm using (svn update about 20 mins ago) the PageHandler object isn't being added to the viewer event handlers... PageHandler isn't use right now and incomplete so is not used. The code is just experimental, me hope right now is to find out whether it works across platforms. Once I get more feedback and have a bit more time to reflect on the needs of the interface and implementation I'll refactor the PDF support to clean it up, at this time the osgpdf example can become a bit more refined too. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Is poppler GLP'd? Gerrick On 11/12/08 9:10 AM, Robert Osfield [EMAIL PROTECTED] wrote: Another day, another curious example... osgpdf ;-) In a similar vain to my work on adding vnc support that I did last week, the volume rendering project also has a need for viewing pdf documents as a way of mixing presentation text/imagery with 3D volumes so no I've embarked on adding pdf support directly into the core OSG. Last month Jeremy Moles added support for pdf reading to osgCairo so I knew it was possible, and I also had some code to learn from and leverage ;-) So today I embarked on the journey to adding pdf support into the core OSG. The first step is just a small example application, but like osgvnc I plan to distil this down into a plugin so that all applications can leverage it will little coding effort. I need to get a bit more experience with using Poppler/Cairo and also spend a bit more time thinking about the public interface before I make the plugin, and I'd also like some feedback from members of the community on how well osgpdf works at your end. To compile you'll need to latest OSG from svn/trunk. Cairo and Poppler libraries. These look like they should be available on all the major platforms, but I've only been able to test under Linux. Once you have Cairo and Poppler installed re-running CMake should be able to pick up on Cairo and Poppler and then osgpdf example should compile. If you get things working under Windows or OSX could you please write in with what you had to do to get things installed. To test osgpdf, simply pass it a pdf document: osgpdf mydocument.pdf Move the mouse of the resulting texture quad and then press 'n' and 'p' to step to next and previous pages. You can also run it with multiple documents at once. osgpdf *.pdf I've just tested this 22 documents and it worked just fine, although each of quads is a bit small on screen to read without zooming in! Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
I meant: Is poppler GPL'd as in it's license. ;) Gerrick On 11/12/08 10:31 AM, Gerrick Bivins [EMAIL PROTECTED] wrote: Is poppler GLP'd? Gerrick On 11/12/08 9:10 AM, Robert Osfield [EMAIL PROTECTED] wrote: Another day, another curious example... osgpdf ;-) In a similar vain to my work on adding vnc support that I did last week, the volume rendering project also has a need for viewing pdf documents as a way of mixing presentation text/imagery with 3D volumes so no I've embarked on adding pdf support directly into the core OSG. Last month Jeremy Moles added support for pdf reading to osgCairo so I knew it was possible, and I also had some code to learn from and leverage ;-) So today I embarked on the journey to adding pdf support into the core OSG. The first step is just a small example application, but like osgvnc I plan to distil this down into a plugin so that all applications can leverage it will little coding effort. I need to get a bit more experience with using Poppler/Cairo and also spend a bit more time thinking about the public interface before I make the plugin, and I'd also like some feedback from members of the community on how well osgpdf works at your end. To compile you'll need to latest OSG from svn/trunk. Cairo and Poppler libraries. These look like they should be available on all the major platforms, but I've only been able to test under Linux. Once you have Cairo and Poppler installed re-running CMake should be able to pick up on Cairo and Poppler and then osgpdf example should compile. If you get things working under Windows or OSX could you please write in with what you had to do to get things installed. To test osgpdf, simply pass it a pdf document: osgpdf mydocument.pdf Move the mouse of the resulting texture quad and then press 'n' and 'p' to step to next and previous pages. You can also run it with multiple documents at once. osgpdf *.pdf I've just tested this 22 documents and it worked just fine, although each of quads is a bit small on screen to read without zooming in! Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Hi again, If you get things working under Windows or OSX could you please write in with what you had to do to get things installed. I'm working on it. I've got Cairo from the gtk+-bundle: http://www.gtk.org/download-windows.html Not sure about Poppler. It seems to only be available as source, and not sure if/how it will compile on Windows. I'm looking into that. I found binaries for Poppler here: http://www.gimp.org/~tml/gimp/win32/downloads.html but they were not compiled with POPPLER_HAS_CAIRO defined, so they don't have the poppler_page_render() function... I'll have to find something else. One thing, I think you need to move the test for Poppler from the examples/osgpdf/CMakeLists.txt to the base CMakeLists.txt, otherwise POPPLER_FOUND can never be true when adding the osgpdf example in examples/CMakeLists.txt (or at least, it wasn't for me until I moved it). I'll keep you posted on my progress (if any). J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
On Wed, 2008-11-12 at 16:32 +, Robert Osfield wrote: Hi Jeremy, On Wed, Nov 12, 2008 at 4:21 PM, Jeremy Moles [EMAIL PROTECTED] wrote: Well, in OpenGL there are to main formats I envision many of us wanting to use: - ARGB32 (GL_RGBA) - A8 (GL_ALPHA) A8 is really helpful because it allows you to create small, compact alpha masks (maybe I'm using the wrong term here) for texturing. For example, in osgPango I use CAIRO_FORMAT_A8 to render just the alpha values for the font glyph, and later a osg::TexEnvCombine() object (courtesy of Cedric) comes along and sets the actual color. This reduces the texture memory size by 75%, since the RGB information is fully irrelevant inside the Cairo texture. Thanks for the explanation. I can certainly see A8 being useful, as well a straight RGB. Yeah, there is a RGB24 format as well--alas, it packs itself using 32 bits and just ignores the alpha byte. However, ARGB32 stores pre-multiplied alpha, so RGB24 could still be useful. Out of curiosity Is the an A16 format? Unfortunately, no. I don't know if you agree with me here, but once people learn about the cool 2D stuff they can actually do with Cairo, I imagine many more people will be interested! I'm very curious where it'll all take us. It's certainly is nice link into a whole set of tools that we don't normally get access to in the pure 3D world. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
* Jean-Sébastien Guay -- Wednesday 12 November 2008: One thing, I think you need to move the test for Poppler from the examples/osgpdf/CMakeLists.txt to the base CMakeLists.txt, otherwise POPPLER_FOUND can never be true when adding the osgpdf example in examples/CMakeLists.txt (or at least, it wasn't for me until I moved it). Isn't built here either, probably for that reason, although poppler cairo are installed. m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
Hi J-S, On Wed, Nov 12, 2008 at 5:43 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: One thing, I think you need to move the test for Poppler from the examples/osgpdf/CMakeLists.txt to the base CMakeLists.txt, otherwise POPPLER_FOUND can never be true when adding the osgpdf example in examples/CMakeLists.txt (or at least, it wasn't for me until I moved it). Sorry about this missing check-in, fix to Poppler check now checked in. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Introducing osgpdf
* Robert Osfield -- Wednesday 12 November 2008: fix to Poppler check now checked in. Now cmake tries to compile osgpdf, and fails: /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_new_from_data' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_n_channels' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_rowstride' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_height' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_width' /usr/local/lib/libpoppler-glib.so: undefined reference to `gdk_pixbuf_get_pixels' Looks like the missing symbols are defined in libgdk-x11-2.0.so and libgdk_pixbuf-2.0.so. m. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org