CImg<float>* img = NULL;
bool loaded;
while ( !loaded )
{
loaded = true;
try
{
img = &CImg<float>( filename );
}
catch ( CImgException )
{
loaded = false;
fprintf( stdout, "ERROR: could not load %smap file.\n", mapname );
}
}
当我输入 CImg 能够找到和读取的有效图像文件名时, img.width()
两者img.height()
都返回-858993460
. 根据文档,img.width()
的返回类型是int
,但如果 fetches 的值是img._width
,一个unsigned int
.