Changeset 132 for Swollen/swollen/animation.cpp
- Timestamp:
- Aug 15, 2005, 9:28:17 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/swollen/animation.cpp
r125 r132 8 8 9 9 #include <iostream> 10 #include <string> 10 11 #include <osg/Image> 11 12 #include <osgDB/WriteFile> 12 #include <osgDB/FileNameUtils> 13 #include <osgDB/FileUtils> 14 //#include <osgDB/FileNameUtils> 13 15 #include <animation.h> 14 16 … … 16 18 Animation::Animation() 17 19 { 18 _ save= false;20 _valid = false; 19 21 _image = new osg::Image; 20 22 … … 42 44 bool Animation::saveImage( unsigned int playback_index ) 43 45 { 44 45 46 _image->readPixels( _x, _y, _width, _height, GL_RGB, GL_UNSIGNED_BYTE); 46 47 47 if ( osgDB::writeImageFile(*_image, "image.jpg") ) 48 // restricted to 9999 frames (famous last words but that should be enough ;-) 49 char nstr[5]; 50 sprintf(nstr, "%04d", playback_index); 51 52 std::string filename = std::string( _dirname + "/frame" + nstr + ".jpg" ); 53 if ( osgDB::writeImageFile(*_image, filename) ) 48 54 { 49 std::cout << "Saved image " << playback_index<< std::endl;55 std::cout << "Saved " << filename << std::endl; 50 56 return true; 51 57 }
Note: See TracChangeset
for help on using the changeset viewer.