| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: $ 00019 // $Date: $ 00020 // $Revision: $ 00021 // $Author: $ 00022 00023 00024 #ifndef VRS_IO_SAVEFRAMEBUFFERGL_H 00025 #define VRS_IO_SAVEFRAMEBUFFERGL_H 00026 00027 #include <vrs/monoattribute.h> 00028 #include <vrs/image/image.h> 00029 #include <vrs/opengl/glcanvas.h> 00030 #include <string> 00031 00032 namespace VRS { 00033 00042 class VRS_CORE_API SaveFrameBufferGL : public MonoAttribute { 00043 public: 00044 SaveFrameBufferGL(const std::string &fileNameStub, GLCanvas::BufferSelection readBuffer = GLCanvas::CURRENT_BUFFER, unsigned int interval = 1, bool whenPushed = true, const Area &area = Area()); 00045 00046 std::string fileName() const; 00047 bool whenPushed() const; 00048 bool needSave() const; 00049 GLCanvas::BufferSelection readBuffer() const; 00050 const Area &area() const; 00051 00052 SO<Image> getImage(); 00053 00054 VRS_TYPEINFO(SaveFrameBufferGL, MonoAttribute); 00055 VRS_SERIALIZABLE(SaveFrameBufferGL); 00056 00057 protected: 00058 // only for serialization 00059 SaveFrameBufferGL(); 00060 00061 private: 00062 std::string fileName_; 00063 unsigned int interval_; 00064 bool whenPushed_; 00065 GLCanvas::BufferSelection readBuffer_; 00066 Area area_; 00067 00068 mutable unsigned int lastSnap_; 00069 mutable SO<Image> lastImage_; 00070 00071 friend class SaveFrameBufferPainterGL; 00072 }; 00073 00074 } 00075 #endif