static bool readFileNames( osgDB::InputStream& is, osg::ImageSequence& image ) { unsigned int files = 0; is >> files >> is.BEGIN_BRACKET; if (is.getOptions()) image.setReadOptions(new osgDB::Options(*is.getOptions())); for ( unsigned int i=0; i<files; ++i ) { std::string filename; is.readWrappedString( filename ); image.addImageFile( filename ); } is >> is.END_BRACKET; return true; }
static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image ) { unsigned int images = is.readSize(); is >> is.BEGIN_BRACKET; for ( unsigned int i=0; i<images; ++i ) { osg::ref_ptr<osg::Image> img = is.readImage(); if ( img ) image.addImage( img ); } is >> is.END_BRACKET; return true; }
static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image ) { unsigned int images = is.readSize(); is >> is.BEGIN_BRACKET; for ( unsigned int i=0; i<images; ++i ) { osg::Image* img = dynamic_cast<osg::Image*>( is.readObject() ); if ( img ) image.addImage( img ); } is >> is.END_BRACKET; return true; }
static bool writeImages( osgDB::OutputStream& os, const osg::ImageSequence& image) { const osg::ImageSequence::ImageDataList& imageDataList = image.getImageDataList(); os.writeSize(imageDataList.size()); os << os.BEGIN_BRACKET << std::endl; for ( osg::ImageSequence::ImageDataList::const_iterator itr=imageDataList.begin(); itr!=imageDataList.end(); ++itr ) { os.writeObject( (*itr)._image.get() ); } os << os.END_BRACKET << std::endl; return true; }
static bool writeFileNames( osgDB::OutputStream& os, const osg::ImageSequence& image ) { const osg::ImageSequence::ImageDataList& imageDataList = image.getImageDataList(); os.writeSize(imageDataList.size()); os << os.BEGIN_BRACKET << std::endl; for ( osg::ImageSequence::ImageDataList::const_iterator itr=imageDataList.begin(); itr!=imageDataList.end(); ++itr ) { os.writeWrappedString( itr->_filename ); os << std::endl; } os << os.END_BRACKET << std::endl; return true; }
// _fileNames static bool checkFileNames( const osg::ImageSequence& image ) { return image.getNumImageData()>0; }