Changeset 13191 for OpenSceneGraph/trunk/include/osg/ImageSequence
- Timestamp:
- 05/23/13 20:29:47 (less than one hour ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/ImageSequence (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/ImageSequence
r13041 r13191 49 49 virtual double getTimeMultiplier() const { return _timeMultiplier; } 50 50 51 typedef std::vector< osg::ref_ptr<osg::Image> > Images; 52 typedef std::vector< std::string > FileNames; 51 struct OSG_EXPORT ImageData 52 { 53 ImageData(); 54 ImageData(const ImageData& id); 55 ImageData& operator = (const ImageData& id); 56 57 std::string _filename; 58 osg::ref_ptr<osg::Image> _image; 59 osg::ref_ptr<osg::Referenced> _imageRequest; 60 }; 61 62 typedef std::vector<ImageData> ImageDataList; 53 63 54 64 virtual void seek(double time); … … 79 89 std::string getImageFile(unsigned int pos) const; 80 90 81 unsigned int getNumImageFiles() const { return _fileNames.size(); }82 83 FileNames& getFileNames() { return _fileNames; }84 const FileNames& getFileNames() const { return _fileNames; }85 86 91 void addImage(osg::Image* image); 87 92 … … 97 102 const Image* getImage(unsigned int pos) const; 98 103 99 unsigned int getNumImage s() const { return _images.size(); }104 unsigned int getNumImageData() const { return _imageDataList.size(); } 100 105 101 Image s& getImages() { return _images; }102 const Image s& getImages() const { return _images; }106 ImageDataList& getImageDataList() { return _imageDataList; } 107 const ImageDataList& getImageDataList() const { return _imageDataList; } 103 108 109 104 110 /** ImageSequence requires a call to update(NodeVisitor*) during the update traversal so return true.*/ 105 111 virtual bool requiresUpdateCall() const { return true; } … … 108 114 virtual void update(NodeVisitor* nv); 109 115 110 protected: 116 117 /** Set the optional osgDB::Options object to use when reading images.*/ 118 void setReadOptions(osg::Referenced* options) { _readOptions = options; } 119 120 /** Get the optional osgDB::Options object used when reading images.*/ 121 osg::Referenced* getReadOptions() { return _readOptions.get(); } 122 123 /** Get the optional osgDB::Options object used when reading images.*/ 124 const osg::Referenced* getReadOptions() const { return _readOptions.get(); } 125 126 protected: 111 127 112 128 virtual ~ImageSequence() {} … … 114 130 virtual void applyLoopingMode(); 115 131 116 void setImageToChild( const osg::Image* image);132 void setImageToChild(int pos); 117 133 118 134 void computeTimePerImage(); … … 130 146 131 147 mutable OpenThreads::Mutex _mutex; 132 FileNames _fileNames;133 148 134 Images _images; 135 136 typedef std::set< std::string > FilesRequested; 137 FilesRequested _filesRequested; 149 ImageDataList _imageDataList; 138 150 139 151 int _previousAppliedImageIndex; … … 143 155 double _seekTime; 144 156 145 157 osg::ref_ptr<osg::Referenced> _readOptions; 146 158 147 159 };
