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


C++ Communicator::receiveWithSelectionByHand方法代码示例

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


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

示例1: testSendReceive


//.........这里部分代码省略.........
				// get the file name
				if (i < argc - 1)
				{
					type = (argv[++i][0]-'0');
				}
				else
				{
					return returnError();
				}
			}
			else if (!strcmp(argv[i], "-t"))
			{
				// get the file name
				if (i < argc - 1)
				{
					text = argv[++i];
				}
				else
				{
					return returnError();
				}
			}
			else if (!strcmp(argv[i], "-roi"))
			{
				// get the file name
				if (i < argc - 1)
				{
					ROI = stod(string(argv[++i]));
				}
				else
				{
					return returnError();
				}
			}
			else if (!strcmp(argv[i], "-v"))
			{
				realVideo = true;
			}
		}
		if (mode != 0 && mode != 1)
		{
			return returnError();
		}
		if (inputFileName == "")
		{
			return returnError();
		}
		if (mode == 0 && text == "")
		{
			return returnError();
		}
		switch (type)
		{
		case 1:
			communicator = new SplitAmplitudeCommunicator;
			break;
		case 2:
			communicator = new SplitFrequencyCommunicator;
			break;
		case 3:
			communicator = new SplitFrequencyAmplitudeCommunicator;
			break;
		case 4:
			communicator = new SpatialFrequencyCommunicator;
			break;
		default:
			communicator = new Communicator;
		}
		if (!strcmp(argv[1], "-s"))
		{
			if (realVideo)
			{
				communicator->sendVideo(inputFileName, text, outputFileName, 1000);
			}
			else
			{
				communicator->sendImage(Utilities::lcm(2 * FREQ[ONE], 2 * FREQ[ZERO]),
					inputFileName, text, outputFileName, 1000);
			}
		}
		else if (!strcmp(argv[1], "-r"))
		{
			if (ROI > 0 && ROI <= 1)
			{
				// then we have ROI
				communicator->receive(inputFileName, 30, ROI);
			}
			else
			{
				communicator->receiveWithSelectionByHand(inputFileName, 30);
			}
		}
		else if (!strcmp(argv[1], "-c"))
		{
			// convert argv2 video to argv3 as a video with the framerate in argv4
			// argv3 must end with .avi
			Utilities::convertVideo(argv[2], argv[3], stod(string(argv[4])));
		}
		return 0;
	}
开发者ID:MasonCong,项目名称:Uber-in-Light,代码行数:101,代码来源:Source.cpp


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