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


C++ MyImage::FillInputRGBSpace方法代码示例

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


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

示例1: WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.
	MSG msg;
	HACCEL hAccelTable;

	int w, h;
	int quant = 0, coEff = 0;

	if(SQUARE == 1)
	{
		w = WIDTH;
		h = HEIGHT;
	}
	else if(RECTANGULAR == 1)
	{
		w = WIDTH;
		h = HEIGHT;
	}

	char ImagePath[_MAX_PATH];
	sscanf(lpCmdLine, "%s %d %d", &ImagePath, &quant, &coEff);

	if(SQUARE == 1)
	{
		w = 512;
		h = 512;
	}
	else if(RECTANGULAR == 1)
	{
		w = 352;
		h = 288;
	}

	myImage.setWidth(w);
	myImage.setHeight(h);
	myImage.setQuant(quant);
	myImage.setCoEff(coEff);
	myImage.setImagePath(ImagePath);
	
	myImage.FillInputRGBSpace();

	myImage.GrayScale2YUV();

	if(DCT_ACTIVE == 1)
		myImage.DCTBasedCompDecomp();

	if(IDCT_ACTIVE == 1)
	{
		remove("zigzag.txt");
		myImage.IDCTBasedCompDecomp();
	}

	myImage.YUV2RGB();
	
	if(TESTZIGZAG == 1)
	{
		remove("test.txt");
		myImage.TestZigTheZag();
	}

	// Initialize global strings
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_IMAGE, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Perform application initialization:
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_IMAGE);

	// Main message loop:
	while (GetMessage(&msg, NULL, 0, 0)) 
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

	return msg.wParam;
}
开发者ID:shook2012,项目名称:Multimedia-ImageCompression,代码行数:89,代码来源:Image.cpp


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