25 #ifndef WGESCREENCAPTURE_H
26 #define WGESCREENCAPTURE_H
31 #include <boost/signals2.hpp>
34 #include <boost/function.hpp>
39 #include <osg/RenderInfo>
41 #include "../common/WSharedObject.h"
42 #include "../common/WCondition.h"
44 #include "WGECamera.h"
46 #include "animation/WGEAnimationFrameTimer.h"
82 typedef osg::ref_ptr< WGEScreenCapture >
RefPtr;
136 virtual void operator()( osg::RenderInfo& renderInfo )
const;
177 virtual void handleImage(
size_t framesLeft,
size_t totalFrames, osg::ref_ptr< osg::Image > image )
const;
184 void record(
size_t frames = std::numeric_limits< size_t >::max() );
208 #endif // WGESCREENCAPTURE_H
SharedRecordingInformation m_recordingInformation
Counts the frames to take.
This class is a screen recorder.
void recordStart()
Starts recording.
boost::shared_ptr< WGEAnimationFrameTimer > SPtr
Convenience typedef for a shared_ptr.
void record(size_t frames=std::numeric_limits< size_t >::max())
Starts recording.
boost::shared_ptr< const WCondition > ConstSPtr
Const shared pointer type for WCondition.
virtual void operator()(osg::RenderInfo &renderInfo) const
The draw callback operator.
boost::shared_ptr< const WGEAnimationFrameTimer > ConstSPtr
Convenience typedef for a const shared_ptr.
virtual void handleImage(size_t framesLeft, size_t totalFrames, osg::ref_ptr< osg::Image > image) const
The function handles new images.
osg::ref_ptr< WGEScreenCapture > RefPtr
Convenience typedef.
WCondition::ConstSPtr getRecordCondition() const
The condition returned here is actually the change condition of the frame counter.
boost::function< void(size_t, size_t, osg::ref_ptr< osg::Image >) > HandleImageCallbackType
This callback signature is needed to subscribe to the handleImage signal.
void recordStop()
Stops recording.
SharedRecordingInformation::ReadTicket getRecordingInformation() const
Returns the current recording information.
virtual ~WGEScreenCapture()
Destructor.
HandleImageSignalType m_signalHandleImage
The signal emitted on every new grabbed image.
void screenshot()
Makes a screenshot with the next frame.
void resetFrameCounter()
Resets the frame-counter to 0.
boost::signals2::connection subscribeSignal(HandleImageCallbackType callback)
Subscribes a specified function to the new-image-signal.
bool isRecording()
Checks if there are frames left for recording.
osg::ref_ptr< const WGEScreenCapture > ConstRefPtr
Convenience typedef.
WGEScreenCapture()
Creates a screen capture callback.
WGEAnimationFrameTimer::SPtr m_timer
The frame timer.
boost::signals2::signal< void(size_t, size_t, osg::ref_ptr< osg::Image >) > HandleImageSignalType
The type of the signal for handleSignal.
WGEAnimationFrameTimer::ConstSPtr getFrameTimer() const
Returns a timer getting ticked on each recorded frame.
boost::shared_ptr< WSharedObjectTicketRead< RecordingInformation > > ReadTicket
Type for read tickets.
WSharedObject< RecordingInformation > SharedRecordingInformation
The shared access type to the FrameCounting struct.