Skip to content
Snippets Groups Projects
Commit 29b22886 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add captureFrame method

parent c8b0264a
No related branches found
No related tags found
No related merge requests found
......@@ -341,6 +341,8 @@ typedef sequence<Position> PositionSeq;
/// \param input state : 0 for off, 1 or 2 for other things.
boolean setHighlight (in string nodeName, in long state) raises (Error);
void captureFrame (in WindowID wid, in string imageFilename) raises (Error);
/// Start capturing a window into image files.
/// \param windowId the ID of the window
/// \param filename, extension image files will be
......
......@@ -249,6 +249,7 @@ namespace graphics {
virtual bool setAlpha(const std::string& nodeName, const float& alpha);
virtual bool setAlpha(const std::string& nodeName, const int& alphaPercentage);
virtual void captureFrame (const WindowID windowId, const std::string& filename);
virtual bool startCapture (const WindowID windowId, const std::string& filename,
const std::string& extension);
virtual bool stopCapture (const WindowID windowId);
......
......@@ -367,6 +367,8 @@ namespace graphics {
BIND_TO_WINDOWS_MANAGER_2(BOOL, setHighlight, STRING, LONG)
BIND_TO_WINDOWS_MANAGER_2(VOID, captureFrame, WINDOW_ID, STRING)
BIND_TO_WINDOWS_MANAGER_3(BOOL, startCapture, WINDOW_ID, STRING, STRING)
BIND_TO_WINDOWS_MANAGER_1(BOOL, stopCapture, WINDOW_ID)
......
......@@ -142,6 +142,7 @@ public:
virtual bool setLightingMode(const char* nodeNameCorba, const char* lightingModeCorba) throw (Error);
virtual bool setHighlight(const char* nodeNameCorba, ::CORBA::Long state) throw (Error);
virtual void captureFrame (const WindowID windowId, const char* filename) throw (Error);
virtual bool startCapture (const WindowID windowId, const char* filename,
const char* extension) throw (Error);
virtual bool stopCapture (const WindowID windowId) throw (Error);
......
......@@ -1172,6 +1172,19 @@ namespace graphics {
return true;
}
void WindowsManager::captureFrame (const WindowID wid, const std::string& filename)
{
WindowManagerPtr_t wm = getWindowManager(wid, true);
mtx_.lock();
try {
wm->captureFrame (filename);
} catch (const std::exception& exc) {
mtx_.unlock();
throw;
}
mtx_.unlock();
}
bool WindowsManager::startCapture (const WindowID windowId, const std::string& filename,
const std::string& extension)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment