コード例 #1
0
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;
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: ImageSequence.cpp プロジェクト: 3dcl/osg
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;
}
コード例 #4
0
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;
}
コード例 #5
0
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;
}
コード例 #6
0
// _fileNames
static bool checkFileNames( const osg::ImageSequence& image )
{
    return image.getNumImageData()>0;
}