コード例 #1
0
ファイル: objdetectionutil.cpp プロジェクト: btabibian/SDP12
void objDetection::utilities::setupBackgroundImage(config& conf)
{
	if(!conf.back)
	{
		if(conf.camera)
		{
			getImageFromFile("bg.jpg",conf.background);
			if(conf.background)
			{
				std::cout<<"background loaded"<<std::endl;
			}
			else
			{
				std::cout<<"Setup for Background image"<<std::endl;
				conf.background = getImageFromCamera(conf);	
			}
		}
		else if(conf.image_file)
		{
			getImageFromFile(getNextImageFileName(conf).c_str(),conf.background);
		}
		conf.back=true;
		cropFrame(conf,conf.background);
	}
}
コード例 #2
0
ファイル: objdetectionutil.cpp プロジェクト: btabibian/SDP12
bool objDetection::utilities::getNextFrame(config& conf)
{
	if(conf.camera)
	{
		
		conf.current_frame=getImageFromCamera(conf);
		
		if(conf.current_frame==NULL)
			return false;
	}
	else if(conf.image_file)
	{
		std::string add=getNextImageFileName(conf);
		if(strcmp(add.c_str(),"")!=0)
			getImageFromFile(add.c_str(),conf.current_frame);
		else
			return false;
	}
	if(conf.current_frame==NULL)
	{
		return false;	
	}
	
	cropFrame(conf,conf.current_frame);
	return true;
}
コード例 #3
0
void LLViewerImageList::doPreloadImages()
{
	LL_DEBUGS("ViewerImages") << "Preloading images..." << LL_ENDL;
	
	// Set the "missing asset" image
	LLViewerImage::sMissingAssetImagep = getImageFromFile("missing_asset.tga", MIPMAP_NO, IMMEDIATE_YES);
	
	// Set the "white" image
	LLViewerImage::sWhiteImagep = getImageFromFile("white.tga", MIPMAP_NO, IMMEDIATE_YES);
	
	LLUIImageList* image_list = LLUIImageList::getInstance();

	image_list->initFromFile();
	
	// turn off clamping and bilinear filtering for uv picking images
	//LLViewerImage* uv_test = preloadUIImage("uv_test1.tga", LLUUID::null, FALSE);
	//uv_test->setClamp(FALSE, FALSE);
	//uv_test->setMipFilterNearest(TRUE, TRUE);
	//uv_test = preloadUIImage("uv_test2.tga", LLUUID::null, FALSE);
	//uv_test->setClamp(FALSE, FALSE);
	//uv_test->setMipFilterNearest(TRUE, TRUE);

	// prefetch specific UUIDs
	getImage(IMG_SHOT, TRUE);
	getImage(IMG_SMOKE_POOF, TRUE);
	LLViewerImage* image = getImageFromFile("silhouette.j2c", MIPMAP_YES, IMMEDIATE_YES);
	if (image) 
	{
		image->setAddressMode(LLTexUnit::TAM_WRAP);
		mImagePreloads.insert(image);
	}
	image = getImageFromFile("noentrylines.j2c", MIPMAP_YES, IMMEDIATE_YES);
	if (image) 
	{
		image->setAddressMode(LLTexUnit::TAM_WRAP);	
		mImagePreloads.insert(image);
	}
	image = getImageFromFile("noentrypasslines.j2c", MIPMAP_YES, IMMEDIATE_YES);
	if (image) 
	{
		image->setAddressMode(LLTexUnit::TAM_WRAP);
		mImagePreloads.insert(image);
	}
	image = getImage(DEFAULT_WATER_NORMAL, MIPMAP_YES, IMMEDIATE_YES);
	if (image) 
	{
		image->setAddressMode(LLTexUnit::TAM_WRAP);	
		mImagePreloads.insert(image);
	}
	image = getImageFromFile("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c", MIPMAP_YES, IMMEDIATE_YES,0,0,LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
	if (image) 
	{
		image->setAddressMode(LLTexUnit::TAM_WRAP);
		mImagePreloads.insert(image);
	}
	
}