本文整理汇总了C++中SharedImage::LoadSharedImage方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedImage::LoadSharedImage方法的具体用法?C++ SharedImage::LoadSharedImage怎么用?C++ SharedImage::LoadSharedImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedImage
的用法示例。
在下文中一共展示了SharedImage::LoadSharedImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadSharedImageSequence
int SharedImageSequence::LoadSharedImageSequence(const std::string& filename, unsigned int Limit, int k)
{
clear();
std::cout << "Loading image sequence " << filename << "\n";
std::stringstream FileNameStream;
FileNameStream << filename << m_InfFileAttachment;
std::ifstream f((FileNameStream.str()).c_str());
if(!f.is_open())
{
std::cout << "SharedImageSequence::LoadSharedImageSequence: Error while opening file "
<< FileNameStream.str().c_str() << ".\n";
return RET_FAILED;
}
/// Read number of images that are stored on disk
int s=0; f >> s; s=intmin(Limit, s);
std::cout << "SharedImageSequence::LoadSharedImageSequence: Loading ";
std::list<SharedImage> listSI;
int i;
for(i=0; i<s; i+=k)
{
std::stringstream FileNameStream2;
FileNameStream2 << filename << m_Spacing << i;
SharedImage Tmp;
/// Load the single images (coordinate and shared image) from disk
if(Tmp.LoadSharedImage(FileNameStream2.str())==RET_FAILED) return RET_FAILED;
push_back(Tmp);
//listSI.push_back(Tmp);
std::cout << i << " ";
}
// std::list<SharedImage>::iterator it;
// (*this).assign(s, SharedImage());
// i=0;
// for(it=listSI.begin(); it!=listSI.end(); it++)
// {
// (*this)[i]=*it;
// i++;
// }
std::cout << "\n";
return RET_OK;
}