17 #ifndef AGXOSG_IMAGECAPTURE_H
18 #define AGXOSG_IMAGECAPTURE_H
25 #include <osg/observer_ptr>
62 void setMaxImages(
int i);
65 virtual void startCapture(
int startImageNumber=0 );
68 virtual bool stopCapture();
71 bool getCaptureStarted()
const;
80 int getImageNum()
const;
82 DrawCallback *getDrawCallback();
84 void setEnableSyncWithSimulation(
bool enableSync );
85 bool getEnableSyncWithSimulation( )
const;
89 virtual void apply( osg::RenderInfo& renderInfo );
92 virtual void writeImage(osg::Image *image,
agx::Index index) = 0;
96 void setCaptureStarted(
bool f);
103 typedef std::queue<std::pair<osg::ref_ptr<osg::Image>,
agx::Index> > ImageVectorT;
112 bool m_captureEnabled;
120 osg::ref_ptr<DrawCallback> m_drawCallback;
171 virtual void writeImage(osg::Image *image,
agx::Index index);
178 std::string m_prefix;
179 std::string m_postfix;
180 std::string m_directory;
189 void push(ImageVectorT::value_type image_set)
192 ImageVectorT::push(image_set);
199 return ImageVectorT::size();
205 while(ImageVectorT::size())
243 void push(ImageVectorT::value_type image_set);
249 ImageVectorT::value_type topAndPop();
254 std::atomic<bool> m_stop;
264 virtual void operator () (osg::RenderInfo& renderInfo)
const;
265 using osg::Camera::DrawCallback::operator();