コード例 #1
0
ファイル: cc_item_tvpic.cpp プロジェクト: Coolstreamto/Coolto
void CComponentsPIP::paint(bool do_save_bg)
{
	//NOTE: real values are reqiured, if we paint not bound items or an own render methodes
	int pig_x = (cc_parent ? cc_xr : x) + fr_thickness;
	int pig_y = (cc_parent ? cc_yr : y) + fr_thickness;
	int pig_w = width-2*fr_thickness;
	int pig_h = height-2*fr_thickness;
	
	paintInit(do_save_bg);
	
	if (videoDecoder->getAspectRatio() == 1){
		int tmpw = pig_w;
		pig_w -= pig_w*25/100;
		pig_x += tmpw/2-pig_w/2; 
	}

	if (!cc_allow_paint)
		return;
	
	if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv){
		videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h);
	}
	else{ //paint an alternate image if no tv mode available
		CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER);
		pic.paint(CC_SAVE_SCREEN_NO);
	}
}
コード例 #2
0
void CComponentsPIP::paint(bool do_save_bg)
{
	//NOTE: real values are reqiured, if we paint not bound items or an own render methodes
	int pig_x = (cc_parent ? cc_xr : x) + fr_thickness;
	int pig_y = (cc_parent ? cc_yr : y) + fr_thickness;
	int pig_w = width-2*fr_thickness;
	int pig_h = height-2*fr_thickness;
	
	paintInit(do_save_bg);
	
	if (videoDecoder->getAspectRatio() == 1){
		int tmpw = pig_w;
		pig_w -= pig_w*25/100;
		pig_x += tmpw/2-pig_w/2; 
	}

	if (!cc_allow_paint)
		return;
	
	if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv || CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv){
#if HAVE_SPARK_HARDWARE
		videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h,
			g_settings.screen_StartX_int,
			g_settings.screen_StartY_int,
			g_settings.screen_EndX_int,
			g_settings.screen_EndY_int);
#else
		videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h);
#endif
	}
	else{ //paint an alternate image if no tv mode available
		CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name, NULL, false, col_frame, col_frame);
		pic.setCorner(corner_rad, corner_type);
		pic.paint(CC_SAVE_SCREEN_NO);
	}
}