当前位置: 首页>>代码示例>>C++>>正文


C++ ImageLoader::load方法代码示例

本文整理汇总了C++中ImageLoader::load方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageLoader::load方法的具体用法?C++ ImageLoader::load怎么用?C++ ImageLoader::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageLoader的用法示例。


在下文中一共展示了ImageLoader::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readEffectData

void OverlayEffect::readEffectData() {
  if (workOverlay!="") {
    if (workOverlay!=readOverlay) {
      img.load(workOverlay.c_str());
      printf("overlay size %dx%d\n", img.width(), img.height());
      readOverlay = workOverlay;
    }
  }
}
开发者ID:ephemeraleclipse,项目名称:ucanvcam,代码行数:9,代码来源:OverlayEffect.cpp

示例2: mess

 void
 Image::load( const std::string &filename )
 {
   using namespace std;
   size_t pos = filename.find_last_of('.');
   if ( pos == string::npos ) {
     std::string mess("Image::load: Can't load image ");
     mess.append(filename);
     throw new Exception(mess);
   }
   const string ext = filename.substr(pos+1);
   ImageLoader *imgLoader = ImageLoader::getImageLoader(ext);
   imgData = imgLoader->load(filename);
 }
开发者ID:BackupTheBerlios,项目名称:sfox-svn,代码行数:14,代码来源:image.cpp

示例3: loadMoreImages

void ImageGridDataProvider::loadMoreImages()
{
	int count = 0;
	int s = this->m_imageFilePaths.size();

	qDebug() << "[ImageGridDataProvider::loadMoreImages] m_loadedItems: " << m_loadedItems << ", s: " << s << ", m_loadingCount: " << m_loadingCount;

	// Make sure the model never loads more images than it should at the same time or more than it should
	if(m_loadingCount == 0 && m_loadedItems < s){

		ImageLoader *loader = NULL;
		while( count < ImageGridDataProvider::MAX_ITENS && s > (count + m_loadedItems) ){

			// don't forget to set the Parent Object or else is memory leak!
			loader = new ImageLoader( m_imageFilePaths.at(m_loadedItems + count), this);

			bool ok = connect(loader,
							SIGNAL(imageChanged()), this,
							SLOT(onImageChanged()));
			Q_UNUSED(ok);
			Q_ASSERT_X(ok,"[ImageGridDataProvider::loadMoreImages]", "connect imageChanged failed");

			m_dataModel->append( loader );
			loader->load();

			// Don't start loading images while ImageLoader instances are created on this while loop or else we have a race condition!
			// m_loadedItems is incremented on onImageChanged and it's possible that an image is finished loading before the while is done.

			++count;
			++m_loadingCount;
			Q_ASSERT_X(m_loadingCount <= ImageGridDataProvider::MAX_ITENS,"[ImageGridDataProvider::loadMoreImages]", "loading count max exceed!");
		}

		// Start loading the images only after the loop is done! This a very simple way of preventing the race condition.
		/*for(int i = 0; i < count; i++){
			loader = m_dataModel->value(m_loadedItems + i);
			loader->load();
		}*/
		loader = NULL;
	}
	else{
		qDebug() << "[ImageGridDataProvider::loadMoreImages] maximum loading reached! Must wait until all images finish loading or must add new images to load.";
	}
}
开发者ID:williamrjribeiro,项目名称:wallpaper-ruler-bb10,代码行数:44,代码来源:ImageGridDataProvider.cpp


注:本文中的ImageLoader::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。