开发者

Handling very large images in Qt

I can't get Qt to work on images beyo开发者_Python百科nd 10,000X10,000. I'm dealing with huge satellite images that are around 2GB each. I considered using memory mapping but the image still occupies space in memory.

QFile file("c://qt//a.ras");
file.open(QIODevice::ReadOnly);
qint64 size = file.size();
uchar *img=file.map(0,size);
QImage I(img,w,h,QImage::Format_ARGB32);

Can anyone tell me a more efficient way to deal with large images in Qt?


Qgraphicsview and a set of image tiles, the view handles all the scrolling and world coords for you.
Then you just have to either pre-chop the images into tiles in advance or pull a section of image data on the fly


Can you use some sort of tiling strategy to load and manipulate the image piecewise, instead of all at once?


I'm guessing you're using a 32-bit OS and you're running out of address space. The easiest solution may be to use a 64-bit OS (e.g. Windows 7 x64) and compile your app for 64-bit. What is your target platform (Windows, Mac OS X, Linux etc.)?

This may help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜