From Luc Fruciel, "Gdal plugins reads lots of information that is not taken into account in ReadHeigthField for example.

Attached a modification that read the HeigthField position and X,Yintervals.
I also removed the limitation to 1024*1024 to 4096*4096, because when you are preprocessing your data with OSG, it can be useful to read large images/heigthfields. Is there a reason (other than hardware limitations for textures) for this limit ?"
This commit is contained in:
Robert Osfield
2007-08-07 14:49:37 +00:00
parent b34c3e3ba2
commit f4b549ba8f

View File

@@ -76,8 +76,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
int destX = 0;
int destY = 0;
int destWidth = osg::minimum(dataWidth,1024);
int destHeight = osg::minimum(dataHeight,1024);
int destWidth = osg::minimum(dataWidth,4096);
int destHeight = osg::minimum(dataHeight,4096);
// int destWidth = osg::minimum(dataWidth,4096);
// int destHeight = osg::minimum(dataHeight,4096);
@@ -530,8 +530,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
int destX = 0;
int destY = 0;
int destWidth = osg::minimum(dataWidth,1024);
int destHeight = osg::minimum(dataHeight,1024);
int destWidth = osg::minimum(dataWidth,4096);
int destHeight = osg::minimum(dataHeight,4096);
osgDB::ImageOptions::TexCoordRange* texCoordRange = 0;
@@ -711,7 +711,9 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
hf->setHeight(c,copy_r,temp);
}
}
hf->setOrigin(osg::Vec3(BottomLeft[0],-BottomLeft[1],0));
hf->setXInterval((BottomRight[0]-BottomLeft[0])/destWidth);
hf->setYInterval((TopLeft[1]-BottomLeft[1])/destHeight);
return hf;
}