> 
> Hi Robert,
> 
> The osg::Camera has a post and final draw callbacks which are perfect
> for implementing custom read pixel operations, and already work
> seamlessly with the code in RenderStage.  So rather than attach your
> own osg::Image to the Camera and expect it to be filled in a custom
> way the appropriate thing to do is attach a post draw callback to the
> Camera instead and let it do what it wants - including call
> osg::Image::readPixels if it sees so fit.

I'm aware of camera callbacks, but unfortunately once you pick the image at the 
post draw callback ther isn't much to do except to to post process resulting 
image and then copy results to new ussually larger image (when you need image 
tiling or banding for example). Processing and copying to new image can be huge 
problem once you start to deal with several thousands*several thousands pixel 
images. Another usage of read pixels callback would be to completely bypass 
image allocation by outputing pixels directly to the destination device 
(printer for example).


> Robert.
> 
> On Mon, Dec 7, 2009 at 7:20 PM, Robert Milharcic
> <[email protected]> wrote:
> >
> > Hi Robert,
> >
> > I don't understand why you are using a readPixels() callback.  Why
> not
> > just avoid calling readPixels() completely and have your own custom
> > method in your own code.
> >
> > Is it there is some higher level OSG functionality that you're
> > actually trying to customize?
> >
> >
> > Yes, that is correct! Image::readPixels is called by the framework
> (osgUtil::RenderStage::drawInner) when you attach image to the camera.
> Hence, if one decides to go custom way he/she is left with no other
> option but to duplicate well-written and well-tested camera attachement
> code. But as I said before, readPixels callback is low priority feature
> which may be left out if no one cares...
> >
> >
> >
> > On Mon, Dec 7, 2009 at 2:18 PM, Robert Milharcic
> > <[email protected]> wrote:
> >> Attached is modified (SVN) osg/Image header and osg/image.cpp that
> adds ReadPixels callback. It can be used to override default
> Image::readPixels implementation. The reasons I'm proposing this *low
> priority* addition are as follows:
> >>
> >> - one can change how pixel packing is handled
> >> - implement alternative image allocation strategies (for image
> banding and tiling as an example)
> >> - on a fly pixel data processing
> >> .. and more.
> >>
> >> Robert M.
> >>
> >> _______________________________________________
> >> 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
> >
> > _______________________________________________
> > 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

<<attachment: Robert Milharcic.vcf>>

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to