Hi JS,
I've merged your new handler. A few comments:
o I've changed the NOTICE message to INFO,
o I've changed the image filename to "screen_shot_" but this really
should be customizable.
o The PBO functionality is only really useful when your are
streaming data, such as when recording
a video, its performs worse when you use it just for a single
screen shot, here glReadPixels wins.
Robert.
On Thu, Jul 17, 2008 at 3:41 PM, Jean-Sébastien Guay
<[EMAIL PROTECTED]> wrote:
> Hello Robert,
>
> So here is the ScreenCaptureHandler.
>
> You will need to add an osgViewer::ScreenCaptureHandler to your viewer (for
> example, the osgviewer application) to use it.
>
> From a high level, most of the code is identical to the osgscreencapture
> example. The event handler will add the WindowCaptureCallback to the viewer
> when the capture key is pressed (default 'c'), and the callback will remove
> itself after it has captured the screen.
>
> There is an abstract base class CaptureOperation which lets the user decide
> what to do with the captured image. The default is a
> WriteToFileCaptureOperation.
>
> I changed the pixel format to GL_RGB or GL_RGBA (was GL_BGR or GL_BGRA,
> which swapped the red and green). Perhaps there should be an interface to
> control this from outside the class.
>
> I also noticed, the JPEG plugin does not seem to handle GL_RGBA images
> gracefully... I would have assumed that it would ignore the alpha, but it
> seems to not realize that the image is RGBA and write it out naively, so one
> column out of four in the output image is alpha data...
>
> It looks slower than the osgscreencapture example (even when no file is
> being written) but I can't find out why. Perhaps more eyeballs will help.
>
> Comments welcome.
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay [EMAIL PROTECTED]
> http://www.cm-labs.com/
> http://whitestar02.webhop.org/
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org