Updated wrappers, and further refined the ImageSequence API
This commit is contained in:
@@ -49,16 +49,20 @@ class OSG_EXPORT ImageSequence : public ImageStream
|
||||
virtual double getTimeMultiplier() const { return _timeMultiplier; }
|
||||
|
||||
typedef std::list< osg::ref_ptr<osg::Image> > Images;
|
||||
typedef std::list< std::string > FileNames;
|
||||
typedef std::vector< std::string > FileNames;
|
||||
|
||||
enum Mode
|
||||
{
|
||||
PRE_LOAD_ALL_IMAGES,
|
||||
PAGE_AND_RETAIN_IMAGES,
|
||||
PAGE_AND_DISCARD_USED_IMAGES
|
||||
};
|
||||
|
||||
void setMode(Mode mode);
|
||||
Mode getMode() const { return _mode; }
|
||||
|
||||
void setDuration(double duration);
|
||||
double getDuration() const { return _duration; }
|
||||
|
||||
void setPreLoadTime(double preLoadTime) { _preLoadTime = preLoadTime; }
|
||||
double getPreLoadTime() const { return _preLoadTime; }
|
||||
|
||||
void setPruneOldImages(bool prune) { _pruneOldImages = prune; }
|
||||
bool getPruneOldImages() const { return _pruneOldImages; }
|
||||
|
||||
void addImageFile(const std::string& fileName);
|
||||
|
||||
@@ -89,10 +93,8 @@ class OSG_EXPORT ImageSequence : public ImageStream
|
||||
double _referenceTime;
|
||||
double _timeMultiplier;
|
||||
|
||||
Mode _mode;
|
||||
double _duration;
|
||||
double _preLoadTime;
|
||||
|
||||
bool _pruneOldImages;
|
||||
|
||||
double _timePerImage;
|
||||
|
||||
|
||||
@@ -291,6 +291,10 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
||||
|
||||
ImageRequestHandler():
|
||||
Referenced(true) {}
|
||||
|
||||
virtual double getPreLoadTime() const = 0;
|
||||
|
||||
virtual osg::Image* readImageFile(const std::string& fileName) = 0;
|
||||
|
||||
virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, double timeToMergeBy, const FrameStamp* framestamp) = 0;
|
||||
|
||||
|
||||
@@ -32,9 +32,6 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
|
||||
|
||||
ImagePager();
|
||||
|
||||
|
||||
|
||||
|
||||
class OSGDB_EXPORT ImageThread : public osg::Referenced, public OpenThreads::Thread
|
||||
{
|
||||
public:
|
||||
@@ -75,8 +72,14 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
|
||||
unsigned int getNumImageThreads() const { return _imageThreads.size(); }
|
||||
|
||||
|
||||
void setPreLoadTime(double preLoadTime) { _preLoadTime=preLoadTime; }
|
||||
virtual double getPreLoadTime() const { return _preLoadTime; }
|
||||
|
||||
virtual osg::Image* readImageFile(const std::string& fileName);
|
||||
|
||||
virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, double timeToMergeBy, const osg::FrameStamp* framestamp);
|
||||
|
||||
|
||||
/** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
|
||||
virtual bool requiresUpdateSceneGraph() const;
|
||||
|
||||
@@ -157,6 +160,8 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
|
||||
ImageThreads _imageThreads;
|
||||
|
||||
osg::ref_ptr<RequestQueue> _completedQueue;
|
||||
|
||||
double _preLoadTime;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user