From 83f9d0f3e6f4a7d611175c302390794eec5779f6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 18 Jan 2013 17:11:49 +0000 Subject: [PATCH] Added Options support to ImageSequence LOAD_* functionality --- include/osg/NodeVisitor | 2 +- include/osgDB/ImagePager | 2 +- src/osg/ImageSequence.cpp | 4 ++-- src/osgDB/ImagePager.cpp | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/osg/NodeVisitor b/include/osg/NodeVisitor index 14e9aef9a..191db4ada 100644 --- a/include/osg/NodeVisitor +++ b/include/osg/NodeVisitor @@ -306,7 +306,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced virtual double getPreLoadTime() const = 0; - virtual osg::Image* readImageFile(const std::string& fileName) = 0; + virtual osg::Image* readImageFile(const std::string& fileName, const osg::Referenced* options=0) = 0; virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const FrameStamp* framestamp, osg::ref_ptr& imageRequest, const osg::Referenced* options=0) = 0; diff --git a/include/osgDB/ImagePager b/include/osgDB/ImagePager index 682e2f8de..04844f354 100644 --- a/include/osgDB/ImagePager +++ b/include/osgDB/ImagePager @@ -78,7 +78,7 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler void setPreLoadTime(double preLoadTime) { _preLoadTime=preLoadTime; } virtual double getPreLoadTime() const { return _preLoadTime; } - virtual osg::Image* readImageFile(const std::string& fileName); + virtual osg::Image* readImageFile(const std::string& fileName, const osg::Referenced* options=0); virtual void requestImageFile(const std::string& fileName, osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp* framestamp, osg::ref_ptr& imageRequest, const osg::Referenced* options); diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index 74bbeb2dc..fa4780d8e 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -313,7 +313,7 @@ void ImageSequence::update(osg::NodeVisitor* nv) { if (!(itr->_image) && !(itr->_filename.empty())) { - itr->_image = irh->readImageFile(itr->_filename); + itr->_image = irh->readImageFile(itr->_filename, _readOptions.get()); } } } @@ -368,7 +368,7 @@ void ImageSequence::update(osg::NodeVisitor* nv) if (loadDirectly) { OSG_NOTICE<<"Reading file, entry="<(const_cast(options)); + return osgDB::readImageFile(fileName, readOptions); } void ImagePager::requestImageFile(const std::string& fileName, osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp* framestamp, osg::ref_ptr& imageRequest, const osg::Referenced* options)